feat(claw): show the user's profile in the bottom-left account
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

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.
This commit is contained in:
vhaudiquet committed 2026-12-01 18:30:50 +01:00
1 parent debc21a89f
commit cb1948742f
17 files changed
+1226 -149

No files matched your search

+9 -61
View File
@@ -22,15 +22,14 @@
// queued work when none runs.
import { Pause, Play, Plus, RefreshCw, Settings, Square, Trash2 } from 'lucide-vue-next'
import { SESSION_NAME_PATTERN, isResidentKey } from '~/composables/useClaw'
import type { ClawSession } from '~/composables/useClaw'
import type { ClawSession, UserProfile } from '~/composables/useClaw'
const props = defineProps<{
sessions: ClawSession[]
activeKey: string
loading: boolean
clawUp: boolean | null
identity?: { name: string | null } | null
avatarUrl?: string | null
user: UserProfile | null
userAvatarUrl: string | null
}>()
const emit = defineEmits<{
@@ -43,6 +42,7 @@ const emit = defineEmits<{
resume: [key: string]
abort: [key: string]
navigateSettings: []
editProfile: []
}>()
interface Group {
@@ -118,14 +118,6 @@ const shownCount = computed(() =>
groups.value.reduce((total, group) => total + group.rows.length, 0),
)
const healthLabel = computed(() =>
props.clawUp === null ? 'checking' : props.clawUp ? 'connected' : 'unreachable',
)
const healthTone = computed(() =>
props.clawUp === null ? 'idle' : props.clawUp ? 'ok' : 'error',
)
// --- new sessions -----------------------------------------------------
const creating = ref(false)
const nameDraft = ref('')
@@ -302,19 +294,11 @@ watch(
<Settings :size="16" aria-hidden="true" />
<span>Settings</span>
</button>
<div class="sidebar-account">
<AgentAvatar
:avatar-url="avatarUrl"
:initials="identity?.name?.slice(0, 1)"
:size="26"
/>
<div class="account-text">
<span class="account-name" :title="identity?.name ?? undefined">
{{ identity?.name?.trim() || 'rhema' }}
</span>
<span class="account-state" :class="healthTone">{{ healthLabel }}</span>
</div>
</div>
<UserProfileButton
:profile="user"
:avatar-url="userAvatarUrl"
@edit="$emit('editProfile')"
/>
</div>
</aside>
</template>
@@ -560,42 +544,6 @@ watch(
color: var(--text);
}
.sidebar-account {
display: flex;
align-items: center;
gap: var(--sp-2);
min-width: 0;
padding: var(--sp-2);
}
.account-text {
display: flex;
flex-direction: column;
min-width: 0;
line-height: 1.3;
}
.account-name {
overflow: hidden;
color: var(--text);
font-size: var(--fs-meta);
text-overflow: ellipsis;
white-space: nowrap;
}
.account-state {
color: var(--faint);
font-size: var(--fs-small);
}
.account-state.ok {
color: var(--accent);
}
.account-state.error {
color: var(--danger);
}
@media (max-width: 860px) {
.sidebar {
position: static;