Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/35062-sidebar-hidden-collapse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@object-ui/app-shell': patch
---

fix(app-shell): a collapsed console sidebar hides fully, and its full menu floats out from the window's left edge

Clause-②: no
Metadata-protocol: none

From 768 px up, a collapsed app sidebar no longer leaves a column of unlabelled icons: it is hidden, the list and record pages get its width, and nothing in it can be focused or is announced. Both ways of collapsing look the same: collapsing it with the app bar's button, and the fold that collapses it on its own on a window narrower than 1416 px. To get the menu back, rest the pointer on the window's left edge (or press there): the full menu, with its labels and groups, floats over the page and folds back when the pointer moves away, a choice is made, Esc is pressed or the page is clicked. The app bar's button and ⌘B float the same menu, however the sidebar was collapsed, and move the keyboard focus into it; Esc gives focus back to the button. Floating it does not expand the sidebar, so a reload still finds it collapsed. To put the sidebar back beside the page, choose "Keep sidebar open" at the foot of the floated menu: the sidebar stays expanded, after a reload too, and on a narrow window the fold stays off. The phone keeps its bottom menu bar and drawer.
10 changes: 8 additions & 2 deletions docs/qa/platform-checklist/areas/platform-core.json
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@
"title": "The built-in apps a stock boot REGISTERS (Setup / Account) render every merged-nav destination; app-level and entry-level gates are enforced, not errored — and Studio's deliberate absence is asserted, never hunted",
"since": "v15",
"status": "active",
"revision": 16,
"revision": 17,
"priority": "P0",
"surface": "browser",
"personas": [
Expand All @@ -662,7 +662,7 @@
"steps": [
"as admin, GET /api/v1/meta/app?id=setup and extract every merged nav destination — Setup is a SHELL of empty group anchors (packages/platform-objects/src/apps/setup.app.ts: group_overview/apps/people_org/access_control/approvals/configuration/diagnostics/integrations/advanced) filled by SETUP_NAV_CONTRIBUTIONS (setup-nav.contributions.ts) plus capability-plugin contributions (plugin-security Positions/Permission Sets, plugin-sharing Sharing Rules/Record Shares, plugin-approvals, plugin-webhooks)",
"GET /api/v1/meta/app with NO query first and record the names actually served — a stock boot answers exactly showcase_app, setup, account. Then GET /api/v1/meta/app?id=account (account.app.ts — Profile + Inbox/Security/Developer groups). ⚠️ GET /api/v1/meta/app?id=studio answers 200 {\"items\":[]} on every stock boot and that is the expected result (knownGap): record the absence as an assertion and move on — do NOT install @objectstack/studio to make the step runnable",
"as admin, hand-walk each destination in each app. At a window narrower than 1416 px (1280 px included) the console folds the sidebar to its icon rail, and Setup and Account open that way (ui/packages/app-shell/src/layout/consoleSidebarRail.ts CONSOLE_SIDEBAR_RAIL_BELOW_WIDTH, objectstack#27593; QA run #29877 met it at 1280 px): press the sidebar toggle at the app bar's left edge (Ctrl/⌘+B) to unfold it before expanding any group. EXPAND every nav group first: some render collapsed by default — Setup's Advanced group and Account's Developer group declare `expanded: false` (packages/platform-objects/src/apps/setup.app.ts, account.app.ts), and QA run #24557 found Setup's Configuration group collapsed as well — so a walk that never expands them never reaches their entries. Then navigate, wait for render, SCREENSHOT FIRST, then read the DOM — assert no pageerror, no 'failed to load', no blank <main>, no 'no actions configured' placeholder",
"as admin, hand-walk each destination in each app. At a window narrower than 1416 px (1280 px included) the console folds the sidebar, and Setup and Account open that way (ui/packages/app-shell/src/layout/consoleSidebarRail.ts CONSOLE_SIDEBAR_RAIL_BELOW_WIDTH, objectstack#27593; QA run #29877 met it at 1280 px). Folded, the sidebar is hidden, with no icon column (ruling 6973617688 on objectstack#35062): press the sidebar toggle at the app bar's left edge (Ctrl/⌘+B), or rest the pointer on the window's left edge, to float the full menu over the page before expanding any group. The float folds back after each chosen entry, so float it again for the next destination. EXPAND every nav group first: some render collapsed by default — Setup's Advanced group and Account's Developer group declare `expanded: false` (packages/platform-objects/src/apps/setup.app.ts, account.app.ts), and QA run #24557 found Setup's Configuration group collapsed as well — so a walk that never expands them never reaches their entries. Then navigate, wait for render, SCREENSHOT FIRST, then read the DOM — assert no pageerror, no 'failed to load', no blank <main>, no 'no actions configured' placeholder",
"Setup detail: confirm each settings URL entry (nav_settings_* → /apps/setup/system/settings/<namespace>) opens the settings namespace form — the 11 namespaces of a stock single-posture boot, localization/company/branding/auth/access_policy/mail/sms/storage/ai/knowledge/lifecycle: the nav_settings_* entries of packages/platform-objects/src/apps/setup-nav.contributions.ts, plus nav_settings_branding, which packages/services/service-settings/src/settings-service-plugin.ts contributes only where no organization wall stands, and Users / Organization / Business Units / Teams / Sessions / OAuth Applications render. User preferences and identity links are not Setup destinations: open a user's record page, /_console/apps/setup/sys_user/record/ID (a row click on the Users list opens a side panel at ?recordId=, which is not that page: take the id from the row or the panel), and confirm the user page's Preferences and Linked Accounts tabs (packages/platform-objects/src/pages/sys-user.page.ts#SysUserDetailPage) render that user's rows",
"Studio detail is NOT walked from here — the app is not registered on a stock boot (knownGap), so there is no merged nav to render. Its metadata:resource lists and component surfaces (App Builder, All Metadata Types, Packages, API Console, Flow Runs, Public Forms) are reached through the console surface at /_console/studio/<pkg>/<pillar> and are covered by area studio-authoring. What THIS item asserts about Studio is the absence itself, per clause 6",
"Account detail: confirm Profile (account:profile_card), Notifications (sys_inbox_message/mine), Approvals (nav_account_approvals, the approvals:inbox component, served as …/component/approvals/inbox — the Approvals Inbox, not the sys_approval_request grid; account.app.ts), Linked Accounts (sys_account), Active Sessions (sys_session/mine), API Keys (sys_api_key/mine), OAuth Applications (sys_oauth_application/mine) and Connect an Agent (nav_connect_agent) each render — 8 Account destinations and 47 Setup destinations for the admin on a stock single-org showcase boot, read from source after objectstack#34724 retired Setup › Packaged Actions (nav_packaged_actions; its switch moved onto the action in Studio); QA runs #32953 (at 5fb79bc0) and #33087 (at 8e3d4a54) read 48 before it (GET /api/v1/meta/app leaves, which match the nav source minus its gates). QA run #29877 read 46 at 589049b0, before Access policy (nav_settings_access_policy, the access_policy namespace) joined the Configuration group. Since QA run #28545's reading Setup's Packaged automation page retired under ADR-0146 D11, leaving Packaged Actions (nav_packaged_actions, automation:packaged-actions; #28785, itself retired by objectstack#34724), and its unfiltered Packages entry moved to Studio (#29547) (47 for #28927, 50 at eeec88d1 for QA run #28545, 48 re-measured at 3fd80337 for #28338, QA run #27481 read 44 and 8, QA run #24557 read 42 at 5b14b7f3, 45 on 2026-10-01, and #9453 recorded 43 and 7). Recount from the payload each run",
Expand Down Expand Up @@ -816,6 +816,12 @@
"date": "2026-11-17",
"change": "steps[5]: the admin's Setup destinations are 47, not 48: Setup › Packaged Actions (nav_packaged_actions) retired, its switch moved onto the action in Studio (the ADR-0146 D4 amendment of 2026-11-17). Read from source; not yet re-measured by a QA run.",
"ref": "#34724"
},
{
"revision": 17,
"date": "2026-11-18",
"change": "steps[2]: below 1416 px the fold now hides the sidebar instead of leaving its icon rail (ruling 6973617688 on #35062): the walk floats the full menu with the toggle (Ctrl/⌘+B) or by resting the pointer on the window's left edge, and floats it again after each chosen entry, since the float folds back on navigation. The walk is unchanged in substance. No clause changed. Read from source, and measured on a CRM boot (at 1280×800 the toggle floated the menu with focus on its entry; at 1600×900 choosing an entry in the float folded it); not yet re-run by a QA run.",
"ref": "#35187"
}
]
},
Expand Down
13 changes: 8 additions & 5 deletions ui/packages/app-shell/src/hooks/useResponsiveSidebar.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
/**
* useResponsiveSidebar
*
* Folds the sidebar to its icon rail while the window is narrower than
* Folds the sidebar while the window is narrower than
* `CONSOLE_SIDEBAR_RAIL_BELOW_WIDTH` (and wider than the phone breakpoint,
* where the drawer takes over), and unfolds it when the window widens again
* (objectstack#27593). A reader who keeps the sidebar open is left alone.
* Must be called inside a SidebarProvider context.
* (objectstack#27593). Folded, the console's sidebar is hidden, and its full
* menu floats over the content from the window's left edge or the app bar's
* trigger (ruling 6973617688 on objectstack#35062; `consoleSidebarRail.ts`).
* A reader who keeps the sidebar open is left alone. Must be called inside a
* SidebarProvider context.
*
* The fold is not the reader's choice, so it does not keep one: every open
* and close on a wide window is kept as the wide-window choice, and only
* those (objectstack#28079). A window that turns wide, or a load that opens
* wide, gets that choice back, whatever the fold, the overlay or a sidebar
* wide, gets that choice back, whatever the fold, the float or a sidebar
* kept open on a narrow window did to the primitive's cookie meanwhile.
* @module
*/
Expand All @@ -34,7 +37,7 @@ export function useResponsiveSidebar() {
setOpenRef.current = setOpen;
});

