Repository navigation
feat(console): the sidebar's docking model: 1280 px starts expanded, the expand/collapse button is the one control, Recent lists this app (#36112) - #36297
Conversation
…lapse button is the one control, recent lists this app (#36112) Windows 1280 px and up start with the sidebar expanded, 768 to 1279 px collapsed; the reader's own collapse or expand is kept per browser on each side of the threshold. The keep-open switch is removed; its stored choice reads as expanded on a narrow window. From 768 px up the sidebar's recent list holds only the current app's entries. Claude-Session: https://claude.ai/code/session_01FEkQ5oK4fFfnLADcipbEeT Co-Authored-By: Claude <noreply@anthropic.com>
…el; pin defaults, choices, legacy keep-open and this-app recent (#36112) Claude-Session: https://claude.ai/code/session_01FEkQ5oK4fFfnLADcipbEeT Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5oK4fFfnLADcipbEeT Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5oK4fFfnLADcipbEeT Co-Authored-By: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5oK4fFfnLADcipbEeT Final green head · 2026-11-22T05:23Z · area a4-H |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5oVqoTJkrRZcyZS4xd 席位核对 — ACCEPT · head ce00125
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5oK4fFfnLADcipbEeT Landing · 2026-11-22T05:25Z · area a4-H · ACCEPT → PR #36297 comment 7074740633 (L1-b, head
State: ready for review + auto-merge into the merge queue. On MERGED, #36112 closes by |
…ds in a form host, four specs read the product as merged (objectstack-ai#36578) <!-- claude-projects-attribution: {"github_login":"os-warren"} --> _Requested by **Warren** · [project thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ88Tcs1L1zT2fWqjj2xTzFXM)_ Fixes objectstack-ai#36321 Clause-②: no repo:objectstack#1 dispatch · os-warren · session_01JQwxbanvK21nJKgGjvE9XL ## 维护者速读 - 用户可见变化:新建发票时,本币发票在填过表头后选产品,单价会照常自动带出;之前一律留空并提示「还没选币种」,而表头明明显示着美元。其余改动只是夜间测试的写法,用户无感。 - 为什么做:夜间浏览器测试在 main 上连红多日,卡片要求找出回归并修好,不许跳过或删测试。 - 出错会怎样:只影响新建主从单据里币种选择框被表单读取的方式;不对可以直接撤回这一个合并。 - 要你做什么:无。 ## What changes The nightly `live` tier's two showcase files were red on main for four reasons. One is a product regression, three are specs that pinned a surface a merged pull request moved. **Product: the currency code picker is readable by a form host that reads the DOM** (`@object-ui/components`, `CurrencyCodePicker`). The master-detail form reads its header's live values off the header's named elements (`scrapeHeaderRecord`) on each bubbling `input` / `change`. The picker's only element in the form is its trigger button, which carries the field's `name`, and a button's `value` was the empty string. Since objectstack-ai#36351 (merged 2026-11-22 22:18Z) the line grid withholds a picked amount from a line whose currency it cannot tell, so on a New Invoice whose Currency shows "USD — US Dollar", picking Widget A left Unit Price empty with "Unit Price was not filled: the picked amount is $29.99, but no currency is chosen here yet." The trigger now carries the selected code as its `value`, and a changed code bubbles one `change` event from the trigger, as a native select does (Radix Select's hidden select does the same). Opening on a code announces nothing. **Specs that read the product as merged** (no test renamed, skipped or deleted; every assertion still pins what it pinned): - `ui/e2e/live/phone-nav-drawer-back-29131.spec.ts`, desktop CONTROL: since objectstack-ai#36297 a 1280 px window starts with the sidebar expanded, and the collapsed sidebar's own button stays in the DOM, off screen. `.first()` on the shared trigger selector clicked it and timed out "element is outside of the viewport". The two presses are now the collapse button, then the page header's expand button, each by its test id, with the visible state checked between. - `ui/e2e/live/inline-edit-polish-2572.spec.ts`: the shared inline-edit session it pins is entered by a double-click on the record page's sectioned face, titled "Double-click to edit". At 1280 px with the sidebar expanded that is the face drawn (measured); the "Click to edit" field-list face now edits one field in place with no session and no save bar (objectstack-ai#36475), which is not what this file pins. - `examples/app-showcase/e2e/detail-shapes.spec.ts` (related-heavy): the meta footer is now a "System information" section that starts collapsed (objectstack-ai#36147), so the case opens it before reading "Created"; and the summary rail is retired in every tier (objectstack-ai#35890), so Contoso's contacts are read from the Contacts tab instead of the rail's card. The vacuous right-column count (no right column exists) is dropped with the rail. Already repaired on main before this branch, so not touched: the `New` button's name (objectstack-ai#36303) and the retired "Keep sidebar open" toggle in `detail-shapes` (objectstack-ai#36297). ## Tests - New `ui/packages/components/src/__tests__/currency-code-picker-form-read-36321.test.tsx` (3 cases): the named trigger's value is the code; with no code it is empty; a pick bubbles one `change` from the trigger, read after the new code is on it, and opening on a code announces nothing. - Ablation on the committed tree, each leg by `scripts/ablation-replace.mjs` and restored to the HEAD blob `a5fe02c11426` with `git diff HEAD` empty: the trigger's `value` removed gives `Tests 2 failed | 1 passed (3)`; the `dispatchEvent` removed gives `Tests 1 failed | 2 passed (3)`. ## Acceptance notes - A line picked BEFORE any header edit on a New Invoice still withholds the price with the same note: the form's create feed opens on the caller's initial record, not on the schema defaults the header seeds, so the seeded home currency reaches the grid only with the first header event. Withholding is the safe direction (no cross-currency copy). Same family as the objectstack-ai#36351 follow-ups on objectstack-ai#36412. ## Verification <details><summary>The two nightly files, whole, at b37d813</summary> `os-verify-lock.sh -c 'pnpm console:build && cd examples/app-showcase && OS_TEST_TIERS=nightly pnpm exec vitest run test/showcase-smoke.live.test.ts test/console-live-specs.live.test.ts'`: smoke `56 passed (2.7m)`, Console live specs `28 passed (2.0m)`, `Test Files 2 passed (2)`, `Tests 2 passed (2)`, VERDICT command-exit 0. Control at main d463c46 (same command): `Test Files 2 failed (2)`; Console live `3 of 28` failed (form-view-subforms, inline-edit-polish-2572, phone-nav CONTROL), smoke `1 of 56` failed (detail-shapes related-heavy). </details> <details><summary>Gates</summary> All at b37d813. - `dispatch-gates --commands` derived 56 families; 53 lock-free ones run one by one, each exit 0. `dispatch-gates --ran` with every exit recorded: `56 derived, 56 run, 0 NOT-MEASURED, 0 UNRUN`. - Under `os-verify-lock` (one hold, parts sequenced, each part's own exit read): `pnpm --filter @object-ui/components run type-check` exit 0; `vitest run packages/components/` (from `ui/`) `Test Files 506 passed | 1 skipped (507)`, `Tests 4936 passed | 24 skipped (4960)`; `pnpm check:type-check-debt` exit 0; `vitest run scripts/` (from `ui/`) `Test Files 172 passed | 2 skipped (174)`, `Tests 5127 passed | 2 skipped (5129)`; `pnpm check:dual-build-cjs-loads` exit 0. - The acceptance note measured in the browser (backend + Console preview at the head): a New Invoice opens with the trigger `value=USD`; an Add line and a Widget A pick with no header edit leaves Unit Price `""` with the note. - Declared to CI: `test:repo` and the full lint farm. </details> ## Two-minute check `pnpm --dir ui exec vitest run packages/components/src/__tests__/currency-code-picker-form-read-36321.test.tsx`: 3 passed. In the Console, New Invoice, type a name, Add line, pick Widget A: Unit Price reads 29.99. --- _Generated by [Claude Code](https://claude.ai/code/session_01JQwxbanvK21nJKgGjvE9XL)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01JQwxbanvK21nJKgGjvE9XL Co-authored-by: Claude <noreply@anthropic.com>
Requested by Leehom · project thread
repo:objectstack#4 · os-project-manager · session_01FEkQ5oK4fFfnLADcipbEeT
Fixes #36112
This is PR B of two for the card: the sidebar's docking model. PR A (#36187) moved everything off the desktop top bar.
Clause-②: no
Metadata-protocol: none
Seat claim: #36112 claim. Ruling: F1, 7069868269.
维护者速读
Upgrade change and accepted cost
consoleSidebarRail.width-27593.test.tsxagainst the primitive's sidebar width and plugin-view's drawer width.What changes
@object-ui/app-shelllayout/consoleSidebarRail.tsCONSOLE_SIDEBAR_RAIL_BELOW_WIDTHis1280, one constant, no longer derived (RECORD_DRAWER_MIN_CONTENT_WIDTHremoved; the drawer and list constants stay, to state the accepted cost).CONSOLE_SIDEBAR_NARROW_OPEN_PREFERENCE(wasCONSOLE_SIDEBAR_KEEP_OPEN_PREFERENCE), stored under the same nameconsole.sidebar.keepOpen, so an existingonreads as "expanded on narrow" with no migration. The wide-window choice keeps its key (os:console-sidebar:wide-open). Wide and narrow stay stored separately.startingSidebarOpen(wide): the reader's choice for that side, else expanded on wide and collapsed on narrow.primeConsoleSidebarOpenwrites it into the primitive's cookie before the first frame;seedWideWindowOpenis gone (with an explicit wide default it has nothing to seed).useConsoleSidebarRailanswersnarrowOpen/setNarrowOpeninstead ofkeepOpen/setKeepOpen;railModeis "narrow and collapsed by the narrow choice".useConsoleSidebarRailPanel:keepOpenControl,dock/undockand the'dock'closer are removed. While the sidebar is hidden, a press on a sidebar trigger (the page header's expand button, or the corner fallback) now docks it: on a narrow window the capture phase sets the narrow choice to expanded before the provider's toggle opens it, so the open is not a float. ⌘B still floats the menu over a collapsed sidebar (unchanged), and so does the left edge.hooks/useResponsiveSidebar.ts: gives a window its starting state on load and when it crosses 1280 px or the phone breakpoint; keeps an open/close on a wide window as the wide choice (only on a change, so a default is never recorded as a choice), and a close of the docked sidebar on a narrow window as the narrow choice; a narrow choice turned collapsed (this tab or another) collapses an open sidebar. Public signature unchanged.layout/UnifiedSidebar.tsx: the 「保持侧边栏展开」 footer row is gone (the foot holds only the account menu). From 768 px up the Recent group lists only entries whose address names the current app (resolved bymatchAppBySegment, as Home resolves a recent row's app); the phone drawer is unchanged.@object-ui/i18n:sidebar.keepOpenremoved from all 11 packs (zh-Hant regenerated withgen:zh-hant).Text that named 1416 (the ruling's list, plus one more found by grep):
ui/packages/plugin-detail/src/synth/recordPageColumns.tscomment (also corrected: it still described the retired 48 px icon rail). Comment only, no bump for plugin-detail.docs/qa/platform-checklist/areas/platform-core.jsonplatform-core.builtin-apps-nav-rendersteps[2], revision 17 → 18 with a history row.examples/app-showcase/e2e/detail-shapes.spec.ts: its comment cited 1416 and the case docked the sidebar with the retired "Keep sidebar open"; it now docks with the page header's expand button.Tests
New (card-named):
layout/__tests__/consoleSidebarRail.docking-36112.test.tsx: threshold 1280; first frame at 1279 collapsed and 1280 expanded whatever the cookie, 768 / 1920 edges, phone keeps the cookie; the mounted layout at 1279 → 1280; a stored choice beats the default on each side and the two sides stay apart; a raw legacyos:pref:console.sidebar.keepOpenrecord{"value":"on","v":1}reads as expanded on a narrow window.layout/__tests__/UnifiedSidebar.recentThisApp-36112.test.tsx: Recent lists only this app's entries (other app, Setup, Studio item left out), its five are this app's newest five, no group when this app has none, and the phone drawer still lists every app's.Rewritten (they encoded 1416 or the keep-open switch):
hooks/__tests__/useResponsiveSidebar.test.tsx: defaults at 1279 / 1280, no choice recorded by a default, each side's state across the threshold, wide collapse kept, narrow close kept as the narrow choice, a narrow choice turned collapsed elsewhere, phone untouched.layout/__tests__/ConsoleLayout.sidebarFirstFrame-28077.test.tsx: 1280 → 1279 for the collapsed first frame; new cases for 1280 expanded against a collapsed cookie, a wide collapse, and a narrow expand.layout/__tests__/consoleSidebarRail.width-27593.test.tsx: no longer pins the derived 1416; pins 1280, the 256 px width (F2) and the 304 / 560 cost.layout/__tests__/UnifiedSidebar.hiddenCollapse-35062.test.tsx: narrow width 1280 → 1024; the trigger-floats cases now float with ⌘B; the "Keep sidebar open" cases are replaced by "the expand button docks (wide and narrow), a reload keeps it, the collapse button takes it back", the legacy keep-open read, and "the expand button docks even when React renders between the capture phase and the trigger's handler" (the old render-between case, now for the dock).layout/__tests__/UnifiedSidebar.railOverlay-27593.test.tsx: 1280 / 1360 → 1024; floats with ⌘B; the three "Keep sidebar open" cases and the Esc-on-keep-open case are replaced by the expand-button dock and the narrow/wide choices kept apart (objectstack#28079).examples/app-showcase/e2e/detail-shapes.spec.ts(see above).Retired: none as a file. The removed cases are the ones that drove the retired control; each behaviour they pinned that still exists (float, Esc, focus, fold on navigation, choices kept apart) is pinned in the rewritten files above.
Local runs (head ce00125)
All at head
ce00125fc, under the shared verify lock unless marked lock-free.pnpm --filter @object-ui/app-shell type-check && pnpm --filter @object-ui/i18n test && vitest runthe seven changed or new app-shell test files: VERDICT command-exit 0; i18nTest Files 105 passed (105),Tests 1962 passed | 13 skipped; app-shellTest Files 7 passed (7),Tests 71 passed (71).114ccd7a7(source identical to the head; the last commit adds one import line to a test):vitest runapp-shelllayout,hooks,chrome:Test Files 279 passed (279),Tests 2217 passed (2217).dispatch-gates.mjs, 65 derived,--ranreconciliation: 65 run, 0 unrun): 62 lock-free families re-run at the head, exit 0 each;check:type-check-debtexit 0 under the lock;vitest run scripts/underui/exit 0 under the lock (the lock-free attempt was SIGKILLed by the box's memory limit, not a red);check:test-source-aliasred on the first run, fixed byce00125fcand green since.check:dual-build-cjs-loadsexit 3, PREREQUISITE NOT MET (needs a fullpnpm buildof 36 framework packages this PR does not touch); CI runs it.test:repoand the full lint farm.Ablations (one per leg; each mutation committed-first, landed on disk by `scripts/ablation-replace.mjs`, restored to HEAD and proven by blob hash)
Six legs, one lock hold (VERDICT command-exit 0), at head
ce00125fc. Each leg red, each restored withgit diff HEADempty and the file's blob equal to HEAD's.consoleSidebarRail.docking-36112consoleSidebarRail.docking-36112UnifiedSidebar.hiddenCollapse-35062UnifiedSidebar.recentThisApp-36112UnifiedSidebar.recentThisApp-36112useResponsiveSidebarThe suites import the edited modules by relative path (source), so no build sits between the mutation and the run.
Acceptance notes
Card acceptance, walked against main after PR A (a5a5312) and this branch:
The PR A rows are read from PR A's body and main's code, not re-driven here except where the screenshots show them.
Browser evidence (showcase booted on a private port, console served by Vite from this branch; the before set from the same server with the three sidebar files and the English pack swapped back to the merge base, then restored to HEAD and checked by blob hash):
UnifiedSidebar.recentThisApp-36112and its ablations L4 and L5.Reading taken where the ruling is literal, carried as an open question in the report:
Out of scope, noted not filed: none.
Overlap:
overlap-check.mjsexit 1 against #34223 (a draft from 2026-11-19 that already conflicts with main on another file) indocs/qa/platform-checklist/areas/platform-core.json; not merged around, per the order. #36234 and #36208 share the i18n packs and merge cleanly.Verification
Read first (riskiest first):
ui/packages/app-shell/src/layout/consoleSidebarRail.ts, the capture listener inuseConsoleSidebarRailPanel(expand docks; ⌘B floats) andstartingSidebarOpen.ui/packages/app-shell/src/hooks/useResponsiveSidebar.ts, the layout effect (which transitions write which choice).ui/packages/app-shell/src/layout/UnifiedSidebar.tsx, therecentItemsfilter.Two-minute check: in a fresh browser profile open any app at a 1280 px window: the sidebar is expanded beside the page. Resize to 1279 px: it collapses and the page header shows the expand button; press it: the sidebar docks, and a reload keeps it docked.
Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01FEkQ5oK4fFfnLADcipbEeT