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
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:
1 parent
debc21a89f
commit
cb1948742f
17 files changed
+1226
-149
No files matched your search
@@ -0,0 +1,71 @@
|
||||
<script setup lang="ts">
|
||||
// The human's account, in the bottom-left slot of both sidebars: their
|
||||
// picture and name, or an invitation to set them. Clicking opens the
|
||||
// editor; the health of the connection is the banner's business, not
|
||||
// this row's.
|
||||
import { User } from 'lucide-vue-next'
|
||||
import type { UserProfile } from '~/composables/useClaw'
|
||||
|
||||
const props = defineProps<{
|
||||
profile: UserProfile | null
|
||||
avatarUrl: string | null
|
||||
}>()
|
||||
|
||||
defineEmits<{ edit: [] }>()
|
||||
|
||||
const name = computed(() => props.profile?.name?.trim() ?? '')
|
||||
const label = computed(() => name.value || 'Set your profile')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<button class="profile" :title="label" :aria-label="label" @click="$emit('edit')">
|
||||
<AgentAvatar
|
||||
v-if="avatarUrl || name"
|
||||
:avatar-url="avatarUrl"
|
||||
:initials="name.slice(0, 1)"
|
||||
:size="26"
|
||||
/>
|
||||
<span v-else class="glyph" aria-hidden="true"><User :size="14" /></span>
|
||||
<span class="profile-name">{{ label }}</span>
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.profile {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--sp-2);
|
||||
width: 100%;
|
||||
min-height: 0;
|
||||
padding: var(--sp-2);
|
||||
border: 0;
|
||||
border-radius: var(--r-control);
|
||||
background: transparent;
|
||||
color: var(--text);
|
||||
font-size: var(--fs-meta);
|
||||
font-weight: 400;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.profile:hover:not(:disabled) {
|
||||
background: var(--surface-2);
|
||||
}
|
||||
|
||||
.glyph {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
flex: none;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
border-radius: var(--r-avatar);
|
||||
background: var(--surface-2);
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.profile-name {
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user