From 22a5f3385b9fc5bdf282eb597aa3db79798aa5ab Mon Sep 17 00:00:00 2001 From: amblued Date: Fri, 28 Aug 2026 01:01:01 +0800 Subject: [PATCH] fix(ui): refine space labels and sidebar menus Keep long Space titles readable without expanding compact surfaces. Fold Inbox into the user menu and align sidebar popups with the rail. --- web/src/components/AppSidebar/AppSidebar.tsx | 51 +------------------ .../components/AppSidebar/SpaceSwitcher.tsx | 38 +++++++++++--- .../MemoView/components/MemoSpaceBadge.tsx | 26 +++++----- web/src/components/UserMenu.tsx | 51 +++++++++++++++---- web/tests/app-sidebar-logo.test.tsx | 38 +++++++------- web/tests/memo-space-badge.test.tsx | 15 +++++- web/tests/space-switcher.test.tsx | 35 +++++++++++++ web/tests/user-menu.test.tsx | 36 ++++++++++++- 8 files changed, 187 insertions(+), 103 deletions(-) diff --git a/web/src/components/AppSidebar/AppSidebar.tsx b/web/src/components/AppSidebar/AppSidebar.tsx index d72f61e0..047568c6 100644 --- a/web/src/components/AppSidebar/AppSidebar.tsx +++ b/web/src/components/AppSidebar/AppSidebar.tsx @@ -658,50 +658,6 @@ const SidebarBrand = ({ className }: { className?: string }) => { ); }; -const InboxFooterLink = () => { - const t = useTranslate(); - const location = useLocation(); - const { setMobileOpen } = useAppSidebar(); - const { data: notifications = [] } = useNotifications(); - const unreadCount = notifications.filter((notification) => notification.status === UserNotification_Status.UNREAD).length; - const active = getSidebarRouteKind(location.pathname) === "inbox"; - const accessibleLabel = unreadCount > 0 ? `${t("common.inbox")}, ${unreadCount} ${t("inbox.unread")}` : t("common.inbox"); - - return ( - - - setMobileOpen(false)} - aria-label={accessibleLabel} - aria-current={active ? "page" : undefined} - className={cn( - "flex size-9 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-sidebar-accent/65 hover:text-foreground md:size-8", - SIDEBAR_ROW_FOCUS_CLASSES, - active && "bg-sidebar-accent text-sidebar-accent-foreground", - )} - /> - } - > - - - {unreadCount > 0 && ( - - - {accessibleLabel} - - - ); -}; - const AppSidebar = ({ className }: { className?: string }) => { const t = useTranslate(); const currentUser = useCurrentUser(); @@ -734,12 +690,7 @@ const AppSidebar = ({ className }: { className?: string }) => {