Repository navigation
Commit c355f85
feat(studio): one table holds the menu's type order and its 常用 / 高级 tier (#37232)
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`:
<details><summary>Ablation readings</summary>
| 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.
</details>
## 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.
<details><summary>Gates (local, head 5568fa6)</summary>
- `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.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01QSeKYkkwuF6UuFtu85Yd5H)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent bd98dd1 commit c355f85
3 files changed
Lines changed: 241 additions & 0 deletions
File tree
- .changeset
- ui/packages/app-shell/src/views/studio-design
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
0 commit comments