From 54d6a67ecfbb08d5e38da2ba00483624f845ffb1 Mon Sep 17 00:00:00 2001 From: chenchen Date: Mon, 11 May 2026 22:10:17 +0800 Subject: [PATCH] feat(client): logged-in user card in sidebar (always visible) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The earlier UserPill landed in the TitleBar tab strip, but the main desktop layout (HeicodeTasksHome shell) renders its own chrome without that strip — so the user info ended up invisible despite mcpAuth having the right data after a2deeb6. Pull the same identity (avatar gradient + name + email + role badge) straight into the bottom of Sidebar.tsx, right above the logout/settings rows, so it's visible on every screen regardless of which top bar is mounted. Two layouts: - expanded: 36px gradient avatar + name + email + admin/root badge - collapsed: 36px avatar circle only, title tooltip carries the email Co-Authored-By: Claude Opus 4.7 (1M context) --- .../desktop/src/components/layout/Sidebar.tsx | 81 ++++++++++++++++++- 1 file changed, 80 insertions(+), 1 deletion(-) diff --git a/cc-haha/desktop/src/components/layout/Sidebar.tsx b/cc-haha/desktop/src/components/layout/Sidebar.tsx index 34837c1..64d51d7 100644 --- a/cc-haha/desktop/src/components/layout/Sidebar.tsx +++ b/cc-haha/desktop/src/components/layout/Sidebar.tsx @@ -36,6 +36,12 @@ export function Sidebar() { const closeTab = useTabStore((s) => s.closeTab) const disconnectSession = useChatStore((s) => s.disconnectSession) const logout = useHeicodeAuthStore((s) => s.logout) + // Logged-in user identity, surfaced as a card right above logout/settings so + // the user can always SEE who they're signed in as without clicking anywhere. + // Populated by /api/heicode-auth/status from the active provider's mcpAuth + // record (credentials login → set in handleLoginWithCredentials; OAuth login + // → set from query params by handleOAuthCallback after backend a2deeb6). + const authUser = useHeicodeAuthStore((s) => s.status?.user ?? null) const [searchQuery, setSearchQuery] = useState('') const [contextMenu, setContextMenu] = useState<{ id: string; x: number; y: number } | null>(null) const [pendingDeleteSessionId, setPendingDeleteSessionId] = useState(null) @@ -372,7 +378,8 @@ export function Sidebar() {