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
12 changes: 12 additions & 0 deletions .changeset/36347-cmd-b-docks-sidebar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@object-ui/app-shell': patch
---

fix(app-shell): ⌘B / Ctrl+B does what the sidebar's expand / collapse button does

Clause-②: no
Metadata-protocol: none

From 768 px up, ⌘B / Ctrl+B is now a press on the console sidebar's expand / collapse button, on a window of any width. With the sidebar beside the page it collapses it; with the sidebar collapsed it puts it back beside the page; either way the browser remembers the choice for that side of 1280 px, as it does for the button, and a reload keeps it. On a window narrower than 1280 px, where the sidebar starts collapsed, ⌘B puts it beside the page and keeps it there. While the menu floats over the page, ⌘B puts it beside the page where it is. The key moves no focus, as a press on the button moves none.

Before, ⌘B floated the menu over the page without changing the collapsed state. The temporary float now comes only from the window's left edge: rest the pointer there, or press there. Unchanged: Esc, a chosen entry and a press outside fold the float; the phone's drawer, which ⌘B still opens and closes; the 1280 px threshold; the sidebar's width. The button's tooltip keeps naming ⌘B, which now does what it says.
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": 18,
"revision": 19,
"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 1280 px a browser with no choice kept opens Setup and Account with the sidebar collapsed, and from 1280 px expanded (ui/packages/app-shell/src/layout/consoleSidebarRail.ts CONSOLE_SIDEBAR_RAIL_BELOW_WIDTH, ruling 7069868269 on objectstack#36112); a reader's own collapse or expand is kept per browser, on each side of that width. Collapsed, the sidebar is hidden, with no icon column (ruling 6973617688 on objectstack#35062): press the expand button at the page header's left edge to put it back beside the page before expanding any group — or press Ctrl/⌘+B, or rest the pointer on the window's left edge, to float the full menu over the page; 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",
"as admin, hand-walk each destination in each app. At a window narrower than 1280 px a browser with no choice kept opens Setup and Account with the sidebar collapsed, and from 1280 px expanded (ui/packages/app-shell/src/layout/consoleSidebarRail.ts CONSOLE_SIDEBAR_RAIL_BELOW_WIDTH, ruling 7069868269 on objectstack#36112); a reader's own collapse or expand is kept per browser, on each side of that width. Collapsed, the sidebar is hidden, with no icon column (ruling 6973617688 on objectstack#35062): press the expand button at the page header's left edge, or press Ctrl/⌘+B, which does the same (ruling 7074574380 on objectstack#36112), to put it back beside the page before expanding any group — or rest the pointer on the window's left edge to float the full menu over the page; 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 @@ -828,6 +828,12 @@
"date": "2026-11-22",
"change": "steps[2]: the threshold is 1280 px, not 1416 px, and it sets only where a browser with no choice kept starts — collapsed below it, expanded from it (ruling 7069868269 on #36112); the reader's own collapse or expand is kept per browser on each side, and the 'Keep sidebar open' switch is gone, so the walk docks the sidebar with the page header's expand button, or floats it with Ctrl/⌘+B or the window's left edge as before. The app bar named in revision 17 is gone from 768 px up (#36187). No clause changed. Read from source; not yet re-run by a QA run.",
"ref": "#36112"
},
{
"revision": 19,
"date": "2026-11-22",
"change": "steps[2]: Ctrl/⌘+B is a press on the expand / collapse button (ruling 7074574380 on #36112, which replaces the words '⌘B unchanged' of ruling 7069868269): it docks the collapsed sidebar beside the page as the reader's choice, a float included, and collapses a docked one; it no longer floats the menu, which floats only from the window's left edge. The walk is unchanged in substance. No clause changed. Read from source; not yet re-run by a QA run.",
"ref": "#36347"
}
]
},
Expand Down
7 changes: 4 additions & 3 deletions ui/packages/app-shell/src/chrome/advertisedShortcuts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
* chat page's `⌘⇧O` / `⌘⇧S` are advertised by that page, so they are listed
* only where that page is mounted.
*
* Two advertisers sit beside a handler they do not own the code of: `⌘B` is
* the Shadcn `SidebarProvider`'s own listener (a synced primitive, see
* `ConsoleLayout`), and `Esc` is Radix's dismiss handler on every dialog and
* Two advertisers sit beside a handler they do not own the code of: `⌘B` is,
* on a phone, the Shadcn `SidebarProvider`'s own listener (a synced primitive;
* from 768 px up the console sidebar answers it, see `ConsoleLayout`), and
* `Esc` is Radix's dismiss handler on every dialog and
* panel (see `KeyboardShortcutsDialog`). The pin
* `KeyboardShortcutsDialog.wiredOnly-11674.test.tsx` fires every listed
* entry's chord against the real handler, those two included, and fails on a
Expand Down
11 changes: 7 additions & 4 deletions ui/packages/app-shell/src/hooks/useResponsiveSidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@
* that side of the threshold, else expanded on a wide window and collapsed on
* a narrow one (ruling 7069868269 on objectstack#36112). Collapsed, the
* console's sidebar is hidden, and its full menu floats over the content from
* the window's left edge or ⌘B (ruling 6973617688 on objectstack#35062;
* `consoleSidebarRail.ts`). Must be called inside a SidebarProvider context.
* the window's left edge (ruling 6973617688 on objectstack#35062;
* `consoleSidebarRail.ts`); ⌘B / Ctrl+B is a press on the expand / collapse
* button (ruling 7074574380 on objectstack#36112), so it collapses and docks
* the sidebar as the reader's choice. Must be called inside a SidebarProvider
* context.
*
* It also keeps the reader's choices, each on its own side of the threshold:
* an open or close on a wide window is the wide-window choice
* (objectstack#28079), a close of the docked sidebar on a narrow window the
* narrow-window choice (the page header's expand button keeps the other
* half, `useConsoleSidebarRailPanel`). The float writes neither, and a state
* narrow-window choice (the page header's expand button and ⌘B keep the
* other half, `useConsoleSidebarRailPanel`). The float writes neither, and a state
* this hook gives a window is not a choice.
* @module
*/
Expand Down
16 changes: 9 additions & 7 deletions ui/packages/app-shell/src/layout/ConsoleLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import { useResponsiveSidebar } from '../hooks/useResponsiveSidebar.js';
import { usePhoneNavDrawerHistory } from './usePhoneNavDrawerHistory.js';
import { usePhoneViewport } from '../hooks/usePhoneViewport.js';
import { isAppDocsPath, isRecordPagePath } from './consoleRoutePaths.js';
import { primeConsoleSidebarOpen } from './consoleSidebarRail.js';
import { SIDEBAR_TOGGLE_CHORD, primeConsoleSidebarOpen } from './consoleSidebarRail.js';
import { useAiSurfaceEnabled } from '../hooks/useAiSurface.js';
import { servedObjectLabel } from '../hooks/servedObjectLabel.js';
import { useNavigationContext } from '../context/NavigationContext.js';
Expand Down Expand Up @@ -82,16 +82,18 @@ interface ConsoleLayoutProps {
}

/**
* `⌘B` / `Ctrl+B` toggles the sidebar. The listener is `SidebarProvider`'s own
* (`@object-ui/components`' synced Shadcn primitive, mounted by `AppShell`):
* it matches `b` with ⌘ or Ctrl, and a bare `B` does nothing. That code is not
* ours to edit, so the shortcut is advertised from inside the provider it
* belongs to, by {@link ConsoleLayoutInner} (objectui#11674).
* `⌘B` / `Ctrl+B` toggles the sidebar: it matches `b` with ⌘ or Ctrl, and a
* bare `B` does nothing. From 768 px up the console sidebar answers it as a
* press on its expand / collapse button (`useConsoleSidebarRailPanel`, ruling
* 7074574380 on objectstack#36112); on a phone the listener is
* `SidebarProvider`'s own (`@object-ui/components`' synced Shadcn primitive,
* mounted by `AppShell`). The shortcut is advertised from inside that
* provider, by {@link ConsoleLayoutInner} (objectui#11674).
*/
const TOGGLE_SIDEBAR_SHORTCUT: AdvertisedShortcut = {
id: 'toggle-sidebar',
group: 'navigation',
chord: { key: 'b', mod: true },
chord: SIDEBAR_TOGGLE_CHORD,
label: (t: ShortcutLabelTranslate) => t('console.shortcuts.toggleSidebar'),
};

Expand Down
31 changes: 14 additions & 17 deletions ui/packages/app-shell/src/layout/LocalizedSidebarTrigger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,21 @@ import {
useSidebar,
} from '@object-ui/components';
import { useObjectTranslation } from '@object-ui/i18n';
import { shortcutKeycaps, type ShortcutChord } from '../chrome/advertisedShortcuts.js';
import { shortcutKeycaps } from '../chrome/advertisedShortcuts.js';
import { SIDEBAR_TOGGLE_CHORD } from './consoleSidebarRail.js';

/**
* The chord `SidebarProvider`'s own listener answers to (⌘B / Ctrl+B). It is
* the same chord `ConsoleLayout` advertises to the keyboard-shortcuts dialog;
* the tooltip draws it with the dialog's keycaps so the two never spell it
* differently.
*/
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 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.
* The shell's sidebar trigger (objectui#12429): below the Shadcn mobile
* breakpoint it opens and closes the drawer, above it it collapses the
* sidebar and expands it again. In the console a collapsed sidebar is hidden,
* and the trigger docks it beside the content again as the reader's choice
* (ruling 7069868269 on objectstack#36112, `consoleSidebarRail`).
* `aria-expanded` follows whichever of the two states the click toggles.
*
* The tooltip names ⌘B / Ctrl+B ({@link SIDEBAR_TOGGLE_CHORD}), drawn with
* the keyboard-shortcuts dialog's keycaps so the two never spell it
* differently: the chord is a press on this button (ruling 7074574380 on
* objectstack#36112).
*/
export const LocalizedSidebarTrigger = React.forwardRef<
React.ElementRef<typeof Button>,
Expand Down Expand Up @@ -64,7 +61,7 @@ export const LocalizedSidebarTrigger = React.forwardRef<
data-testid="sidebar-trigger-shortcut"
className="pointer-events-none inline-flex h-5 select-none items-center gap-0.5 rounded border bg-muted px-1.5 font-mono text-xs font-medium text-muted-foreground"
>
{shortcutKeycaps(TOGGLE_SIDEBAR_CHORD).join('')}
{shortcutKeycaps(SIDEBAR_TOGGLE_CHORD).join('')}
</kbd>
</TooltipContent>
</Tooltip>
Expand Down
3 changes: 2 additions & 1 deletion ui/packages/app-shell/src/layout/UnifiedSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,8 @@ export function UnifiedSidebar({ activeAppName, onAppChange, railOverlay = false
</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. */}
the pointer only; the keyboard has the page header's expand button
and ⌘B, which dock the sidebar. */}
{railPanel.edgeZoneProps && (
<div
data-testid="console-sidebar-edge"
Expand Down
Loading
Loading