Skip to content

feat(studio): one table holds the menu's type order and its 常用 / 高级 tier - #37232

Merged
objectstack-fleet[bot] merged 7 commits into
mainfrom
claude/issue-37200-studio-menu-placement
Nov 25, 2026
Merged

objectstack-fleet[bot] merged 7 commits into
mainfrom
claude/issue-37200-studio-menu-placement

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #37200

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户无感:这次只新增一张「菜单排序与常用 / 高级分层」的表,左侧菜单暂时还不读它,界面与之前完全一样。
  • 属于 Studio 改版(左侧菜单分「常用 / 高级」两层)这个大任务,是菜单真正改动前的第二步。
  • 出错只会让测试变红,不会影响任何用户;这次改动可以直接撤回。
  • 无。

What changes

  • New 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 on origin/main; field is hidden by the directory).
    • 常用 (common), in the ruled order: object · app, page, dashboard, report · flow · permission · agent, tool, skill.
    • 高级 (advanced), every other type, in the proposal's order: picklist, hook, mapping, object_extension, seed · view, action, dataset · job · doc, book, email_template, translation, api, datasource, external_catalog · position, assignment_rule, sharing_rule, queue, capability · ai_context.
    • Order and tier only; a type's group stays its served domain. Not wired into anything (the menu card wires it).
  • New studioMenuPlacement.test.ts, three holds:
    • registry: every type DEFAULT_METADATA_TYPE_REGISTRY registers and the directory lists has exactly one row, and every row names a registered, listed type;
    • ruling: the common and advanced rows, in order, as literals;
    • ADR-0084 (merged with the type table's Order and Tier columns): tier per type both ways, each ADR row's group equal to the served domain, and the order inside each group equal to the Order column. A failure names the type or the group.
  • .changeset/37200-studio-menu-placement.md (@object-ui/app-shell patch).

Tests

Final head 5568fa63a1.

  • vitest run packages/app-shell/src/views/studio-design/studioMenuPlacement.test.ts: 1 file, 12 tests passed.
  • @object-ui/app-shell type-check (both tsc programs): exit 0, 0 errors (after pnpm --filter '@object-ui/app-shell^...' build). The first run caught a real typing error in the test (a Set of the registry's literal type union), fixed in 2eae5a0f90.
  • Ablations, each through scripts/ablation-replace.mjs on a committed head, each restored and proven by the HEAD blob hash and an empty git diff HEAD:
Ablation readings
Mutation File Result
remove the hook row placement 3 red: exactly-one-row, same-set, advanced order
swap app and page placement 1 red: common order
add a row not_a_registered_type placement 3 red: row-names-a-registered-type, same-set, advanced order
remove the ai_context row placement 3 red: exactly-one-row, same-set, advanced order
job retiered to common placement 4 red, including job: ADR-0084 row: expected 'advanced' to be 'common'
ADR row picklist retiered to 常用 ADR-0084 1 red: picklist: ADR-0084 row: expected 'common' to be 'advanced'
ADR row app Order 1 to 9 ADR-0084 1 red: group ui order

The 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

  • The card names studioAddressTable.test.ts as the pattern; no file has that name. The address table is pinned in studioAddress.test.ts ("the mapping table agrees with the code"), which is the model used.
  • ai_context was registered on main after 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.
  • ADR-0146 still reads "32 at origin/main 151e8123" 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 of studioMenuPlacement.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.ts with @objectstack/spec built; expect 12 passed. Change any tier in the file and expect a red that names the type.

Gates (local, head 5568fa6)
  • dispatch-gates.mjs --commands derived 38 families; all 38 run, each exit 0 (--ran reconciliation: 38 run, 0 NOT-MEASURED, a derived zero), including pnpm check:test-source-alias, pnpm check:cross-package-test-inputs and pnpm --dir ui exec vitest run scripts/.
  • overlap-check.mjs --branch=HEAD: merges cleanly with origin/main, VERDICT clean exit 0.
  • Repo-wide scans and the rest of the farm are CI's.

Generated by Claude Code

…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
…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
…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
@github-actions github-actions Bot added size/m 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 25, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

席位核对 — ACCEPT · L1 · head 5568fa63a1698f656c29f4e2145301125d732d28 · 2026-11-25T05:57Z

  • Scope. +241/−0 in 3 new files: ui/packages/app-shell/src/views/studio-design/studioMenuPlacement.ts, its .test.ts, and .changeset/37200-studio-menu-placement.md. The PR is a draft, mergeable_state is clean, the body says Fixes #37200, and both declaration lines (Clause-②: no, Metadata-protocol: none) are in the body and the changeset. Nothing imports the table, so there is no wiring, as the card requires.

  • Rows against the ruling ([Decision] Studio left menu: features are there but the focus is unclear — order and visual weight inside the groups #37192, 7151834490 + 7151811337). The 常用 rows are object · app, page, dashboard, report · flow · permission · agent, tool, skill. That is the ruled set in the ruled order, and these 10 rows come first (indices 0–9). The other 22 rows are 高级. picklist (adjustment 1) and email_template are among them. The AI types are 常用 and drawn last (adjustment 2). The OWD overview (默认共享) is not a type, so it has no row here; Studio 菜单(M3):左侧菜单读顺序表——分组标题变小号灰字、默认只显示常用、其余收进「高级」 #37201 places it with the other non-type entries.

  • Rows against ADR-0084 on main (docs/adr/0084-…md:161-195, merged in docs(adr): amend ADR-0084 — the Studio menu draws two tiers, 常用 and 高级, and the type table gains order and tier columns #37219 3b87ff7eb05). The ADR blob at head is byte-identical to origin/main. All 32 rows match the ADR's Tier column. Inside each group they follow the ADR's Order column: data: object, picklist, hook, mapping, object_extension, seed. ui: app, page, dashboard, report, view, action, dataset. automation: flow, job. system: doc, book, email_template, translation, api, datasource, external_catalog. security: permission, position, assignment_rule, sharing_rule, queue, capability. ai: agent, tool, skill, ai_context. ADR item 6 (:310) places ai_context at 高级, last in ai, and the table follows that direction.

  • Count, and why field is excluded. DEFAULT_METADATA_TYPE_REGISTRY (packages/spec/src/kernel/metadata-plugin.zod.ts) has 33 entries at head. HIDDEN_DIRECTORY_TYPES = new Set(['field', 'package']) (ui/packages/app-shell/src/views/metadata-admin/directoryScope.ts:15, with the reason "field is edited inside its object") is applied first in scopeDirectoryEntries (:36). That function is the filter the menu's types pass through (studioMenuModel.ts, buildStudioMenu's doc comment). package is not a registered type, so 33 − 1 = 32 listable types. The ADR's field row carries — in both Order and Tier (:169), and the ADR regex's (\d+) deliberately skips it. Excluding field is justified. The test imports the same HIDDEN_DIRECTORY_TYPES set, so a future change to it moves the pin too.

  • Pins go red. I re-ran them myself instead of trusting the report. I ported the 12 assertions into a standalone tsx harness (pr-37232/h/pins.mts, results in pr-37232/h/ablations.txt). It runs on the head's studioMenuPlacement.ts, the head's ADR and the head's registry. Baseline: 12/12 green. Every mutation went red:

    • remove hook: 5 red;
    • swap app/page: 2 red (O1 and the ADR order pin for group ui);
    • swap view/action inside 高级: 2 red;
    • add bogus: 4 red;
    • add field: 5 red;
    • duplicate hook: 4 red;
    • newly registered form, with no row: 3 red;
    • job retiered to common: 4 red;
    • ADR ai_context Order 4→0: 1 red (ai);
    • ADR picklist set to 常用: 1 red;
    • ADR seed row dropped: 3 red.

    So the pins catch a missing row, a misordered row, a duplicate, an unknown or hidden row, and an unplaced new type. The registry pin reads the live registry, not a copy.

  • How robust the ADR parse is. ADR_ROW is anchored on | **Group** | \domain` | N | `type`… | 常用|高级 |aftertrim(), so CRLF and trailing spaces still parse (both ablations green). It does require exactly one space around each pipe. It fails closed, though: a double space on one row makes the count pin go red (31 ≠ 32), and the tier pin names the type (seed). A table re-aligned by a formatter would drop the count to 0, which is red, never a silent pass. No formatter or prettier config touches docs/adr. No other table in the ADR matches the pattern, and the count pin would catch one that did. The relative path ../`×6 resolves to the repo root. That is acceptable, see N2.

  • Changeset. The diff is not test-only: it adds an exported source module to @object-ui/app-shell (private, but versioned under privatePackages.version: true). So a changeset is owed, and one is present. It is patch with Metadata-protocol: none (a UI-only table that adds nothing authorable), which is the level AGENTS.md post-task step 3 gives for none. Check Changeset is green.

  • Check-runs at head. 51 runs, every one success or skipped, none failing or pending. Green: Test UI (9 of the 16 shards planned, plus the aggregate), Type Check UI, Lint UI, Build & E2E UI, Live E2E UI, Check Changeset, PR-body guards, Governed Surface Queue Guard, Dogfood Regression Gate, Test Core (aggregate). The Core shards were skipped because nothing changed outside ui/.

  • K = 6. Merge-base 8b74082f1ab4 against origin/main a03c3d4e3c8. The ADR, the registry and directoryScope.ts are unchanged between head and main, so the pins hold on main as it is now.

  • Overlap with Studio 菜单(M3):左侧菜单读顺序表——分组标题变小号灰字、默认只显示常用、其余收进「高级」 #37201. None. Studio 菜单(M3):左侧菜单读顺序表——分组标题变小号灰字、默认只显示常用、其余收进「高级」 #37201 will edit studioMenuModel.ts, its test (:64), StudioMenu.tsx and ui/packages/i18n/src/namespaces/studio/{en,zh}.ts, plus whatever always list it re-points. This PR adds only new files. Studio 菜单(M3):左侧菜单读顺序表——分组标题变小号灰字、默认只显示常用、其余收进「高级」 #37201 will import STUDIO_MENU_PLACEMENT and does not need to edit it. The open designer PRs feat(studio): the object designer opens full-screen on its metadata address, tabs in #36513's order #37168, feat(studio): the flow designer opens full-screen on its metadata address; no flow rail (#36903) #37169 and feat(studio): a permission set opens full-screen at its metadata address; the sharing overview gets its own route #37089 touch none of these three files.

  • Dev report (7153810065). It matches the diff. The out-of-scope notes are accurate: ADR-0146 still says 32 types, and studioAddressTable.test.ts does not exist (the pattern lives in studioAddress.test.ts). Both are for the seat to route. They are not open items on this PR.

  • N1 — The ## Pins block of studioMenuPlacement.ts's doc comment names only the registry pin. The literal-order pin and the ADR-0084 pin, which the changeset describes, are not mentioned. Also, "the menu applies that rule when it reads this list" (for a type with no row) is written in the present tense, but nothing reads the list yet. Both are fine to fold into Studio 菜单(M3):左侧菜单读顺序表——分组标题变小号灰字、默认只显示常用、其余收进「高级」 #37201's edit.

  • N2 — ADR_ROW hard-codes single spaces around pipes. It fails closed (see above), so this is cosmetic. * around the pipes would make it tolerate a hand-padded row.

  • N3 — How far CI reaches (out of card scope, a carrier candidate). The ui: paths filter in ci.yml (:735-771) does not list docs/adr/**. A PR that edits only ADR-0084's type table would not start Test UI, so the ADR pin would go red on the next unrelated ui/ PR instead of on the PR that caused it. The pin is always-on through select-affected-tests.mjs, so it never goes stale silently. This is the same shape as the existing app-shell/src/__tests__/product-neutral-renderer.ratchet.test.ts reading ADR-0060, so it is precedent and not a defect introduced here.

  • N4 — The PR body's ablation red counts for the row mutations (remove hook 3, swap app/page 1) are readings from before the ADR pin existed. At the final head the same mutations give 5 and 2 red, because the ADR pin fires as well. They are red either way, so the evidence still holds, but the head each count came from should be named.

No must-fix, no should-fix.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H

Landing · 2026-11-25T05:59Z · head 5568fa63a1 · zone a4-S (#37200)

  • L1 ACCEPT from seat repo:objectstack#4 at 5568fa63a1, on this PR (7154317361). No must-fix and no should-fix. N1 (the doc comment's ## Pins block, and its present tense) folds into Studio 菜单(M3):左侧菜单读顺序表——分组标题变小号灰字、默认只显示常用、其余收进「高级」 #37201's edit; N2–N4 are cosmetic.
  • check-governed-merges.mjs --pr 37232: NOT governed; 241 changed lines, under 3,000.
  • Checks on the head: 38 success, 13 expected skips (path filters), 0 failed.
  • K: GitHub compare puts the head 7 commits behind main, under 15.
  • Clause-②: no, Metadata-protocol: none. No L2 is owed: the PR adds three new files to a private package, and no contract face.
  • Action: ready, then auto-merge through the merge queue.

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/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Studio 菜单(M2):类型顺序和「常用 / 高级」写成一张表,用测试钉住注册表和 ADR

2 participants