From 6c57aee1ae652d9d3e2813afeab9e20cc74b694c Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 18 Nov 2026 09:13:52 +0000 Subject: [PATCH 01/12] wip(app-shell): the console sidebar collapses hidden and floats its menu from the left edge Claude-Session: https://claude.ai/code/session_01JQwxbXBffgVtUPBEY2nLFm Co-authored-by: Claude --- .../src/layout/LocalizedSidebarTrigger.tsx | 9 +- .../app-shell/src/layout/UnifiedSidebar.tsx | 36 +- .../src/layout/consoleSidebarRail.ts | 392 ++++++++++++++---- 3 files changed, 353 insertions(+), 84 deletions(-) diff --git a/ui/packages/app-shell/src/layout/LocalizedSidebarTrigger.tsx b/ui/packages/app-shell/src/layout/LocalizedSidebarTrigger.tsx index b06193791de..559da35186d 100644 --- a/ui/packages/app-shell/src/layout/LocalizedSidebarTrigger.tsx +++ b/ui/packages/app-shell/src/layout/LocalizedSidebarTrigger.tsx @@ -22,9 +22,12 @@ const TOGGLE_SIDEBAR_CHORD: ShortcutChord = { key: 'b', mod: true }; /** * The shell's one sidebar trigger (objectui#12429). It lives in the app bar's * left slot at every width: below the Shadcn mobile breakpoint it opens and - * closes the drawer, above it it collapses the sidebar to the icon rail and - * expands it again. `aria-expanded` follows whichever of the two states the - * click toggles, and the tooltip names the keyboard shortcut. + * closes the drawer, above it it collapses the sidebar and expands it again. + * In the console a collapsed sidebar is hidden, and while it is folded on a + * narrow window the trigger floats its menu over the content instead + * (objectstack#35062, `consoleSidebarRail`). `aria-expanded` follows whichever + * of the two states the click toggles, and the tooltip names the keyboard + * shortcut. */ export const LocalizedSidebarTrigger = React.forwardRef< React.ElementRef, diff --git a/ui/packages/app-shell/src/layout/UnifiedSidebar.tsx b/ui/packages/app-shell/src/layout/UnifiedSidebar.tsx index 46de82ab4a8..8db4d585fe6 100644 --- a/ui/packages/app-shell/src/layout/UnifiedSidebar.tsx +++ b/ui/packages/app-shell/src/layout/UnifiedSidebar.tsx @@ -75,7 +75,7 @@ import { } from './ContextSelectors.js'; import { AppMark } from './AppMark.js'; import { CONSOLE_BELOW_TOP_BAR } from './consoleTopBar.js'; -import { useConsoleSidebarRail, useConsoleSidebarRailPanel } from './consoleSidebarRail.js'; +import { SIDEBAR_EDGE_ZONE, useConsoleSidebarRail, useConsoleSidebarRailPanel } from './consoleSidebarRail.js'; import { SidebarItemMenu, sidebarItemDesignPath, favoriteDesignPath } from './SidebarItemMenu.js'; import { SortableFavoriteRows, type FavoriteRowDragProps } from './SortableFavoriteRows.js'; import { favoriteAppSegment } from './listViewFavorites.js'; @@ -149,10 +149,13 @@ interface UnifiedSidebarProps { /** Callback when user switches apps */ onAppChange?: (name: string) => void; /** - * Below the fold width, draw the sidebar as the icon rail that expands over - * the content (objectstack#27593). The console layout sets it, and folds - * the sidebar with `useResponsiveSidebar`; off, the sidebar is drawn as the - * provider says at every width. + * The console's sidebar (objectstack#27593, objectstack#35062): from 768 px + * up a collapsed sidebar is hidden, takes no width, and floats its full menu + * over the content from the window's left edge; below the fold width it + * collapses on its own, and the app bar's trigger floats the menu. The + * console layout sets it, and folds the sidebar with + * `useResponsiveSidebar`; off, the sidebar is drawn as the provider says at + * every width, collapsed to the primitive's icon rail. */ railOverlay?: boolean; /** @@ -192,8 +195,9 @@ export function UnifiedSidebar({ activeAppName, railOverlay = false, phoneNavBar // hook, so the two surfaces cannot name one entry two ways. const resolveNavTargetLabel = useNavTargetLabel({ byName: true }); const resolveNavTargetIcon = useNavTargetIcon(); - // Below the fold width the sidebar is the icon rail and expands over the - // content (objectstack#27593); `useResponsiveSidebar` folds and unfolds it. + // Collapsed, the console's sidebar is hidden and its menu floats over the + // content (objectstack#35062); below the fold width it collapses on its own + // (objectstack#27593), and `useResponsiveSidebar` folds and unfolds it. const rail = useConsoleSidebarRail({ enabled: railOverlay }); const railPanel = useConsoleSidebarRailPanel(rail); const keepOpenLabel = t('sidebar.keepOpen', { defaultValue: 'Keep sidebar open' }); @@ -616,7 +620,8 @@ export function UnifiedSidebar({ activeAppName, railOverlay = false, phoneNavBar return (
@@ -878,8 +883,8 @@ export function UnifiedSidebar({ activeAppName, railOverlay = false, phoneNavBar {/* "Keep sidebar open" turns the fold off for this browser; offered - where the fold applies, while the rail is expanded or kept open. */} - {rail.narrow && (rail.overlayOpen || rail.keepOpen) && ( + where the fold applies, while the menu floats or is kept open. */} + {rail.narrow && (railPanel.overlayOpen || rail.keepOpen) && ( @@ -900,6 +905,17 @@ export function UnifiedSidebar({ activeAppName, railOverlay = false, phoneNavBar {/* No footer trigger: the app bar's left slot holds the shell's one sidebar trigger at every width (objectui#12429). */} + {/* objectstack#35062 — the window's left edge while the sidebar is + hidden: resting the pointer on it, or a press, floats the menu. For + the pointer only; the keyboard has the app bar's trigger and ⌘B. */} + {railPanel.edgeZoneProps && ( +