Files
rhema-claw/web/claw/app/components/UserProfileButton.vue
T
vhaudiquet 18787390b8
android / debug (push) Successful in 2m39s
android / release (push) Successful in 2m21s
ci / checks (push) Successful in 3m12s
ci / test (push) Successful in 1m14s
ci / chart (push) Successful in 6s
ci / docker (push) Successful in 2m4s
ci / web (push) Successful in 14s
ci / publish-edge-images (deploy/docker/claw.Dockerfile, rhema-claw) (push) Successful in 2m19s
ci / publish-edge-images (deploy/docker/ui.Dockerfile, rhema-claw-ui) (push) Successful in 16s
ci / publish-edge-chart (push) Successful in 4s
fix(web/claw): left-align the account row like the links above it
The global button reset centers a button's content. The account row
spans the sidebar's full width, so its glyph and label sat centered
instead of on the same edge as the Settings link above it. Re-pin
justify-content to flex-start, as .sidebar-link already does.
2026-12-01 19:07:22 +01:00

75 lines
1.8 KiB
Vue

<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;
/* The global button reset centers content; a full-width row is
* left-aligned like the Settings link above it. */
justify-content: flex-start;
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>