Skip to content

Commit a68b475

Browse files
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) ![Studio left menu, wide, self-built app](https://raw.githubusercontent.com/objectstack-ai/objectstack/ecb115a7ace8ef97fb1b25f37497fd526861d956/issue-36899/selfbuilt-wide.png) ### Collapsed (self-built app) ![Studio left menu, collapsed, self-built app](https://raw.githubusercontent.com/objectstack-ai/objectstack/ecb115a7ace8ef97fb1b25f37497fd526861d956/issue-36899/selfbuilt-collapsed.png) ### Narrow, 390 px drawer (self-built app) ![Studio left menu, drawer at 390 px, self-built app](https://raw.githubusercontent.com/objectstack-ai/objectstack/ecb115a7ace8ef97fb1b25f37497fd526861d956/issue-36899/selfbuilt-narrow.png) ### Wide (HotCRM) ![Studio left menu, wide, HotCRM](https://raw.githubusercontent.com/objectstack-ai/objectstack/ecb115a7ace8ef97fb1b25f37497fd526861d956/issue-36899/hotcrm-wide.png) ### Collapsed (HotCRM) ![Studio left menu, collapsed, HotCRM](https://raw.githubusercontent.com/objectstack-ai/objectstack/ecb115a7ace8ef97fb1b25f37497fd526861d956/issue-36899/hotcrm-collapsed.png) ### Narrow, 390 px drawer (HotCRM) ![Studio left menu, drawer at 390 px, HotCRM](https://raw.githubusercontent.com/objectstack-ai/objectstack/ecb115a7ace8ef97fb1b25f37497fd526861d956/issue-36899/hotcrm-narrow.png) ## 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
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
'@object-ui/components': patch
4+
'@object-ui/i18n': patch
5+
'@object-ui/console': patch
6+
---
7+
8+
feat(studio): a collapsible left menu of six groups replaces the top pillar nav
9+
10+
Clause-②: yes (widening)
11+
Metadata-protocol: none
12+
13+
ADR-0084 (amended) · #36899, part of #36890.
14+
15+
- **Studio's one navigation is a left menu.** The top bar's Data / Automations / Access / All metadata switcher is gone. Every Studio page (a package's pillars and area, the package-less flows `~org`, and the cross-package leg `~all`) draws the same menu of six groups: Data, UI, Automation, Platform, Access, AI (数据、界面、自动化、平台、访问、AI). Each group lists the metadata types the package holds (the directory's own rule, `scopeDirectoryEntries`), with a type count per group and an item count per type, and a search box that narrows the entries. A type entry opens that type's list in the area; an item of an object, flow or permission set still opens its designer. Four entries are not a type: Organization flows (`~org`, under Automation), Default sharing (the Access pillar's OWD overview, under Access), Diagnostics (under Platform) and Positions and permissions (the environment catalog on `~all`, under Access).
16+
- **It collapses like the app sidebar, under its own cookie.** It is the app sidebar's primitive: the header's toggle hides and shows it, the state survives a reload under `studio_menu_state` (never the app sidebar's `sidebar_state`), and below 768 px it is a drawer. `SidebarProvider` (`@object-ui/components`) takes a new optional `cookieName` prop for that; the default is unchanged.
17+
- **The menu names the `system` group Platform / 平台 and the `security` group Access / 访问**, the amended ADR-0084's group names, through its own `studioMenuGroupLabel`. The shared domain dictionary (`translateMetadataDomain`) is unchanged: Setup's datasource pages and the rest of Studio still say System / 系统 and Security / 安全.
18+
- **`~all` is drawn in the builder's shell.** `/studio/~all/metadata/*` is served by the same route as a package's area, so it has the left menu too; the landing's frame no longer draws it. A `~org` area URL (or `?package=~org`) now lands on the package-less flows instead of being read as a package.
19+
- **「‹ Back to app」 names the current package's app** (decision 5), never a remembered app of another package; a package with no app names the package and goes to the apps home.
20+
- Changes and Publish stay at the right end of the top bar, beside Cancel and Save.

‎ui/apps/console/src/components/StudioRoute.metadataArea-28561.test.tsx‎

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99
* the route hands it `area="metadata"`. `:packageId/:tab` matches one
1010
* segment, so without this route an area URL such as
1111
* `/studio/crm/metadata/flow` matched nothing.
12-
* - The cross-package leg (`/studio/~all/metadata/*`) is the area alone, with
13-
* no package, in the frame the landing draws. Every other `~all` URL lands
14-
* on it, so none reaches the pillar builder as a package id.
15-
* - The entry gate decides first, as for every Studio URL.
12+
* - The cross-package leg (`/studio/~all/metadata/*`) is the same builder
13+
* route with `~all` as its segment (objectstack#36899): the surface draws
14+
* the area alone, with no package, beside the left menu every Studio page
15+
* has. Every other `~all` URL lands on it, so none reaches a pillar.
16+
* - The entry gate decides first, as for every Studio URL, the left menu's
17+
* targets included.
1618
*
1719
* The builder module is mocked with markers (as in
1820
* `StudioRoute.lazyBuilder-11798.test.tsx`); the gate, the frame and the
@@ -139,28 +141,37 @@ describe('/studio — the "All metadata" area\'s routes (objectstack#28561)', ()
139141
expect(surface).toHaveAttribute('data-area', '');
140142
});
141143

142-
it('the cross-package leg is the area alone, with no package, in the landing\'s frame', async () => {
144+
it('the cross-package leg is the builder with its area open on `~all` (objectstack#36899: one shell, one menu)', async () => {
143145
renderStudio('/studio/~all/metadata/permission?scope=environment');
144-
const area = await screen.findByTestId('studio-metadata-area');
145-
expect(area).toHaveAttribute('data-package', 'null');
146-
expect(screen.queryByTestId('studio-pillar-builder')).toBeNull();
147-
// The console's own top bar frames it; its brand links home.
148-
expect(screen.getByRole('link', { name: 'ObjectOS home' })).toHaveAttribute('href', '/home');
146+
const surface = await screen.findByTestId('studio-pillar-builder');
147+
expect(surface).toHaveAttribute('data-package', '~all');
148+
expect(surface).toHaveAttribute('data-area', 'metadata');
149+
// The landing's frame (the console's top bar) no longer draws it.
150+
expect(screen.queryByRole('link', { name: 'ObjectOS home' })).toBeNull();
151+
expect(screen.queryByTestId('studio-metadata-area')).toBeNull();
149152
expect(location()).toBe('/studio/~all/metadata/permission?scope=environment');
150153
});
151154

152155
it.each(['/studio/~all', '/studio/~all/data', '/studio/~all/flow/f1'])(
153-
'%s lands on the cross-package area, never on the builder as a package id',
156+
'%s lands on the cross-package area, never on a pillar',
154157
async (url) => {
155158
renderStudio(url);
156-
expect(await screen.findByTestId('studio-metadata-area')).toBeInTheDocument();
159+
const surface = await screen.findByTestId('studio-pillar-builder');
157160
expect(location()).toBe('/studio/~all/metadata');
158-
expect(screen.queryByTestId('studio-pillar-builder')).toBeNull();
161+
expect(surface).toHaveAttribute('data-area', 'metadata');
162+
expect(surface).toHaveAttribute('data-package', '~all');
159163
},
160164
);
161165

162-
it.each(['/studio/~all/metadata', '/studio/com.example.crm/metadata'])(
163-
'a principal the gate refuses gets neither leg: %s',
166+
it.each([
167+
'/studio/~all/metadata',
168+
'/studio/com.example.crm/metadata',
169+
// objectstack#36899 — the left menu's targets that are not an area list.
170+
'/studio/~org/automations',
171+
'/studio/com.example.crm/access?surface=owd%3Aoverview',
172+
'/studio/com.example.crm/metadata/_diagnostics',
173+
])(
174+
'a principal the gate refuses gets none of them: %s',
164175
async (url) => {
165176
permissionsFetch = answer(['setup.access']);
166177
renderStudio(url);

‎ui/apps/console/src/components/StudioRoute.recentPackage-11863.test.tsx‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,14 @@ describe('/studio/PKG/TAB records the package as a recent entry (objectui#11863)
199199
expect(persisted()).toBeNull();
200200
});
201201

202+
it('the cross-package leg is not a package either, now the builder draws it (objectstack#36899)', async () => {
203+
renderStudio('/studio/~all/metadata/permission?scope=environment');
204+
await screen.findByTestId('studio-pillar-builder');
205+
206+
expect(recent()).toEqual([]);
207+
expect(persisted()).toBeNull();
208+
});
209+
202210
it('a principal the entry gate refuses records nothing: the visit is recorded behind the gate', async () => {
203211
permissionsFetch = async () => jsonResponse({ authenticated: true, systemPermissions: ['setup.access'] });
204212
renderStudio('/studio/com.acme.crm/data');

‎ui/apps/console/src/components/StudioRoute.tsx‎

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ const StudioDesignSurface = lazy(() =>
7979
const BuilderLanding = lazy(() =>
8080
import('./studioBuilder').then((m) => ({ default: m.BuilderLanding })),
8181
);
82-
const StudioMetadataArea = lazy(() =>
83-
import('./studioBuilder').then((m) => ({ default: m.StudioMetadataArea })),
84-
);
8582

8683
/**
8784
* What a principal without `studio.access` sees, at the Studio URL they opened
@@ -221,7 +218,7 @@ function StudioLanding() {
221218
}
222219

223220
/**
224-
* The console frame `/studio` screens without a package draw (objectui#11863):
221+
* The console frame the `/studio` landing draws (objectui#11863):
225222
* the console's own top bar in its `studio` variant and the command palette in
226223
* its `studio` scope, around a body that loads with its route.
227224
*/
@@ -246,21 +243,6 @@ function StudioConsoleFrame({ children }: { children: ReactNode }) {
246243
);
247244
}
248245

249-
/**
250-
* objectstack#28561 — the "All metadata" area's cross-package leg
251-
* (`/studio/~all/metadata/*`, ADR-0146 D1): the environment catalog, served
252-
* with no package. No package means no pillars, no package switcher and no
253-
* package publish, so it is not the pillar builder: it is the area alone, in
254-
* the frame the landing draws, which it is entered from.
255-
*/
256-
function StudioAllPackagesMetadata() {
257-
return (
258-
<StudioConsoleFrame>
259-
<StudioMetadataArea packageId={null} />
260-
</StudioConsoleFrame>
261-
);
262-
}
263-
264246
/**
265247
* A package's pillar builder, which records the visit as a recent `package`
266248
* entry (objectui#11863), so the landing can list the packages an author was
@@ -272,14 +254,14 @@ function StudioAllPackagesMetadata() {
272254
* which lands on the Data pillar — and no label: the landing labels it from the
273255
* package list it loads (objectui#11678's shape). Keyed on the package, not the
274256
* pillar, so moving between pillars of one package leaves the list as it is,
275-
* and the provider writes nothing. The package-less scope (`~org`) is not a
276-
* package and records nothing.
257+
* and the provider writes nothing. The package-less scope (`~org`) and the
258+
* cross-package leg (`~all`) are not packages and record nothing.
277259
*/
278260
function StudioPackageBuilder({ area }: { area?: typeof STUDIO_METADATA_AREA }) {
279261
const { packageId } = useParams();
280262
const { addRecentItem } = useRecentItems();
281263
useEffect(() => {
282-
if (!packageId || packageId === STUDIO_ORG_SCOPE_SEGMENT) return;
264+
if (!packageId || packageId === STUDIO_ORG_SCOPE_SEGMENT || packageId === STUDIO_ALL_PACKAGES_SEGMENT) return;
283265
addRecentItem({
284266
id: `package:${packageId}`,
285267
type: 'package',
@@ -309,8 +291,7 @@ function StudioPackageBuilder({ area }: { area?: typeof STUDIO_METADATA_AREA })
309291
*
310292
* `/studio` front door (pick / create a writable package)
311293
* `/studio/~org` the package-less scope lands on its one pillar
312-
* `/studio/~all/metadata/*` the "All metadata" area across packages
313-
* `/studio/~all/*` lands on that area
294+
* `/studio/~all/*` lands on the "All metadata" area across packages
314295
* `/studio/:packageId` a package lands on its Data pillar
315296
* `/studio/:packageId/metadata/*` a package's "All metadata" area, in the builder
316297
* `/studio/:packageId/:tab` the pillar builder (a recent-package visit)
@@ -331,6 +312,15 @@ function StudioPackageBuilder({ area }: { area?: typeof STUDIO_METADATA_AREA })
331312
* cross-package segment (`metadataArea.ts` in app-shell says why it is not
332313
* `~org`); every `~all` URL outside the area lands on it, so none reaches the
333314
* pillar builder as a package id.
315+
*
316+
* objectstack#36899 — the cross-package leg (`/studio/~all/metadata/*`) is
317+
* served by the generic area route, as `~org`'s pillar is by the generic pillar
318+
* route: the SAME `StudioDesignSurface`, which reads `~all` as "no package"
319+
* and draws the area alone, under the left menu every Studio page draws. It
320+
* used to be the area in the landing's console frame, a second shell the
321+
* author flipped into from the menu's Access group. The more specific
322+
* `:packageId/metadata/*` outranks `~all/*` for an area URL; every other
323+
* `~all` URL still lands on the area.
334324
*/
335325
export const studioRoutes = (
336326
<Route path="/studio" element={<StudioRoute />}>
@@ -339,10 +329,6 @@ export const studioRoutes = (
339329
path={STUDIO_ORG_SCOPE_SEGMENT}
340330
element={<Navigate to={STUDIO_ORG_SCOPE_PILLAR} replace />}
341331
/>
342-
<Route
343-
path={`${STUDIO_ALL_PACKAGES_SEGMENT}/${STUDIO_METADATA_AREA}/*`}
344-
element={<StudioAllPackagesMetadata />}
345-
/>
346332
<Route
347333
path={`${STUDIO_ALL_PACKAGES_SEGMENT}/*`}
348334
element={<Navigate to={studioMetadataAreaPath(STUDIO_ALL_PACKAGES_SEGMENT)} replace />}

0 commit comments

Comments
 (0)