Files
rhema-claw/web/claw/app/components/AgentAvatar.vue
T
vhaudiquet cb1948742f
android / debug (push) Successful in 2m26s
android / release (push) Successful in 2m19s
ci / checks (push) Successful in 3m48s
ci / test (push) Successful in 1m24s
ci / chart (push) Successful in 7s
ci / docker (push) Successful in 2m11s
ci / web (push) Successful in 15s
ci / publish-edge-images (deploy/docker/claw.Dockerfile, rhema-claw) (push) Successful in 2m17s
ci / publish-edge-images (deploy/docker/ui.Dockerfile, rhema-claw-ui) (push) Successful in 16s
ci / publish-edge-chart (push) Successful in 4s
feat(claw): show the user's profile in the bottom-left account
The web shell's account showed the agent's identity and the word
"connected", which left no way to see or set the human's own name and
picture.

The claw now stores a user profile beside the bootstrap files and
serves it over /v1/user and /v1/user/avatar. The agent sets it during
onboarding with user_profile_set; the bottom-left account in both
sidebars renders it and opens an editor for the name and picture. The
prompt context exposes user_name and user_profile, and bootstrap
documents resolve {{ user_name }}, so USER.md and the other markdown
files can address the user by name.

The connection state stays with the unreachable banner, so the sidebars
no longer report it.

Unit and HTTP tests cover the profile store, the tool, the variable
expansion, and the routes. fmt, clippy, cargo test, nuxt typecheck, and
nuxt build pass; both sidebars and the editor checked at 1280x800.
2026-12-01 18:30:50 +01:00

56 lines
1.2 KiB
Vue

<script setup lang="ts">
// A face at one size: the uploaded avatar when there is one, the
// name's initial when not. The agent's own pages and the user's
// bottom-left account both render through it, so the precedence lives
// here and nowhere else.
const props = withDefaults(
defineProps<{
/** The uploaded avatar's object URL, when the claw has one. */
avatarUrl?: string | null
/** The fallback, first letter of the name or R. */
initials?: string | null
size?: number
}>(),
{
avatarUrl: null,
initials: null,
size: 32,
},
)
const glyph = computed(() => props.initials?.trim() || 'R')
</script>
<template>
<img
v-if="avatarUrl"
:src="avatarUrl"
:style="{ width: `${size}px`, height: `${size}px` }"
class="agent-avatar"
alt=""
/>
<span
v-else
class="agent-avatar agent-square"
:style="{ width: `${size}px`, height: `${size}px`, fontSize: `${Math.round(size * 0.5)}px` }"
aria-hidden="true"
>{{ glyph }}</span>
</template>
<style scoped>
.agent-avatar {
display: grid;
place-items: center;
flex: none;
border-radius: var(--r-avatar);
object-fit: cover;
}
.agent-square {
background: var(--accent);
color: var(--on-accent);
font-weight: 700;
line-height: 1;
}
</style>