SidebarProfileMenu
src/lib/components/sidebar/SidebarProfileMenu.svelte
Purpose
A sidebar footer dropdown that shows the signed-in user. The trigger is a large
Sidebar.MenuButton with a hex avatar (colored fallback from
avatar_color + initials, or a chrome-palette fallback) and the user's display
name plus a profile label. The dropdown header restates the avatar, name, and
email; a Settings item navigates to /system/settings/profile (and switches
to the settings module); a destructive Sign out item calls the onLogout
callback. The whole component only renders when user is non-null. When
collapsed, the trigger centers the avatar and hides the label and chevron.
Origin
Custom — Primebrick-written. Uses shadcn-svelte™ Sidebar, DropdownMenu,
and Avatar, $lib/avatar-chrome-palette, and @lucide/svelte icons.
Usage
Default (mounted in AppSidebar footer)
Code
Collapsed (avatar-only)
When collapsed is true, the avatar is centered full-width and the label/chevron
hide via group-data-[collapsible=icon].
Code
Settings + sign-out wiring
Settings switches to the settings module and navigates; sign-out delegates to
the parent's onLogout.
Code
Props
Full prop table: see API reference — sidebarprofilemenu.
Key props: user: UserProfile | null, collapsed: boolean,
onLogout: () => void.