// A layout effect, so a window that opens narrow paints the rail first.
// A layout effect, so a window that opens narrow paints the hidden sidebar first.
useLayoutEffect(() => {
const previous = last.current;
last.current = { wide, railMode };
Expand Down
8 changes: 5 additions & 3 deletions ui/packages/app-shell/src/layout/LocalizedSidebarTrigger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ 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 the trigger floats its
* menu over the content instead of expanding it (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<typeof Button>,
Expand Down
49 changes: 34 additions & 15 deletions ui/packages/app-shell/src/layout/UnifiedSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 and from the app bar's
* trigger; below the fold width it collapses on its own. 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;
/**
Expand Down Expand Up @@ -192,10 +195,12 @@ 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 sidebarRef = React.useRef<HTMLDivElement | null>(null);
const railPanel = useConsoleSidebarRailPanel(rail, sidebarRef);
const keepOpenLabel = t('sidebar.keepOpen', { defaultValue: 'Keep sidebar open' });

// Swipe-from-left-edge gesture to open sidebar on mobile
Expand Down Expand Up @@ -616,7 +621,8 @@ export function UnifiedSidebar({ activeAppName, railOverlay = false, phoneNavBar
return (
<div data-testid="console-sidebar-frame" className={railPanel.frameClassName}>
<Sidebar
collapsible="icon"
ref={sidebarRef}
collapsible={railPanel.collapsible}
className={cn(CONSOLE_BELOW_TOP_BAR, railPanel.panelClassName)}
{...railPanel.panelProps}
>
Expand Down Expand Up @@ -877,18 +883,20 @@ export function UnifiedSidebar({ activeAppName, railOverlay = false, phoneNavBar
)}
</nav>
</SidebarContent>
{/* "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) && (
{/* "Keep sidebar open": in the floated menu it puts the sidebar back
beside the content and keeps it there (on the fold, for this
browser); in a sidebar kept open on a narrow window it is pressed,
and turns the fold back on (objectstack#35062). */}
{railPanel.keepOpenControl && (
<SidebarFooter className="border-t border-sidebar-border">
<SidebarMenu>
<SidebarMenuItem>
<SidebarMenuButton
data-testid="sidebar-keep-open"
aria-pressed={rail.keepOpen}
isActive={rail.keepOpen}
aria-pressed={railPanel.keepOpenControl.pressed}
isActive={railPanel.keepOpenControl.pressed}
tooltip={keepOpenLabel}
onClick={() => rail.setKeepOpen(!rail.keepOpen)}
onClick={railPanel.keepOpenControl.onPress}
>
<Pin className="h-4 w-4" />
<span>{keepOpenLabel}</span>
Expand All @@ -900,6 +908,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). */}
</Sidebar>
{/* 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 && (
<div
data-testid="console-sidebar-edge"
aria-hidden="true"
className={cn(SIDEBAR_EDGE_ZONE, CONSOLE_BELOW_TOP_BAR)}
{...railPanel.edgeZoneProps}
/>
)}
{/* objectstack#34594 — the phone's bottom menu bar. After the sidebar,
so it takes the sidebar's place before the page in reading order. */}
{phoneMenu && (
Expand Down
Loading
Loading