Repository navigation
feat(studio): a collapsible left menu of six groups replaces the top pillar nav - #36985
Conversation
…r nav Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziBCAytAzzCu3iPBFR
The eight surface tests that read the top pillar nav now read the left menu: its groups, its type entries (links to the area's lists), the entry each page marks current, and the leave guard on its links. The narrow-header pin reads the header's one two-column row; the back-to-app pins follow decision 5 (the current package's app, never a remembered one). A model test pins the menu's groups, entries, links and current-entry rule. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziBCAytAzzCu3iPBFR
…page The menu's render pins (its own cookie, the drawer, the current entry, the search, focus order), the console's cross-package leg on the builder route and the entry gate before the menu's targets, a Chromium page for the menu's geometry, and the changeset. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziBCAytAzzCu3iPBFR
The default-sharing entry re-enters the Access pillar on another query. The pillar reads its deep link once, at mount, and the router may apply the navigation in a later render than the click's own state updates, so the remount now waits for the new query to be the router's. The package-less scope's pins read the left menu. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziBCAytAzzCu3iPBFR
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziBCAytAzzCu3iPBFR
The surface under test reaches a dynamic import of @objectstack/lint, so the edited test file imports it at module top, as its held-data sibling does: the first load is paid during collection, never inside a case's clocked window (check:test-source-alias). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziBCAytAzzCu3iPBFR
…es; three pins read the menu The left menu's SidebarGroupLabel carries HIDDEN_ICON_LABEL_NOT_FOCUSABLE, as every call site of the primitive does (the call-site pin enumerates them). Three surface pins that still read the retired pillar links now read the menu: the package-list failure keeps the menu and its toggle, and the header's first way out is Back to app right after the menu toggle. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziBCAytAzzCu3iPBFR
|
repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt 席位核对 — REWORK · repo:objectstack#3 · head 1f7534d · 2026-11-24T14:39ZL1: REWORK Read
Checklist
FindingsNo must-fix.
Delta read owed: L1 on the new head plus a |
…ctionary keeps System and Security The shared domain dictionary has readers outside the menu (Setup's datasource pages draw its badge), so its labels are back to System / 系统 and Security / 安全. The left menu names the system and security groups Platform / 平台 and Access / 访问 through its own studioMenuGroupLabel. A pin holds both. The changeset declares the published SidebarProvider's new optional cookieName prop as a widening. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziBCAytAzzCu3iPBFR
|
repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt Contract-review-claim: session_01WGufzhjqviExWpzQMm57Mt · head 0af200c · 2026-11-24T15:55Z |
|
repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt Contract reviewServed-tier: This is the declaration face. The review is owed by the Inputs read:
Nothing was built, run or re-run. ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt 席位核对 — ACCEPT · repo:objectstack#3 · head 0af200c · 2026-11-24T16:00ZL1: ACCEPT Read
Findings
Still owedOnce #36973 lands, this branch merges |
Brings in the one-builder Studio address module. The header pillar nav stays removed (the menu replaced it); metadataArea keeps its ~org redirect beside main's studioAddress vocabulary import. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziBCAytAzzCu3iPBFR
…builder Every menu link and the open-page prefix are composed by studioAddress.ts builders instead of by hand; each address is byte-identical to before, scope segment encoding included. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziBCAytAzzCu3iPBFR
|
repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt Contract-review-claim: session_01WGufzhjqviExWpzQMm57Mt · head 7617f52 · 2026-11-24T16:42Z |
|
repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt Contract reviewServed-tier: This is the declaration face. The review is owed by the Inputs read:
Nothing was built, run or re-run. ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt 席位核对 — ACCEPT · repo:objectstack#3 · head 7617f52 · 2026-11-24T17:02ZL1: ACCEPT Read
FindingsNo must-fix, no should-fix. S1 and S2 stay closed (7136982449). N1–N4 are unchanged. Landable on full green. |
|
repo:objectstack#3 · os-support-ai · session_01WGufziBCAytAzzCu3iPBFR Landing · 2026-11-24T17:04Z · ACCEPT 7138622131 at head 7617f52
Open findings are nits only:
State: ready + auto-merge (Tier S). On MERGED, #36899 closes by |
…I draft gets the designers' notice and discard (objectstack-ai#37026) <!-- claude-projects-attribution: {"github_login":"os-support-ai"} --> _Requested by **Yibo Wang** · [project thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBTuMGhLAZx29zwDrayDGZZF)_ Fixes objectstack-ai#36902 Clause-②: yes (widening) Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:管理员在 Studio 的通用详情页(钩子、选项集、视图等)改完点「保存」,改动立刻生效;不再有自动保存开关,也不用再点一次「发布」。 - 为什么做:Studio 重构专题里「通用详情保存即生效」这一项,让通用详情和各个设计器的保存方式一致。 - 出错会怎样:发布被拒时,页面上方写明原因,什么都不生效,页面上的修改保留可以再存;AI 留下的草稿保留并有提示,可以一键放弃;本改动可以直接撤回。 - 要你做什么:无 ## What changes Studio's generic item page (`ResourceEditPage`, every type without its own designer: hook, picklist, view, page, app, doc…) now saves the way the designers do (objectstack-ai#36511, epic decisions 1, 12, 14). 1. **Save = draft + this one item's publish.** Save writes the draft (`PUT /meta/:type/:name?mode=draft`, If-Match / If-None-Match pin and conflict dialog unchanged), then publishes that one item (`POST /meta/:type/:name/publish`) at the same `?package=` and bundle `member`. The publish is pinned to the published version the page loaded, through the existing `DraftSaveGuard.publish` (objectstack-ai#36601), so a Save over a row another editor published since opens the same conflict dialog (reload, overwrite, keep editing). The auto-save switch, its 1.5 s debounce and the `metadata-admin:autosave` browser setting are gone; the header's Publish and discard-draft buttons are gone. 2. **Create publishes after its first save** (If-None-Match `*`, then the publish). 3. **AI draft** (`draftChanges[].by` is `copilot` or `mcp`): the page shows the AI's version under the designers' `StudioAiDraftNotice`; a person's Save makes it live together with their edits; "Discard the AI's changes" drops that one item's draft at its package and member, and asks first (in the page's own dialog, objectui#13333) when the page holds unsaved edits. 4. **A person's pending draft** from before this change is marked "This item has unpublished changes" with its own Publish (pinned) and Discard for that one item. 5. **Leave guard**: ×, ‹ ›, the side menu, in-app links, reload and close ask first when the page holds unsaved edits; browser Back is not intercepted (decision 12). The seam was already in place (`chrome/unsavedEdits.ts`); this PR pins it on this page. 6. **A refused publish** shows its reason above the editor in the designers' words (`publishRefusal`, server text under Details). Nothing goes live; the draft the Save wrote is taken back when no draft was pending before, and the edits stay on the page, unsaved. A draft that was pending before (the AI's or a person's) is kept. 7. **`@object-ui/data-objectstack`: `MetadataClient.layered()` now forwards `overlayVersion`.** The client rebuilt its answer field by field and dropped it, so a publish pin read off `layered()` was always `null`. This is why the Save's publish could not be pinned; it also made the object page's objectstack-ai#36601 publish pin a no-op on a server that serves the field. Fixed in place (bounded fix: same defect class as the card's pin, mechanical, the file had no other claim, no new gate surface) and pinned in `metadata-client.layeredDraft-29793.test.ts`. **Clause-② yes (widening):** the published package's exported `MetadataLayered` type gains the optional member `overlayVersion?: string | null` (claim amendment on objectstack-ai#36902, 7137741670; L1-b (3) S1, 7137721696). New shared piece: `detailSaveAtOnce.ts` (`publishDetailSave`, `isAiDraft`). The designers' `publishSavedItem` (`studioSaveBar.tsx`) names no bundle member, so this page carries its own instead of changing that file. `StudioDesignSurface.tsx`, `DraftConflictDialog.tsx` and `studioSaveBar.tsx` are unchanged (reused as they are). ### How this relates to objectstack-ai#36726 and objectstack-ai#36350 - **objectstack-ai#36726** (open PR objectstack-ai#36958 pins the designers' publish): no shared files, either PR can land first. This card pins the generic page's own publish with the same objectstack-ai#36601 `DraftSaveGuard` API, used as it is on main. The `overlayVersion` client fix (item 7) is what makes a pin read off `layered()` effective at all, the object page's included. One sequencing item: objectstack-ai#36958 adds rule 9 to the guard (a reload over a draft that was pending before the Save keeps the conflict's pin until the author re-confirms), answered by a `beforeReload` that returns `'kept'`. On main that callback is typed to resolve to nothing (a void promise) and refuses that answer (tsc TS2345, measured), so it cannot be written here without editing `DraftConflictDialog.tsx`, which this card must not touch. Today this page is at parity with main's guard. Whichever PR lands second adds the one-line `beforeReload` for the `hadDraft` case in `publishDetailSave`. - **objectstack-ai#36350** (view-draft publish takes a draft-version precondition): left to objectstack-ai#36350. That is a change to the publish door (server / protocol), outside this card's boundary (Metadata-protocol: none). This page's publish is pinned on the published version, not on the draft version, so the window objectstack-ai#36350 describes (another writer's draft write between this Save's draft save and its publish, then published by this Save) is still open for views until objectstack-ai#36350 lands. When it does, the Save's publish can send the draft version it just received; the call site is `publishDetailSave`. ### Read first (by risk) 1. `ResourceEditPage.tsx` `doSave`: the draft save → `publishDetailSave` → refresh sequence, and the refused branch (take-back only when `hadDraft` is false). 2. `detailSaveAtOnce.ts`: the take-back on a refused or conflicted publish. 3. `metadata-client.ts` `layered()`: the two `overlayVersion` forwards. ### Two-minute check Open Studio → All metadata → any view, change its label, press Save. Expected: one `PUT …?mode=draft` and one `POST …/publish` in the network panel, the Unsaved chip clears, no "unpublished changes" line, and `GET /api/v1/meta/view/NAME` already serves the new label. ## Tests ### Acceptance run (the card's 验收 scenario, real browser, self-built stack) Backend `examples/app-showcase` (`objectstack dev --seed-admin --fresh`) and the console dev server, both built from this branch, on per-agent ports. The items are my own, authored into the showcase's customization package (`com.example.showcase.custom`): a hook, a shared option set (picklist) and two views. The backend ran with `OS_METADATA_WRITABLE=picklist`: the picklist type is not runtime-creatable by default (`NOT_CREATABLE`, its registry entry), so the option-set leg needs that operator setting. Each leg edits the label and presses Save once; the network log is the page's own requests. | Item | Before Save | Writes after Save | Live read after Save | |---|---|---|---| | hook `s36902_stamp_title` | chip `unsaved`, no request in 2.5 s | `PUT …?mode=draft&package=…custom` then `POST …/publish?package=…custom` (200) | new label served; no unpublished-changes line | | picklist `s36902_priority` | same | same pair (200) | same | | view `showcase_task.s36902_triage` | same | same pair (200) | same | <details><summary>Screenshots: hook, option set, view (unsaved, then saved and live)</summary>       </details> **AI draft.** Written through the real MCP door, not faked: an OAuth client (dynamic registration, PKCE, consent, `metadata:write`) called `save_metadata_draft` on `showcase_task.s36902_ai`; the draft read then carried `draftChanges: [{path: ["label"], by: "mcp", …}]`. - The page shows the AI's version under the notice (4). An edit then "Discard the AI's changes" asks in the page's own dialog (5); confirming sends one `DELETE …?state=draft&package=…custom`, the draft read answers 404 and the live version is back (6). - A second MCP draft, then an edit and Save: `PUT` draft + `POST …/publish` (200), the draft read answers 404, the live label is the AI's change plus the person's edit (7). - Leave guard: with an unsaved edit, × asked "You have unsaved changes. Leave this page anyway?", and Cancel stayed on the item. <details><summary>Screenshots: AI draft notice, discard, save</summary>     </details> Images: orphan branch `claude/issue-36902-screenshots` at `566b916`. ### Live e2e `LIVE_APP_URL=… LIVE_API_URL=… pnpm exec playwright test -c playwright.live.config.ts e2e/live/studio-detail-save-at-once.spec.ts e2e/live/studio-editor.spec.ts`: 3 passed (the new spec: no auto-save in 2.5 s, × asks, Save sends exactly `PUT` + `POST …/publish`, the live page has the added block, the draft read is 404, browser Back is not intercepted; `studio-editor.spec.ts`'s Add-block round trip now reads the published item after Save). ### Unit At head `09693db5c`, under the shared verify lock, one run: every test file under `metadata-admin/` plus every other ui test file that mentions publish, draft, auto-save or the detail page (338 files), then `type-check` (which compiles the test files too) of `@object-ui/data-objectstack`, `@object-ui/i18n` and `@object-ui/app-shell`. <details><summary>Readings</summary> ```text Test Files 338 passed (338) Tests 2918 passed (2918) packages/data-objectstack type-check: Done packages/i18n type-check: Done packages/app-shell type-check: Done os-verify-lock: VERDICT command-exit 0 ``` New: `ResourceEditPage.saveAtOnce-36902.test.tsx` (19 cases over the real `MetadataClient` and an in-memory server that honours If-Match / If-None-Match on the draft door and on the publish door: items 1–6, the leave guard on ×, ‹ ›, links, beforeunload, Back unguarded, create publishes, refused create). `metadata-client.layeredDraft-29793.test.ts` gains the `overlayVersion` forward on both answer shapes (served value, served null, absent). </details> ## Acceptance notes - 'Changes 1' in shots 1–3 is the AI draft of `showcase_task.s36902_ai`, written through MCP before the save leg for shots 4–7; it clears in shot 6 once that draft is discarded (not the hook: its Save sent `PUT ?mode=draft` then `POST /publish` 200). - Existing detail-page suites that waited out the auto-save or clicked the header's Publish / Discard draft now press Save and read the Save's own publish, or use the unpublished-changes line's buttons (14 files). Their doubles gained a publish that drains the draft, as the real door does; assertions that only held because a draft stayed pending after Save were rewritten to the live result. `layersUnsaved-11799`'s SAVE case now expects one `/layers` re-read: a Save publishes, so the item has a layer afterwards. - Leftover `localStorage.setItem('metadata-admin:autosave', '0')` lines in suites this PR does not otherwise touch are now no-ops; left as they are to keep the diff to the card. - The platform checklist step that says the ResourceEditPage draft auto-saves and is then published (`docs/qa/platform-checklist/areas/studio-authoring.json`, the page Add-block item) is now stale. carrier: objectstack-ai#36910 (the epic's checklist-and-docs card). - The designers' own auto-save (Data / Automations / Access pillars) is unchanged: out of this card. ## Verification <details><summary>Local gates (derived for this diff) and reconciliation</summary> - `node scripts/pm/dispatch-gates.mjs --commands`: 39 families. All 39 run locally: 38 exit 0 (`check:*` and the node scripts, re-run after the last code commit), and `pnpm --dir ui exec vitest run scripts/` under the lock at `c8a49c900` (the one later commit changes only a live e2e spec): `Test Files 172 passed | 2 skipped (174)`, VERDICT command-exit 0. - `node scripts/pm/dispatch-gates.mjs --ran FILE` (each line with its exit code): `39 derived famil(ies) accounted for — 39 run, 0 NOT-MEASURED (a DERIVED zero)`. - `node scripts/check-test-source-alias.mjs`: OK, 34 changed test files judged (the touched suites now load `@objectstack/lint` at collection, as the gate asks). - `node scripts/pm/overlap-check.mjs` before every push: `VERDICT clean exit 0` (shares only the i18n catalogues and `metadata-client.ts` with objectstack-ai#36983, objectstack-ai#36985, objectstack-ai#36784; each merges cleanly). - The rest of the farm (lint, the CI test shards, `test:repo`) is CI's; its check-runs are read on the PR. </details> Changed lines: 1,650 over 24 files (1,317 added, 333 removed), one PR. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- signed: repo:objectstack#3 · os-support-ai · session_01WGufziBCAytAzzCu3iPBFR --> --------- Co-authored-by: Claude <noreply@anthropic.com>
… and items (objectstack-ai#37108) Fixes objectstack-ai#36900 Part of objectstack-ai#36890 Clause-②: no Metadata-protocol: none repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H ## 维护者速读 - 在 Studio 的任何设计页面(包括「全部元数据」跨包页)按 ⌘K / Ctrl+K,都能打开搜索面板:按左侧菜单的六组列出当前包的全部类型和每一项,选中即打开它的详情或设计器;页面上有没保存的修改时,会先问一句再走。 - 属于「Studio 重构」专题:去掉设计器左侧那一列后,作者靠 ×、‹ › 和 ⌘K 换到别的项;同时补回上一步左侧菜单改造时临时丢掉的跨包页 ⌘K。 - 出错时作者只是搜不到或打不开某一项,左侧菜单和列表照常可用;不动任何数据,直接撤回这次改动即可。 - 无。 ## What changes Head `7bbe1c54b`: 15 files, +1,679 / −92 against `main`, one PR for the card. REWORK round 1 (L1 7144125191) and its delta L1 ACCEPT (7147006586) are folded in below. `main` was merged in that round. **The command palette is mounted on every Studio design page.** `StudioDesignSurface` mounts it in its shell under its own `CommandPaletteProvider`, on a package's pillars and "All metadata" area, `~org` and `~all`. After objectstack-ai#36985 only the `/studio` landing had one, so `~all` had lost ⌘K (the hand-off's stated temporary regression); this restores it. A host that already mounts a palette above the surface keeps its own (`useCommandPaletteProviderMounted()`): the surface then mounts neither provider nor palette. - **What it lists on a package.** The left menu, group by group (`buildStudioMenu`, decision 11: Data, UI, Automation, Platform, Access, AI, under the menu's names). Each group holds the menu's own entries: each type's list, plus Organization flows, Default sharing, Diagnostics and Positions and permissions. Then come the items of every type the group lists, from the package and its `.custom` pair (ADR-0146 D3). - **Types.** The menu's own data, read once per page: `StudioMenuDataProvider` in the surface feeds both the menu and the palette (new `studioMenuData.ts`: the data hook, the context, the group icons and the entry names). The palette and the menu cannot disagree, and opening the palette re-reads neither types nor the diagnostics sweep. - **Items.** Each listed type's served list, read only while the palette is open, as its list page reads it (`include: listInclude`). The rows are kept by the list page's own rule (`scopeListRows`: the package, its pair, the type's list predicate) and named by the type's primary key. - **Customizations.** A customization item reads "Customization of PACKAGE NAME", never the pair's raw id. - **Other scopes.** On a package the palette no longer lists every package's objects and flows, because the package's own items replace them. The packages stay listed. `~org` and `~all` keep those lists and add their own menu entries. - **Where a pick opens.** Every address comes from `studioAddress.ts` (objectstack-ai#36895). An object, flow or permission set goes through `studioItemPath`, so it opens its designer today and follows each designer card's `STUDIO_ITEM_PILLAR` switch with no edit here. Any other item opens `studioMetadataItemAddress(…, ?package=OWNER)`, the address its list row links to (ADR-0048). A menu entry goes to the menu entry's own `to`. - **How it leaves (decision 12): through the shell's unsaved-edits seam (M1).** `openStudioPaletteAddress` handles another page through `confirmUnsavedLeave`. That seam holds the surface's own work and every editor that registered its own, the "All metadata" item page (`ResourceEditPage`) among them; the surface's own bit never saw that page's edits. The page already open on another query (Default sharing from the Access pillar) goes through `reenterPillar`. It asks, then remounts the pillar once the router shows the requested query (S5): the palette's own `?palette=` change comes first and no longer triggers it. The page already shown, palette keys aside, just closes the palette. - The surface's `confirmLeavePillar` now goes through the same seam, so its own header departures ask about the item page's edits too: Back to app, the retired-Interfaces notice, the other-pillar `requestSurface` and the Access opener. They had the same blind spot; it is closed here, and no defect card is owed. - **The palette stays free of Studio reads.** `CommandPalette`'s `studio` scope takes an optional `surface` (`packageScope`, `renderGroups`, `open`), documented in the app-shell README. The page draws its own groups (`StudioPaletteGroups`), so the Studio modules load with the Studio chunk, never with the console's eager closure. `@object-ui/app-shell` is private, so the new optional prop and exported types widen no published surface: `Clause-②: no`. - **N4.** `ResourceEditPage`'s fullscreen Escape now ignores an Escape a dialog above it already took (`defaultPrevented`, which Radix sets), so closing the palette over a fullscreen editor no longer also leaves fullscreen. - **Card item 1 (`advertisedShortcuts.ts`)** needs no edit. `CommandPaletteProvider` already advertises ⌘K (`useAdvertiseShortcut(OPEN_COMMAND_PALETTE_SHORTCUT)`), and it now runs on every design page. - **Card item 4 (objectstack-ai#35308)**: the studio scope searches no record, so it has no record title. Items are titled by their served metadata label, as their lists show them, and no second title rule exists. Files: - New: `studio-design/studioPaletteModel.ts` (pure: pair, items, addresses, groups, departure, `openStudioPaletteAddress`), `studio-design/StudioPaletteGroups.tsx` (reads and draws) and `studio-design/studioMenuData.ts` (the menu's shared data and vocabulary). - `StudioMenu.tsx`: it gains `StudioMenuDataProvider`, draws the shared data when a provider above holds it, and otherwise reads its own. - `StudioDesignSurface.tsx`: changes are in its shell region only: the providers, the palette mount, `confirmLeavePillar`, `reenterPillar` and `openFromPalette`. - `StudioRoute.tsx` is unchanged. No i18n key is added. - `e2e/studio-left-menu-36899.spec.ts` stubs the menu's reads where they now live. Read first, by risk: 1. `ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx`: `confirmLeavePillar` (now the seam), the `reenterPillar` latch, `openFromPalette` / `paletteSurface`, and the provider wrap. It is the only edit to a shared file beyond `StudioMenu.tsx`. 2. `ui/packages/app-shell/src/views/studio-design/studioPaletteModel.ts`: `openStudioPaletteAddress` and `studioPaletteItemsOf` over `scopeListRows`. 3. `ui/packages/app-shell/src/views/studio-design/studioMenuData.ts` with `StudioMenu.tsx`: the shared data and the menu's own-read fallback. ## Tests - `studioPaletteModel-36900.test.ts` (15 cases). It pins: - the pair; - items through `scopeListRows`: unwrapped, scoped, deduped and named by the primary key, with the list predicate applied; - pillar types following `studioItemPath` for every `STUDIO_ITEM_PILLAR` row, and other types on their area page with `?package=OWNER`; - the menu's six groups; - the leave / re-enter / stay decision; - M1 at the unit: with an editor registered, a leave asks its question (Cancel stays, OK goes), with a CONTROL that nothing registered asks nothing; re-entry hands the host the query to wait for. - `StudioPaletteGroups.surfaceScope-36900.test.tsx` (11 cases): the real `CommandPalette` + `CommandPaletteProvider` + `StudioMenuDataProvider` + `StudioPaletteGroups`, with the metadata reads doubled at the menu's own seam. It pins: - group headings and order, menu entries, and the package's and pair's items; - the list read's `include` and list predicate; - "Customization of" the package's name, with no `.custom` text shown; - no cross-package object or flow on a package; - addresses handed to `surface.open`, and matching; - "Searching…" then "No results", and a query typed before the lists answer: the arriving row is selected and Enter opens it; - no item list read until open, with its CONTROL; - `~all`. - `StudioDesignSurface.metadataArea-28561.test.tsx`: 7 new cases on the real surface. - Ctrl+K on a pillar, on `~all` and on a missing package. - **M1**: with the "All metadata" item page holding registered edits, a palette pick asks the page's question (Cancel keeps the page, OK leaves), and Back to app asks too. CONTROL: a clean page leaves at once. - **S5**: Default sharing picked on the real Access pillar shows the overview at `?surface=owd%3Aoverview`. - `ResourceEditPage.leaveGuard-13231.test.tsx` (2 new cases): **M1 on the real `ResourceEditPage`** with a dirty draft and the real palette leaving through `openStudioPaletteAddress`. Cancel keeps the page and the draft, OK leaves, and a CONTROL clean page leaves without asking. - `ResourceEditPage.detailTabs-36901.test.tsx` (1 new case): **N4**, an Escape a dialog took leaves the fullscreen and the page alone, with its CONTROL. <details><summary>Local readings, head 5e181ef / 7bbe1c5</summary> - Touched and related files at 5e181ef (new pins, StudioMenu, studioMenuModel, the address guard, all 16 `CommandPalette.*`, every console `StudioRoute*`): `Test Files 31 passed (31)`, `Tests 249 passed (249)`, lock `VERDICT command-exit 0`. 7bbe1c5 changes the e2e spec only. - All 83 `StudioDesignSurface.*.test.tsx` (at cf95fe5; later commits change no surface file): `Test Files 43 passed (43)`, `Tests 236 passed (236)` and `Test Files 40 passed (40)`, `Tests 217 passed (217)`. - `@object-ui/app-shell` `type-check` (both programs) and `type-check:e2e`: exit 0. `e2e/studio-left-menu-36899.spec.ts`, local: `3 passed`. - `pnpm --dir ui exec vitest run scripts/`: `Test Files 172 passed | 2 skipped (174)`. - Derived gate families (`dispatch-gates.mjs --commands`, 39): all exit 0 on the final tree; `--ran`: `39 derived, 39 run, 0 NOT-MEASURED, 0 UNRUN`. `check:new-line-citations` (ui): `0 new citation(s)`. eslint on the changed ui files: 0 errors, none in the new modules. - `overlap-check.mjs` before every push of the round: `VERDICT clean exit 0`. - CI at 7bbe1c5: 38 success, 13 expected skips, 0 failed. </details> <details><summary>Ablations (scripts/ablation-replace.mjs, each restored to HEAD: blob == HEAD, git diff HEAD empty)</summary> - A1, the seam dropped from the palette's leave (`confirmUnsavedLeave(() => act.navigate(to))` → `act.navigate(to)`): `Tests 3 failed | 33 passed`. The three M1 pins (real `ResourceEditPage`, surface, unit) go red. - A2, the seam dropped from `confirmLeavePillar`: `Tests 1 failed | 13 passed` (Back to app). - A3, the re-entry latch back to "the next query change": stays green (`14 passed`). Under test the palette's close and the navigation land in one render, so no pin tells the latch from the old trigger. The latch guards the ordering the code's own comment warns about: the router applying a navigation in a later render. - A4, a first-row selection added during the round: green in happy-dom and no effect live (a live probe with it removed). It was taken out again, so it is not on this head. - Round 0: the package-scope cross-package guard (`Tests 1 failed | 9 passed`) and the surface's palette mount (`Tests 3 failed | 7 passed`). </details> ## Acceptance notes - **Live walk-through, showcase leg: passed** (PR comment 7145761753). A real build, backend `--fresh`, and the Console dev server serving app-shell from `src` at this head, driven by headless Chromium as a person would. - One non-first item each of object, flow, permission set, hook and dashboard, found by label and opened at its list-row address with its label on the page. The object pick re-enters the Data page. - Ctrl+K on the cross-package catalog. - **M1** on a real item page with an unsaved edit: the pick asks once, Cancel keeps the page and the edit, Back to app asks, OK leaves. - **S5**: Default sharing from the Access page shows the overview. - **HotCRM leg: carried by objectstack-ai#36910** (the joint walk-through card); this container has no HotCRM stack. - N1: `MetadataQuickFind` on ⌘⇧M (`DirectoryPage`) is a second item finder beside ⌘K; a follow-up retires or routes it. - N2: each open of the palette on a package reads one item list per listed type (the menu's types and counts are shared and not re-read). The client shares only in-flight reads. Draft-only items are not listed. - N5: nothing inside Studio advertises ⌘K. Studio's own header draws no search trigger, and the help dialog that lists advertised shortcuts is mounted only inside apps. - N6: `useStudioMenuTypes` no longer memoizes `types`, and the provider value is a new object each render. The palette's reads key on the type names, so this costs re-renders only. - N7: while the package entry loads, the customization label briefly names the base package by its id. - N8: the changeset's English body carries the six group names in Chinese too, beside the English. - Walk observation: with zero delay between Escape and the next Ctrl+K (automated), a query typed before the lists answered left no row highlighted. With no earlier close, or with a 1 s gap, it worked every time measured. This is synthetic timing, not filed. - objectstack-ai#36784 (paused, pre-split) conflicts in `StudioDesignSurface.tsx` against `main` itself; this branch merges cleanly with `main` and objectstack-ai#37089. ## Verification Two minutes: open any package in Studio (`/studio/PKG/data`), press ⌘K (Ctrl+K), type part of a dashboard's or hook's name, and press Enter. The palette lists the six menu groups and the item; Enter opens `/studio/PKG/metadata/TYPE/NAME?package=OWNER`. Edit a field on that item page without saving, then pick another entry: the leave prompt appears first, and Cancel keeps the edit. <details><summary>Where to look in code</summary> - Leave path: `openStudioPaletteAddress` (model) and `confirmLeavePillar` / `reenterPillar` / `openFromPalette` (surface). - Groups: `StudioPaletteGroups` (reads) over `useStudioMenuData` and `buildStudioPaletteGroups` / `studioPaletteItemAddress` (pure). </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01QSeKYkkwuF6UuFtu85Yd5H)_ <!-- signed: repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Yibo Wang · project thread
Fixes #36899
Part of #36890
Clause-②: yes (widening)
Metadata-protocol: none
repo:objectstack#3 · os-support-ai · session_01WGufziBCAytAzzCu3iPBFR
维护者速读
What changes
Studio's one navigation is now a left menu of six groups (amended ADR-0084: Data, UI, Automation, Platform, Access, AI; zh 数据、界面、自动化、平台、访问、AI). The top pillar switcher is gone from every Studio page.
scopeDirectoryEntries(newdirectoryScope.ts) is now read by bothDirectoryPageand the menu, so the two never disagree. A group carries its type count, an entry its item count (the diagnostics sweep the directory already reads), and a search box narrows entries by label or machine name. Object, Flow and Permission Set are always listed, so an empty package can create its first one./studio/PKG/metadata/TYPE?package=PKG); an item of an object, flow or permission set still opens its designer throughareaItemPillarPath, so the pillar routes stay and are reached as before. Four entries are not a type: Organization flows (/studio/~org/automations) under Automation, Default sharing (the Access pillar on?surface=owd:overview; the page itself is Studio 重构(3-3):权限集矩阵在元数据地址上右侧全屏打开,组织级默认共享总览有自己的路由,权限集类型切到新地址 #36905's) under Access, Diagnostics (metadata/_diagnostics) under Platform, and Positions and permissions (the environment catalog on~all) under Access. Datasource still goes to Setup (ADR-0146 D1).aria-current="page"and the sidebar's active state: an area page marks its type, a pillar marks the type it designs (Data marks Object, Automations marks Flow, Access marks Permission Set, Access on the OWD overview marks Default sharing).SidebarProvider/Sidebar collapsible="offcanvas"from@object-ui/components), docked below the top bar. The top bar's leading toggle hides and shows it; the state survives a reload under Studio's own cookiestudio_menu_state, never the app sidebar'ssidebar_state. Below 768 px it is a drawer that closes when an entry is chosen.SidebarProvidergains an optionalcookieNameprop for this (default unchanged), declared as a new shadcn local-patch family inui/scripts/shadcn-local-patches.mjswith its pin.studioMenuGroupLabel(newstudioMenuGroupLabel.ts) names thesystemgroup Platform / 平台 and thesecuritygroup Access / 访问 (new keysengine.studio.menu.groupSystem/groupSecurity); the other four groups readtranslateMetadataDomain. Only the left menu's group headings use it. The shared dictionary is unchanged (System / 系统, Security / 安全): Setup's datasource pages read it forPageShell's domain badge, and no other Studio heading or chip is renamed.@object-ui/componentsSidebarProvidergains an optionalcookieNameprop (claim amendment on Studio 重构(1-3):去掉顶部分区,换成可折叠的左侧分组菜单(数据、界面、自动化、平台、访问、AI),右侧是列表和全屏详情 #36899, 7134770955).~allframe: merged into one shell./studio/~all/metadata/*is now served by the same route as a package's area (:packageId/metadata/*already outranked~all/*), andStudioDesignSurfacedraws it with no package, no package actions and no right slot, beside the same menu. The landing's frame (StudioConsoleFrame) now frames only the landing.areaLocationRedirectnow sends a~orgarea URL, or?package=~org, to the package-less flows instead of reading~orgas a package.engine.studio.pillar.*removed,engine.studio.menu.*added.Choices the card asked to state
studioMenuGroupLabel): system = Platform/平台, security = Access/访问; the shared dictionary keeps System/Security~allframestudio_menu_state(own key;sidebar_stateuntouched)studioMenuModel.tslink and its open-page detection now come from thestudioAddress.tsbuilders, byte-identical (the menu tests pin the hrefs). NoSTUDIO_ITEM_PILLARrow and no scope-segment encoding is changed here.Where the work landed outside the stated file surface
ui/packages/components/src/ui/sidebar.tsxandui/scripts/shadcn-local-patches.mjs(the surface said "read; a new cookie key"): the provider hard-codedsidebar_stateon every write, ⌘B included, so a second key needed thecookieNameprop. It is a declared local patch with its pin.ui/packages/app-shell/src/views/metadata-admin/DirectoryPage.tsxand newdirectoryScope.ts: the directory's listing rule moved into one helper the menu shares (item 1 says the menu reuses the directory's grouping data)./appsindex route, so "back to the apps home" goes touseHomePath()(the/homelauncher in Studio), which is what the console calls the apps home.HIDDEN_ICON_LABEL_NOT_FOCUSABLE, as everySidebarGroupLabelcall site does (objectui#12795 call-site pin); the menu is offcanvas, so the classes never take effect there.Known regression (temporary, accepted by the seat 2026-11-24 13:41Z)
~all:~allnow renders inside Studio's builder shell, so the consoleAppHeaderand its ⌘K command palette are no longer drawn on the~allleg. Studio's own ⌘K arrives with Studio 重构(⌘K):Studio 设计界面里挂命令面板,范围是当前包的全部元数据类型,结果打开新地址 #36900, which is queued next on the list side once this PR and Studio 重构(1-4a):所有产生 Studio 地址的地方改成调用同一个函数(行为不变,为逐类型切换新地址做准备) #36895 land.Tests
studioMenuModel.test.ts(groups, entries, links, counts, current-entry rule, search),StudioMenu.test.tsx(own cookie and remount, app sidebar collapse does not collapse the menu, drawer below 768 px closing on choose, aria-current, counts, search with no-match status, focus order toggle then search then entries), a sidebarcookieNamecase insidebar-cookie-restore.test.tsx, the patch-family pin inshadcn-local-patches.test.ts, a~orgcase inmetadataArea.test.ts, console route cases (~allon the builder route, the entry gate before~org/automations, the OWD overview and Diagnostics, no recent-package record for~all).studio-pillar-navnow assert the menu:notFound-26708,accessSegment-12452,heldDataLeave-26705,heldFlowLeave-26705,interfacesRetired-36502,metadataArea-28561,pillarNavGuard,narrowHeader-12509;backToApp-36501andpackageLessFlows-11553follow decision 5. Also converted:packageListErrorPosture(the menu and its toggle survive a package-list failure),homeLoop-12513(the menu toggle is the bar's first button, Back to app the first way out after it) andheldFlowLeave-26705(module-top@objectstack/lintimport, as its held-data sibling has).studioMenuModel.test.tsalso pins the menu's own group names (en and zh) and the shared dictionary keeping System/系统 and Security/安全;PageShell.narrowHeader-12306is back to main's 'Security'.ui/e2e/studio-left-menu-36899.spec.ts, a Chromium page bundling the real menu: docked at the left with the content beside it, off the canvas when collapsed with the content at full width, still collapsed after a reload (cookie on a real http origin), a drawer inside the viewport at 390 px.Local readings at 214400b, patch rounds to 7617f52
vitest runon the 50 touched and related files (touched tests, every test namingtranslateMetadataDomainor asecurity/systemdomain, DirectoryPage, StudioRoute, StudioBackToApp, packageLess, sidebar):Test Files 50 passed (50),Tests 450 passed (450), lockVERDICT command-exit 0.pnpm --dir ui exec vitest run scripts/:Test Files 172 passed | 2 skipped (174),Tests 5130 passed | 2 skipped,VERDICT command-exit 0(at b901832; the last commit touched only the e2e spec).type-checkof@object-ui/components,@object-ui/i18n,@object-ui/app-shell,@object-ui/consoleandtype-check:e2e:VERDICT command-exit 0(at b901832;type-check:e2ere-run at 214400b).playwright test e2e/studio-left-menu-36899.spec.ts --project chromium:3 passed.dispatch-gates.mjs --commands): all 18 exit 0 locally;check:i18n-keys,check:i18n-drift,check:i18n-dead-keys,check:new-line-citations,check-nul-bytes,check-platform-checklist --changed-from origin/mainexit 0.heldFlowLeave-26705now imports@objectstack/lintat module top, as its held-data sibling does.node scripts/check-test-source-alias.mjsexit 1 before, exit 0 after (123 packages with tests scanned);--self-testexit 0.Test Files 3 failed (3),Tests 3 failed | 10 passed (13),VERDICT command-exit 1; on the fixTest Files 3 passed (3),Tests 13 passed (13),VERDICT command-exit 0.studioMenuModel.test.tsTests 11 passed (11)plus the other 5 touched files green;check-test-source-aliasexit 0;@object-ui/app-shelltype-check exit 0;check:i18n-keys/check:i18n-dead-keys/check:i18n-driftexit 0; card 2,362 changed lines.metadataArea.ts(main'sstudioAddressimports kept, this branch's~orgimport added) andStudioDesignSurface.tsx(header pillar nav stays removed; main's otherstudioAddressedits kept).studioAddress.guard.test.tsred at c840fdd (Tests 1 failed | 1 passed (2), offenderstudioMenuModel.ts:173), green after the repoint; 20 touched/related filesTests 166 passed (166); card 2,364 changed lines (+1774/−590, 37 files).Acceptance notes
ui/apps/consoledev server, this branch) against a running server: a self-built app (created through the Studio landing's New app,com.default.field-service) on the showcase example server, and HotCRM (its own repo at main,app.objectstack.hotcrm) on its published 18.6.0 server. On HotCRM the Data pillar's rail shows "Couldn't read customizations": that is this branch's console against an older published server, not the menu.studio-pillar-navon the page; six groups in order; the Object entry current on the Data pillar; after collapsedata-state=collapsed, the cookiestudio_menu_state=falseand nosidebar_state, still collapsed after a reload; at 390 px no docked menu until the toggle, then a 288 px drawer at the left edge.overlap-check.mjs, final head): merges cleanly with main; textual conflicts with refactor(studio): every Studio address comes from one builder; no address changes #36973, fix(studio): pin the object extension, hook, action and flow Saves' publish (#36726) #36958 and feat(studio): design an object's public forms in Studio's Form tab #36784 inStudioDesignSurface.tsx(andmetadataArea.tswith refactor(studio): every Studio address comes from one builder; no address changes #36973), all in the header region this card replaces. Their code is not reshaped here.Wide (self-built app)
Collapsed (self-built app)
Narrow, 390 px drawer (self-built app)
Wide (HotCRM)
Collapsed (HotCRM)
Narrow, 390 px drawer (HotCRM)
Verification
Read first, by risk:
ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx: the header and body row (menu mounted inside the provider), the~allbranch, and the re-entry remount (reenterPillarplus its layout effect).ui/packages/app-shell/src/views/studio-design/studioMenuModel.ts: what each scope lists and where each entry goes;studioMenuCurrentKey.ui/packages/components/src/ui/sidebar.tsxwithui/scripts/shadcn-local-patches.mjs: thecookieNameprop and its declared patch.Two-minute check: open
/studio/PKG/datafor any package, click the toggle at the top-left, reload. Expected: the left menu stays hidden after the reload, and the app sidebar elsewhere in the console keeps its own state.🤖 Generated with Claude Code