Repository navigation
fix(studio): a permission set's review link opens the draft review on its matrix page - #37347
Conversation
…on its matrix page The generic item page's review sheet and its ?review=1 arrival move into DraftReviewSheet / useDraftReviewArrival; PermissionMatrixEditPage (Studio's permission-set page and the routed one) uses both. Claude-Session: https://claude.ai/code/session_01QSeKYnq7io51czLb81MZMd Co-authored-by: Claude <noreply@anthropic.com>
…e, the routed matrix and both producers Claude-Session: https://claude.ai/code/session_01QSeKYnq7io51czLb81MZMd Co-authored-by: Claude <noreply@anthropic.com>
…ts callbacks refresh in an effect Claude-Session: https://claude.ai/code/session_01QSeKYnq7io51czLb81MZMd Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — REWORK · L1 · head
|
| Mutation | Result |
|---|---|
A1: matrix arrival enabled: true changed to false |
5 red: both Studio review pins, both producer pins, the no-draft address pin. Both CONTROLs green. |
A3: generic page enabled: !createMode changed to false |
2 red: detailTabs ?review=1 opens the review and is consumed, and its CONTROL |
A4: the hook's next.delete(DRAFT_REVIEW_PARAM) removed |
6 red: detailTabs ×2, Studio address pin, both producer pins, the no-draft pin |
A5 (mine, not in the report): matrix hasDraft forced to false |
4 red: both producer pins, Studio review pin, Studio editing pin. The no-draft pin and both CONTROLs stay green. |
The dev's A1, A3 and A4 counts reproduce exactly.
Check-runs at head. 51 runs: 38 success, 13 skipped (all expected-skip per l1-face), 0 failed, 0 pending, and no legacy commit status. Lint & Repo Gates, TypeScript Type Check, Lint UI, Type Check UI, Test UI, Check Changeset and Governed Surface Queue Guard are all success.
Merge state.
git merge-tree --write-treeagainst origin/main134b71dbis clean (exit 0). No file is shared with main's 7 new commits.- feat(ui): New Package offers 「同时创建应用」 / Also create an app, ticked by default #37338 (
PackagesPage.tsx) and feat(studio): the left menu reads the placement table — 常用 types first, the rest in one 「高级」 fold #37341 landed in between and touch neighbouring files only. - Overlap with fix(console): "customized" means overrides + extensions everywhere; Setup → Packages names arrangements apart #37351 (
c9c1d9e4) and fix(studio): a customization pair's dashboard or report opens in its base app's edit state #37348 (7e57a1c7): none of their files are in this diff. The pairwisemerge-treeon top of main+fix(studio): a permission set's review link opens the draft review on its matrix page #37347 is clean for both. - Both PRs touch components this PR's new test renders:
PackageCustomizationsPanel(insidePackageDetailSheet) andStudioAreaAppOpen(StudioAreaAppGatearoundAreaItemOpen). So I built a local tree of main + fix(studio): a permission set's review link opens the draft review on its matrix page #37347 + fix(console): "customized" means overrides + extensions everywhere; Setup → Packages names arrangements apart #37351 + fix(studio): a customization pair's dashboard or report opens in its base app's edit state #37348, rebuilt the deps closure on it, and ran the 6 suites above plusPackagesPage.installedAppsUpdates-34722andStudioAreaAppOpen-36906:Test Files 8 passed (8),Tests 264 passed (264).
K = 7 (origin/main 134b71db). It was 6 at the zone's finalize 2026-11-25T21:42Z; test(runtime): get_record_context answers one caller with the same bytes on the /mcp and stdio doors over a real kernel #37350 has landed since, and it is a runtime test. Under 15, so no merge of main is owed before queueing.
Contract review: not owed. Clause-②: no without a (narrowing) arm, no packages/spec/src/**, and no governed path among the 7 files. Not Tier H: under 3,000 lines and not governed. CI plus this seat read is the whole review.
Report evidence. Every gate reading in the report names f781168f. The two local timeouts (check:query-options-erasure, check:type-check-debt) are NOT MEASURED locally, and their CI jobs are success at head. The report's mcp_calls are all reads.
Findings
- S1 (should-fix) — The 维护者速读 understates the risk in 「出错会怎样」. It says 「矩阵编辑和其他类型的审阅不受影响」. After this PR, every other type's
?review=1arrival runs through the shareduseDraftReviewArrival, and every other type's review sheet renders throughDraftReviewSheet. A defect there would break the review link for every type, not only the permission set's. That outcome is what the extraction preserves (pinned by A3/A4), not a worst case it rules out. In the same bullet set, 「在软件包页点某个权限集草稿的「审阅」」 names a label the page does not show: the per-draft link readsTYPE · NAME(PackagesPage.tsx:1340). Body-only fix by the zone before landing, no head move. Suggested 「出错会怎样」: 「最坏情况是审阅链接打开后面板不弹出或内容不对:权限集之外,其他类型的审阅也改走同一段共享代码(已有测试钉住,行为不变);矩阵编辑不受影响。纯界面改动,直接撤回即可。」 and 「点某个权限集草稿的链接」 for the first bullet. - N1 — The "What changes" bullet says the arrival reads the draft "at the address its load reads". That holds for the published (layered) read only. The matrix's load reads a draft at the door's
packageIdalone (PermissionMatrixEditor.tsx:1159), while the arrival reads it atlayeredPackageId, else by name. The Acceptance notes already state the cross-package consequence. Wording only; nothing owed. - N2 — On the cross-package leg, where both producers land, the matrix under the sheet shows the published set while the sheet shows the draft. The matrix behaved this way before this PR, and the Acceptance notes record it. It is the more meaningful gap behind the parity question (below), not a defect of this PR.
- N3 — The chat pin re-states
DraftReviewNavigator's navigate call rather than mountingAppContent. The call is the same shape asAppContent.tsx:286, and the redirect is pinned separately inAppContent.setupMetadataStudio-28578. Accepted. - N4 —
reviewReadis not keyed onname. If one matrix instance were reused across sets, a stale read would remain, but it is closed. A new arrival setsloadingbefore it readshasDraft, so no stale review opens. Harmless.
Parity ux card (zone Q1 A)
I agree with A: no reopen chip in this PR, and no parity card filed now.
- The card's Done-when is the arrival, and it is met.
- There is no measured pull for a chip on the matrix header (startup no-diffusion axis).
- On Studio's package leg, the surface's Changes panel and pending count already reach the package's drafts.
- The producers' links stay where they were, so the review can be opened again.
If a card is filed later, scope it to the cross-package leg (N2): the matrix there shows the published set under a draft review, and that, not a missing chip, is what a user would trip on. That calls for a design ruling, so a needs-user-decision card, not a ux chip card.
Landing
- The zone lands it after the S1 body edit (no head move; the seat then posts a same-head delta ACCEPT). K = 7 < 15: no merge of main first. Changeset present. Not Tier H, and no contract review owed.
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — ACCEPT · L1 · head
|
|
repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H Landing · 2026-11-25T22:45Z · head
|
…ts dashboards (objectstack-ai#37368) Fixes objectstack-ai#36907 Clause-②: no Metadata-protocol: none ## 维护者速读 - 管理员在 Studio 的仪表盘列表点「新建」,会直接打开对应应用,「设计布局」已开、「添加菜单项」停在仪表盘一栏;建好的仪表盘挂在菜单上并进入编辑,点 × 回到 Studio 列表;手机宽度不出现「新建」,包里没有可打开的应用时也不出现,并写明原因。 - 属于「Studio 重构」专题,落实你定的「新建跳到设计模式加菜单」,让新仪表盘不会游离在所有菜单之外。 - 出错时管理员在 Studio 里可能新建不了仪表盘,或进不了设计模式;已有仪表盘、报表和菜单不受影响,纯前端改动,可直接撤回。 - 无 ## What changes The Studio dashboard list's New now uses design mode's existing 「Add menu item → New dashboard…」 flow (objectstack-ai#36364), the maintainer's 「新建跳到设计模式加菜单」 (dashboard half). The report half (decision 13) is unchanged. **The arrival (`layout/designModeArrival.ts`, `layout/useDesignModeArrival.ts`).** A second navigation-state arrival, `designModeAddDashboard`, sits beside `designModeNewDashboard` and carries the Studio list it came from. `ConsoleLayout` reads it once per history entry through `useDesignModeArrival`. It first replaces the entry without the arrival, so a reload or Back enters nothing. Then it asks the mode to `enterOpening({ column: 'dashboard', studioReturn })`. - ⛔ No URL enters design mode. The arrival rides navigation state only; the landing address carries no `?studio=` and no mode. - `enterOpening` is `enter` plus a one-shot "opening" held in the mode store. Where `enter` refuses (an editor holds the mode out, PR objectstack-ai#36848), nothing is held and the mode's own `designMode.editorOpen` toast says why. On a phone the arrival is cleared and nothing more happens. - The held-out count moved from state to a ref. An editor that opens in the same commit the arrival lands in is then still judged (pinned; ablation A5c below). `enter()` keeps its zero-argument contract: a click event is never an opening. **`DesignModeMenu`** takes the opening once (`useDesignModeOpening`). It opens the picker on 「Dashboards」 for an entry at the end of the top level, as that level's 「Add menu item」 would. A dashboard created from that picker navigates with `withStudioReturn(href, studioReturn)`, so the dashboard page's existing × goes back to the Studio list (`?studio=`). Closing that picker drops the return, and later adds are plain. **Studio (`StudioAreaAppOpen.tsx`, `studioAppEdit.ts`, `StudioMetadataArea.tsx`).** `StudioAreaAppTarget` gains `{ kind: 'new-dashboard' }`. `AreaCreate` sends `dashboard/new` through it, under the same condition the report leg uses (`!readOnly || pairCreate`). It replaces the Studio address with `/apps/SEGMENT` (`appHomePath`) and the arrival. - The app comes from decision 6 via `studioAppCreateSegment`. - The `.custom` pair leg from objectstack-ai#37348 applies: a pair with no app of its own reads its base's apps. That reading is factored into `readStudioTargetApps`, which the item leg now shares too. - With no app, or on a phone, the fallback is the area's own create, as for a report. **The list (`ResourceListPage.tsx`).** `useStudioDashboardNew` gates the area's dashboard 新建 by the same reads. It never shows at phone width, and it is not drawn while the apps are being read. With no target app the header shows no 新建 and shows a `role="note"` reason instead (`engine.list.dashboardNewNoApp`); the empty state says the same. **Riders from seat 4's L1 on PR objectstack-ai#37348.** - N1: the `StudioAreaAppOpen-36906` test header now says a pair row opens in the base's app. - N2: this changeset carries a note on the objectstack-ai#37237 entry: rule 1's menu leg (the remembered app counts when its menu opens the item) applies on the pair leg too. Additive en and zh keys: `engine.list.dashboardNewNoApp` and `engine.list.dashboardNewWiderScreen` (the phone empty state, from the L1 S1 round) in the `studio` namespace (it is en/zh only). No server, spec or route change. ## Read first 1. `ui/packages/app-shell/src/layout/useDesignModeArrival.ts`: the consume-then-enter order. Risk: it navigates (replace) in the same commit `AppRootLanding`'s redirect may navigate. Child effects run first, so the landing redirect re-applies on the next render; see Acceptance notes. 2. `ui/packages/app-shell/src/layout/designMode.tsx`: `enterWith` / `enterOpening` / `takeOpening`, and `heldOut` moving to a ref. 3. `ui/packages/app-shell/src/views/studio-design/StudioAreaAppOpen.tsx`: the `new-dashboard` leg and `useStudioDashboardNew`. ## Tests Pins, each with an ablation that turned it red (and restored hash-verified through `scripts/ablation-replace.mjs`). Every file below imports the subject from source, so no build or dist preflight applies: | Pin | File (new top-level describe) | Ablation → red | |:--|:--|:--| | Studio 新建 lands in the target app, design mode open, dashboard column open | `StudioAreaAppOpen-36906` (`dashboard list's New…`), `DesignModeMenu-36363` (`the arrival…`) | A6 `AreaCreate` dashboard branch off → 5 red; A1 `enterOpening` call removed → 6 red; A2 picker kind `null` → 2 red | | A created dashboard is in the menu and opens for editing, × back to the list | `DesignModeMenu-36363` | A3 `withStudioReturn` dropped → 1 red | | CONTROL: the report 新建 is unchanged | existing 36906 report-New tests and pair report-New control; list control `CONTROL — the report list` | (control: green under every ablation) | | No 新建 at phone width | `ResourceListPage.pairCreate-36897` (`dashboard list's 「新建」…`) | A8 phone read as false → 1 red | | No 新建 without a target app, reason shown | same | A9 gate ignores `no-app` → 3 red; A10 reason not drawn → 2 red | | A refused `enter()` does nothing | `DesignModeMenu-36363` | A5 hold ignored → 2 red; A5c render-time snapshot of the hold → the same-commit pin red, the prior-editor pin green | | The pair leg | `StudioAreaAppOpen-36906`, `ResourceListPage.pairCreate-36897` | A7 pair leg off (Studio) → 2 red; A7b (list) → 1 red | | The arrival is consumed (reload / Back enter nothing) | `DesignModeMenu-36363` | A4 replace removed → 4 red | Moved by this change, and re-pinned rather than deleted: - 36906's "a dashboard New is not this card" half is now the new describe. - 36906's "a dashboard made by the area's create … Back lands on the list" runs at phone width, the one place the area's own dashboard create is still reached from a list. <details><summary>Local runs on the final head 6fbbdd9 (rebased on d5ae7a4)</summary> - `cd ui && npx vitest run --maxWorkers=2` over the 4 pinned files (`DesignModeMenu-36363`, `designMode-36362`, `StudioAreaAppOpen-36906`, `ResourceListPage.pairCreate-36897`) gave `Test Files 4 passed (4) · Tests 114 passed (114)` before the L1 S1 round. At the final head `cc7bb340`, with the S1 and N2 pins added, the seat's L1 run over the same files gives 119/119 passed. - `pnpm --filter @object-ui/app-shell type-check` (both `tsconfig.json` and `tsconfig.test.json`) gives lock `VERDICT command-exit 0`. - The 156 app-shell/i18n test files that name a touched surface (ResourceListPage, designMode, DesignModeMenu, StudioAreaAppOpen, StudioMetadataArea, ConsoleLayout, studioAppEdit) were run on the pre-rebase head `b0fc2e64`, giving `Test Files 156 passed (156) · Tests 1743 passed (1743)`. The rebase brought in one commit, objectstack-ai#37347, which touches none of this PR's files. The full app-shell suite (2,431 files) is left to CI's `Test UI` (a declared narrowing). - Gates derived by `node scripts/pm/dispatch-gates.mjs --commands`: all 38 commands exit 0, run on `b0fc2e64`. - Pre-push gates on `6fbbdd9b`: `pnpm check:test-source-alias` exit 0, `pnpm --dir ui check:i18n-keys` exit 0, `node scripts/pm/overlap-check.mjs` gives `VERDICT clean exit 0`. It reports one open PR, objectstack-ai#37362, that shares the studio en/zh namespace files and merges cleanly. - In-flight branches, by `git merge-tree`: - `claude/issue-37139-studio-package-menu` merges clean. - `claude/issue-36909-studio-pillar-dead-code` merges clean. It shares `StudioMetadataArea.tsx` with this PR, in different hunks. </details> <details><summary>Ablations (each through scripts/ablation-replace.mjs, restored, git diff HEAD empty)</summary> - A1: drop the `enterOpening` call in `useDesignModeArrival` → `DesignModeMenu-36363`: 6 failed | 50 passed. - A2: `setPickerKind(null)` → 2 failed. - A3: navigate without `withStudioReturn` → 1 failed. - A4: drop the consuming `navigate(..., { replace: true })` → 4 failed. - A5: `if (false)` in place of the held-out check → 2 failed. - A5b: a held-out getter that always reads 0 → 2 failed. - A5c: judge the hold at render time (`heldOutAtRender`) → only "the same refusal when the editor opens in the very commit the arrival lands in" fails among this card's pins. The prior-editor pin stays green. - A6: `AreaCreate`'s dashboard branch never taken → `StudioAreaAppOpen-36906`: 5 failed | 22 passed. - A7: pair leg off in `readNewDashboardSegment` → 2 failed. A7b (list) → `ResourceListPage.pairCreate-36897`: 1 failed. - A8: `useStudioDashboardNew` reads no phone → 1 failed. - A9: `canCreate` ignores `dashboardNew` → 3 failed. - A10: reason note not drawn → 2 failed. </details> ## Acceptance notes - **Double replace at the app root.** `useDesignModeArrival` replaces the history entry it read, in the same commit `AppRootLanding` may redirect to the app's landing. Child effects run first, so the landing redirect re-applies on the next render. In the browser, the showcase landed on its first page (`/page/showcase_capability_map`) with the mode on and `history.state.usr === null`. A self-built app whose menu holds only links stays on `/apps/ID`, with the same result. - **An app whose menu is split into `areas`** keeps its plain menu under design mode, because `UnifiedSidebar` draws the editor only when `areas.length === 0`. That predates this PR. There the arrival enters the mode but no picker opens. No example app uses `areas`. See the report's open question. - **The arrival does not repeat the 「Design layout」 door's own gate** (`useStudioEntryGate` and the customization wall). The Studio list's 新建 is already gated by `canCreate` (`walled`, `pairCreate`), and the server judges every write again. - **The held-out count moved from state to a ref** (`designMode.tsx`). Nothing rendered from it; `enter` is the only reader. The existing 36692 pins pass unchanged. - **The pair leg is applied to the dashboard New only.** A pair's report New still falls back to the area's own create, pinned as CONTROL per the dispatch's "report 新建 unchanged". Whether it should gain the leg is in the report's open questions. - While the package's apps are being read, the list draws no 新建, so a no-app package never flashes one. ## Verification - Browser walk on the showcase stack: `pnpm dev -- --fresh -p 38461` (seeded admin), and the Console from `ui/` sources via `pnpm --filter @object-ui/console dev` on :5180 pointed at it. Driven with Playwright from a scratch script, not committed. - **Showcase** (`com.example.showcase`, a read-only code package; the HotCRM shape): Studio › dashboard list › 新建 lands on `/apps/com.example.showcase/page/showcase_capability_map` with the Design layout bar and the 「Add menu item」 picker on Dashboards (「New dashboard…」 first). The history entry's state was cleared. - Create lands on `/apps/com.example.showcase/dashboard/walk_showcase?studio=/studio/com.example.showcase/metadata/dashboard?package=com.example.showcase` in its edit state, with the × drawn. The entry is in the menu, and the dashboard was saved to `com.example.showcase.custom`. - A reload of that page shows no design bar. × returns to the Studio list. - **Self-built** (`com.walk.selfbuilt`, created through `POST /api/v1/packages` with one app `walk_app`): 新建 lands on `/apps/com.walk.selfbuilt` with the bar and picker. Create opens `/apps/com.walk.selfbuilt/dashboard/walk_selfbuilt?studio=…`, and the dashboard was saved to `com.walk.selfbuilt`. × returns to the list. - **No app** (`com.walk.noapp`): no 新建, and the note reads "A new dashboard is made in an app's design mode, so that it hangs in a menu. This package has no app to make it in." - **Phone** (390 px): no 新建 and no note. - Two-minute check: in Studio, open any package's Dashboards list and press 新建. Expect the app with the purple Design layout bar and the 「Add menu item」 dialog already on Dashboards. --- _Generated by [Claude Code](https://claude.ai/code/session_01QSeKYoLfUxK6MRhuSp7nAt)_ <!-- signed: repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…e redirect; the pillar-era code with no reader goes (objectstack-ai#37383) Fixes objectstack-ai#36909 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:Studio 的旧地址(以前的「数据 / 自动化 / 权限 / 界面」分区链接、收藏夹、AI 给过的链接、服务器发的草稿审阅链接)都还能打开原来要看的页面,而且一次就跳到位;清理本身用户无感。 - 为什么做:Studio 重构专题的收尾——分区已经被左侧菜单和全屏设计器取代,这一单删掉分区留下的、已经没人读的代码。 - 出错会怎样:如果哪条旧地址漏了,打开它会落到「页面不存在」或错误的列表页;这是纯前端改动,撤回这个 PR 即可恢复。 - 要你做什么:无。 ## What changes No Studio pillar draws a page any more. This PR makes the route, not the builder, answer every retired pillar address, and deletes what the redesign left with no reader. **1. One redirect table, mounted on the route** (`studioPillarRedirectModel.ts`, `StudioPillarRedirect.tsx`, `StudioRoute.tsx`). `/studio/PACKAGE` and `/studio/PACKAGE/:tab` now render `StudioPillarRedirect`. A retired pillar address redirects once; any other segment renders the builder (the sharing overview `owd`, or the not-found state). | old address | lands on | |---|---| | `/studio/PACKAGE`, `/studio/PACKAGE/data` | `/studio/PACKAGE/metadata/object?package=PACKAGE` | | `/data?surface=object:NAME` (all three spellings, `?action=` kept) | `/studio/PACKAGE/metadata/object/NAME?package=PACKAGE` | | `/data?changes=review` (the server's `studioChangesReviewLink`) | `/studio/PACKAGE/metadata/object?changes=review&package=PACKAGE` | | `/automations[?surface=flow:NAME]` | the flow list, or `/metadata/flow/NAME?package=PACKAGE` | | `/access[?surface=permission:NAME / owd:overview]` | the permission set list, the set's matrix (its holder read, as before), or `/owd` | | `/interfaces[?…]` | the object list, with the "interface editing moved" notice | | `/studio/~org` and every `/studio/~org/…` | `/studio/~org/metadata/flow[/NAME]?source=runtime` | A base's `.custom` pair keeps each pillar's old rule (Data and Automations in the pair's area; Access and Interfaces on the base). **2. One hop (carry item from 7157423170).** Every target in the area is put where the area would put it (`settledAreaAddress`, built on a new `studioAddressParts` parser in `studioAddress.ts`), so the area never redirects a second time. Before: `/data` took two redirects, bare `/studio/PACKAGE` three, `/studio/~org` two. The publish toast's "Open Access" now opens the package's permission sets, and the Changes sheet's link to a permission set opens that set's page, directly instead of through the old Access address. **3. Removed, with every reader gone** (all in `@object-ui/app-shell`, `private: true`, last published 18.2.0 — nothing published narrows): - `AREA_PILLAR_FOR_TYPE`, `areaItemPillarPath`, `studioPillarItemPath` (`metadataArea.ts`); `StudioMetadataArea`'s pillar redirect branch. - `STUDIO_ITEM_PILLAR` (empty since objectstack-ai#36903), `studioItemPillar`, `studioPillarItemAddress`, `studioSurfaceQuery`, `StudioItemOptions.spelling` (`studioAddress.ts`). `studioItemPath` now always returns the metadata address. - `STUDIO_ORG_SCOPE_PILLAR` (`studioAddress.ts`, its `studioScope.ts` re-export and the package entry). Kept only as data where a redirect needs it: the literal `'automations'` inside the redirect table. - `STUDIO_HOME_PILLAR` from the package entry (the console no longer reads it). It stays inside app-shell: `studioHomePath` / `studioChangesReviewPath` mirror the server's `/data?changes=review` link, which this card may not change. - The `?surface=` mirror half and the capture half with it (`useSurfaceDeepLink`, `useSurfaceDeepLinkCapture`, `useSurfaceDeepLinkMirror`, `parseSurfaceTarget`, `resolveSurfaceDeepLink`) and their test file. `useSurfaceActionDeepLink` and the qualifier keys stay (the object designer and the redirects read them). - The channel's subscriber half: `useRequestedSurface`, `SurfaceRequest` and the `requested` state (carry item: no reader since objectstack-ai#37168). `useSurfaceNavigator` + `SurfaceDeepLinkProvider` stay: the Changes sheet's security block uses them. - In `StudioDesignSurface`: the in-surface Data / Automations / Interfaces redirects, `PILLARS`, the Access landing branch, `PILLAR_FOR_SURFACE_TYPE`, and the pillar re-entry counter whose value nothing read. - `studioMenuModel.ts` needed only the sharing overview's section, not a pillar map: `PILLAR_TYPE` went; the menu marks nothing current on a retired address (it never draws one). **4. `studio.app.ts`: no change needed.** All 15 `metadata:resource` / `metadata:directory` entries were walked through the console's real path (`/apps/studio/metadata/TYPE?package=PACKAGE` → `setupMetadataStudioPath`): each lands on `/studio/PACKAGE/metadata/TYPE?package=PACKAGE` (or `~all` with no package), a settled area address, none on a pillar. Reading in Verification. **5. Card item 3** (`engine.studio.pillar.*`) was already gone on main (the claim's Premise). This diff removes no translation call site; `ui/scripts/check-i18n-dead-keys.mjs` exits 0. ## Tests Pins (each ablated, below): - **Table** — `studioPillarRedirectModel.test.ts` walks 22 old addresses (every package pillar, bare package, a `.custom` pair, every `~org` address, the three `?surface=` spellings) to their literal targets, plus the Access mapping; `studioAddress.test.ts` holds every `STUDIO_ITEM_TYPES` row's `redirectsTo` equal to what the table returns for each spelling. Route-level: `StudioRoute.metadataArea-28561.test.tsx` walks 14 old addresses through the real `studioRoutes` and the real redirect. - **`/data` single hop** — `the old /data address reaches the object list in one redirect` (the area's `areaLocationRedirect` answers null for the target); route-level, the location probe records exactly `[old, new]`. - **CONTROL** — `/owd`, `/owd?object=…`, area addresses and an unknown segment are not redirected (pure and route-level: the probe records `[url]` only). - **Changes sheet → permission set** — `StudioDesignSurface.heldDataCreate-26845.test.tsx` (last describe): the sheet's request for a permission set lands on `/studio/PACKAGE/metadata/permission/NAME` on a writable base, and on the `.custom` pair's address on a read-only base with a pair. Narrowing `requestSurface` back to objects alone turns both red (`Tests 2 failed | 3 passed`). Updated: 38 app-shell surface tests now mount the console's route shape (`StudioPillarRedirect` around the builder on `:tab`); the console route tests expect the new landings; the publish toast test expects the permission set list. ## Acceptance notes Not filed (dead code / drift, no defect class); carrier: none. - Client producers still write old addresses that now cost one redirect: `studioHomePath` callers (command palette, app no-access state, AI chat page, `appRoute`, `PackagesPage`, `PackageCustomizationsPanel`) and `setupMetadataRedirect`'s `packagedAutomationStudioPath` / `packagedActionsStudioPath` (two hops for those legacy Setup bookmarks). Left alone: two of those files belong to an in-flight branch, and the address they write still works. - The copilot's surface context (`StudioAiCopilot`) still reads `:tab` and `?surface=` as its pillar context (cloud#1610 contract); on current pages it reads the area path instead. - The surface keeps its `~org` non-area fallback and its pair→base redirect for owd/unknown segments; the route no longer reaches the first. Finding for the seat (class a, user-visible misleading text), not fixed here: the not-found state at `/studio/PACKAGE/bogus_pillar` says "pick Data, Automations, Interfaces, Access or All metadata above" (`engine.studio.notFound.pillar`, en and zh) — none of those exist any more. ## First read (by risk) 1. `ui/packages/app-shell/src/views/studio-design/studioPillarRedirectModel.ts` — the table; the `.custom` pair rules and the `~org` catch-all. 2. `ui/apps/console/src/components/StudioRoute.tsx` — the two routes that now render the redirect, and the lazy boundary it rides. 3. `ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx` — the removed in-surface redirects and the `requestSurface` permission branch. ## Verification Two-minute check: open `/studio/com.example.showcase/data?changes=review` in the Console (`OS_PORT=3000 pnpm dev`, Console on :5180). Expected: the address bar shows `/studio/com.example.showcase/metadata/object?changes=review&package=com.example.showcase`, the Objects list is open, and the Changes drawer is open over it. All readings below are on tree `26ec30e1` (the rebased head), byte-identical to the pushed head `2322b402` (`git diff --quiet` between them exits 0; see Process notes). <details><summary>Type-check</summary> - `pnpm --filter @object-ui/app-shell type-check` (both programs, `tsconfig.json` and `tsconfig.test.json`): `VERDICT command-exit 0`, 0 `error TS`. - `pnpm --filter @object-ui/console type-check`: `VERDICT command-exit 0`, 0 `error TS` (run on the pre-rebase head `3a7bc226`; the rebase brought no console change). </details> <details><summary>Tests</summary> - Full app-shell suite, pre-rebase head `3a7bc226` + the guard fix: `Test Files 1 failed | 2429 passed | 1 skipped (2431)`, `Tests 1 failed | 23308 passed`. The one failure was `studioAddress.guard.test.ts` (my parse prefix spelled the Studio root outside `studioAddress.ts`); fixed by `studioAddressParts`, then that guard passes. - Rebased head `26ec30e1`: `vitest run packages/app-shell/src/views/studio-design packages/app-shell/src/views/metadata-admin packages/app-shell/src/console apps/console/src/components` → `Test Files 1442 passed (1442)`, `Tests 14059 passed | 1 skipped`. - Pins: `studioPillarRedirectModel.test.ts` + `StudioRoute.metadataArea-28561.test.tsx` → 64 tests pass. </details> <details><summary>Ablations (one per pin; each via `scripts/ablation-replace.mjs`, anchor hit x1, mutation landed on disk, restored to HEAD blob `85ed9932ab4b`, `git diff HEAD` empty after)</summary> - **Table** — the Automations case maps through `dataPillarRedirect` instead: red, exactly the Automations rows — 4 in `studioPillarRedirectModel.test.ts` and 2 route-level ones. - **`/data` single hop** — `settledAreaAddress(...)` dropped from the Data case: `Tests 14 failed | 50 passed (64)`, the one-hop pin `the old /data address reaches the object list in one redirect` among them, and every route-level `/data` and bare-package row (the probe saw a second hop). - **CONTROL** — the `default:` arm redirects to the object list instead of `null`: `Tests 8 failed | 56 passed (64)`: all pure and route-level CONTROL cases, plus the `/access?surface=owd:overview` row (its `/owd` target then redirects again). - Restored leg: both files plus a scratch walk of `studio.app.ts` → `Test Files 3 passed`, `Tests 66 passed`. </details> <details><summary>`studio.app.ts` walk (scratch test, not committed)</summary> Each `metadata:resource` / `metadata:directory` entry through `/apps/studio/metadata/TYPE?package=PACKAGE` → `setupMetadataStudioPath`, then `areaLocationRedirect` on the result: 15 of 15 land on `/studio/PACKAGE/metadata/TYPE?package=PACKAGE` (directory: `/studio/PACKAGE/metadata?package=PACKAGE`), section `metadata`, settled (no second redirect). With no package: 15 of 15 on `/studio/~all/metadata/TYPE`, settled. Types: object, app, view, page, dashboard, report, dataset, action, hook, flow, agent, tool, skill, email_template. </details> <details><summary>Gates</summary> - Before the pushes: `pnpm check:test-source-alias` exit 0; `ui` `pnpm check:i18n-keys` exit 0; `node scripts/pm/overlap-check.mjs` `VERDICT clean exit 0` against origin/main and open PRs objectstack-ai#37380, objectstack-ai#37368, objectstack-ai#37362 (and earlier objectstack-ai#37351, objectstack-ai#37347, objectstack-ai#37348). - `node ui/scripts/check-i18n-dead-keys.mjs` exit 0; the diff removes no translation call site. - `node scripts/check-platform-checklist.mjs --changed-from origin/main`: OK, 2 anchors judged, 0 lost. - `dispatch-gates --commands`: 38 derived families. 37 exit 0 locally (list in the report). `pnpm check:type-check-debt` is NOT MEASURED locally: the first run hit my 500 s timeout while waiting on the verify lock my own test run held (exit 124, not a red); CI's run is the reading. - `pnpm check:nul-bytes` exit 0. </details> ## Process notes - One push (`3a7bc226`) went out before I re-ran the three pre-push gates; I ran them on that head right after (all exit 0). - The final rebase could not be pushed: the permission classifier refused the `--force-with-lease`. I did not retry it. Instead the branch keeps its pushed history, merges `origin/main` (`1691563a`) and replays the two later commits; the resulting tree is byte-identical to the rebased, tested tree. --- _Generated by [Claude Code](https://claude.ai/code/session_01QSeKYngc1UxywCSQwtqdZz)_ <!-- signed: repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Fixes #37269
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
A review link (
?review=1) on a permission-set draft now opens the draft review on the set's matrix page, the same review sheet the generic item page opens.ResourceEditPage'sSheetaroundDraftReviewPanel) moves intoDraftReviewSheet, and its?review=1arrival effect intouseDraftReviewArrival(read afresh, open once the read settles and a draft is pending, then drop?review=1with a history replace).ResourceEditPagenow uses both; its behaviour is unchanged and its existing pins (ResourceEditPage.detailTabs-36901) pass on the shared hook.?review=1.PermissionMatrixEditPageuses the same hook and sheet. That covers Studio'sStudioPermissionSetPage(which embeds the matrix, package leg) and the routed matrix on the cross-package leg, where both producers' links land (/studio/~all/metadata/permission/NAME?review=1, through Setup's metadata redirect).layeredPackageId: the page's package, else the route's?package=), else by name alone, as the generic page reads a draft. The matrix's own load is not asked again, so an unsaved matrix edit is kept, and the matrix stays editable under the sheet and after it closes.?review=1still leaves the address. No published set readable: no review (nothing to compare against).?review=1the matrix reads exactly what it read before.?review=1is dropped the way the generic page drops it;AreaItemOpendecides its page once per item (StudioMetadataArea.tsx), so dropping the query does not move the set off its matrix page. No routing changed.PackagesPage.tsx,AppContent.tsx), the flow and object review links,StudioMetadataArea.tsx, server, spec and routes. No locale key added.Changeset:
.changeset/37269-permission-set-review-link.md(@object-ui/app-shellpatch).Read first (by risk)
ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.tsx, the new block aboveconst [draft, setDraft]: the arrival's own draft and published read, and the sheet added todialogsEl.ui/packages/app-shell/src/views/metadata-admin/useDraftReviewArrival.ts: the arrival effect moved out ofResourceEditPage; callbacks are read through a ref refreshed in an effect that runs before the arrival effect.ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.tsx: the inline effect and sheet replaced by the shared hook and component.Two-minute verification
On a showcase dev server, open Setup, then Packages, then a package with a pending permission-set draft, and click that draft's link. Expected: Studio opens the set's matrix with a right-hand sheet titled "Draft review" listing the changed keys, and the address no longer carries
review=1.Tests
New pins, all at head of this branch:
StudioPermissionSetPage.fullScreen-36905.test.tsx, new top-leveldescribe(the real Studio page and matrix):?review=1shows the draft's change against the published set (onlylabeldiffers), read at the page's package, then leaves the address;?review=1, a set with a pending draft opens no review, and the matrix's load is the only draft read.permissionReviewLinks-37269.test.tsx(new; the realPackageDetailSheet, the realStudioMetadataAreaon the cross-package leg, the real matrix registered as the type'sEditPage):setupMetadataStudioPath(item, 'review=1'), asDraftReviewNavigatorcalls it) reaches the same;?review=1opens no review and reads no draft;?review=1still leaves the address.StudioMetadataArea.routes-28561), the generic page's review (ResourceEditPage.detailTabs-36901), the redirect tables (setupMetadataRedirect,AppContent.setupMetadataStudio-28578).Runs (head f781168)
@object-ui/app-shelltype-check(both programs,tsc --noEmitandtsconfig.test.json): os-verify-lockVERDICT command-exit 0(at the feature commit; the later refactor commit only moved the hook to its own module, andeslinton the moved files is clean).?review=1or the review panel (11 files):Test Files 11 passed (11),Tests 281 passed (281),VERDICT command-exit 0.ResourceEditPage.*,PermissionMatrixEditor.*andStudioPermissionSetPage.*suite (113 files):Test Files 113 passed (113),Tests 664 passed (664),VERDICT command-exit 0.eslinton the changed files: 0 errors; no warning on a changed line.Ablations (one per pin, each through scripts/ablation-replace.mjs, restored to the HEAD blob with git diff HEAD empty)
enabled: truetofalseinPermissionMatrixEditor.tsx)useDraftReviewArrival.ts)ResourceEditPage.tsx)?review=1 opens the review and is consumed, and its CONTROL?review=1kept in the address (useDraftReviewArrival.ts)StudioMetadataArea.tsx)routes-28561Each leg ran the four suites (
StudioPermissionSetPage.fullScreen-36905,permissionReviewLinks-37269,ResourceEditPage.detailTabs-36901,StudioMetadataArea.routes-28561; 76 tests) under the lock; each mutation landed (anchor 1 to 0) and was restored to its HEAD blob.Acceptance notes
?review=1, as the generic page does; unlike the generic page it does not reload the editor, so a same-item arrival keeps unsaved matrix edits.Verification
Local, on
f781168f(exit code read before any pipe):pnpm check:test-source-alias: exit 0.pnpm --dir ui check:i18n-keys: exit 0.node scripts/pm/overlap-check.mjs: exit 0 (VERDICT clean; no open PR shares a file). With--pr=37341,37338: exit 0, both merge cleanly. Theclaude/issue-37236-*andclaude/issue-37237-*branches share no file with this diff.node scripts/pm/dispatch-gates.mjs --commandsderived 39 commands. At the time of writing 28 had run locally: 27 exit 0 (the changeset gates,check:nul-bytes,check:cross-package-test-inputs,check:adr-anchors,check:published-files,check:sdui-manifestamong them), andcheck:query-options-erasurehit the local 300 s wrapper timeout (exit 124): NOT MEASURED locally, left to CI. The rest, andpnpm --dir ui exec vitest run scripts/(this diff touches no script), are left to CI.CI: in progress at the time of writing.
Generated by Claude Code