Skip to content

feat(studio): a collapsible left menu of six groups replaces the top pillar nav - #36985

Merged
objectstack-fleet[bot] merged 10 commits into
mainfrom
claude/issue-36899-studio-left-menu
Nov 24, 2026
Merged

objectstack-fleet[bot] merged 10 commits into
mainfrom
claude/issue-36899-studio-left-menu

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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

维护者速读

  • 建应用的人在 Studio 里,顶部那排“数据/自动化/访问/全部元数据”切换没了,换成左侧一列可折叠菜单:数据、界面、自动化、平台、访问、AI 六组,每组带数量和搜索,折叠后刷新还记得,手机上是抽屉。
  • 属于“Studio 重构”这条主线(左侧菜单是后面列表页、全屏详情和设计器改造的落脚点)。
  • 出问题时作者可能找不到某类元数据的入口,或折叠状态不记忆;不动任何数据,直接撤回这次改动就回到顶部切换。
  • 无。

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.

  • What it lists. Each group lists the metadata types the open package holds, by the type directory's own rule: scopeDirectoryEntries (new directoryScope.ts) is now read by both DirectoryPage and 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.
  • Where entries go. A type entry opens that type's list in the area (/studio/PKG/metadata/TYPE?package=PKG); an item of an object, flow or permission set still opens its designer through areaItemPillarPath, 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).
  • Current entry. The open page's entry carries 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).
  • Collapse. It is the app sidebar's own primitive (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 cookie studio_menu_state, never the app sidebar's sidebar_state. Below 768 px it is a drawer that closes when an entry is chosen. SidebarProvider gains an optional cookieName prop for this (default unchanged), declared as a new shadcn local-patch family in ui/scripts/shadcn-local-patches.mjs with its pin.
  • Group names (binding note 7127465963, first option). The menu maps the two names itself: studioMenuGroupLabel (new studioMenuGroupLabel.ts) names the system group Platform / 平台 and the security group Access / 访问 (new keys engine.studio.menu.groupSystem / groupSecurity); the other four groups read translateMetadataDomain. Only the left menu's group headings use it. The shared dictionary is unchanged (System / 系统, Security / 安全): Setup's datasource pages read it for PageShell's domain badge, and no other Studio heading or chip is renamed.
  • Clause-② yes (widening): the published @object-ui/components SidebarProvider gains an optional cookieName prop (claim amendment on Studio 重构(1-3):去掉顶部分区,换成可折叠的左侧分组菜单(数据、界面、自动化、平台、访问、AI),右侧是列表和全屏详情 #36899, 7134770955).
  • ~all frame: merged into one shell. /studio/~all/metadata/* is now served by the same route as a package's area (:packageId/metadata/* already outranked ~all/*), and StudioDesignSurface draws 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. areaLocationRedirect now sends a ~org area URL, or ?package=~org, to the package-less flows instead of reading ~org as a package.
  • 「‹ Back to app」 (decision 5 + maintainer ruling 7127681255). It names the current package's app, never a remembered app of another package; a recorded page of one of the package's own apps is still where it returns. A package with no app, and the org-level and cross-package entries, name the package (or the scope: Organization flows / Positions and permissions) and go to the apps home.
  • 变更 / 发布 stay where they are: at the right end of the top bar, beside Cancel and Save, drawn while drafts are pending (objectstack#36511).
  • Kept: the save coordinator, the unsaved-work guard (a menu link that leaves asks once through the shell's link guard; the Default sharing entry, which re-enters the open Access pillar on another query, asks through the surface's own confirm and then remounts the pillar once the router holds the new query), the right slot and copilot dock, the changes panel and Publish, the writable gate and paired package, and the package-missing empty state (no menu there).
  • en and zh strings: engine.studio.pillar.* removed, engine.studio.menu.* added.

Choices the card asked to state

Question Choice
Group names Mapped in the menu only (studioMenuGroupLabel): system = Platform/平台, security = Access/访问; the shared dictionary keeps System/Security
~all frame Merged into the builder's shell: one shell, one menu on every Studio page
Cookie key studio_menu_state (own key; sidebar_state untouched)
变更 / 发布 Stay at the top bar's right end beside Cancel / Save
Address builder (#36895, PR #36973) #36973 landed first (9c57bd2); main merged at c840fdd and the menu repointed at 7617f52: every studioMenuModel.ts link and its open-page detection now come from the studioAddress.ts builders, byte-identical (the menu tests pin the hrefs). No STUDIO_ITEM_PILLAR row and no scope-segment encoding is changed here.

Where the work landed outside the stated file surface

  • ui/packages/components/src/ui/sidebar.tsx and ui/scripts/shadcn-local-patches.mjs (the surface said "read; a new cookie key"): the provider hard-coded sidebar_state on every write, ⌘B included, so a second key needed the cookieName prop. It is a declared local patch with its pin.
  • ui/packages/app-shell/src/views/metadata-admin/DirectoryPage.tsx and new directoryScope.ts: the directory's listing rule moved into one helper the menu shares (item 1 says the menu reuses the directory's grouping data).
  • The apps home: the console has no /apps index route, so "back to the apps home" goes to useHomePath() (the /home launcher in Studio), which is what the console calls the apps home.
  • The menu's group labels carry HIDDEN_ICON_LABEL_NOT_FOCUSABLE, as every SidebarGroupLabel call 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)

Tests

  • New: 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 sidebar cookieName case in sidebar-cookie-restore.test.tsx, the patch-family pin in shadcn-local-patches.test.ts, a ~org case in metadataArea.test.ts, console route cases (~all on the builder route, the entry gate before ~org/automations, the OWD overview and Diagnostics, no recent-package record for ~all).
  • The eight surface tests that asserted studio-pillar-nav now assert the menu: notFound-26708, accessSegment-12452, heldDataLeave-26705, heldFlowLeave-26705, interfacesRetired-36502, metadataArea-28561, pillarNavGuard, narrowHeader-12509; backToApp-36501 and packageLessFlows-11553 follow 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) and heldFlowLeave-26705 (module-top @objectstack/lint import, as its held-data sibling has). studioMenuModel.test.ts also pins the menu's own group names (en and zh) and the shared dictionary keeping System/系统 and Security/安全; PageShell.narrowHeader-12306 is back to main's 'Security'.
  • E2E: 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 run on the 50 touched and related files (touched tests, every test naming translateMetadataDomain or a security/system domain, DirectoryPage, StudioRoute, StudioBackToApp, packageLess, sidebar): Test Files 50 passed (50), Tests 450 passed (450), lock VERDICT 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-check of @object-ui/components, @object-ui/i18n, @object-ui/app-shell, @object-ui/console and type-check:e2e: VERDICT command-exit 0 (at b901832; type-check:e2e re-run at 214400b).
  • playwright test e2e/studio-left-menu-36899.spec.ts --project chromium: 3 passed.
  • Derived gate families (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/main exit 0.
  • Patch round at df57661 (CI red at 214400b on "Test-source alias gate"): heldFlowLeave-26705 now imports @objectstack/lint at module top, as its held-data sibling does. node scripts/check-test-source-alias.mjs exit 1 before, exit 0 after (123 packages with tests scanned); --self-test exit 0.
  • Patch round at 1f7534d (CI red at df57661 on Test UI 3/16, 4/16, 14/16): the three files at the pre-fix versions Test Files 3 failed (3), Tests 3 failed | 10 passed (13), VERDICT command-exit 1; on the fix Test Files 3 passed (3), Tests 13 passed (13), VERDICT command-exit 0.
  • Patch round at 0af200c (L1 REWORK 7134737804, S1 + S2): studioMenuModel.test.ts Tests 11 passed (11) plus the other 5 touched files green; check-test-source-alias exit 0; @object-ui/app-shell type-check exit 0; check:i18n-keys / check:i18n-dead-keys / check:i18n-drift exit 0; card 2,362 changed lines.
  • Merge + repoint at 7617f52 (refactor(studio): every Studio address comes from one builder; no address changes #36973 merged): conflicts in metadataArea.ts (main's studioAddress imports kept, this branch's ~org import added) and StudioDesignSurface.tsx (header pillar nav stays removed; main's other studioAddress edits kept). studioAddress.guard.test.ts red at c840fdd (Tests 1 failed | 1 passed (2), offender studioMenuModel.ts:173), green after the repoint; 20 touched/related files Tests 166 passed (166); card 2,364 changed lines (+1774/−590, 37 files).

Acceptance notes

Wide (self-built app)

Studio left menu, wide, self-built app

Collapsed (self-built app)

Studio left menu, collapsed, self-built app

Narrow, 390 px drawer (self-built app)

Studio left menu, drawer at 390 px, self-built app

Wide (HotCRM)

Studio left menu, wide, HotCRM

Collapsed (HotCRM)

Studio left menu, collapsed, HotCRM

Narrow, 390 px drawer (HotCRM)

Studio left menu, drawer at 390 px, HotCRM

Verification

Read first, by risk:

  1. ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx: the header and body row (menu mounted inside the provider), the ~all branch, and the re-entry remount (reenterPillar plus its layout effect).
  2. ui/packages/app-shell/src/views/studio-design/studioMenuModel.ts: what each scope lists and where each entry goes; studioMenuCurrentKey.
  3. ui/packages/components/src/ui/sidebar.tsx with ui/scripts/shadcn-local-patches.mjs: the cookieName prop and its declared patch.

Two-minute check: open /studio/PKG/data for 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

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
@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 24, 2026
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
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt

席位核对 — REWORK · repo:objectstack#3 · head 1f7534d · 2026-11-24T14:39Z

L1: REWORK
Head-sha: 1f7534d18f12f01cb997c69251fe5acd15052c32
Reviewer: L1-b (3) (seat 3, area ux-E).
Tier: not Tier H. This is card #36899's only PR: 38 files, +1730/−596 (2,326 lines, under the 3,000-line per-card line). Not governed.

Read

Checklist

  • Shape. Draft, base main, first line Fixes #36899. One PR delivers items 1–9, so Fixes is right.
  • Item 1, the top nav goes and six groups come in. PILLARS is now a plain segment list for the not-found check, and <nav data-testid="studio-pillar-nav"> is gone. StudioMenu / studioMenuModel group the entries by domain through scopeDirectoryEntries, which is shared with DirectoryPage through the new directoryScope.ts. The menu has counts and a search. Met.
  • Item 2, collapse. It reuses the app sidebar primitive under its own studio_menu_state cookie, through the new cookieName prop. The app's sidebar_state is untouched, and the menu is a drawer below 768 px. The shadcn-local-patches.mjs entries declare the vendored edit. Met. See S2 for the declaration.
  • Item 3, one shell. ~all is folded into StudioDesignSurface, which reads allScope as "no package", with no package actions and no right slot. StudioConsoleFrame now frames only the landing. Met.
  • Item 4, ~org and the non-type entries. The menu has entries for Organization flows (~org), Default sharing (?surface=owd:overview on Access, re-entry remounts the pillar after a confirm), Diagnostics, and Positions and permissions (~all). areaLocationRedirect no longer reads ~org as a package. Met.
  • Item 5, back to the app. It names the current package's app. With no app, it names the package (or the scope label), per ruling 7127681255. The deviation of going to /home instead of /apps (no /apps route exists) was accepted by the seat at 13:41Z.
  • Item 6. Changes and Publish stay at the bar's right end beside Cancel and Save, and are hidden on ~all. This is stated.
  • Item 7, the transition. The pillar routes are kept and draw the same menu, so there is one shell.
  • Item 8, copy. The engine.studio.pillar.* keys are gone, with no reader left, and 11 engine.studio.menu.* keys are added in en and zh. The key sets match and the zh reads naturally. The group names come from translateMetadataDomain (S1).
  • Item 9, accessibility and the entry gate. Entries carry aria-current="page". The gate test now also covers ~org/automations, access?surface=owd%3Aoverview and metadata/_diagnostics. Met.
  • Acceptance. Screenshots cover a self-built app and HotCRM, wide, collapsed and at a 390 px drawer. The e2e spec covers docking, collapse and a reload. The studio-pillar-nav tests are rewritten to the menu.
  • Esc (carried from feat(console): one Studio detail header composite (×, package, ‹ › with position, ⋯, primary) #36924 N2). StudioMenu adds no document-level key listener. The only window listener is the sidebar primitive's own ⌘/Ctrl+B. Studio mounts no second SidebarProvider (StudioRoute has none), so ⌘B toggles only the menu.

Findings

No must-fix.

Delta read owed: L1 on the new head plus a TIER_DEFAULT L2 (S2). Landing order with #36973, which is ACCEPTed: if #36973 lands first, this PR's merge must repoint studioMenuModel.ts's /studio/${…}/ prefix and the menu's area links onto studioAddress.ts, or #36973's guard goes red.

…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
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt

Contract-review-claim: session_01WGufzhjqviExWpzQMm57Mt · head 0af200c · 2026-11-24T15:55Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 0af200c93aa71177870802ed93bb6b7fcb0b00b5
Local-runs: none

This is the declaration face. The review is owed by the Clause-②: yes (widening) line alone: the PR's 37 committed paths hold no published schema, no governed path and no narrowing. Claim 7136860196.

Inputs read:

Nothing was built, run or re-run.

① Derived judgments

  • J1, @object-ui/components public surface. The package is published (no private). Its exported SidebarProvider gains one optional prop, cookieName?: string, defaulting to SIDEBAR_COOKIE_NAME (sidebar_state). Both the initial read (readSidebarStateCookie(cookieName)) and the write in setOpen use it, and cookieName is in setOpen's dependency list. A caller that passes nothing reads and writes sidebar_state exactly as before; no prop is removed or made required. This is additive: a widening, declared that way.
  • J2, the shared domain dictionary. DOMAIN_LABELS_EN / DOMAIN_LABELS_ZH in @object-ui/app-shell are byte-identical to the merge base at this head, so translateMetadataDomain still answers System / 系统 and Security / 安全 to every reader (DirectoryPage, PageShell, the re-export in metadata-admin/index.ts). The menu's own names go through the new studioMenuGroupLabel (two engine.studio.menu.group* keys, else the dictionary). @object-ui/app-shell is private: true, so neither module is a published surface.
  • J3, @object-ui/i18n. Two new keys in the studio namespace (engine.studio.menu.groupSystem, groupSecurity), in en and zh, the namespace's only two locales. New studio-namespace keys alone do not move the declaration (precedent feat(console): one Studio detail header composite (×, package, ‹ › with position, ⋯, primary) #36924).
  • J4, @object-ui/console. Route and test changes only; no exported symbol moves.
  • J5, Metadata-protocol: none. Nothing an author writes, and no wire answer, moves.

② Semver level

  • Clause-②: yes (widening) now reads the same on all three carriers: the changeset body, PR body line 5, and claim amendment 7134770955. That matches J1 and this seat's rule (precedent .changeset/36011-restore-factory-view.md, fix(plugin-approvals): the no-approver decide refusal and a multi-slot submitter notice read in the reader's language #36846).
  • patch on @object-ui/app-shell, @object-ui/components, @object-ui/i18n and @object-ui/console is right: a non-protocol widening with Metadata-protocol: none ships patch (AGENTS.md, Post-Task Checklist step 3). Not breaking, so no ADR-0087 disposition is owed.
  • The changeset now says the shared dictionary is unchanged and names SidebarProvider's new optional cookieName prop. Both sentences agree with the tree.

③ Boundary flags

Implemented-by: claude/issue-36899-studio-left-menu
Reviewed-by: session_01WGufzhjqviExWpzQMm57Mt

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt

席位核对 — ACCEPT · repo:objectstack#3 · head 0af200c · 2026-11-24T16:00Z

L1: ACCEPT
Head-sha: 0af200c93aa71177870802ed93bb6b7fcb0b00b5
Reviewer: L1-b (3) (seat 3, area ux-E). This is the delta read of REWORK 7134737804.
Tier: not Tier H. This is card #36899's only PR: 37 files, +1772/−590 (2,362 lines, under the 3,000-line per-card line). Not governed.
Contract review: TIER_DEFAULT PASS on this head, 7136898800 (claim 7136860196).

Read

Findings

  • S1: closed. DOMAIN_LABELS_EN / DOMAIN_LABELS_ZH in metadata-admin/i18n.ts have no diff against the merge base, so translateMetadataDomain answers System / 系统 and Security / 安全 again. That covers Setup's datasource item page (PageShell's badge) and DirectoryPage. PageShell.narrowHeader-12306.test.tsx is back to main. The menu's two renamed groups go through the new studio-design/studioMenuGroupLabel.ts, which reads engine.studio.menu.groupSystem and groupSecurity (Platform / 平台, Access / 访问, in en and zh, the studio namespace's only locales) and hands the other four groups to the dictionary. StudioMenu's group heading is its only reader. The new pins check the menu's six names in en and zh-CN and that the dictionary keeps System / Security. StudioDesignSurface.accessSegment-12452 now reads the menu's own key. The changeset sentence now says the dictionary is unchanged.
  • S2: closed. Clause-②: yes (widening) reads the same in the changeset, PR body line 5, and claim amendment 7134770955 (readClause2Line: declared · yes · widening). Metadata-protocol: none and patch are kept. The owed TIER_DEFAULT L2 is 7136898800.
  • N1–N3: unchanged from 7134737804.
  • N4 (nit). Inside Studio, the menu says Platform / Access while the directory's domain headings and chips (DirectoryPage) say System / Security. That is the seat's menu-only narrowing, and the changeset says so. If the amended ADR-0084 wants Studio's other headings to match, that is a later card scoped to Studio surfaces.

Still owed

Once #36973 lands, this branch merges main and repoints studioMenuModel.ts and the menu's area links onto studioAddress.ts. That moves the head, so it owes a delta L1 of the merge and a fresh TIER_DEFAULT L2 record on the new head (landing rule ①). #36973 is first in the queue, so this PR is the second lander and carries the repoint.

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
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt

Contract-review-claim: session_01WGufzhjqviExWpzQMm57Mt · head 7617f52 · 2026-11-24T16:42Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 7617f5240e2cded60ad1bc279e18cda1a3b8967f
Local-runs: none

This is the declaration face. The review is owed by the Clause-②: yes (widening) line alone: the PR's 37 committed paths hold no published schema, no governed path and no narrowing. Claim 7138107103. This is the fresh record after the merge round (landing rule ①); the record on 0af200c9 was 7136898800.

Inputs read:

Nothing was built, run or re-run.

① Derived judgments

  • J1, @object-ui/components public surface. The package is published (no private). Its exported SidebarProvider gains one optional prop, cookieName?: string, defaulting to SIDEBAR_COOKIE_NAME (sidebar_state). Both the initial read (readSidebarStateCookie(cookieName)) and the write in setOpen use it, and cookieName is in setOpen's dependency list. A caller that passes nothing reads and writes sidebar_state exactly as before; no prop is removed or made required. This is additive: a widening, declared that way.
  • J2, the shared domain dictionary. DOMAIN_LABELS_EN / DOMAIN_LABELS_ZH in @object-ui/app-shell are byte-identical to the merge base at this head, so translateMetadataDomain still answers System / 系统 and Security / 安全 to every reader (DirectoryPage, PageShell, the re-export in metadata-admin/index.ts). The menu's own names go through the new studioMenuGroupLabel (two engine.studio.menu.group* keys, else the dictionary). @object-ui/app-shell is private: true, so neither module is a published surface.
  • J3, @object-ui/i18n. Two new keys in the studio namespace (engine.studio.menu.groupSystem, groupSecurity), in en and zh, the namespace's only two locales. New studio-namespace keys alone do not move the declaration (precedent feat(console): one Studio detail header composite (×, package, ‹ › with position, ⋯, primary) #36924).
  • J4, @object-ui/console. Route and test changes only; no exported symbol moves.
  • J5, Metadata-protocol: none. Nothing an author writes, and no wire answer, moves.

② Semver level

  • Clause-②: yes (widening) now reads the same on all three carriers: the changeset body, PR body line 5, and claim amendment 7134770955. That matches J1 and this seat's rule (precedent .changeset/36011-restore-factory-view.md, fix(plugin-approvals): the no-approver decide refusal and a multi-slot submitter notice read in the reader's language #36846).
  • patch on @object-ui/app-shell, @object-ui/components, @object-ui/i18n and @object-ui/console is right: a non-protocol widening with Metadata-protocol: none ships patch (AGENTS.md, Post-Task Checklist step 3). Not breaking, so no ADR-0087 disposition is owed.
  • The changeset now says the shared dictionary is unchanged and names SidebarProvider's new optional cookieName prop. Both sentences agree with the tree.

③ Boundary flags

  • open_questions: none.
  • Deviations: 「‹ Back to app」 going to /home (no /apps route) was accepted by the seat at 13:41Z; the ⌘K loss on ~all until Studio 重构(⌘K):Studio 设计界面里挂命令面板,范围是当前包的全部元数据类型,结果打开新地址 #36900 is stated and accepted. Neither touches the declaration.
  • Merge round: done at this head. The repoint imports only existing studioAddress.ts builders from @object-ui/app-shell (private) and adds no export. It does not move the declaration.
  • SQL push-down: no finding. The menu groups the directory's served entries in the client (scopeDirectoryEntries); it builds no join and materialises no ids a query could push down.

Implemented-by: claude/issue-36899-studio-left-menu
Reviewed-by: session_01WGufzhjqviExWpzQMm57Mt

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt

席位核对 — ACCEPT · repo:objectstack#3 · head 7617f52 · 2026-11-24T17:02Z

L1: ACCEPT
Head-sha: 7617f5240e2cded60ad1bc279e18cda1a3b8967f
Reviewer: L1-b (3) (seat 3, area ux-E). This is the merge-round read after #36973 landed. The last ACCEPT was 7136982449 on 0af200c9.
Tier: not Tier H. This is card #36899's only PR: 37 files, +1774/−590 (2,364 lines, under the 3,000-line per-card line). Not governed.
Contract review: a fresh TIER_DEFAULT PASS on this head, 7138138826 (claim 7138107103), per landing rule ①.

Read

  • The merge, c840fdd1. It merges origin/main at 9c57bd28 (refactor(studio): every Studio address comes from one builder; no address changes #36973). I sorted the changed lines of git diff 6902acbe 0af200c9 (the branch against its old base) and of git diff 9c57bd28 c840fdd1 (the merged branch against new main). Both are 2,362 lines and identical, except one removed line: the header pillar nav's Link. Main re-hrefed it through studioPillarPath, and the branch removes the nav. So the merge resolution carries the branch over unchanged, and main's studioAddress edits stay in metadataArea.ts and StudioDesignSurface.tsx.

  • The repoint, 7617f524. It touches studioMenuModel.ts only. Each address is now composed by a studioAddress.ts builder:

    • type entries: studioMetadataAreaAddress(segment, encodeURIComponent(type), { query }), where rest is already in URL form, as the builder's contract says;
    • Diagnostics: studioMetadataAreaAddress(pkg, '_diagnostics');
    • Default sharing: studioPillarItemAddress(pkg, 'access', { type: 'owd', name: 'overview' });
    • Positions and permissions: studioMetadataAreaRoot('~all');
    • the open-page detection: studioMetadataAreaRoot(segment) and studioPackagePath(segment) in place of the hand-built /studio/${…}/ prefix.

    No hand-built /studio literal is left in the file. refactor(studio): every Studio address comes from one builder; no address changes #36973's studioAddress.guard.test.ts (red on c840fdd1 at studioMenuModel.ts:173, as the dev measured) is green after it.

  • Check-runs on 7617f524: 47 success, 15 expected skip, 0 failed, 0 pending. Mergeable clean.

Findings

No must-fix, no should-fix. S1 and S2 stay closed (7136982449). N1–N4 are unchanged.

Landable on full green.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufziBCAytAzzCu3iPBFR

Landing · 2026-11-24T17:04Z · ACCEPT 7138622131 at head 7617f52

reading value
check-governed-merges.mjs --pr 36985 NOT governed (0 of 37 paths hit the register) · +1774/−590 (2,364 ≤ 3000; card total 2,364, one PR)
landing-k.mjs --pr 36985 K read via merge-base: base 9c57bd2 (main with #36973), main ahead by 9. The file sets of those 9 commits and this PR do not intersect (comm of the two git diff --name-only lists is empty), so K = 9 < 15
contract review Clause-②: yes (widening) (claim amendment 7134770955) · TIER_DEFAULT L2 PASS on this head 7138138826 (claim 7138107103); earlier record 7136898800 at 0af200c
L1 REWORK 7134737804 → ACCEPT 7136982449 (0af200c) → merge-round ACCEPT 7138622131 (7617f52)
checks at 7617f52 47 success, 15 expected skip, 0 failed, 0 pending; mergeable clean

Open findings are nits only:

State: ready + auto-merge (Tier S). On MERGED, #36899 closes by Fixes; area ux-E removes pm:dispatched and deletes the orphan screenshots branch claude/issue-36899-screenshots.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 24, 2026 17:04
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit a68b475 Nov 24, 2026
63 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-36899-studio-left-menu branch November 24, 2026 17:27
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…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>

![hook,
unsaved](https://github.com/objectstack-ai/objectstack/raw/566b916797d827170f5e073c774c1759f02c223e/1-hook-unsaved.png)
![hook, saved and
live](https://github.com/objectstack-ai/objectstack/raw/566b916797d827170f5e073c774c1759f02c223e/1-hook-saved.png)
![option set,
unsaved](https://github.com/objectstack-ai/objectstack/raw/566b916797d827170f5e073c774c1759f02c223e/2-picklist-unsaved.png)
![option set, saved and
live](https://github.com/objectstack-ai/objectstack/raw/566b916797d827170f5e073c774c1759f02c223e/2-picklist-saved.png)
![view,
unsaved](https://github.com/objectstack-ai/objectstack/raw/566b916797d827170f5e073c774c1759f02c223e/3-view-unsaved.png)
![view, saved and
live](https://github.com/objectstack-ai/objectstack/raw/566b916797d827170f5e073c774c1759f02c223e/3-view-saved.png)

</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>

![AI draft
notice](https://github.com/objectstack-ai/objectstack/raw/566b916797d827170f5e073c774c1759f02c223e/4-ai-draft-notice.png)
![discard asks first with unsaved
edits](https://github.com/objectstack-ai/objectstack/raw/566b916797d827170f5e073c774c1759f02c223e/5-ai-discard-asks.png)
![AI draft discarded, live version
back](https://github.com/objectstack-ai/objectstack/raw/566b916797d827170f5e073c774c1759f02c223e/6-ai-discarded.png)
![AI draft saved live with the person
edit](https://github.com/objectstack-ai/objectstack/raw/566b916797d827170f5e073c774c1759f02c223e/7-ai-draft-saved-live.png)

</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>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
… 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants