Repository navigation
Commit a68b475
feat(studio): a collapsible left menu of six groups replaces the top pillar nav (#36985)
<!-- 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 #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 #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 #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)
- **⌘K on `~all`:** `~all` now renders inside Studio's builder shell, so
the console `AppHeader` and its ⌘K command palette are no longer drawn
on the `~all` leg. Studio's own ⌘K arrives with #36900, which is queued
next on the list side once this PR and #36895 land.
## 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.
<details><summary>Local readings at 214400b, patch rounds to
7617f52</summary>
- `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 (#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).
</details>
## Acceptance notes
- Screenshots below are the real console (`ui/apps/console` dev server,
this branch) against a running server: a self-built app (created through
the Studio landing's New app, `com.default.field-service`) on the
showcase example server, and HotCRM (its own repo at main,
`app.objectstack.hotcrm`) on its published 18.6.0 server. On HotCRM the
Data pillar's rail shows "Couldn't read customizations": that is this
branch's console against an older published server, not the menu.
- Readings from the same runs: no `studio-pillar-nav` on the page; six
groups in order; the Object entry current on the Data pillar; after
collapse `data-state=collapsed`, the cookie `studio_menu_state=false`
and no `sidebar_state`, still collapsed after a reload; at 390 px no
docked menu until the toggle, then a 288 px drawer at the left edge.
- Overlap check (`overlap-check.mjs`, final head): merges cleanly with
main; textual conflicts with #36973, #36958 and #36784 in
`StudioDesignSurface.tsx` (and `metadataArea.ts` with #36973), all in
the header region this card replaces. Their code is not reshaped here.
### Wide (self-built app)

### Collapsed (self-built app)

### Narrow, 390 px drawer (self-built app)

### Wide (HotCRM)

### Collapsed (HotCRM)

### Narrow, 390 px drawer (HotCRM)

## Verification
Read first, by risk:
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](https://claude.com/claude-code)
<!-- signed: repo:objectstack#3 · os-support-ai ·
session_01WGufziBCAytAzzCu3iPBFR -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent ed4d322 commit a68b475
37 files changed
Lines changed: 1774 additions & 590 deletions
File tree
- .changeset
- ui
- apps/console/src/components
- e2e
- packages
- app-shell/src/views
- metadata-admin
- studio-design
- components/src
- __tests__
- ui
- i18n/src/namespaces/studio
- scripts
- __tests__
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
139 | 141 | | |
140 | 142 | | |
141 | 143 | | |
142 | | - | |
| 144 | + | |
143 | 145 | | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
149 | 152 | | |
150 | 153 | | |
151 | 154 | | |
152 | 155 | | |
153 | | - | |
| 156 | + | |
154 | 157 | | |
155 | 158 | | |
156 | | - | |
| 159 | + | |
157 | 160 | | |
158 | | - | |
| 161 | + | |
| 162 | + | |
159 | 163 | | |
160 | 164 | | |
161 | 165 | | |
162 | | - | |
163 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
164 | 175 | | |
165 | 176 | | |
166 | 177 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
202 | 210 | | |
203 | 211 | | |
204 | 212 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | 82 | | |
86 | 83 | | |
87 | 84 | | |
| |||
221 | 218 | | |
222 | 219 | | |
223 | 220 | | |
224 | | - | |
| 221 | + | |
225 | 222 | | |
226 | 223 | | |
227 | 224 | | |
| |||
246 | 243 | | |
247 | 244 | | |
248 | 245 | | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | 246 | | |
265 | 247 | | |
266 | 248 | | |
| |||
272 | 254 | | |
273 | 255 | | |
274 | 256 | | |
275 | | - | |
276 | | - | |
| 257 | + | |
| 258 | + | |
277 | 259 | | |
278 | 260 | | |
279 | 261 | | |
280 | 262 | | |
281 | 263 | | |
282 | | - | |
| 264 | + | |
283 | 265 | | |
284 | 266 | | |
285 | 267 | | |
| |||
309 | 291 | | |
310 | 292 | | |
311 | 293 | | |
312 | | - | |
313 | | - | |
| 294 | + | |
314 | 295 | | |
315 | 296 | | |
316 | 297 | | |
| |||
331 | 312 | | |
332 | 313 | | |
333 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
334 | 324 | | |
335 | 325 | | |
336 | 326 | | |
| |||
339 | 329 | | |
340 | 330 | | |
341 | 331 | | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | 332 | | |
347 | 333 | | |
348 | 334 | | |
| |||
0 commit comments