Repository navigation
feat(studio): one table holds the menu's type order and its 常用 / 高级 tier - #37232
Conversation
…advanced tier STUDIO_MENU_PLACEMENT lists every type the directory can list, in the ruled order, each with its tier. It holds order and tier only; a type's group stays its served domain. A pin holds it against DEFAULT_METADATA_TYPE_REGISTRY and against the ruled order. Not wired into the menu yet. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSeKYkkwuF6UuFtu85Yd5H
…udio-menu-placement
…nced tier main registers ai_context (domain ai) since the table was written; it takes an advanced row, last in ai, matching the ADR table on the M1 PR. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSeKYkkwuF6UuFtu85Yd5H
…-checks Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSeKYkkwuF6UuFtu85Yd5H
…udio-menu-placement
…lumns The ADR's type-to-group table now carries an order and a tier per type. The pin reads it and holds the list equal to it: tier per type both ways, each row's group equal to the served domain, and the order inside each group. A drift names the type or the group. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSeKYkkwuF6UuFtu85Yd5H
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSeKYkkwuF6UuFtu85Yd5H
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — ACCEPT · L1 · head
|
|
repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H Landing · 2026-11-25T05:59Z · head
|
…ress; no flow rail (objectstack-ai#36903) (objectstack-ai#37169) Fixes objectstack-ai#36903 Clause-②: yes (narrowing) Metadata-protocol: none Skills-docs: none — no page under `skills/` or `content/docs/` names the Automations rail's strings or teaches overriding a Studio console string ## 维护者速读 - 搭建者在 Studio 点开一个流程,会在右侧全屏打开它的设计器,左上角 × 回到流程列表,‹ › 按列表顺序看上一个、下一个;原来设计器左侧那一列流程列表没有了,组织级流程也在同样的新地址上打开。流程的“审阅草稿”链接打开通用详情页并显示审阅;权限集的审阅链接照旧打开它的权限矩阵页。 - 这是 Studio 重构专题(左侧菜单 → 列表 → 右侧全屏详情)里流程设计器的一张,和对象、权限集的设计器共用同一套“设计器页面”写法。 - 出错时最可能是旧书签没跳对、或某个流程打不开;不改数据和元数据协议。原流程列表专用的 9 条界面文字随 19.0.0 大版本退役,已在变更说明里逐条列出(若有人自定义过这几条翻译,自定义将不再显示),回退这个 PR 即可恢复。 - 这个 PR 超过 3000 行,按您的裁决在席位审核后请您审核;另有一个问题请您定:流程列表要不要加“触发对象”和“运行状态”两列(需要另开一张协议卡)。 ## What changes - **The flow designer is full-screen on its metadata address.** `/studio/PACKAGE/metadata/flow/NAME` mounts the designer (`AutomationsPillar`, now fixed on one flow named by the route). The area decides it through the shared designer-page helper in `metadataArea.ts` (`AREA_DESIGNER_PAGE_TYPES`, `areaItemOpensDesignerPage`, `areaDesignerItemOf`), now on main from objectstack-ai#37089; after the merges the list is `['permission', 'object', 'flow']`. Header: the shared full-screen item header (`ResourceDetailHeader`): × back to the list with its filters, ‹ › in the list's order (decision 10), title, type, package, and the flow's ⋯ (New similar, Delete). Tabs: Canvas, Variables, Runs, Problems, Debug, then References, History, Source from `item-tools/ItemToolTabs` (hand-off §2); the open tab is `?tab=` (`flowDesignerTabs.ts`). - **No flow rail.** The rail, its search, object groups, legend, status dots, contributed-flow rows and the pillar's own New dialog are deleted. Create is the list's 「新建」 (`MetadataListCreateDialog`, same presets). - **Nine released console strings are retired, declared (M1, ruling 7153171432 「B」 with 7153326968 「下一版是大版本 19.0.0」).** The nine `engine.studio.auto.*` keys only the rail read (`heading`, `none`, `emptyMain`, `group.noObject`, `kind.record`, `kind.scheduled`, `kind.screen`, `kind.autolaunched`, `legend`) are removed from `en` and `zh` of `@object-ui/i18n`'s studio namespace. The changeset declares `Clause-②: yes (narrowing)`, carries the BREAKING note, the ADR-0087 `not-required (no-migration-prescription)` disposition and a 「Removed translation keys」 list, and keeps `'@object-ui/i18n': patch` (the one `major` is objectstack-ai#37223's). `engine.studio.org.none` is kept: S5 reads it. - **Address switch.** `flow` leaves `STUDIO_ITEM_PILLAR` (with objectstack-ai#37168's `object` gone too, it is empty), so `studioItemPath`, ⌘K, the AI artifact links and the Changes drawer open the new address. Old addresses redirect (`automationsPillarRedirect.ts`): `/automations?surface=flow:NAME` to the flow, bare `/automations` to the list; `?view=`/`?nav=` dropped, everything else kept (including `?changes=review`). - **`~org` flows** live on the package-less scope's own area leg: list `/studio/~org/metadata/flow?source=runtime`, flow `/studio/~org/metadata/flow/NAME?source=runtime`. Its list offers no 「新建」, and when it is empty it says how a packaged flow is changed instead (`engine.studio.org.none`, ADR-0146 D11), through a new optional `emptyListHint` on the area host. An empty, unsearched list there reads as empty, not as "No matches for """. - **Copilot context** has the sisters' shape: a designer on its metadata address sends `{ pillar: STUDIO_METADATA_AREA, artifact }`, the same block as objectstack-ai#37089 (on main) and objectstack-ai#37168, plus `orgScopeFlowOf` for the `~org` leg. - **Review links, in plain words:** a flow's review link opens the general item page with its review; a permission set's review link keeps its matrix page; an object's opens the general item page with its review, as objectstack-ai#37168 shipped it. - **One predicate for the generic page.** `?review=1` and `?scope=environment` keep an item on the generic item page through `areaItemAsksGenericPage`, with objectstack-ai#37168's text, for a designer type whose generic page serves that review (the flow). A type whose item page is its own editor (`registerMetadataResource`'s `EditPage`: the permission set's matrix) has no generic review, so it keeps its designer page, exactly as main does. Seat 4 recorded this as the measured form of its ruling A (7157282796). See Acceptance notes. - **Taken name in this package.** The list dialog's flow create says 「This package already has an automation…」 (`engine.studio.auto.createTaken`) and offers Open, to the flow's address, when the flow holding the identifier is this package's; `createTakenElsewhere` otherwise. - **Kept (card item 6):** the copilot's refresh after its edits (`useMetadataRefreshNonce`) and its current-item report (`onSurfaceLabelChange`). objectstack-ai#36726's pinned publish on Save and on the switch is unchanged; the list dialog's flow create publishes with `publishCreated`. - **Run status (card item 2):** the list has no column for it or for the trigger object (the spec's flow columns are NAME, LABEL, type, DESCRIPTION). Both stay on the designer header's Trigger and Status pills. No `packages/spec` change; the column question is a fork for the maintainer. ## Empty state and old deep links (card item 7) - A package with no flow: the flow list's own empty state. The designer is never opened on nothing. - An address naming a flow the package does not hold: one block, 「The link names flow “NAME”, which is not here.」, nothing else opened. A package-less flow opens in `~org` instead (objectui#11553). - Old `/studio/PACKAGE/automations`, `/studio/BASE.custom/automations` and `/studio/~org/automations` links redirect as above. `…/metadata/flow/NAME/history` opens the History tab. - Delete returns to the flow list (its filters kept); no other flow is opened in the deleted one's place. ## Tests - This round: - `heldFlowLeave-26705`: an unsaved, NOT held edit. × asks, Cancel keeps the edit, OK lands on the list with nothing sent; › the same, onto the next flow; CONTROL: after Save neither asks. The Changes sheet's flow request: over a dirty or a held edit it asks, then lands; on the open flow it does nothing; CONTROL: no edit, no question. - `packageLessFlows-11553`, through the real surface: the old address of a package flow lands on its address with the designer open; a read-only base's old address naming a pair-added flow lands on the base's address, writable, with the pair chip; the pair's old address lands on the pair's own address; CONTROL: the base's own flow stays read-only. Also the `~org` Changes request landing on the scope's flow, and the empty `~org` list's guidance. - `tabs-12454`: `?tab=runs` and `?tab=history` open their panel on the real designer; CONTROL: no tab, Canvas. - `createTaken-26917`: a published flow in this package reads `createTaken` and Open lands on `/studio/PKG/metadata/flow/escalate`; another package's keeps `Elsewhere` and no Open. - `aiChipLabel`: repinned to `{ pillar: 'metadata', artifact }`. - `customizeFlow-28570`: the Restore dialog's label is read off the header's title. - Earlier rounds: the remaining `AutomationsPillar.*` suites and the `StudioDesignSurface.*` / `StudioMetadataArea.*` suites that open a flow, converted to the address. Deleted as rail-only, each with the pin that covers what is left: `AutomationsPillar.railSearch-11794`, `FlowStatusDot`, `FlowStatusDot.registration-12349`, `StudioDesignSurface.railUnboundReason-11281` (the unbound reason is on the header's Status pill, `flowStatusTruth-11779`), `.automationsRailOrder-12612`, `.draftObjectFlowGroup-29706`, and the rail cases in `.emptyStates-12514`, `.homeLoop-12513`, `.oneSurface-28572`, `.autosaveSwitch-11232`, `.heldFlowCreate-26845`, `StudioRail.noMatches-26733`. New pins: `automationsPillarRedirect.test.ts`, `flowDesignerTabs.test.ts`, the helper and predicate cases in `metadataArea.test.ts`, the designer and `/history` routes in `StudioMetadataArea.routes-28561`. <details><summary>Ablations (each: committed fix, anchored mutation through the ablation-replace script, restored to the HEAD blob)</summary> - M2, `dirty: autoDirty` → `dirty: false` at `AutomationsPillar.tsx:803`: the two new guard cases go red on `expected "vi.fn()" to be called 1 times, but got 0 times` (lines 315, 338), the CONTROL goes red on Save not offered, and the 5 held-step cases stay green (`Tests 3 failed | 5 passed (8)`). Restored: blob `068563e042de` == HEAD, `git diff HEAD` empty. - S4, `here: own.some(…)` → `here: false`: the in-package case goes red, the others stay green (`1 failed | 9 passed (10)`). Restored: blob `c5263910bff6` == HEAD. - S5, the area host's `emptyListHint` spread deleted: the empty `~org` list case goes red (`1 failed | 23 passed (24)`). Restored: blob `5386130ea404` == HEAD. - The first M2 run went red at the case's own precondition (Save not offered), not at the question; the precondition was moved out of the shared helper and the ablation re-run as above. Declared, not hidden. </details> <details><summary>Local readings (final head first; earlier heads named)</summary> - **Final head `9fcff540`** (the third merge of `origin/main`, at `1b91538b` with objectstack-ai#37168, in `7a7af7ad`; then the lint fix). CI on `7a7af7ad` was red in Lint UI only: three imports that the retired-pillar cases left unused (`fireEvent` and `screen` in `expectedMisses-11799`, `parseSurfaceParam` in `metadataArea.test`). `9fcff540` removes them; no source changed. Readings on that tree, each under the lock: - `pnpm --dir ui --filter @object-ui/app-shell run lint`: exit 0, 0 errors. - app-shell type-check (src and `tsconfig.test.json`): exit 0, 0 `error TS`. - Full run over `studio-design`, `metadata-admin`, `CommandPalette.studioScope-11863`, `console`, `packages/i18n/`, `clickableNonControlCensus-13461` and the console's `StudioRoute`: Test Files 1508 passed (1508); Tests 15400 passed, 14 skipped; VERDICT command-exit 0. - `check:i18n-keys`: exit 0. `check:test-source-alias`: exit 0 before the push. The 36 light derived families re-ran on `7a7af7ad`: all exit 0. `overlap-check`: `origin/main` and objectstack-ai#37226 merge cleanly; objectstack-ai#37166 conflicts. - Full dogfood battery on `7a7af7ad` (the lint fix changes no runtime file), `pnpm --filter @objectstack/dogfood test` under the lock: Test Files 487 passed, 3 skipped (490); Tests 4128 passed, 68 skipped (4196); VERDICT command-exit 0. - Ablation of the review rule after the merge: `const genericPage = areaItemAsksGenericPage(search) && !getMetadataResource(type)?.EditPage;` → `const genericPage = false;` in `StudioMetadataArea.tsx`. `routes-28561`: Tests 2 failed, 32 passed (34). The object's `?review=1` CONTROL and the flow's `?review=1` case go red (`expected 'flow-designer' to be 'item'`); the permission set's matrix pin stays green. Restored: blob `c3b2d2786f9f` == HEAD. - CI on `9fcff540`: 58 check-runs, all completed: 45 success, 13 skipped (path filters, opt-in and queue jobs), 0 failed. Lint UI, Type Check UI, Test UI (shards 1–16), Build & E2E UI, Live E2E UI, Lint & Repo Gates, TypeScript Type Check, Test Core, Dogfood Regression Gate, Governed Surface Queue Guard, Check Changeset and PR-body guards: success. - **Review-link round, head `d3e30576`** (on top of `3f65d38b`, below): app-shell type-check exit 0. `StudioMetadataArea.*`, `StudioPermissionSetPage.*`, `metadataArea.*`, `packageLessFlows-11553`, `heldFlowLeave-26705`, `oneSurface-28572` and `AppContent.setupMetadataStudio-28578`: Test Files 8 passed (8), Tests 218 passed (218). Ablation as above. Full dogfood battery on `d3e30576` under the lock: Test Files 487 passed, 3 skipped (490); Tests 4128 passed, 68 skipped (4196); VERDICT command-exit 0. `check:test-source-alias`: exit 0 before the push. CI on `d3e30576`: 58 check-runs, 45 success, 13 skipped, 0 failed. - **Final head `3f65d38b`** (the second merge of `origin/main`, at `6211ddf4`). app-shell type-check: exit 0. `studio-design`, `metadata-admin`, `CommandPalette.studioScope-11863`, `console/ai`, `packages/i18n/` and `clickableNonControlCensus-13461`: Test Files 1265 passed (1265), Tests 13230 passed, 14 skipped (VERDICT command-exit 0). Full dogfood battery, `pnpm --filter @objectstack/dogfood test` under the lock: Test Files 487 passed, 3 skipped (490); Tests 4128 passed, 68 skipped (4196); VERDICT command-exit 0. The derived gate list is unchanged (38); its 36 light families re-ran, all exit 0. `check:test-source-alias`: exit 0 before the push. `overlap-check`: `origin/main` merges cleanly; objectstack-ai#37168 and objectstack-ai#37166 conflict. - Diff against the merge base with `origin/main` at `3f65d38b`: 94 files, +2,235 / −2,787. - **M1 round, head `576f67d3`.** `check-adr-0087-registration --base origin/main`: exit 0, one declared-breaking changeset with `not-required (no-migration-prescription)`. `check-changeset-no-major`: exit 0. `check-empty-changeset`: exit 0. `ui` `check:i18n-keys`, `check:i18n-drift`, `check:i18n-dead-keys`: exit 0 each. `packages/i18n/` plus `plainLanguage-11659`, `studio-locale.i18n` and `packageLessFlows-11553`: Test Files 114 passed (114), Tests 2060 passed, 13 skipped (VERDICT command-exit 0). app-shell type-check: exit 0. The 36 light derived families re-run: all exit 0. Full dogfood battery (owed by the `(narrowing)` arm), `pnpm --filter @objectstack/dogfood test` under the lock: Test Files 487 passed, 3 skipped (490); Tests 4128 passed, 68 skipped (4196); VERDICT command-exit 0. `check:test-source-alias`: exit 0 before the push. - `pnpm --filter @object-ui/app-shell type-check` (src and `tsconfig.test.json`): exit 0 on `49bf2233`, after the `@object-ui/*` dependency closure was rebuilt from this tree (turbo, 68 tasks). - Full run on `1d6b2854` (the merge plus its seam fixes), over `packages/app-shell/src/views/studio-design`, `packages/app-shell/src/views/metadata-admin`, `CommandPalette.studioScope-11863`, `console/ai` and `clickableNonControlCensus-13461`: Test Files 2 failed, 1150 passed (1152); Tests 3 failed, 11175 passed, 1 skipped. The failures came from the merge: `homeLoop-12513` opened on `/access`, which objectstack-ai#37089 turned into a redirect; and `MetadataListCreateDialog.pairCreate-36897` mounts the dialog without a router, where this round's Open used `useNavigate`. Both are fixed at `49bf2233`, where the touched files re-ran: Test Files 24 passed (24), Tests 176 passed (176). - `dispatch-gates --commands`: 38 families. `--ran` reconciliation: 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN, all with exit codes, all 0. `pnpm --dir ui exec vitest run scripts/` was OOM-killed on its first run beside the full suite; re-run alone under the lock it exited 0 (Test Files 172 passed, 2 skipped). `check:type-check-debt` re-measured under the lock: OK, 0 raw errors. - `check:test-source-alias`: exit 0 before each push. `overlap-check`: `origin/main` merges cleanly; objectstack-ai#37168, objectstack-ai#37166 and objectstack-ai#37185 conflict (exit 1). - ESLint (`--no-inline-config`) over every changed `ui/` file: 0 errors, 59 warnings. </details> ## Acceptance notes - **M1, how it ended.** Round 2 first restored the ten released keys (the L1's preferred fix). The maintainer then ruled retire-and-declare (7153171432 「B」; next release is the major, 7153326968), so this round removes the nine keys no code reads and declares them; the tenth, `engine.studio.org.none`, is read again by the `~org` list (S5) and stays. `studioAutomationCopy.plainLanguage-11659`'s heading case went with its row (N1, first option). The ~35 keys main had already removed are objectstack-ai#37223's, not declared here. - **Merged `origin/main` at `bc3ec37a`, which holds objectstack-ai#37089 (the permission designer).** The merge unions the two designers: `AREA_DESIGNER_PAGE_TYPES = ['permission', 'flow']`, `STUDIO_ITEM_PILLAR` keeps `object` only, and `AreaItemOpen` mounts `AutomationsPillar` for a flow and `StudioPermissionSetPage` for a set. Two consequences, both deliberate: - **Declared deviation, accepted (seat 4, 7157282796): a permission set's `?review=1` keeps main's behaviour and opens the matrix page.** The ruling said uniform (A), on this branch's recommendation. Checking it showed the premise was false. For a type whose item page is its own editor, the generic page never draws: `MetadataResourceEditPage` hands the item to the registered `PermissionMatrixEditPage`, which has no draft review. Neither it nor main's `StudioPermissionSetPage` reads `?review=1`. Uniform would therefore have sent a set's review link to Setup's matrix editor, with no review sheet and outside the Studio page: a regression. So `AreaItemOpen` asks the generic page only for a type with no own `EditPage`. That is the flow here and the object in objectstack-ai#37168 (objectstack-ai#37168 should check the object's registry before relying on it). Pinned in `routes-28561` (`?review=1` keeps the matrix page), and ablated: dropping the `EditPage` guard reds it, `1 failed | 31 passed (32)`, restored to the HEAD blob. The flow's `?review=1` still opens the generic page and its review (the case beside it). - **Carrier for the permission set's review, objectstack-ai#37269.** Two live links write a permission set's `?review=1` today: the Packages page's per-draft review link (`PackagesPage.tsx:1317`) and the chat's 「Review N changes」 (`AppContent.tsx:286`). Both open the matrix page with no review, as on main. objectstack-ai#37269 makes the matrix page show the draft's changes; this PR does not change what those links open. - The census rows for `AccessPillar.tsx` and `AutomationsPillar.tsx` `setRailOpen` both go: both rails are gone. - **Merged `origin/main` again at `6211ddf4`**, after objectstack-ai#37185 (the authenticated fetch) and objectstack-ai#37232 (the menu's type table) landed and the PR showed a conflict. Two files conflicted, each resolved so both sides survive: `CommandPalette.studioScope-11863.test.tsx` (one comment above the shared `@object-ui/plugin-detail` warm-up; main's wording kept) and `FlowItemMoreMenu.tsx` (main's `authFetch` for the clone door kept; the `STUDIO_HEADER_ICON_BUTTON` import this branch had dropped as unused stays dropped). objectstack-ai#37168 had still not merged, so the exemption below stands. - **Merged `origin/main` a third time, at `1b91538b` (objectstack-ai#37168, the object designer).** This PR now lands second of the pair, so it carries the routing ruling. The 47 conflict hunks in 22 files were resolved so both designers survive: - `AREA_DESIGNER_PAGE_TYPES = ['permission', 'object', 'flow']`, and `STUDIO_ITEM_PILLAR` is empty. - `AreaItemOpen` mounts `DataPillar` for an object, `AutomationsPillar` for a flow and `StudioPermissionSetPage` for a set. objectstack-ai#37168's `type === 'object'` review gate is replaced by the one `EditPage` rule; it gives the object the same answer. - Both creates' `onOpenExisting` paths are kept: the object's at its target package, the flow's in this package. The prop, which both PRs added, is passed once. - Both old-pillar redirects (`/data`, `/automations`) are kept. - Two suites lost their last case, every one a retired pillar's in-place behaviour: `StudioRail.noMatches-26733` (all three rails are gone) and `StudioDesignSurface.autosaveSwitch-11232` (main kept only the Automations cases and this branch only the Data cases, and both pillars are gone). Each is deleted. What they pinned for items is pinned per item: the area keys each designer by item, and `heldFlowLeave-26705`'s › case pins that the next flow opens clean, with nothing sent. - **`AreaHistoryRedirect`'s designer-item exemption (`pillarItem`) is deleted** (seat 4's routing: the second lander of objectstack-ai#37168 and objectstack-ai#37169 deletes it). With `STUDIO_ITEM_PILLAR` empty it could no longer fire. `routes-28561`'s CONTROL keeps its own-`EditPage` leg (the standalone history page), and its object leg is repointed at the object designer's History tab; the flow's `/history` opens the flow designer's History tab (the case beside it). - The closing line on line 1 is kept this round (N4): the maintainer is still to answer card item 2. - N2: the stale `/studio/~org/automations` comments in `src/index.ts` and `studioScope.ts` now name the scope's area addresses. - N3: not changed. The caption's `title="API name: …"` predates this PR: main's pillar header set the same `titleProps.title`, and 20 test lookups across 15 suites key on it. A cut label's hover still shows the API name; the changeset now names the api-name chip instead of a tooltip. - N5 / `orgScopeFlowOf` (seat 4: keep it): a one-line comment at the leg says it is dormant because the package-less scope mounts no copilot (objectui#11553). No surface-level `~org` copilot case is possible: the package-less scope mounts no copilot (`slotHost` needs a package, objectui#11553; `packageLessFlows-11553` pins `chatDock.mounts === 0`). The `~org` leg's context is pinned on the pure `orgScopeFlowOf` in `metadataArea.test.ts`. - N6: four `docs/qa/platform-checklist/areas/studio-authoring.json` items still describe the deleted rail and the `~org` pillar: `automations-rail-and-new-flow`, `org-scope-flows`, `flow-status-matches-runtime`, `flow-edge-type-authoring`. They carry to objectstack-ai#36910, whose item 3 owns that rewrite. - N7: corrected. CI on `5d9bb8da` was 47 success and 15 skipped, and "Check PR Size" was skipped, not passed. - N8: the Restore case reads its label off the header's title (`auto-canvas-caption`), so it still cross-checks the dialog. - S6: `ui/packages/app-shell/README.md`'s package-less section describes the scope's area leg; the changeset is in user terms, with no route templates and no query parameters. - The suites this PR edits import `@objectstack/lint` and `@object-ui/plugin-detail` at module top, so the dynamic imports their source reaches are paid at collection (`check:test-source-alias`). - Overlaps at this head (`9fcff540`): objectstack-ai#37166 conflicts with this branch; `origin/main` and objectstack-ai#37226 merge cleanly. Whichever lands later merges main. - Left for objectstack-ai#36909 (pillar leftovers): `groupFlowsByObject`, `withContributedFlowGroups`, `ContributedRailRow`, `useOpenContributor`, the console's `/studio/~org` bare route, and producers still writing the old `/automations` (all redirect). ## Verification First read, by risk: `StudioMetadataArea.tsx` (`AreaItemOpen`: the designer decision for both types, the `~org` leg), `metadataArea.ts` (the shared helper and `areaItemAsksGenericPage`), `MetadataListCreateDialog.tsx` (the taken-name branch). Two-minute check: open `/studio/com.example.showcase/automations?surface=flow:showcase_urgent_task_alert`; expect the flow full-screen at `/studio/com.example.showcase/metadata/flow/showcase_urgent_task_alert?package=com.example.showcase`, with × to the list and ‹ › enabled. <details><summary>Live walk-through (showcase, earlier round, head 5d9bb8d)</summary> Stack: `pnpm dev -- --fresh -p 38917` after `pnpm build`, and the Console dev server, driven with Playwright. It covered the list, the full-screen canvas, › and ×, a `~org` flow, an old bookmark, bare `/automations` and `/history`. No page errors. HotCRM was not walked: this container holds only this repository. This round adds no new screen path that the cases above do not drive through the real surface; it was not re-walked. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01QSeKYnHH41MS5hWVGPia4F)_ <!-- signed: repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…t, the rest in one 「高级」 fold (objectstack-ai#37341) Fixes objectstack-ai#37201 Fixes objectstack-ai#37211 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:在 Studio 里打开一个软件包,左侧菜单先列常用的十项(对象 · 应用、页面、仪表盘、报表 · 流程 · 权限集 · 智能体、工具、技能),其余全部收进底部默认收起的「高级」;分组名变成灰色小字、不再带数字,条目旁的灰色数字只表示有多少条。 - 为什么做:这是 Studio 重构专题里「左侧菜单分常用和高级两层」那项裁决的落地,解决菜单二十多项一样重、重点不清的问题,也让新建的空软件包能看到应用、页面、仪表盘、报表的入口。 - 出错会怎样:受影响的只是菜单怎么排、怎么折叠,地址和收藏链接一个没改,打不开的页面不会因此出现;撤回只需回退这一个改动。 - 要你做什么:无。 ## What changes `buildStudioMenu` (`studioMenuModel.ts`) now reads the placement table `STUDIO_MENU_PLACEMENT` (landed in objectstack-ai#37232): - **Order.** Inside each group the type entries follow the table's row order; a type with no row comes after the placed ones in served order; the four entries that are not a type (organization flows, diagnostics, default sharing, the environment catalog) follow the types of their group, as before. - **Tier.** Every entry carries `tier: 'common' | 'advanced'` from its row; a type with no row is `advanced`; the four non-type entries are `advanced` (ruling 7151834490, ADR-0084 amendment of 2026-11-25). - **Always listed.** The directory rule's `always` list is now `STUDIO_MENU_ALWAYS_TYPES`, the table's 常用 rows (it was `STUDIO_MENU_DESIGNER_TYPES`, object · flow · permission). A new package shows app, page, dashboard, report and the three AI types before it holds one. - **Empty.** A 常用 entry on a package is `empty` only when the diagnostics sweep has answered (`settled`) and counts none of it. The menu passes `countsAnswered` (`studioMenuData.ts`): settled **and** not failed, because a server without the sweep answers no counts, not "none of each". The palette's own `settled` is unchanged. - **Groups.** A group is returned only where it holds an entry, on every scope; `studioMenuTiers()` splits the menu into the 常用 groups and the 高级 fold's groups, each holding only its tier's entries. `StudioMenu.tsx` draws it: - Group labels: 11 px, muted, no count, no link, not focusable (the icon stays at reduced opacity). The group-count test id `studio-menu-group-count-GROUP` is gone; nothing else's id changes. - Entry counts: muted, items only (unchanged class; new test id `studio-menu-count-KEY`). - An empty 常用 entry: dimmed label, no number (never "0"), still a link, with a tooltip; marked `data-empty="true"`. - Below a divider, one 「高级」 / "Advanced" button (`aria-expanded`, `aria-controls` → the region) over a region holding the 高级 groups (`studio-menu-advanced-group-GROUP`). The region stays in the DOM with `hidden` when closed. - Closed by default; a click writes `studio_menu_advanced=true|false` (path `/`, 7 days, the menu collapse cookie's lifetime), apart from `studio_menu_state`. - Open by itself while the current entry is a 高级 one (a bookmark to the hook list, the default sharing overview), without writing the cookie; the author can still close it there. - A search lists the matches of both tiers flat, under their group labels, with no fold. - `~org` and `~all` draw no fold: their entries are listed flat, in the table's order, under the same muted labels. ⌘K: no change to the palette model. It reads `buildStudioMenu`'s output, so it lists the same entries in the new order and ignores the fold; on a package it now also shows the AI group, because its 常用 agent type is always listed (`StudioPaletteGroups.surfaceScope-36900.test.tsx` updated on purpose). `studioMenuPlacement.ts`: objectstack-ai#37232's L1 N1 carried. The `## Pins` block names the three pins (the registry, the ruled order, ADR-0084), and "the menu applies that rule when it reads this list" is now true and says where (`buildStudioMenu`). i18n: two keys added in `studio/{en,zh}.ts` — `engine.studio.menu.advanced` (Advanced / 高级) and `engine.studio.menu.emptyType`. None removed; `engine.studio.menu.typeCount` is now unread (see Acceptance notes). No route, address, entry key or entry test id changes. ## Tests - `studioMenuModel.test.ts` - **`:64` rewritten on purpose**: "a package draws all six groups, an empty one included" → "a package draws a group only where it holds an entry" (with no type served, only the non-type entries' groups). - New: table order with an unplaced type and the non-type entries last; tier stamping (rows, unplaced → advanced); the four non-type entries are 高级; `studioMenuTiers` (a group in a tier only where it has an entry of that tier; 平台 only in the fold); addresses and keys unchanged; `STUDIO_MENU_ALWAYS_TYPES` = the 常用 rows and the directory rule lists them on a package that holds none; empty = settled ∧ no item (not before settled, never on 高级, never off a package); the cookie reader. - The `~org`/`~all` case now expects the table's order (permission before position). - `StudioMenu.test.tsx`: group labels muted with no count / link; muted item count; tier-labelled groups; empty 常用 type dimmed, numberless (no "0" either), a link; not empty before the sweep answers or when it failed; a new package lists every 常用 type; the fold (closed by default, `aria-expanded` / `aria-controls`, the cookie written on click and read on remount, open by itself on a bookmark to 钩子 with no cookie written, closable there, a 常用 page leaves it closed, search ignores it); focus order toggle → search → 常用 entries → 高级 button → its entries; `~org` / `~all` flat with no fold and, for objectstack-ai#37211, no count above Organization flows. - `StudioPaletteGroups.surfaceScope-36900.test.tsx`, `StudioDesignSurface.notFound-26708.test.tsx`: expectations moved on purpose (the AI group in ⌘K; the 常用 groups and the fold on a listed package). - `ui/e2e/studio-left-menu-36899.spec.ts` (Chromium, real Tailwind): the six-groups case now reads the 常用 groups; a new case lays out the fold closed, opened by a click, its cookie written and kept across a reload. <details><summary>Local runs (head <code>ff794532</code>; the readings below name the tree each was taken on)</summary> - `ui`: `vitest run packages/app-shell/src/views/studio-design/ packages/app-shell/src/views/metadata-admin/` at `ba3afa16` less one fix: **Test Files 1 failed | 1078 passed (1079)**, Tests 1 failed | 10757 passed | 1 skipped. The one failure was `StudioDesignSurface.notFound-26708.test.tsx` "CONTROL — a listed package renders its builder" (it expected all six groups drawn on a package); fixed in `ba3afa16`, re-run green: 2 files, 18 passed. - Menu, palette and surface files at `b5b0f6ad` + the fixture fix: **Test Files 6 passed (6), Tests 97 passed (97)**. - `pnpm --filter @object-ui/app-shell type-check` (both `tsc` programs, the test one included): exit 0 at `ff794532`'s bytes. The first run, before `ff794532`, was red on the search fixture missing `tier` (TS2345 x4) — the reason for that commit. - `ui/e2e/studio-left-menu-36899.spec.ts`, Chromium, with the Console web server switched off (the spec bundles and serves its own page): **4 passed**. - `pnpm --dir ui exec vitest run scripts/`: Test Files 172 passed | 2 skipped, Tests 5130 passed | 2 skipped. - `eslint` on the 11 changed ui files: exit 0. - Derived gate families (`dispatch-gates.mjs --commands`): 38 derived, 38 run, every one exit 0; `--ran` reconciliation: "38 run, 0 NOT-MEASURED (a DERIVED zero)". Before every push: `check:test-source-alias` exit 0, `ui check:i18n-keys` exit 0, `overlap-check.mjs` "VERDICT clean exit 0" (against `origin/main` and objectstack-ai#37315, which shares the two studio i18n files and merges cleanly). </details> <details><summary>Ablations: 17 of 17 red, each restored to the HEAD blob</summary> Committed implementation first (`b5b0f6ad`); each row mutated one anchor through `scripts/ablation-replace.mjs` (anchor hit 1 → 0, blob moved, restored blob equal to HEAD, `git diff HEAD` empty) and ran `studioMenuModel.test.ts` + `StudioMenu.test.tsx` (45 tests; all green unmutated). The test files are resolved from `ui/` source by vitest, so there is no `dist/` leg. | # | Mutation | Result | |---|---|---| | A1 | no sort by the placement table | 4 failed | | A2 | every type stamped 常用 | 8 failed | | A3 | organization flows stamped 常用 | 4 failed | | A4 | always-listed = the old object · flow · permission | 8 failed | | A5 | empty without `settled` | 3 failed | | A6 | a failed sweep counts as answered | 1 failed | | A7 | a group drawn in a tier with no entry of it | 2 failed | | A8 | group label not muted | 3 failed | | A9 | an empty 常用 type still shows its number | 1 failed | | A10 | an empty 常用 type not dimmed | 1 failed | | A11 | fold open by default | 4 failed | | A12 | a click writes no cookie | 2 failed | | A13 | no self-open on a 高级 page | 2 failed | | A14 | the self-open writes the cookie | 1 failed | | A15 | the search honours the fold | 2 failed | | A16 | a fold on `~org` / `~all` | 2 failed | | A17 | no `aria-controls` | 1 failed | A first pass of this table is not counted: three rows (A6, A12, A14) were refused by `ablation-replace.mjs` before running (the replacement was a substring of the anchor), and A9 stayed green — no test had an empty 常用 type with a served count of 0. That pin was added (`b5b0f6ad`, "a sweep that counts 0 of it: still no number, never 0") and the whole table re-run. </details> ## Acceptance notes - `engine.studio.menu.typeCount` ("{count} types") has no reader after this change; `check:i18n-dead-keys` reports it as a candidate. It ships in the released `@object-ui/i18n` catalogue, and this card's rule is additive-only, so it stays. - "Empty" uses `countsAnswered` (settled and the sweep did not fail) rather than the bare `settled`: on a failed sweep `settled` is true with no counts, which would have dimmed every 常用 type. - `studio-menu-group-GROUP` now names the 常用 (or flat) instance of a group; the fold's instance is `studio-menu-advanced-group-GROUP`. - Follow-up decision cards F1–F3 from proposal §3.10 are the seat's to file when this lands (card Notes). ## Verification **Browser walk-through on a live showcase stack** — measured, not described. Own ports, torn down after: backend `examples/app-showcase` `objectstack dev --seed-admin --fresh -p 38417` (built tree at `b5b0f6ad`, `pnpm build` 121/121), Console from `ui/` source (`ui/apps/console`, `vite --port 5197 --strictPort`, `DEV_PROXY_TARGET` the backend). Driven with Playwright/Chromium at 1280 px, signed in as the seeded admin; the menu was read from the DOM after the reads settled, and screenshots were checked. 1. **Package scope, 高级 closed** — `/studio/com.example.showcase/metadata/object?package=com.example.showcase`, fresh browser. Fold: a `BUTTON` "Advanced", `aria-expanded=false`, `aria-controls` resolves to the region. Drawn: Data — Object 24 (current) · UI — Application 1, Page 29, Dashboard 3, Report 4 · Automation — Flow 33 · Access — Permission Set 9 · AI — AI Agent, AI Tool, AI Skill (dimmed, no number: the package holds none). Every group label muted, no group count anywhere (0 `studio-menu-group-count-*` nodes). The 高级 groups were in the DOM and not visible. 2. **Package scope, 高级 open** — one click: `aria-expanded=true`, cookie `studio_menu_advanced=true`, `studio_menu_state` not written. The fold shows Data — Hook 8, Mapping 1 · UI — View 36, Action 73, Dataset 4 · Automation — Job 1, Organization flows · Platform — Doc 8, Book 1, Email template 1, API 3, Datasource 1, Diagnostics · Access — Position 10, Sharing rule 2, Capability 2, Default sharing, Positions and permissions · AI — AI context 2. A reload kept it open. Closed again and searched "hook": the hook entry listed under Data, no fold drawn. 3. **A bookmark to 钩子** — a second fresh browser straight to `/studio/com.example.showcase/metadata/hook?package=com.example.showcase`: the fold open, Hook 8 marked current, and no `studio_menu_advanced` cookie in the jar. 4. **A new empty package** — `POST /api/v1/packages` (201, `com.walk.empty…`), then its object list: all ten 常用 entries listed and dimmed with no number (Object, Application, Page, Dashboard, Report, Flow, Permission Set, AI Agent, AI Tool, AI Skill); the fold closed, holding only Organization flows, Diagnostics, Default sharing, Positions and permissions. 5. **`~org`** — `/studio/~org/metadata/flow?source=runtime`: no fold; Automation — Organization flows (current), with no number above it (objectstack-ai#37211); Access — Permission Set 19, Position 17, Sharing rule 3, Capability 13, Positions and permissions, in the table's order. `~all` reads the same, the catalog entry current. **Two-minute check:** open any package in Studio. Expect the ten Common entries, then a closed "Advanced" row; click it, reload, and it stays open. > PM note (zone a4-S): objectstack-ai#37211 now carries a claim (7172656271) naming this branch, so `Fixes objectstack-ai#37211` closes it at merge. That was the dev's open question 1, ruled A. --- _Generated by [Claude Code](https://claude.ai/code/session_01QSeKYniqTW93usTV1hShjE)_ <!-- signed: repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Fixes #37200
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
ui/packages/app-shell/src/views/studio-design/studioMenuPlacement.ts:STUDIO_MENU_PLACEMENT, one ordered list of{ type, tier }, 32 rows (every listable type of the 33 the registry holds onorigin/main;fieldis hidden by the directory).domain. Not wired into anything (the menu card wires it).studioMenuPlacement.test.ts, three holds:DEFAULT_METADATA_TYPE_REGISTRYregisters and the directory lists has exactly one row, and every row names a registered, listed type;.changeset/37200-studio-menu-placement.md(@object-ui/app-shellpatch).Tests
Final head
5568fa63a1.vitest run packages/app-shell/src/views/studio-design/studioMenuPlacement.test.ts: 1 file, 12 tests passed.@object-ui/app-shelltype-check(both tsc programs): exit 0, 0 errors (afterpnpm --filter '@object-ui/app-shell^...' build). The first run caught a real typing error in the test (aSetof the registry's literal type union), fixed in2eae5a0f90.scripts/ablation-replace.mjson a committed head, each restored and proven by the HEAD blob hash and an emptygit diff HEAD:Ablation readings
hookrowappandpagenot_a_registered_typeai_contextrowjobretiered to commonjob: ADR-0084 row: expected 'advanced' to be 'common'picklistretiered to 常用picklist: ADR-0084 row: expected 'common' to be 'advanced'appOrder 1 to 9group uiorderThe first try at the unknown-type mutation was a no-op (its anchor survived inside the replacement, and the tool refused it with "the anchor count moved 1 -> 1"); it was re-run with an anchor that disappears. The ADR mutations were transient and restored; this PR does not edit the ADR.
Acceptance notes
studioAddressTable.test.tsas the pattern; no file has that name. The address table is pinned instudioAddress.test.ts("the mapping table agrees with the code"), which is the model used.ai_contextwas registered onmainafter the ruling (33 types). It takes an advanced row, last in ai, matching ADR-0084's table; its tier is an open question for the maintainer, and a ruling the other way is a one-row edit plus the ADR row.origin/main151e8123" for the registered-type count. That sentence lives only in the ADR, which this PR does not touch; it is reported to the seat as a follow-up. Nothing in this PR relies on the count 32.Verification
Read first:
studioMenuPlacement.ts(the rows themselves), then the ADR block ofstudioMenuPlacement.test.ts(the table-row regex is the risk: a reformatted ADR table makes the row-count test go red, never silently pass).Two-minute check:
cd ui && pnpm exec vitest run packages/app-shell/src/views/studio-design/studioMenuPlacement.test.tswith@objectstack/specbuilt; expect 12 passed. Change any tier in the file and expect a red that names the type.Gates (local, head 5568fa6)
dispatch-gates.mjs --commandsderived 38 families; all 38 run, each exit 0 (--ranreconciliation: 38 run, 0 NOT-MEASURED, a derived zero), includingpnpm check:test-source-alias,pnpm check:cross-package-test-inputsandpnpm --dir ui exec vitest run scripts/.overlap-check.mjs --branch=HEAD: merges cleanly withorigin/main, VERDICT clean exit 0.Generated by Claude Code