Repository navigation
feat(studio): a permission set opens full-screen at its metadata address; the sharing overview gets its own route - #37089
Conversation
Claude-Session: https://claude.ai/code/session_01QSeKYkkwuF6UuFtu85Yd5H Co-authored-by: Claude <noreply@anthropic.com>
…ect (#36905) Claude-Session: https://claude.ai/code/session_01QSeKYkkwuF6UuFtu85Yd5H Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYkkwuF6UuFtu85Yd5H Co-authored-by: Claude <noreply@anthropic.com>
…ses (#36905) Claude-Session: https://claude.ai/code/session_01QSeKYkkwuF6UuFtu85Yd5H Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYkkwuF6UuFtu85Yd5H Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYkkwuF6UuFtu85Yd5H Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYkkwuF6UuFtu85Yd5H Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYkkwuF6UuFtu85Yd5H Co-authored-by: Claude <noreply@anthropic.com>
…rmission-fullscreen
… similar is no create (#36905) Claude-Session: https://claude.ai/code/session_01QSeKYkkwuF6UuFtu85Yd5H Co-authored-by: Claude <noreply@anthropic.com>
…ns to the permission set page (#36905) Claude-Session: https://claude.ai/code/session_01QSeKYkkwuF6UuFtu85Yd5H Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYkkwuF6UuFtu85Yd5H Co-authored-by: Claude <noreply@anthropic.com>
… dialog from the live census (#36905) Claude-Session: https://claude.ai/code/session_01QSeKYkkwuF6UuFtu85Yd5H Co-authored-by: Claude <noreply@anthropic.com>
…w reaches it (#36905) Claude-Session: https://claude.ai/code/session_01QSeKYkkwuF6UuFtu85Yd5H Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H Finalized head for L1 · 2026-11-24T23:41Z ·
|
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — REWORK · L1 · head
|
…rmission-fullscreen
|
repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H Finalized head for delta L1 + delta contract review · 2026-11-25T03:35Z ·
|
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ Contract reviewServed-tier: Delta review of this head on the FAIL at ① Derived judgmentsPublished i18n: api-surface baselines and accept sets: no change. Nothing in M1 (closed) — the old address of a set a read-only base's pair adds now opens at the pair.
The mechanism (spec rule vs. the surface's
Loading and failure states:
S1 (closed) — the sharing chip's leave guard is pinned with a dirty matrix.
N1 (closed) — N2 (nit) — the landing's failed-read path is pinned only through the pure ② Semver level
③ Boundary flags
Implemented-by: No must-fix, no should-fix. VERDICT: PASS |
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — ACCEPT · L1 · head
|
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 维护者速读
Hand-off · 2026-11-25T03:41Z · @os-zhuang — PR #37089 (card #36905) is ready for your review. Tier H by size (5,223 changed lines; ruling 7145880574). Seat ACCEPT 7152152994 and contract review PASS 7152146345 (TIER_DEFAULT), Head-sha |
#37089 (the permission designer) landed first: one designer-page list now holds both types, AREA_DESIGNER_PAGE_TYPES = ['permission', 'object']. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSeKYoFqGdRM9Qmg7M2o2B
…r beside the flow designer) Claude-Session: https://claude.ai/code/session_01QSeKYnHH41MS5hWVGPia4F Co-authored-by: Claude <noreply@anthropic.com>
…ge say Platform / Access, like the menu (objectstack-ai#37121) Fixes objectstack-ai#37082 Clause-②: no Metadata-protocol: none ## 维护者速读 - Studio 里「全部元数据」目录页的分组标题、筛选标签和类型页头部的分组徽标,从「系统 / 安全」改成和左侧菜单一样的「平台 / 访问」;系统设置里数据源页面的徽标也随之改为「平台」。 - 属于 Studio 重构的收尾:同一个 Studio 里同一组不再有两种叫法,组名以修订后的 Studio 信息架构决策为准。 - 出错只会让分组名称显示不对,不影响数据和权限,直接撤回这个改动即可恢复。 - 请确认系统设置里数据源页面的徽标显示「平台 / Platform」可以接受(它在决策里就属于「平台」这一组)。 ## What changes - **Route (a): the shared dictionary is renamed.** `DOMAIN_LABELS_EN` / `DOMAIN_LABELS_ZH` in `ui/packages/app-shell/src/views/metadata-admin/i18n.ts` (read through `translateMetadataDomain`) now draw `system` as Platform / 平台 and `security` as Access / 访问, the group names of ADR-0084 as amended. The dictionary carries exactly two locales (en, zh); both changed. - **The menu reads the dictionary.** `studioMenuGroupLabel` now returns `translateMetadataDomain(group, locale)`; its two menu-only keys `engine.studio.menu.groupSystem` / `engine.studio.menu.groupSecurity` are removed from the `studio` namespace (en and zh), since nothing reads them any more. The function stays as the menu's named seam, so `StudioMenu.tsx` is untouched. - `studioMenuModel.ts`: one doc comment that said the dictionary keeps System / Security is corrected (this change made it false). ### Route choice and the readers, before and after Every reader of `translateMetadataDomain`, measured on `origin/main` 9d70768 (`git grep` over the whole monorepo, plus a GitHub code search across the org: no hit outside this repo; `@object-ui/app-shell` is `private`, so the re-export at `metadata-admin/index.ts` has no external consumer): | Reader | Surface | Before | After | |---|---|---|---| | `DirectoryPage.tsx` chips | Studio, All metadata | System / 系统, Security / 安全 | Platform / 平台, Access / 访问 | | `DirectoryPage.tsx` group headings | Studio, All metadata | System / 系统, Security / 安全 | Platform / 平台, Access / 访问 | | `PageShell.tsx` badge (list header and compact item header) | Studio type and item pages | System / 系统, Security / 安全 | Platform / 平台, Access / 访问 | | `PageShell.tsx` badge | **Setup's datasource pages** (the one kept type: `SETUP_KEPT_METADATA_TYPE = 'datasource'`, rendered in place by `MetadataResourceEditPage`) | System / 系统 | Platform / 平台 | | `studioMenuGroupLabel` | Studio left menu | Platform / 平台, Access / 访问 (own keys) | unchanged words, now from the dictionary | The only non-Studio surface is Setup's datasource badge. It names the same group: the badge shows the type's registered domain, and ADR-0084's amendment says in its type-to-group table and its third reading that a `datasource` is **found under 平台 Platform** (its item opens in Setup per ADR-0146 D1, but its group is Platform). So route (a) changes what that surface says to the group name the ADR gives it, not to a different concept; route (b) would keep two words for one group, the inconsistency this card closes. No `security`-domain type is kept in Setup, so Access appears on Studio surfaces only. ## Tests - New pin `ui/packages/app-shell/src/views/metadata-admin/DirectoryPage.groupNames-37082.test.tsx`, over the real directory page and the real `PageShell`, for **en and zh-CN** (`describe.each`): the directory's group headings, the domain chips, the type page badge (list header) and the item page badge (compact header, the one Setup's datasource item page draws). Each word is compared with the menu's own (`studioMenuGroupLabel`) and with the literal Platform / 平台, Access / 访问; CONTROL: `data` stays Data / 数据, and System / 系统, Security / 安全 are drawn nowhere. - `studioMenuModel.test.ts`: the old "dictionary keeps System / Security" case is replaced by "the menu draws each group with the dictionary's word, en and zh-CN". - Two existing pins read the old words and are updated: `PageShell.narrowHeader-12306.test.tsx` (badge text Security to Access) and `StudioDesignSurface.accessSegment-12452.test.tsx` (the Access label now from `translateMetadataDomain`, since the removed key is gone). - Ablation (one-time, through `scripts/ablation-replace.mjs`, restored to the HEAD blob): the zh `system` value set back to 系统 turned 6 cases red (the five zh-CN cases of the new pin and the menu case in `studioMenuModel.test.ts`), en stayed green; restore verified blob == HEAD and `git diff HEAD` empty. ## Acceptance notes - `DOMAIN_LABELS_*` also carry a UI-local `platform` key that already read Platform / 平台. No producer sets `domain: 'platform'` (the spec's `domain` enum is data, ui, automation, system, security, ai; `git grep` finds no UI registration with it), so the two cannot meet in one directory today. Noted, not changed. - File surface: beyond the claim's list, two existing test files that pin the old words (above) and one doc comment in `studioMenuModel.ts` were edited, because this change made them false. ## Verification Two-minute check: open Studio, All metadata, in zh-CN. The left menu, the chips and the section headings all read 平台 and 访问; open a permission set and its header badge reads 访问 (Access in en). Read first, by risk: 1. `ui/packages/app-shell/src/views/metadata-admin/i18n.ts`, the two renamed values in each `DOMAIN_LABELS_*` table (the change that reaches Setup's datasource badge). 2. `ui/packages/app-shell/src/views/studio-design/studioMenuGroupLabel.ts`, the menu now reading the dictionary. 3. `ui/packages/app-shell/src/views/metadata-admin/DirectoryPage.groupNames-37082.test.tsx`, the en and zh-CN pin. <details><summary>Local readings on head b5fb875</summary> - Targeted tests (from `ui/`, under the verify lock): the new pin, `PageShell.narrowHeader-12306`, `DirectoryPage.stateVocabulary-29705` and all of `packages/app-shell/src/views/studio-design/`: `Test Files 303 passed (303)`, `Tests 2299 passed (2299)`, `VERDICT command-exit 0`. - `pnpm --filter @object-ui/app-shell --filter @object-ui/i18n run type-check`: both packages echoed `type-check`, `VERDICT command-exit 0`. - `node scripts/pm/dispatch-gates.mjs --commands`: 38 derived families, all exit 0; `--ran` reconciliation: `38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN` (a derived zero, every line with its exit code). Among them `pnpm --dir ui exec vitest run scripts/`: `Test Files 172 passed | 2 skipped (174)`. - Also run: `pnpm --dir ui run check:i18n-dead-keys`, `check:i18n-keys`, `check:i18n-drift`: exit 0 each. - `node scripts/pm/overlap-check.mjs`: `VERDICT clean exit 0` (merges cleanly with origin/main and with objectstack-ai#37089, which shares three studio-design files). - Lint, the full UI suite and the type-check lanes are CI's. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01QSeKYkkwuF6UuFtu85Yd5H)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
… and items (objectstack-ai#37108) Fixes objectstack-ai#36900 Part of objectstack-ai#36890 Clause-②: no Metadata-protocol: none repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H ## 维护者速读 - 在 Studio 的任何设计页面(包括「全部元数据」跨包页)按 ⌘K / Ctrl+K,都能打开搜索面板:按左侧菜单的六组列出当前包的全部类型和每一项,选中即打开它的详情或设计器;页面上有没保存的修改时,会先问一句再走。 - 属于「Studio 重构」专题:去掉设计器左侧那一列后,作者靠 ×、‹ › 和 ⌘K 换到别的项;同时补回上一步左侧菜单改造时临时丢掉的跨包页 ⌘K。 - 出错时作者只是搜不到或打不开某一项,左侧菜单和列表照常可用;不动任何数据,直接撤回这次改动即可。 - 无。 ## What changes Head `7bbe1c54b`: 15 files, +1,679 / −92 against `main`, one PR for the card. REWORK round 1 (L1 7144125191) and its delta L1 ACCEPT (7147006586) are folded in below. `main` was merged in that round. **The command palette is mounted on every Studio design page.** `StudioDesignSurface` mounts it in its shell under its own `CommandPaletteProvider`, on a package's pillars and "All metadata" area, `~org` and `~all`. After objectstack-ai#36985 only the `/studio` landing had one, so `~all` had lost ⌘K (the hand-off's stated temporary regression); this restores it. A host that already mounts a palette above the surface keeps its own (`useCommandPaletteProviderMounted()`): the surface then mounts neither provider nor palette. - **What it lists on a package.** The left menu, group by group (`buildStudioMenu`, decision 11: Data, UI, Automation, Platform, Access, AI, under the menu's names). Each group holds the menu's own entries: each type's list, plus Organization flows, Default sharing, Diagnostics and Positions and permissions. Then come the items of every type the group lists, from the package and its `.custom` pair (ADR-0146 D3). - **Types.** The menu's own data, read once per page: `StudioMenuDataProvider` in the surface feeds both the menu and the palette (new `studioMenuData.ts`: the data hook, the context, the group icons and the entry names). The palette and the menu cannot disagree, and opening the palette re-reads neither types nor the diagnostics sweep. - **Items.** Each listed type's served list, read only while the palette is open, as its list page reads it (`include: listInclude`). The rows are kept by the list page's own rule (`scopeListRows`: the package, its pair, the type's list predicate) and named by the type's primary key. - **Customizations.** A customization item reads "Customization of PACKAGE NAME", never the pair's raw id. - **Other scopes.** On a package the palette no longer lists every package's objects and flows, because the package's own items replace them. The packages stay listed. `~org` and `~all` keep those lists and add their own menu entries. - **Where a pick opens.** Every address comes from `studioAddress.ts` (objectstack-ai#36895). An object, flow or permission set goes through `studioItemPath`, so it opens its designer today and follows each designer card's `STUDIO_ITEM_PILLAR` switch with no edit here. Any other item opens `studioMetadataItemAddress(…, ?package=OWNER)`, the address its list row links to (ADR-0048). A menu entry goes to the menu entry's own `to`. - **How it leaves (decision 12): through the shell's unsaved-edits seam (M1).** `openStudioPaletteAddress` handles another page through `confirmUnsavedLeave`. That seam holds the surface's own work and every editor that registered its own, the "All metadata" item page (`ResourceEditPage`) among them; the surface's own bit never saw that page's edits. The page already open on another query (Default sharing from the Access pillar) goes through `reenterPillar`. It asks, then remounts the pillar once the router shows the requested query (S5): the palette's own `?palette=` change comes first and no longer triggers it. The page already shown, palette keys aside, just closes the palette. - The surface's `confirmLeavePillar` now goes through the same seam, so its own header departures ask about the item page's edits too: Back to app, the retired-Interfaces notice, the other-pillar `requestSurface` and the Access opener. They had the same blind spot; it is closed here, and no defect card is owed. - **The palette stays free of Studio reads.** `CommandPalette`'s `studio` scope takes an optional `surface` (`packageScope`, `renderGroups`, `open`), documented in the app-shell README. The page draws its own groups (`StudioPaletteGroups`), so the Studio modules load with the Studio chunk, never with the console's eager closure. `@object-ui/app-shell` is private, so the new optional prop and exported types widen no published surface: `Clause-②: no`. - **N4.** `ResourceEditPage`'s fullscreen Escape now ignores an Escape a dialog above it already took (`defaultPrevented`, which Radix sets), so closing the palette over a fullscreen editor no longer also leaves fullscreen. - **Card item 1 (`advertisedShortcuts.ts`)** needs no edit. `CommandPaletteProvider` already advertises ⌘K (`useAdvertiseShortcut(OPEN_COMMAND_PALETTE_SHORTCUT)`), and it now runs on every design page. - **Card item 4 (objectstack-ai#35308)**: the studio scope searches no record, so it has no record title. Items are titled by their served metadata label, as their lists show them, and no second title rule exists. Files: - New: `studio-design/studioPaletteModel.ts` (pure: pair, items, addresses, groups, departure, `openStudioPaletteAddress`), `studio-design/StudioPaletteGroups.tsx` (reads and draws) and `studio-design/studioMenuData.ts` (the menu's shared data and vocabulary). - `StudioMenu.tsx`: it gains `StudioMenuDataProvider`, draws the shared data when a provider above holds it, and otherwise reads its own. - `StudioDesignSurface.tsx`: changes are in its shell region only: the providers, the palette mount, `confirmLeavePillar`, `reenterPillar` and `openFromPalette`. - `StudioRoute.tsx` is unchanged. No i18n key is added. - `e2e/studio-left-menu-36899.spec.ts` stubs the menu's reads where they now live. Read first, by risk: 1. `ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx`: `confirmLeavePillar` (now the seam), the `reenterPillar` latch, `openFromPalette` / `paletteSurface`, and the provider wrap. It is the only edit to a shared file beyond `StudioMenu.tsx`. 2. `ui/packages/app-shell/src/views/studio-design/studioPaletteModel.ts`: `openStudioPaletteAddress` and `studioPaletteItemsOf` over `scopeListRows`. 3. `ui/packages/app-shell/src/views/studio-design/studioMenuData.ts` with `StudioMenu.tsx`: the shared data and the menu's own-read fallback. ## Tests - `studioPaletteModel-36900.test.ts` (15 cases). It pins: - the pair; - items through `scopeListRows`: unwrapped, scoped, deduped and named by the primary key, with the list predicate applied; - pillar types following `studioItemPath` for every `STUDIO_ITEM_PILLAR` row, and other types on their area page with `?package=OWNER`; - the menu's six groups; - the leave / re-enter / stay decision; - M1 at the unit: with an editor registered, a leave asks its question (Cancel stays, OK goes), with a CONTROL that nothing registered asks nothing; re-entry hands the host the query to wait for. - `StudioPaletteGroups.surfaceScope-36900.test.tsx` (11 cases): the real `CommandPalette` + `CommandPaletteProvider` + `StudioMenuDataProvider` + `StudioPaletteGroups`, with the metadata reads doubled at the menu's own seam. It pins: - group headings and order, menu entries, and the package's and pair's items; - the list read's `include` and list predicate; - "Customization of" the package's name, with no `.custom` text shown; - no cross-package object or flow on a package; - addresses handed to `surface.open`, and matching; - "Searching…" then "No results", and a query typed before the lists answer: the arriving row is selected and Enter opens it; - no item list read until open, with its CONTROL; - `~all`. - `StudioDesignSurface.metadataArea-28561.test.tsx`: 7 new cases on the real surface. - Ctrl+K on a pillar, on `~all` and on a missing package. - **M1**: with the "All metadata" item page holding registered edits, a palette pick asks the page's question (Cancel keeps the page, OK leaves), and Back to app asks too. CONTROL: a clean page leaves at once. - **S5**: Default sharing picked on the real Access pillar shows the overview at `?surface=owd%3Aoverview`. - `ResourceEditPage.leaveGuard-13231.test.tsx` (2 new cases): **M1 on the real `ResourceEditPage`** with a dirty draft and the real palette leaving through `openStudioPaletteAddress`. Cancel keeps the page and the draft, OK leaves, and a CONTROL clean page leaves without asking. - `ResourceEditPage.detailTabs-36901.test.tsx` (1 new case): **N4**, an Escape a dialog took leaves the fullscreen and the page alone, with its CONTROL. <details><summary>Local readings, head 5e181ef / 7bbe1c5</summary> - Touched and related files at 5e181ef (new pins, StudioMenu, studioMenuModel, the address guard, all 16 `CommandPalette.*`, every console `StudioRoute*`): `Test Files 31 passed (31)`, `Tests 249 passed (249)`, lock `VERDICT command-exit 0`. 7bbe1c5 changes the e2e spec only. - All 83 `StudioDesignSurface.*.test.tsx` (at cf95fe5; later commits change no surface file): `Test Files 43 passed (43)`, `Tests 236 passed (236)` and `Test Files 40 passed (40)`, `Tests 217 passed (217)`. - `@object-ui/app-shell` `type-check` (both programs) and `type-check:e2e`: exit 0. `e2e/studio-left-menu-36899.spec.ts`, local: `3 passed`. - `pnpm --dir ui exec vitest run scripts/`: `Test Files 172 passed | 2 skipped (174)`. - Derived gate families (`dispatch-gates.mjs --commands`, 39): all exit 0 on the final tree; `--ran`: `39 derived, 39 run, 0 NOT-MEASURED, 0 UNRUN`. `check:new-line-citations` (ui): `0 new citation(s)`. eslint on the changed ui files: 0 errors, none in the new modules. - `overlap-check.mjs` before every push of the round: `VERDICT clean exit 0`. - CI at 7bbe1c5: 38 success, 13 expected skips, 0 failed. </details> <details><summary>Ablations (scripts/ablation-replace.mjs, each restored to HEAD: blob == HEAD, git diff HEAD empty)</summary> - A1, the seam dropped from the palette's leave (`confirmUnsavedLeave(() => act.navigate(to))` → `act.navigate(to)`): `Tests 3 failed | 33 passed`. The three M1 pins (real `ResourceEditPage`, surface, unit) go red. - A2, the seam dropped from `confirmLeavePillar`: `Tests 1 failed | 13 passed` (Back to app). - A3, the re-entry latch back to "the next query change": stays green (`14 passed`). Under test the palette's close and the navigation land in one render, so no pin tells the latch from the old trigger. The latch guards the ordering the code's own comment warns about: the router applying a navigation in a later render. - A4, a first-row selection added during the round: green in happy-dom and no effect live (a live probe with it removed). It was taken out again, so it is not on this head. - Round 0: the package-scope cross-package guard (`Tests 1 failed | 9 passed`) and the surface's palette mount (`Tests 3 failed | 7 passed`). </details> ## Acceptance notes - **Live walk-through, showcase leg: passed** (PR comment 7145761753). A real build, backend `--fresh`, and the Console dev server serving app-shell from `src` at this head, driven by headless Chromium as a person would. - One non-first item each of object, flow, permission set, hook and dashboard, found by label and opened at its list-row address with its label on the page. The object pick re-enters the Data page. - Ctrl+K on the cross-package catalog. - **M1** on a real item page with an unsaved edit: the pick asks once, Cancel keeps the page and the edit, Back to app asks, OK leaves. - **S5**: Default sharing from the Access page shows the overview. - **HotCRM leg: carried by objectstack-ai#36910** (the joint walk-through card); this container has no HotCRM stack. - N1: `MetadataQuickFind` on ⌘⇧M (`DirectoryPage`) is a second item finder beside ⌘K; a follow-up retires or routes it. - N2: each open of the palette on a package reads one item list per listed type (the menu's types and counts are shared and not re-read). The client shares only in-flight reads. Draft-only items are not listed. - N5: nothing inside Studio advertises ⌘K. Studio's own header draws no search trigger, and the help dialog that lists advertised shortcuts is mounted only inside apps. - N6: `useStudioMenuTypes` no longer memoizes `types`, and the provider value is a new object each render. The palette's reads key on the type names, so this costs re-renders only. - N7: while the package entry loads, the customization label briefly names the base package by its id. - N8: the changeset's English body carries the six group names in Chinese too, beside the English. - Walk observation: with zero delay between Escape and the next Ctrl+K (automated), a query typed before the lists answered left no row highlighted. With no earlier close, or with a 1 s gap, it worked every time measured. This is synthetic timing, not filed. - objectstack-ai#36784 (paused, pre-split) conflicts in `StudioDesignSurface.tsx` against `main` itself; this branch merges cleanly with `main` and objectstack-ai#37089. ## Verification Two minutes: open any package in Studio (`/studio/PKG/data`), press ⌘K (Ctrl+K), type part of a dashboard's or hook's name, and press Enter. The palette lists the six menu groups and the item; Enter opens `/studio/PKG/metadata/TYPE/NAME?package=OWNER`. Edit a field on that item page without saving, then pick another entry: the leave prompt appears first, and Cancel keeps the edit. <details><summary>Where to look in code</summary> - Leave path: `openStudioPaletteAddress` (model) and `confirmLeavePillar` / `reenterPillar` / `openFromPalette` (surface). - Groups: `StudioPaletteGroups` (reads) over `useStudioMenuData` and `buildStudioPaletteGroups` / `studioPaletteItemAddress` (pure). </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01QSeKYkkwuF6UuFtu85Yd5H)_ <!-- signed: repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…dio-design reads and writes send the stored bearer token (objectstack-ai#37185) Fixes objectstack-ai#37080 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:浏览器里只剩登录令牌(会话 Cookie 被替换、拦截或清掉)的用户,侧边栏、应用头部、命令面板和 Studio 入口里的应用包列表不再消失,AI 对话列表、建议权限绑定、提交历史、草稿面板等也正常加载;只用 Cookie 登录的用户看不到任何变化。 - 为什么做:控制台其它请求都会带上登录令牌,这一批读写漏带,属于"控制台登录状态体验"这一块的缺陷,替所有处于这种登录状态的用户解决,并加了一道测试防止以后再写出漏带令牌的请求。 - 出错会怎样:最坏情况是这些地方重新读不到数据,与修复前一样;不改服务端接受什么、不改登录方式,可以直接撤回。 - 要你做什么:无。 ## What changes Same-server `/api/` reads and writes in app-shell and the console that called the bare global `fetch` with `credentials: 'include'` (the session cookie and nothing else) now go through `createAuthenticatedFetch` from `@object-ui/auth`, exactly as objectstack-ai#37077 did for the Setup pages: built per call (`createAuthenticatedFetch()(input, init)`, a local `authFetch` in each module), `credentials: 'include'` kept on every call, so the cookie still rides along and a `401` now reaches the console's session-ended check. No second auth-fetch helper and no new export. Nothing changes in what the server accepts. The measured case: under a bearer-only session, `readPackagesPayload` (`GET /api/v1/packages`, the session's held package list read by the sidebar, the app header, the command palette and the Studio entries) sends the bearer and the list loads (pinned below). ### The family, measured at `origin/main` 63ab479 79 non-test files under `ui/packages/app-shell/src` and `ui/apps/console/src` contain `credentials: 'include'`. Read call by call (AST scan of every `credentials: 'include'` property and the call it is handed to): **Converted here: 64 calls in 39 files.** | File | Calls | |---|---| | `app-shell/.../studio-design/packages-io.ts` | `readPackagesPayload` (`GET /api/v1/packages`, the measured case), `ensureCustomizationPackage`, `duplicatePackage` | | `app-shell/.../studio-design/packageCustomizations-io.ts`, `PackageSwitcher.tsx`, `AutomationsPillar.tsx`, `FlowItemMoreMenu.tsx` | 1 each (customizations read, switcher list, automation status, flow clone) | | `app-shell/src/hooks/useConversationList.ts` | 4 (list, detail, rename, delete) | | `app-shell/src/hooks/useChatConversation.ts` | 3 (read, create, update) | | `app-shell/src/console/ai/buildDebugApi.ts` | 1 (build-debug report) | | `app-shell/src/hooks/useAiUsage.ts` | 1 | | `app-shell/src/services/suggestedBindingsApi.ts` | 4 (list, confirm, dismiss, reopen) | | `app-shell/src/preview/commitHistory.ts` | 2 (timeline, revert) | | `app-shell/src/preview/DraftChangesPanel.tsx`, `UnpublishedAppBar.tsx`, `usePendingDrafts.ts` | 2, 1, 1 | | `app-shell/src/preview/flowDraftChecks.ts` | the default transport (`opts.fetchImpl ?? createAuthenticatedFetch()`) | | `app-shell/src/views/changeOwner.ts` | the fallback transport (`apiFetch ?? createAuthenticatedFetch()`) | | `app-shell/src/views/metadata-admin/` `PackageFormDialog.tsx`, `catalog-activation.ts`, `permission-set-clone.ts`, `sharing-rule-catalog.ts` | 1, 2, 1, 1 | | `app-shell/src/views/metadata-admin/inspectors/` `FlowReferenceField.tsx`, `connector-input-fields.ts` | 2, 1 | | `app-shell/src/views/metadata-admin/previews/` `FlowRunsPanel.tsx`, `useFlowNodePalette.ts`, `PagePreview.tsx` | 1, 1, 2 | | `app-shell/src/views/setup/` `packagedActionLedger.ts`, `packagedFlowLedger.ts` | 2, 1 | | `app-shell/src/hooks/` `useRecordApprovals.ts`, `sharedUserFeeds.ts`, `useInboxBell.ts` | 1 each | | `app-shell/src/console/` `AppNoAccessEmptyState.tsx`, `connect/ConnectAgentWidget.tsx`, `deployment-notice/deploymentNoticeState.ts` | 1, 2, 2 | | `app-shell/src/console/marketplace/marketplaceApi.ts` | 5 same-server calls onto the existing `serverFetch` (`/cloud-connection/install`, `install-namespace`, `installation`, and on the control plane its own `install_package` action and installed-state route) | | `app-shell/src/layout/designModeMenuSave.ts` | 1 (`/api/v1/i18n/locales`) | | `app-shell/src/layout/ContextSelectors.tsx` | 1, with `{ sameOriginOnly: true }`: the endpoint is author-written (`optionsSource.endpoint`) and may name another host | | `console/src/pages/developer/` `AgentConnectSection.tsx`, `IntegrationsPage.tsx` | 2, 1 | | `console/src/pages/auth/DeviceAuthPage.tsx` | 3 (claim, approve, deny: a signed-in act) | Of the card's named ones: `packages-io.ts` `readPackagesPayload`, `useConversationList`, `useChatConversation`, `suggestedBindingsApi` and the studio-design writes (ensure-customization, duplicate, customizations, flow clone) are all converted. `suggestedBindingsApi`, `useRecordApprovals`, `sharedUserFeeds`, `useInboxBell`, `ConnectAgentWidget`, `deploymentNoticeState` and three `marketplaceApi` calls already set the bearer header by hand (`authHeaders` / `bearerAuthHeaders` / `withEnvAuth`), so those were not cookie-only; they are converted anyway for the session-ended check and the one mechanism, and their hand-rolled header is left in place (the wrapper sets the same value). **Already authenticated or injected (not the family): 24 files.** `settings/api.ts`, `AuditLogPage.tsx`, `approvalsApi.ts`, `studioEntry.ts`, `ExcelImportBar.tsx`, `CloudAiModelStatus.tsx`, `useEnvironmentEntitlements.ts`, `storageUsageEndpoint.ts`, `ImpersonationBanner.tsx`, `useImpersonationExit.ts`, `RecordAttachmentsPanel.tsx`, `RecordDetailView.tsx`, `useConsoleActionRuntime.tsx`, `AccessExplainPanel.tsx`, `MetadataTypeActions.tsx`, `PackagesPage.tsx`, `DatasourceResourcePage.tsx`, `personalViews.ts`, `connectorConnections.ts`, `connectorCredentials.ts`, and the injected transports of `myPreferences.ts`, `slackDoors.ts`, `orgEnvironments.ts`, `useLauncherApps.tsx`. `App.tsx` names the string in a comment only. **Left, on the pin's shrink-only list: 21 calls in 15 files**, each with its reason in the pin (`sameServerFetch.bearer.ratchet.test.ts`, `ALLOWED`): - `console/src/LocalizationFetchProvider.tsx` (1) and `console/src/languageSeed.ts` (not counted by the pin: it hands `sharedGetJson` a transport argument that may be `undefined`): the boot read of `/api/v1/auth/me/localization`, shared in flight by a key built from the init with the early request `index.html` sends. A session it cannot see reads `authenticated: false` and falls back to the browser language rather than failing. Its transport is its own decision (Acceptance notes). - `console/src/components/FormPage.tsx` (1): the bare channel is the public form route's on purpose. - `console/src/lib/auth-preflight.ts`, `console/src/lib/early-discovery.ts` (1 each): set the bearer header themselves on purpose. - `console/src/pages/auth/OAuthConsentPage.tsx` (3), `followAuthorize.ts` (1), `handoffClientName.ts` (1): the OAuth hand-off, whose authorize step is a top-level navigation that can only carry the cookie. - `console/src/pages/auth/SetupPage.tsx`, `app-shell/src/console/auth/bootstrapStatus.ts`, `console/src/pages/auth/VerifyEmailPage.tsx`, `app-shell/src/chrome/ConditionalAuthWrapper.tsx`, `app-shell/src/runtime-config.ts` (1 each): read before or without a session. - `app-shell/src/console/ai/AiChatPage.tsx` (1): an open PR (objectstack-ai#37123) edits this file; its call moves with that work. - `app-shell/src/console/marketplace/marketplaceApi.ts` (5): each targets `getCloudBase() || SERVER_URL`, the cloud control plane's own origin whenever one is configured, which must never see this runtime's bearer. - `app-shell/src/views/metadata-admin/previews/ActionPreview.tsx` (1): the test request of an `api` action preview, sent to the author-written target; its transport is not decided here. The other two fenced files hold no family call: `RecordDetailView.tsx` and `useConsoleActionRuntime.tsx` already route every `credentials: 'include'` call through their `authFetch`. Neither was edited. ## Tests - `ui/packages/app-shell/src/sameServerFetch.bearer.ratchet.test.ts` (new, the enumeration pin; runs in **Test UI**, app-shell's `unit` project): parses every non-test source file of both trees with the TypeScript parser and refuses a bare cookie-only call (the transport is the global `fetch`, `window.fetch`, `globalThis.fetch`, `self.fetch`, one of those as a `??` / `||` fallback, or `sharedGetJson` without its transport argument; the init carries `credentials: 'include'`, inline or as a `const` of the file, `as const` included). The URL is not judged: a call that must stay bare is a counted row with its reason. Four cases: the scan reads both trees (more than 500 and 100 files); a 13-case detector battery (each bare spelling found, each authenticated one not); every bare call is a counted row; every row is still exact (a file that sheds a call must shrink its row). - `ui/packages/app-shell/src/views/studio-design/packages-io.bearerSession.test.ts` (new): against a server that refuses any request without the bearer, with a token stored, `fetchPackages` loads the list and its one request carries `Authorization: Bearer TOKEN` and `credentials: 'include'`; `fetchListedPackageIds` likewise; the duplicate write, the commit timeline and revert, suggested bindings and the build-debug report carry the bearer. Each with a cookie-only control (no token stored: no `Authorization`, `credentials: 'include'`). Test doubles that moved (118 files, no assertion weakened): - 102 files: hand-rolled `Response` doubles (`{ ok, status, json }`) gain `headers: new Headers()`, the headers a real `Response` carries and the authenticated fetch reads (`set-auth-token`), as objectstack-ai#37077 did. The 102nd, `StudioPaletteGroups.surfaceScope-36900` (the command-palette suite that reached `main` after round 0), doubles `GET /api/v1/packages`: without the headers the converted `readPackagesPayload` threw on the double and the palette drew no Packages group. For `fetchInstalledPackageRow-7881` and `StudioDesignSurface.readOnlyPosture-12453` the headers are added at the one stub instead of each answer. - 8 files whose `@object-ui/auth` mock answered `createAuthenticatedFetch: () => vi.fn()` (a transport that answers nothing) now hand the authenticated fetch's requests to the global `fetch` the file already stubs: the four `RecordApprovalsPanel` suites and `RecordDetailView` `editLockedByState-32756`, `phoneFace-27058`, `userActionPredicates`, `harness`. - 5 `RecordDetailView` approval suites whose `authFetchSpy` stands for the action door: approvals reads (now through the authenticated fetch too) are handed to the file's wire double, as before (`approvalRecallGate`, `accessEndedAfterDecision-26589`, `approvalDeclaredActions`, `approvalLock-12220`, `approvalLock-25934`). - `StudioRoute.searchPalette-11863` (console): its auth mock answers the Studio permissions read and hands every other request (the package list) to the wire double. - 3 assertions read the init the wire received (the last two files are also among the 101): `useConversationList` and `BuildDebugDrawer` assert `{ credentials: 'include', headers: expect.any(Headers) }` (exact keys, as before); `DraftChangesPanel.flowChecks-34818` reads `Accept-Language` off a `Headers`. - `RecordDetailView.headerApiInterpolation`: the flow-trigger case asserts exactly one call to the trigger door, filtered by its path, since the page's own reads now share that spy. ## Acceptance notes - Same defect family outside the two trees, not touched (the card scopes the `plugin-*` hooks out unless measured here): `credentials: 'include'` with the bare `fetch` remains in `ui/packages/plugin-chatbot` (`useAgents`, `useAiModels`, `useHitlInChat`, `usePendingActions`), `plugin-detail` (`queueClaim`, `stageChangeStarts`, `useRecordEditable`), `plugin-grid` (`useRecordCrudVerdicts`, `useRowApprovalLocks`), `plugin-dashboard` (`DatasetWidget`), `plugin-charts` (`ObjectChart`), `fields` (`ShareableObjectRefField`, `preferenceOptions`), `components` (`ShareDialog`) and `permissions` (`MePermissionsProvider`). Not each read call by call. - A bare `fetch('/api/…')` with no init at all is cookie-only as well (the default `same-origin` credentials) and is outside the pin's spelling: `views/metadata-admin/widgets.tsx` `fetchFieldSelectorOptions` (`GET /api/v1/objects/:name/fields`). - `LocalizationFetchProvider` and `languageSeed` read `/api/v1/auth/me/localization` cookie-only; under a bearer-only session that read answers anonymously and the console falls back to the browser language instead of the user's own locale. Not measured in a browser; left because the request key is shared with the early request `index.html` sends. - The hand-rolled bearer helpers left beside converted calls (`authHeaders` in `suggestedBindingsApi`, `bearerAuthHeaders`, `withEnvAuth`) are now redundant there; not removed here. ## Verification <details><summary>The measured case and the pins (green at the head)</summary> `packages-io.bearerSession.test.ts` and the ratchet are in the rerun below (all green). The ratchet's detector battery first went red on a real detector issue: at a script's top level `await (x)(…)` parses as a call of `await`, so the `(apiFetch ?? fetch)` case read 0; the cases now run inside an async function. </details> <details><summary>Ablation: one conversion reverted, both pins red</summary> Through `scripts/ablation-replace.mjs` on `packages-io.ts`: anchor `const res = await authFetch('/api/v1/packages', {` hit 1 → 0, blob `d3c93d771344` → `42f8862ba05e`; the ratchet and the bearer-session file run under the lock: ```text FAIL sameServerFetch.bearer.ratchet.test.ts > every bare cookie-only call is a counted row of the shrink-only allow-list + "packages/app-shell/src/views/studio-design/packages-io.ts:398 :: fetch('/api/v1/packages', …)" FAIL packages-io.bearerSession.test.ts > loads the package list, sending the stored bearer beside the cookie FAIL packages-io.bearerSession.test.ts > answers the listed-id read from the same authenticated request Test Files 2 failed (2) Tests 3 failed | 14 passed (17) ``` The cookie-only control stayed green. Restored: blob `d3c93d771344` equal to `HEAD`, `git diff HEAD` empty. </details> <details><summary>Suites</summary> The whole `@object-ui/app-shell` and `@object-ui/console` suites, under the shared verify lock, in six shards (`cd ui && pnpm exec vitest run --maxWorkers=3 --shard=k/6 packages/app-shell apps/console`) at `32505939` (the final source; only test files changed after it). These are the readings BEFORE the doubles moved, and they are how the moved doubles were found: ```text shard 1/6: Test Files 21 failed | 440 passed (461) · Tests 121 failed | 4304 passed (4425) shard 2/6: Test Files 16 failed | 446 passed (462) · Tests 64 failed | 4352 passed | 1 skipped (4417) shard 3/6: Test Files 23 failed | 439 passed (462) · Tests 104 failed | 4111 passed (4215) shard 4/6: Test Files 17 failed | 445 passed | 1 skipped (463) · Tests 87 failed | 4383 passed | 8 skipped (4478) shard 5/6: Test Files 26 failed | 436 passed (462) · Tests 116 failed | 4636 passed (4752) shard 6/6: Test Files 14 failed | 448 passed (462) · Tests 77 failed | 4286 passed (4363) ``` The 117 failing files are exactly the 117 moved doubles. Each was re-run after its fix (the two new pin files with them): `Test Files 116 passed | 3 failed (119)`, then the three fixed again `Test Files 3 passed (3)`. After the last two type fixes `Test Files 2 passed (2)`, and after the collection-time imports the 34 files that gained one `Test Files 34 passed (34)` / `Tests 319 passed (319)`, at `5dde589a8c`. The 2,655 files that passed in the shards were not edited. A full re-run after the fixes was not done locally (NOT MEASURED, reason: about 90 minutes of shared lock); Test UI runs the full affected set on this PR. Type-check through turbo (dependency closure built): `@object-ui/app-shell` and `@object-ui/console` `type-check` `Tasks: 77 successful, 77 total` at `3080a68173`; `@object-ui/app-shell` again at `5dde589a8c` after the last test edits, `Tasks: 69 successful, 69 total`. The first run found two type errors in my test edits (a typed tuple, an object literal against a declared parameter type), fixed in `3080a68173`. `pnpm --dir ui exec vitest run scripts/` after building the seven `@objectstack` packages as Test UI does: `Test Files 172 passed | 2 skipped (174)`, `Tests 5131 passed | 2 skipped (5133)`. </details> <details><summary>Gates</summary> `node scripts/pm/dispatch-gates.mjs --commands` (no paths, merge base `63ab4794`): 39 families. All 39 run locally, each exit captured before any pipe; 37 lock-free families re-run at `5dde589a8c`, all exit 0; `pnpm check:type-check-debt` exit 0 (`0 raw tsc error(s) total, none above its recorded number`); the ui `scripts/` suite above exit 0. Reconciled: `dispatch-gates --ran`: `39 derived famil(ies) accounted for — 39 run, 0 NOT-MEASURED (a DERIVED zero)`. `check:test-source-alias` first went red on the edited suites (exit 1): 34 of them reach a dynamic `import('@objectstack/lint')`, `import('@objectstack/formula')` or `import('@object-ui/plugin-detail')` in the source under test with no collection-time load. Each gained the module-top side-effect import the gate prescribes (`5dde589a8c`), then exit 0. `overlap-check` before every push: at `4a990ef7` it merges cleanly with `origin/main` (`93bd4595`) and with objectstack-ai#37204, objectstack-ai#37188 and objectstack-ai#37148, and exits 1 on textual conflicts with three open Studio PRs that edit the same test files: objectstack-ai#37166, objectstack-ai#37168, objectstack-ai#37169 (in `StudioDesignSurface.*`, `BuilderLanding.*`, `CommandPalette.studioScope-11863`, `StudioRoute.searchPalette-11863`, and objectstack-ai#37166/objectstack-ai#37169 also in `PackageSwitcher.tsx`, `FlowItemMoreMenu.tsx`). Whichever lands second takes the merge. </details> <details><summary>Round 1: main merged at 3b4f0b9, re-measured at e055596</summary> CI at `5dde589a` was red on two causes, both from `main` moving (the ⌘K palette work): - `check:test-source-alias` exit 1: four edited suites (`StudioDesignSurface` `entryReadsOnce-11797`, `itemDraftLine-12725`, `notFound-26708`, `readOnlyPosture-12453`) now reach `import('@object-ui/plugin-detail')` through the surface's command palette and its record preview. Each gained the prescribed module-top `import '@object-ui/plugin-detail';` (38 files carry a collection-time import in all). Then exit 0. - `StudioPaletteGroups.surfaceScope-36900`: 3 failed, 8 passed; after its package-list double gained `headers` (above), 11 passed. No assertion changed. Readings at `e0555965`, under the shared verify lock: ```text ratchet + bearer-session pin + main's 35 incoming app-shell/console test files + the 5 edited files: Test Files 41 passed (41) · Tests 394 passed (394) whole @object-ui/app-shell + @object-ui/console (cd ui && pnpm exec vitest run --maxWorkers=3 packages/app-shell/ apps/console/): Test Files 1 failed | 2779 passed | 1 skipped (2781) · Tests 2 failed | 26745 passed | 9 skipped (26756) ``` The one failing file is `ReportNewPage-36692.test.tsx`, which this branch does not touch (nor its page); it passed 3 of 3 runs alone (`Tests 6 passed (6)` each). Its second failure received the first case's save call, late: its cases flush by `setTimeout(0)` rounds while the page loads its Han romanizer lazily, so on a loaded box the save can land after the case ends. `@object-ui/app-shell` `type-check` through turbo: `Tasks: 69 successful, 69 total`. `pnpm --dir ui exec vitest run scripts/`: `Test Files 172 passed | 2 skipped (174)`, `Tests 5131 passed | 2 skipped (5133)`. Gates: `dispatch-gates --commands` (merge base `3b4f0b98`): 39 families, all run, each exit captured before any pipe, all exit 0. `check:type-check-debt` first answered exit 3 (its closure build queued behind the suite above and never got the lock: not measured), then exit 0 under the lock (`0 raw tsc error(s) total, none above its recorded number`). `dispatch-gates --ran`: `39 derived famil(ies) accounted for — 39 run, 0 NOT-MEASURED (a DERIVED zero …)`. </details> ## Read first 1. `ui/packages/app-shell/src/sameServerFetch.bearer.ratchet.test.ts`: the detector and the `ALLOWED` rows (each reason is a claim about a call left bare). 2. `ui/packages/app-shell/src/layout/ContextSelectors.tsx`: the one conversion with `sameOriginOnly`, because its URL is author-written. 3. `ui/packages/app-shell/src/console/marketplace/marketplaceApi.ts`: which calls moved onto `serverFetch` and which stay bare because they may target the cloud origin. Two-minute check: `cd ui && pnpm exec vitest run packages/app-shell/src/sameServerFetch.bearer.ratchet.test.ts packages/app-shell/src/views/studio-design/packages-io.bearerSession.test.ts`, expect `Test Files 2 passed (2)`. <details><summary>Round 2: main merged at 93bd459, re-measured at 4a990ef</summary> - objectstack-ai#37089 landed on `main` after round 1 and left this PR conflicting in `StudioDesignSurface.notFound-26708` and `StudioDesignSurface.readOnlyPosture-12453`: both sides add the same `import '@object-ui/plugin-detail';` with a different comment. The merge (`48321c62`) keeps one import with `main`'s comment, so against `main` those two files differ only by round 0's doubles. - Main's ten new commits add no `credentials: 'include'` line under `ui/packages/app-shell/src` or `ui/apps/console/src`, and their one new hand-rolled Response double already carries `headers: new Headers()`. - The two changesets (`4a990ef7`) now name every converted door in user terms (flow clone, permission-set clone, page preview, the no-access state and the design-mode language list were missing) and claim only "the other same-server console requests", since the 21 listed calls stay cookie-only. Readings at `4a990ef7`, under the shared verify lock (`packages/spec` moved on `main`: the seven `@objectstack` packages Test UI builds were rebuilt first, and `pnpm --filter @objectstack/spec check:generated` reads `All 14 generated artifacts are up to date`): ```text the ratchet, the bearer-session pin, the 5 test files edited in round 1, every existing test file the merge touched in the two trees, and the suites named for each source file it touched: Test Files 311 passed (311) · Tests 2133 passed (2133) ``` `check:test-source-alias` exit 0. `@object-ui/app-shell` `type-check` through turbo: `Tasks: 69 successful, 69 total`. `dispatch-gates --commands` (merge base `93bd4595`): the same 39 families, all run, each exit captured before any pipe, all exit 0 (`check:type-check-debt`: `0 raw tsc error(s) total, none above its recorded number`; the ui `scripts/` suite `Test Files 172 passed | 2 skipped (174)`). `dispatch-gates --ran`: `39 derived famil(ies) accounted for — 39 run, 0 NOT-MEASURED (a DERIVED zero …)`. The whole app-shell and console suites were not re-run this round (NOT MEASURED, reason: about 70 minutes of shared lock for a merge that changed no source line of this PR); Test UI runs the affected set on this PR. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D)_ <!-- signed: repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…ddress, tabs in objectstack-ai#36513's order (objectstack-ai#37168) Fixes objectstack-ai#36904 Refs objectstack-ai#36513 (its section 一, the tab order, is delivered here; its section 二 was superseded by epic objectstack-ai#36890) Clause-②: no Metadata-protocol: none ## 维护者速读 - Studio 里点开一个对象,设计器在右侧整屏打开,有自己的地址;左上角 × 回对象列表,右上角 ‹ › 看上一个、下一个,设计器左边那一列对象列表没有了。 - 这是 Studio 改版专题里的对象设计器一张,也按之前定的把对象页签排成:记录、字段布局、验证、操作、设置、钩子、API。 - 出错时管理员会打不开或改不了对象(Studio 最常用的路径),旧链接也会落到对象列表;整张合并即可撤回。 - 这张约 4200 行(4,177 行),超过 3000 行:其中删掉的测试约 1700 行(六个整份删掉的测试文件约 1000 行,测的是左侧列表、页内新建、空包页面和实时请求,这些本卡都去掉了),改写和新增的测试约 1000 行,产品代码约 1400 行;需要您审核后合并。 ## What changes - **The object designer is full-screen on the object's address**, `/studio/PKG/metadata/object/NAME`, mounted by the "All metadata" area (`StudioMetadataArea`). The area decides it with the zone's shared designer-page helper from objectstack-ai#37089: `AREA_DESIGNER_PAGE_TYPES`, `areaItemOpensDesignerPage({ packageId, type })` and `areaDesignerItemOf(pathname, segment)`, which reads `new` as the create page, never an item. objectstack-ai#37089 landed first; this branch merged main, so the one list now holds both types, `['permission', 'object']`, and `AreaItemOpen` mounts the permission set's matrix or the object designer by type. For an object, the environment scope and `?review=1` keep the generic page, as the pillar did (`areaItemAsksGenericPage`, shared with `areaItemPillarPath`); the permission page keeps objectstack-ai#37089's behaviour and opens on any query. The header is the shared full-screen item header (`ResourceDetailHeader`): × back to the object list with the list's filter and sort, ‹ › through the list, Esc. No switcher, no "open in app" (epic decision 7). - **No left list, no in-page New.** `DataPillar` takes `objectName` and designs that one object: the object rail, its search and customization filter, the in-page 新建 dialog and the empty-package state are gone. Creating an object is the object list's 「新建」 (`MetadataListCreateDialog`, objectstack-ai#36897), which already has the OWD choice, the app-menu join and the read-only base's `.custom` landing; checked before deleting this copy. - **Tabs in objectstack-ai#36513's order**, verbatim: 记录、字段布局、验证、操作、设置、钩子、API (`objectDesignerTabs.ts`). Narrow columns fold Hooks and API into "Advanced" first (below 1200px), then the other three (below 1000px); each trigger's menu lists only what is folded at its width (`dataTabsFold.ts`). The five header icons became tabs through the shared `ItemToolTabs` (hand-off brief): References, History (audit log inside), Source (layers inside). The open tab is `?tab=` in the address, carried by ‹ ›. - **The address switch.** `object` leaves `STUDIO_ITEM_PILLAR`, so every `studioItemPath` producer opens the new address: the app's 「对象设置」 (`appStudioObjectPath`), the record page's 「配置页面」 (`recordTabsStudioPath`), ⌘K, the AI artifact link, and the switched-off action link (`?action=NAME` on the new address). `/studio/PKG/data` redirects (`dataPillarRedirect`): with `?surface=object:NAME` to that object's designer (`?action=` kept; `?view=`, `?nav=` dropped), otherwise to the object list (`?changes=review`, the server's draft-review link, kept). A `.custom` pair's old address lands on the pair's own area. An object request from the Changes sheet navigates to the object's address in the package that holds the draft (`draftScope`: on a read-only base, its `.custom` pair). - **`AreaHistoryRedirect`:** objects no longer take the designer-item exemption (`/metadata/object/NAME/history` opens the designer's History tab). The line itself stays for flows until objectstack-ai#36903; removing it now would send a flow's history to the flow pillar and lose it. - Kept as the card asks: the copilot's 「对象 · 页签」 chip and the AI-change line. The copilot read the open item only from `?surface=`, which the new address does not carry, so it now also reads it from the designer's address (`areaDesignerItemOf`, as objectstack-ai#37089 does). - Fixed on the way: a partly refused AI-drafts discard kept its message for one render only (the object re-read the discard triggers cleared `error`); it is now its own state. The retired-Interfaces notice is latched on the landing path, not the pillar, since the home is the area's object list now. ### This rework round (L1 7149684173) - **M1:** the rail-switch suite's four cases are carried onto the designer's × and › on the real surface (`StudioDesignSurface.heldDataLeave-26705`, new top-level describe): an unsaved edit that is not held asks on › and ×; an edit whose Save was refused asks; a saved edit leaves without asking; nothing pending leaves at once and sends nothing. - **S2:** the Changes-sheet object link uses `draftScope ?? packageId` (`StudioDesignSurface.tsx`), pinned in `heldDataCreate-26845` (a read-only base with a listed pair lands on the pair's address). - **S3:** `/metadata/object/X/history` opens the designer on History (`StudioMetadataArea.routes-28561`); `?tab=hooks` and `?tab=history` open those tabs, `?tab=nonsense` opens Records (`DataPillar.flatTabs-12450`). - **S4:** `copilotChangesLine-34725` asserts the partly-refused discard's message is still on screen after the object re-read. - **S5:** metadata-address cases in `studioSurfaceContext` (the object, its history address, and the create page, the list and a generic item naming nothing) and `studioSurfaceLabel-8219` (the chip shows the label only for the object the address names). - **S6:** `ui/packages/app-shell/README.md` sends an object to its designer's address; the changeset is rewritten in user terms. - **S7:** `areaItemOpensObjectDesigner` and `metadataAddressArtifact` are replaced by objectstack-ai#37089's helper (above); after objectstack-ai#37089 landed, main is merged and the list holds both types. - **N8, found on the browser walk:** an address naming no object offered it as an "Unpublished new object"; it now says "Object not found" (`objMissing`, `DataPillar.tsx`; pinned in `draftOnlyNoLayers-12508`). - **Added by seat a4-S:** the object create publishes pinned (`publishCreated`, `If-None-Match: *`), as the flow create does, so an object another writer published under the name since the check is refused, not replaced. Pinned in `MetadataListCreateDialog.pairCreate-36897`, with the in-package taken notice and its Open. - **N2, N3, N4:** stale comments corrected (`SidebarItemMenu.tsx`, `studioAddressTable.ts`, `studioInterfacesRetired.ts`, the header-label comment in `DataPillar.tsx`, which now says what the code does: the draft's label when there is one); two controls carried over (a package with no namespace previews and saves the bare identifier, in `MetadataListCreateDialog.pairCreate-36897`; a label-less draft-only object is titled by its name, in `DataPillar.draftOnlyNoLayers-12508`). **N7:** `areaDesignerItemOf` reads `/metadata/object/new` as the create page. ## Tests - New: `objectDesignerTabs.test.ts` (order word for word, address round trip, tool tabs, values that open nothing); `metadataArea.test.ts` (the designer-page helper, `dataPillarRedirect`, `areaDesignerItemOf`); `DataPillar.flatTabs-12450` rewritten for the ruled order, the two-step fold and `?tab=`. - Rehosted on the list dialog (the create's home now): the OWD default, the stored-name preview (with and without a namespace) and the taken-identifier refusal into `MetadataListCreateDialog.pairCreate-36897`; the app-menu join suite, the OWD select, the labels and the taken-identifier object block onto `MetadataListCreateDialog`. - Converted: about 60 designer and surface suites now open the object on its address (`objectName`, area routes). - Deleted, behaviour removed by this card, each with the pin that remains: `StudioDesignSurface.emptyPackage` (no in-page empty state), `StudioDesignSurface.createObjectOwd` (duplicated in `MetadataListCreateDialog.pairCreate-36897`: chosen and default `sharingModel`, `mode: 'draft'`), `DataPillar.railSwitchFlush-27511` (its four cases now on the designer's × and ›, `heldDataLeave-26705`), `DataPillar.surfaceRequest` (the pillar's own live-request apply; the surface's navigation is pinned in `heldDataCreate-26845`), `DataPillar.draftObjectLabel-11843` (the rail's label read; the header's label is pinned in `draftOnlyNoLayers-12508`, both the labelled and the label-less draft), `StudioDesignSurface.aiApplyRefresh` (the rail growing on the pulse); and the rail-only cases inside `autosaveSwitch-11232`, `celGate`, `actionDeepLink-34724`, `heldDataLeave-26705` (the rail switch case became × back to the list), `StudioRail.noMatches-26733` (Data rail), `oneSurface-28572` (pair rows on the rail). <details><summary>Local runs at a9e7bb7, the CI follow-up at 562d068, the main merges at 046762e and 64a5a2d, and the seat's additions at d09f2b3 / 2bf127d</summary> **Main merge after objectstack-ai#37185, `64a5a2d7`:** app-shell closure rebuilt (VERDICT exit 0); app-shell type-check 0 `error TS` (VERDICT exit 0); every app-shell suite naming the designer, the area, the copilot, the menu model, the permission page, the access redirect or the create dialog, plus every app-shell test objectstack-ai#37185 touched (359 files): `Test Files 359 passed (359)`, `Tests 3237 passed (3237)`, VERDICT exit 0. `dispatch-gates --commands` (39 families) all exit 0; `--ran` "39 derived, 39 run, 0 NOT-MEASURED, 0 UNRUN". Declared narrowing: `pnpm --dir ui exec vitest run scripts/` was killed by the container's memory limit at the default worker count (twice, once with nothing else running), so it ran with `--maxWorkers=2`: `Test Files 172 passed | 2 skipped (174)`, exit 0; CI runs it at its own width. `check:test-source-alias` exit 0; overlap-check: origin/main merges cleanly. **Seat additions, `d09f2b31` (code) and `2bf127d4` (changeset wording):** the create dialog's suites plus the create-adjacent surface suites (8 files): `Test Files 8 passed (8)`, `Tests 67 passed (67)`, VERDICT exit 0; app-shell type-check 0 `error TS` (VERDICT exit 0); eslint 0 errors, no warning on an added line; `check:test-source-alias`, `check:nul-bytes`, `check:cross-package-test-inputs` and `check-empty-changeset` exit 0; overlap-check: origin/main `0a1b69c0` merges cleanly. **CI at the head, `64a5a2d7`:** 62 check-runs, 47 success, 15 skipped, 0 failed. **CI at `2bf127d4`:** the same, 45 success, 13 skipped, 0 failed. **CI at `046762e5`:** 58 check-runs, 45 success, 13 skipped, 0 failed (Test UI, Type Check UI, Lint UI, Build & E2E UI, Live E2E UI, Test Core, Dogfood Regression Gate, Governed Surface Queue Guard, Check Changeset, Check PR Size among the successes). **Main merge, `046762e5`** (after objectstack-ai#37089 landed; 139 files, +1,601 / −2,489 = 4,090 changed lines against the new merge base): `pnpm install`, then the app-shell dependency closure rebuilt (lock VERDICT command-exit 0); app-shell type-check 0 `error TS` (VERDICT exit 0); every app-shell suite naming the designer, the area, the copilot, the menu model, the permission page or the access redirect (258 files): `Test Files 258 passed (258)`, `Tests 2237 passed (2237)`, VERDICT exit 0; `dispatch-gates --commands` (39 families) all exit 0, `--ran` "39 derived, 39 run, 0 NOT-MEASURED, 0 UNRUN" (a derived zero); overlap-check: origin/main `8b74082f` merges cleanly. Tree of `a9e7bb72` = tree of the tested commit `3b4d4722` (`79415e13`, compared byte for byte; the commits were reworded for the trailer rule before the push, no file changed). CI follow-up, `562d0689`: Test UI (5/16) failed at `a9e7bb72` on `objectDesignerTabs.test.ts`'s order pin (this card's own test, unchanged this round): the studio namespace fetches its zh catalogue on demand, so in a worker where no earlier suite had loaded it, `t(key, 'zh-CN')` answered English. Reproduced locally by running the file alone (1 failed); fixed with the module-top `await loadStudioCatalogue('zh')` other suites use (alone: 4 passed); app-shell type-check 0 `error TS` (VERDICT exit 0); `check:test-source-alias` exit 0; overlap-check: origin/main merges cleanly. - The suites this round edits (10 files): `Test Files 10 passed (10)`, `Tests 103 passed (103)`, lock VERDICT command-exit 0 (before the not-found fix; its suite is in the broad run below). - Every app-shell suite naming `DataPillar`, `StudioDesignSurface`, `StudioMetadataArea`, `StudioAiCopilot`, `metadataArea` or a `metadata/object` address (259 files): `Test Files 259 passed (259)`, `Tests 2211 passed (2211)`, lock VERDICT command-exit 0. - `@object-ui/app-shell` type-check (src `tsc --noEmit`, then `tsconfig.test.json`): 0 `error TS`, lock VERDICT command-exit 0. eslint `--no-inline-config` on the edited files: 0 errors (40 warnings, none in a line this round added). - `dispatch-gates --commands` (39 families): all 39 exit 0; `--ran` reconciliation: "39 derived, 39 run, 0 NOT-MEASURED, 0 UNRUN", a derived zero. Re-run at `3b4d4722` after the last commits: `check:test-source-alias`, `check:cross-package-test-inputs`, `check:nul-bytes`, `check-empty-changeset`, `check-changeset-no-major`, each exit 0. - `overlap-check` before the push: origin/main merges cleanly; the sibling drafts conflict textually (Acceptance notes). Ablations, each through `scripts/ablation-replace.mjs` on committed code, restored, `git diff HEAD` empty after (the app-shell suites import the source, so no build leg): | Mutation | Turned red | |---|---| | `unsavedPillarWork` without `saveBar.dirty` (M1) | 3 of the 5 new departure cases (› and × over an unsaved edit, the refused Save); the saved-edit and nothing-pending controls stayed green | | the Changes link back on `packageId` (S2) | the read-only base's pair-address case | | objects back on the history exemption (S3) | the object history-address case | | the designer tab not seeded from `?tab=` (S3) | `?tab=hooks` and `?tab=history` | | the discard refusal back on `error` (S4) | the partly refused discard case | | the copilot's address read removed (S5) | the address cases in both copilot suites (3) | | `objMissing` always false (N8) | the not-found case | | the object create's `publishCreated` dropped (`d09f2b31`) | the pinned-publish case and the pair-create case's call shape | | the taken holder never this package (`d09f2b31`) | the in-package notice-and-Open case (a first attempt was refused by the tool as a replacement it could not count, so nothing ran; re-run with a countable replacement) | </details> ## Acceptance notes - **S8, fixed (added by seat a4-S from the objectstack-ai#37169 L1, 7152310574):** the list dialog's taken-name notice tells the two cases apart. When the package the create writes to holds the object, it reads `engine.studio.data.createTaken` (read again) and offers 「打开」, which opens that object's designer (`studioItemPath`). When the holder is elsewhere, it keeps `createTakenElsewhere` and offers no Open. The `onOpenExisting` prop has the same shape as objectstack-ai#37169's flow side. - **i18n keys:** the released `@object-ui/i18n@18.6.0` keys this PR leaves unread are kept (the optional drop from ruling 7153326968 is not taken). `Clause-②` stays `no`. - **Header shows the machine name beside the label (N4):** the designer's header is the shared full-screen item header, which shows the API name beside the label, as every Studio item page does; objectstack-ai#34794 kept it in the tooltip on the old pillar header. Kept, for one header across Studio's item pages. - **N1, for objectstack-ai#36909:** `useRequestedSurface` has no product reader left after this card; objectstack-ai#36909 (route and remnant deletion) removes it with the pillar routes. - **N2, for objectstack-ai#36909:** the retired-Interfaces redirect goes `/interfaces` → `/data` → the object list, two hops; the hop through `/data` goes when objectstack-ai#36909 retires `STUDIO_HOME_PILLAR` and the pillar routes. Only the stale comments are fixed here. - **N8, fixed:** the browser walk showed that an address naming no object did not show a refusal strip but offered the name as an "Unpublished new object" to design. It now says "Object not found" (an existing `@object-ui/i18n` string, `engine.form.objectNotFound`) under the header, whose × goes back to the list. - **For objectstack-ai#36903:** `AreaHistoryRedirect`'s designer-item exemption line now serves flows only; objectstack-ai#36903 deletes it when the flow designer moves. - **Old base address of a pair's object:** `/studio/BASE/data?surface=object:PAIR_OBJECT` (what the retired rail mirrored for an object the `.custom` pair adds) now redirects to the base's area, where that name does not resolve; the pair's own address works, and the object list and the Changes sheet link pair objects to it. - **Paused objectstack-ai#36784** (public forms, now closed): it conflicted textually with this branch on `StudioDesignSurface.tsx`, the Data pillar mount removed here. - **Main merged after objectstack-ai#37089 (objectstack-ai#36905, the permission designer) landed:** 15 files conflicted, all resolved toward both designers (the shared list, the area's mount by type, the copilot comment, the menu model's named designer types, the sharing overview's route beside the object designer's reports, and the test files' collection-time imports and pillar lists). **Main merged again after objectstack-ai#37185 landed** (`64a5a2d7`): two conflicts, each resolved by hand. `StudioDesignSurface.entryReadsOnce-11797.test.tsx` and `StudioDesignSurface.itemDraftLine-12725.test.tsx` both kept the collection-time `@object-ui/plugin-detail` import; only main's explanatory comment beside it differed, and main's comment was taken. `StudioDesignSurface.readOnlyPosture-12453.test.tsx` auto-merged and keeps both sides: this PR's designer address in `PILLARS` and objectstack-ai#37185's header-carrying fetch doubles. Sibling drafts objectstack-ai#37169 (objectstack-ai#36903, flow designer) and objectstack-ai#37166 still conflict textually; whichever lands later merges main. - Size: over 3,000 changed lines, Tier H by size (maintainer ruling recorded on epic objectstack-ai#36890, comment 7145880574). ## Verification Read first (risk order): `views/studio-design/DataPillar.tsx` (the removed rail and create, the header and tab block), `views/studio-design/StudioMetadataArea.tsx` + `metadataArea.ts` (the mount, the designer-page helper and `dataPillarRedirect`), `views/studio-design/StudioDesignSurface.tsx` (the `/data` redirect, `requestSurface` and `unsavedPillarWork`). Two-minute check: on the showcase app, open an app's 「对象设置」. Expected: the URL is `/studio/PKG/metadata/object/NAME`, the designer fills the right pane with no object column, the tabs read 记录、字段布局、验证、操作、设置、钩子、API、被引用、历史、源码; › opens the next object on the same tab; × returns to the object list. ### Browser walk (rework S1), showcase Run at `a9e7bb72` on a live stack: the showcase backend (`objectstack dev --seed-admin`, its own port and database, closure built at this head) with the Console's dev server from this branch's `ui/` source, Chromium through Playwright, signed in as the seeded admin. In this boot `com.example.showcase` is a read-only package, so the walk also covers the `.custom` pair. Every step below passed unless it says otherwise. | Step | What was done | What the browser showed | |---|---|---| | 1 | Object list, click the Account row | `/studio/com.example.showcase/metadata/object/showcase_account?package=…`; the designer fills the right pane beside the left menu, no object column; tab row Records, Field layout, Validations, Actions, Settings, (Hooks, API folded into Advanced at this width), Referenced by, History, Source; ‹ 1 / 24 › | | 2 | Advanced → Hooks, then › | `?tab=hooks`; › opened `showcase_announcement` on the same tab, `2 / 24` | | 3 | History tab | `?tab=history`, the History panel | | 4 | × | back to `/studio/com.example.showcase/metadata/object?package=…` | | 5 | Old link `/studio/PKG/data?surface=object:showcase_account&view=x&action=nope` | `/metadata/object/showcase_account?action=nope&package=…&tab=actions` (`view` dropped) | | 6 | Old home `/studio/PKG/data` | the object list | | 7 | `/metadata/object/showcase_account/history` | the designer on `?tab=history` | | 8 | Field layout → Add field "Walk Probe" (unsaved), then × | the native question "You have unsaved changes. Leave this page anyway?"; dismissed, the designer and the top bar's Save stayed. The walk's next page load was then held by the browser's leave prompt (first run: the navigation aborted while that prompt was dismissed) | | 9 | The running app's Accounts list → ⋮ → Object settings | `/studio/com.example.showcase/metadata/object/showcase_account?package=…`, the designer | | 10 | Object list → 新建 "Walk Gadget" on the read-only package | created in the pair: `/studio/com.example.showcase.custom/metadata/object/showcase_custom_walk_gadget?package=com.example.showcase.custom`, the designer open on it | | 11 | `/metadata/object/no_such_object_36904` | **first run: "Unpublished new object", offered as a new object to design.** Fixed in this round (`objMissing` in `DataPillar.tsx`, pin in `draftOnlyNoLayers-12508`); re-run: "Object not found" with the name, × in the header | | 12 | Viewport 1100px | Validations, Actions and Settings fold too: Records, Field layout, Advanced, Referenced by, History, Source | Console: 36 `Failed to load resource` errors over the whole walk; the five read were a 401 (before sign-in) and 404s. Not traced one by one, and nothing on screen failed. **HotCRM: NOT MEASURED.** Reason: this session's GitHub access is scoped to `objectstack-ai/objectstack`, so the HotCRM app (its own repository) cannot be cloned and booted here. The HotCRM leg the card names carries to objectstack-ai#36910 (the end-to-end walk-through card) as NOT MEASURED, with this reason. --- _Generated by [Claude Code](https://claude.ai/code/session_01QSeKYoFqGdRM9Qmg7M2o2B)_ <!-- signed: repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…e widens after its rows are drawn (objectstack-ai#37253) Fixes objectstack-ai#37239 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:管理员在工作室「全部元数据」列表(例如共享规则)里,表格比可视区域宽时,右侧固定列前那道提示「右边还有列」的阴影现在每次都会出现;以前大约一半的打开次数不出现。 - 为什么做:夜间回归测试因此变红(共享规则列表在 1440 宽下的可达性检查),这是让它恢复的产品修复。 - 出错会怎样:最坏只是宽表右侧阴影不显示或多显示一次,不影响数据和操作;改动可直接撤回。 - 要你做什么:无。 ## What changes - `ui/packages/components/src/custom/use-horizontal-overflow.ts` (`useHorizontalOverflow`): the box re-reads its overflow when the box, each child of the box, **or each child's own children** resize. Before, it watched the box and its direct children only. - Why that matters: every table here sits inside the shadcn `Table` wrapper (`relative w-full`, `overflow-visible` inside a box that scrolls). The wrapper keeps the box's width, so when the table element widens past the box with no row added and the box unchanged, no observer fired, `overflowRight` stayed `false`, and `data-table`'s right seam shadow (`data-table-scroll-shadow-right`) was never drawn. - The same hook drives `HorizontalOverflowBox` (`data-overflow-right` and its edge or pinned seam), so a table placed in that box inside a wrapper (the approvals inbox mounts one that way) follows the table's width too. Pinned below; not measured live. - Changeset: `@object-ui/components` patch. ## Why Nightly `nightly-tiers` run 45554381420 (`0a1b69c0b`) failed `ui/e2e/live/declared-sharing-rules-reach-13091.spec.ts`: the seam shadow was not found within 5 s although the table's scroll box was wider than its client box. **Which suspect it is.** objectstack-ai#36978 (`c48f06c87`, the metadata list on ObjectGrid) is the change that exposed it, and is not itself wrong. It moved the list onto `data-table` and pointed the spec at `data-table`'s shadow. That shadow carried a latent defect in `useHorizontalOverflow`, and the new list's layout hits it about half the time. objectstack-ai#37089 (the permission set full-screen) is ruled out: it does not touch this list's grid or the overflow hook. Nothing else changed the data-table seam shadow between the last green nightly (`d9c799c10`, 2026-11-24) and the red one. The only other `data-table.tsx` edit in that window is objectstack-ai#37124 (the footer summary row), which does not touch the overflow read. **Measured DOM** (Chromium 1440x1000, this tree's Console against the workspace showcase backend, a requestAnimationFrame log of the scroll box from first paint): ``` before the fix, a failing open (12 of 20 opens ended like this): +1315ms sw=1134 cw=1134 child=1134 table=1134 rows=3 shadow=false rows drawn, the table fits +1331ms sw=2168 cw=1134 child=1134 table=2168 rows=3 shadow=false the columns widen the table +1384ms sw=1826 cw=1134 child=1134 table=1826 rows=3 shadow=false ...and it stays without a shadow a passing open: the table is already wider than the box when the rows draw (sw=1826 at the first frame) after the fix (20 of 20 opens with a shadow), the same sequence: +1379ms sw=1134 cw=1134 child=1134 table=1134 rows=3 shadow=false +1391ms sw=2168 cw=1134 child=1134 table=2168 rows=3 shadow=false +1427ms sw=1826 cw=1134 child=1134 table=1826 rows=3 shadow=true ``` `child` is the wrapper, the box's only child, and it stays at 1134 throughout. That is why the old read never ran. The scrollbar-at-rest read in `data-table` already observed the table element itself, which is why the bar showed while the shadow did not. So the product regressed, and the spec is unchanged. It still measures that the controls are in reach and that a seam shows while columns remain to the right. ## Tests - `data-table-scroll-shadow-12463.test.tsx`: a new top-level describe. A recording `ResizeObserver` calls back only the observers watching the element that resized, as a browser does. The table element alone grows past the box (no scroll, no row added), and the shadow is drawn. CONTROL: a table that grows but still fits draws none. - `horizontal-overflow-12708.test.tsx`: a new top-level describe, the same reading for `HorizontalOverflowBox` with a wrapped table. CONTROL: a resize of the wrapper itself still re-reads. Read first (by risk): 1. `use-horizontal-overflow.ts`: the nested observe loop. It adds observers on grandchildren and changes no read. 2. `data-table-scroll-shadow-12463.test.tsx`: the recording observer and the new describe. Two-minute check: `pnpm --dir ui exec vitest run packages/components/src/renderers/complex/__tests__/data-table-scroll-shadow-12463.test.tsx`. Expect 8 passed, including "draws the shadow once the table alone grows past the box". <details><summary>Unit and package runs at ddb6f6f: both pin files 15/15; the whole components package 510 files passed, 1 skipped; type-check green</summary> ``` pnpm --dir ui exec vitest run --maxWorkers=2 packages/components/src/renderers/complex/__tests__/data-table-scroll-shadow-12463.test.tsx packages/components/src/__tests__/horizontal-overflow-12708.test.tsx Test Files 2 passed (2) Tests 15 passed (15) pnpm --dir ui exec vitest run --maxWorkers=2 packages/components/ Test Files 510 passed | 1 skipped (511) Tests 4970 passed | 24 skipped (4994) os-verify-lock: VERDICT command-exit 0 pnpm --filter @object-ui/components type-check (tsc --noEmit && tsc -p tsconfig.test.json, the ui/ dependency closure built first) os-verify-lock: VERDICT command-exit 0 ``` </details> <details><summary>Local gate families at ddb6f6f: 38 derived, 38 run, every one exit 0</summary> ``` node scripts/pm/dispatch-gates.mjs --ran FILE Run reconciliation — 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN. ✓ dispatch-gates --ran: 38 derived famil(ies) accounted for — 38 run, 0 NOT-MEASURED (a DERIVED zero — all 38 recorded an exit code and none of them is 3). pnpm check:test-source-alias -> exit 0 node scripts/pm/overlap-check.mjs -> VERDICT clean exit 0 (origin/main; and with --pr=37168,37169,37166,37226: every one merges cleanly) ``` </details> ## Acceptance notes - Ablation (one run, both pins, `scripts/ablation-replace.mjs`): deleting the grandchild-observe line, `anchor 1 -> 0, blob 7965aaa -> aae15c0c6be7`, makes both new pins fail. The data-table one fails with "Unable to find an element by: data-testid=data-table-scroll-shadow-right", and both CONTROLs stay green (`Tests 2 failed | 13 passed (15)`). Restored: `blob == HEAD (7965aaa)`, `git diff HEAD` empty. Both test files import the hook from source, so no build is involved. - Size: 4 files, 182 changed lines (176+, 6-). - Deviation: part of the scratchpad logs (the raw Playwright and probe outputs) was deleted mid-session by a process this run does not own. The readings above were copied from those runs as they finished. ## Verification The stack the nightly boots, step for step: `ui/e2e/live/ci/start-backend.sh` (this tree's CLI serving `examples/app-showcase`, a throwaway database), the Console built with `VITE_BASE_PATH=/` and served by `vite preview`, then Playwright from `ui/` with `playwright.live.config.ts`, Chromium. <details><summary>Before the fix (main at d7f299c): the spec fails 5 of 10 repeats, with the nightly's error</summary> ``` playwright test --config=playwright.live.config.ts declared-sharing-rules-reach-13091.spec.ts --repeat-each=10 Error: expect(locator).toBeVisible() failed (Locator: getByTestId('data-table-scroll-shadow-right').first()) 5 failed 5 passed (57.3s) ``` </details> <details><summary>After the fix (Console rebuilt from this branch): 20 of 20, and the whole nightly list 28 of 28</summary> ``` playwright test --config=playwright.live.config.ts declared-sharing-rules-reach-13091.spec.ts --repeat-each=20 20 passed (55.0s) pnpm --dir ui run test:e2e:live:nightly (the 14 spec files console-live-specs.live.test.ts runs) 28 passed (1.7m) ``` </details> The backend and the preview server this run started were stopped by their recorded PIDs. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (not touched) - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. (CI) - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: n/a. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. --- _Generated by [Claude Code](https://claude.ai/code/session_01QSeKYnxVj5xoUcFUWLa5Aw)_ <!-- signed: repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…state; × returns to the list (objectstack-ai#37226) Fixes objectstack-ai#36906 Clause-②: no Metadata-protocol: none ## 维护者速读 - 管理员在 Studio 的仪表盘、报表列表里点一项会直接进入应用里的编辑状态(仪表盘进编辑态、报表打开构建器),页头的 × 回到刚才的 Studio 列表(刷新后也在),报表列表的「新建」进入应用的新建报表页。 - 属于 Studio 重构专题:Studio 是某个应用的开发界面,这一步打通了 Studio 和应用之间的往返编辑。 - 从 Studio 报表列表新建的报表改由应用的新建报表页保存,和以前一样存进该包(已安装的应用存进它的定制包),只有保存那一刻定制包恰好用不了时才存到包外并提示列表里看不到它;出错会影响打开到哪里和新报表存在哪里,可以直接撤回,已存的报表留在原处,只有草稿的仪表盘和报表、以及已安装应用定制包里的仪表盘和报表暂时仍打开 Studio 原来的详情页。 - 无。 ## What changes Epic objectstack-ai#36890, decisions 3, 6, 13 and 15. - **Studio opens a dashboard or a report in its app.** A plain open of a dashboard or a report in Studio's list no longer shows the generic item page. It opens the item's page in an app, using the arrival state the design mode already uses: the dashboard opens in its edit state, the report opens its builder. The Studio address is replaced, not stacked, so browser Back from the app lands on the list. - **Which app (decision 6).** It is the app the author came from, when that app is one of the package's published apps, or when its menu opens the item. Otherwise it is the package's first published app. With no app, the item keeps the generic item page (decision 3). The same happens on the cross-package leg, and whenever the address asks the item page for one of its own tools (a tab, the draft review, a selection), so History and the draft door's review links still land there. The rule is shared with Studio's back link (`studioBackTarget`), so the two cannot disagree. It lives in a new pure module, `studioAppEdit.ts`, and the area's step is `StudioAreaAppOpen.tsx`. - **× back to Studio (decision 15).** The app address carries `?studio=` with the Studio list it came from, filters and sort included. It is built and read only through `studioAddress.ts` (`withStudioReturn`, `readStudioReturn`) and registered as a reserved console param. The value is read as untrusted: only a Studio address on this origin is followed. While the param is present, the dashboard page and the report page draw a × that returns to that list, after a reload too. The report builder's own × does the same. Leaving unsaved edits asks first. - **Report New (decision 13).** Studio's report list New opens `/apps/APP/reports/new` in the app picked the same way. Its × goes back to the list, and the saved report's page keeps the way back. With no app, the area creates as before. Dashboard New is objectstack-ai#36907's, untouched. - **Where that new report is saved.** Opened from Studio, the new-report page saves the report into the app's package, the way a new view made in an app is saved (`resolveRuntimeCreatePackage`): the package when it is writable, else its `.custom` pair through the ensure door; when neither can be had, naming no package, as views fall back, and then an info notice says the report was saved outside the app's package, so the Studio list does not show it (`report.builder.savedOutsideApp`, the counterpart of a view's `onSavedOutsideApp` notice). The draft, the publish and the discard of a refused publish all name that package (`saveAndPublishInPackage`), so on every other leg the report is in the list × returns to. The console warning `resolveRuntimeCreatePackage` prints on that fallback now names the type it saves (it said "the view" for a report too): the function takes the type as its second argument. On a read-only base whose pair door is closed (walled, or a kernel package), report New no longer opens the app page: it goes back to the list, as every create there does. - **An item with no published version keeps the generic item page.** Before handing over, `StudioAreaAppOpen` reads the item once, as the app reads it (published, no draft preview, `?package=` the open package). No published version (a draft only: an AI draft, a create whose publish was refused), or a failed read, keeps Studio's generic item page, which is the page that opens the draft. Only then are the package's apps read. - **A dashboard made in Studio lands in its app, and Back skips the create page.** The area's own create publishes and lands on the item, which the gate forwards to the app. In a package's area, for a dashboard or a report, that landing now replaces the create page's history entry (`studioCreateLandsInApp`, read by `ResourceEditPage`), so Back from the app lands on the list. Every other type, and Setup, land as before. - **The report builder's × and the new-report page's × ask over unsaved edits outside Studio too.** Both handlers already received `dirty` for the Studio leg; the ask now runs before either leg. - **No dashboard edit on a phone.** `useDashboardEditOffered` now also requires a window at least `sm` (640 px) wide, the width from which the edit state's side panel is drawn. Before, only the button's CSS hid it. A landing that asks for the edit state on a narrower window is cleared and opens nothing, so neither Studio nor the design mode can put a phone into the edit state. - New `studioReturn` strings, and `report.builder.savedOutsideApp`, in every bundled locale (additive only; no released key removed). zh-Hant is regenerated from zh-Hans by its generator. ## Why The maintainer asked that dashboards and reports listed in Studio open straight into the front end's design page (epic objectstack-ai#36890). The epic's decisions fix which app, the fallback, the report New target and the address-borne way back. ## Tests - New `studioAppEdit.test.ts`: decision 6, rule by rule; the new-report variant; agreement with the back link; the app addresses. - `studioAddress.test.ts`, new top-level describe: the `?studio=` builder and reader, the refusals both ways (another origin, protocol-relative, `/studiox`, a backslash, `javascript:`), and the reserved-param registry. - New `StudioAreaAppOpen-36906.test.tsx`, through the real `StudioMetadataArea` routes: the app picked, the arrival carried, the return address (list context kept, item-only params dropped), the replace, and every open that keeps the item page (a tab, the review, no app, the cross-package leg, other types). Also report New, and its fallback. - `DashboardView.inPageEdit-36372.test.tsx`, new describe: landing from Studio, × target, × after a reload, the dirty prompt, the phone landing (cleared, no edit, no Edit button), and an off-Studio value drawing no ×. - `ReportView.designModeExclusion-36692.test.tsx`, new describe: landing in the builder, the builder × to Studio, its dirty prompt, the page × beside Edit, and the card's check: reached with the design mode already on, no builder and no Edit, while × still goes back. - `ReportNewPage-36692.test.tsx`, new describe: × to Studio, and Save keeping `?studio=`. This round: Save from Studio names `packageId: P` on the draft and the publish; on a read-only base it names the pair (`P.custom`, asked of the ensure door); CONTROL: a refusing ensure door falls back to the package-less save. × over an edit asks; declining stays with nothing sent; agreeing goes back to the Studio list (and the clean × asks nothing). Outside Studio: Save names no package and asks no package door, and × over an edit asks. - `StudioAreaAppOpen-36906.test.tsx`, previous round: a draft-only dashboard row keeps the item page and reads no app; so does a draft-only report and a failed read; `studioCreateLandsInApp` rule by rule. Its "dashboard create → Save lands on the app's dashboard and Back lands on the list" case drives the area's routes over a create STUB (`CreateStub` reimplements the landing), so it pins the gate's forward and Back over a replaced entry, not `ResourceEditPage`'s call site; that is pinned in the new file below. A read-only base (`readOnly`, `customization` handed in): its dashboard row opens in the base's app; a pair-row address (`/studio/BASE.custom/metadata/dashboard/X?package=BASE.custom`) keeps the generic page (the starting point of objectstack-ai#37237); report New opens the base app's new-report page; with the pair door walled, or no customization, report New goes back to the list. - `ReportView.designModeExclusion-36692.test.tsx`, previous round: outside Studio, a clean builder × closes without asking; over an edit it asks, declining keeps the builder, agreeing closes it. - New `ResourceEditPage.createLandingReplace-36906.test.tsx` (this round), the REAL `MetadataResourceEditPage` over a real `MetadataClient` and an in-memory server: under a `MetadataAreaHost` with a `packageId`, a dashboard create's Save lands on the item with a REPLACE (`useNavigationType`); CONTROLs: a `view` create in the same area, and a dashboard create with no area host (Setup), land with a PUSH. Each case also pins the save's `?package=` (the area's package, or none). - `ReportNewPage-36692.test.tsx`, this round: the refusing-door CONTROL now also asserts the info notice (once, the `report.builder.savedOutsideApp` key) and that the console warning names the report; the package, pair and outside-Studio cases assert no notice. The clock is gone from the save cases: the Han romanizer `handleSave` awaits is paid once in a `beforeAll` (a cold dynamic import, paid at collection), and every save case waits on the address it asserts (`waitFor`) instead of two `setTimeout(0)` ticks, so a late save can no longer land in the next case. - Ablation (one, on the behaviour change the tests pin): with the phone gate removed from `useDashboardEditOffered`, the phone pin fails 1/1. Restored, its blob equals HEAD's and `git diff HEAD` is empty. - This round's ablations, each through `scripts/ablation-replace.mjs` (anchor 1 to 0, restore proven blob == HEAD and `git diff HEAD` empty), are listed under Verification. ## Acceptance notes - **Read first, by risk (rework 2):** the notice line after the save in `ReportNewPage.tsx` (fires only when Studio opened the page, the app has a package, and none could be had), and the new real-page pin `ResourceEditPage.createLandingReplace-36906.test.tsx`. - **Read first, by risk (rework 1):** the save hunk of `ReportNewPage.tsx` (where a report made from Studio is written: the package, its pair, or none), the published-version read at the top of `StudioAreaAppOpen.tsx`'s effect, and the `replace` on the create landing in `ResourceEditPage.tsx` (shared by every type; it reads `studioCreateLandsInApp`, true only for a dashboard or report in a package's area). - **Read first, by risk (first round):** `StudioAreaAppOpen.tsx` (async app pick and replace; the fallback), the `useDashboardEditOffered` and arrival hunks in `DashboardInPageEditor.tsx` and `DashboardView.tsx` (the phone gate now also governs the design mode's landing), and the `?studio=` reader in `studioAddress.ts` (an address-bar value followed by a navigate). - `StudioMetadataArea.tsx` is kept narrow: one import, the item open wrapped in `StudioAreaAppGate`, and the create split. Open PRs objectstack-ai#37089, objectstack-ai#37168 and objectstack-ai#37169 edit the same file in other hunks. `overlap-check` merges cleanly with all three at this head. Whichever lands later merges main. - **Callers of the persistence path.** `runtime-metadata-persistence.ts` changes in one place this round: `resolveRuntimeCreatePackage(appPackageId, type, doors?)` takes the type it resolves for, only so its fallback warning names it; its answer is unchanged, and its two internal callers pass the type they save (`view`). The new-report page now also calls two of its existing exports: `resolveRuntimeCreatePackage` (other callers: `createRuntimeMetadata` and `saveAndPublishRuntimeMetadata` themselves, for views only) and `saveAndPublishInPackage` (other callers: `saveInPlace`, the in-page dashboard and report Save, and `setup/publicForms.ts`). `saveAndPublishRuntimeMetadata`'s other callers (`objectViewViewSharing.ts`, `objectViewViewCrud.tsx`, `setup/publicForms.ts`) and `createRuntimeMetadata`'s (`objectViewViewCrud.tsx`, `ObjectDataPage.tsx`) are untouched. - **Outside Studio, a new report is saved where it was before.** The new-report page reached from the app's own reports index still saves naming no package, and asks no package door (pinned). Only the page opened from Studio's report list resolves a package. - **Draft-only check (M2): one read, not the list row's mark.** The read covers every way into the item address: a list click, a typed or shared address, and the area's create landing on the item. The list row's draft mark would cover the click only. The read is asked as the app asks it, so the two cannot disagree. - **A pending Studio draft over a published version.** The item has a published version, so it opens in the app, which shows the published version. A dashboard's edit state then refuses to open, with the existing toast 「This dashboard has unpublished changes in Studio. Publish or discard them there, then edit it here.」, so the page stays a viewer. A report's page shows the published version, and its builder opens on the pending draft's content (the report's Edit reads the stored draft layer first, `authoredBuffer`); the builder's Save is then refused with 「This report has unpublished changes. Publish or discard them above, then save.」, and nothing is written over the draft (the first-write pin). Either way the draft stays Studio's to publish or discard. Read from the code at this head, not walked. - Reload (seat ruling: keep as shipped): after a reload, × back to the Studio list survives, but the editor does not reopen. A reloaded or shared address never opens an editor by itself; that is the arrival modules' rule. - Card item 5 (a dashboard saved on an installed app lands in `.custom`) is pinned at unit level by the existing case "an installed package saves into its customization pair". It is NOT MEASURED live on HotCRM: no HotCRM checkout is in this session. That leg carries to objectstack-ai#36910. - Follow-up card filed: objectstack-ai#37237. In this PR, a `.custom` pair's dashboards and reports keep the generic item page (decision 6, rule 3); objectstack-ai#37237 resolves them through the base package's apps. ## Verification Two-minute check: open Studio for a writable package with a published app, go to Reports, press New, pick a data source and a measure, name it, and Save. Expected: the report's page in the app, with a 「Back to Studio」 ×; click it, and the new report is in the Studio list. Rework 2's readings are at head `298361bd` (this branch with `origin/main` `057cedfa` merged in) unless a line names another head. The previous rounds' readings below keep their own heads (`08107d2f`, `727300e5`). <details><summary>Live walk-through, this round (per-agent stack; CRM example plus one writable package)</summary> The stack is a fresh `examples/app-crm` backend (`pnpm dev:crm -- --fresh`) with the Console served by Vite from this branch's `ui/` source, driven by Playwright as the seeded admin, at `727300e5`. In this stack the CRM package is a read-only code package, so it walks the read-only base leg. A second package, created writable through `POST /api/v1/packages` with one published app, walks the writable leg. Writable package (11 PASS, 0 FAIL): - A dashboard staged as a draft only (`PUT ?mode=draft`), opened at its Studio row address, stays on Studio's generic item page. - Studio's dashboard New, then Save: lands on `/apps/PKG/dashboard/NAME` with the way back to the dashboard list. The app page shows the just-published dashboard in its edit state (no 「not found」). Browser Back from there lands on the dashboard list, not on the create page. - Studio's report New opens the app's new-report page. After picking a data source and a measure and saving, it lands on the report's page with the way back. `GET /api/v1/meta/report/NAME?package=PKG` answers 200 with `packageId: PKG`. × returns to the report list, and the new report is in it. - No page errors. Read-only CRM package: - Report New, then Save: the server holds the new report in `com.example.crm.custom` (a read at `?package=com.example.crm` answers 409 naming that pair as the holder). × returns to the CRM report list, and the new report is in it. - Dashboard New there is the area's own create in the pair (unchanged). Its Save lands on the pair's item page, which keeps the generic page (no app of its own; objectstack-ai#37237). Back lands on the list. - No page errors. HotCRM: NOT MEASURED, carried to objectstack-ai#36910. </details> <details><summary>Tests, rework 2 (head `298361bd` unless named)</summary> - The six pin files (`ReportNewPage-36692`, `ReportView.designModeExclusion-36692`, `StudioAreaAppOpen-36906`, `studioAppEdit`, `studioAddress`, `DashboardView.inPageEdit-36372`) plus the new `ResourceEditPage.createLandingReplace-36906`, default workers, 3 runs on this merged tree: each run lock VERDICT command-exit 0, Test Files 7 passed (7), Tests 95 passed (95). The six alone, 3 runs at `35c94a71` (merged with `origin/main` `ede9b91f`): each 6 passed (6), 92 passed (92). - The seat's S3 red (2 failed of 92 on the merged tree) did NOT reproduce on this box: the six at the merge commit `ad67a645`, before the fix, ran 92 of 92 green once. So the clock is shown another way: with `loadHanRomanizer` slowed by 100 ms (a mutation through `scripts/ablation-replace.mjs`, restored blob == HEAD), the previous round's test file fails its two clock-bound save cases (plus its refusing-door CONTROL, which also lacks the new `toast.info` mock), while this round's file passes 13 of 13. - At `35c94a71`, the wider set: every `ResourceEditPage*`, `runtime-metadata-persistence*`, `Report*` and `DashboardView*` test, `urlParams.test.ts`, `views/studio-design/`, `views/studio-detail/` and `packages/i18n/`. Lock VERDICT command-exit 0, Test Files 505 passed (505), Tests 4838 passed, 13 skipped. - `pnpm --filter @object-ui/app-shell run type-check`, both tsc programs, at `35c94a71`: lock VERDICT command-exit 0, 0 `error TS`. (The final merge brings no app-shell or i18n file.) - eslint on this round's changed ui files: 0 errors; the 15 warnings are existing ones (`no-explicit-any`, `only-export-components`). - Ablations this round, each through `scripts/ablation-replace.mjs` under the lock (anchor 1 to 0, restore proven by blob == HEAD and `git diff HEAD` empty): 8. The call site, `replace: studioCreateLandsInApp(areaHost?.packageId, type),` to `replace: false,` in `ResourceEditPage.tsx`: the new dashboard REPLACE case fails (1 failed, 2 passed of 3); both CONTROLs stay green. 9. The notice line removed from `ReportNewPage.tsx`: the refusing-door CONTROL fails (1 failed, 12 passed of 13). </details> <details><summary>Tests, previous rounds</summary> - At `08107d2f`, the seven touched test files (`ReportNewPage-36692`, `ReportView.designModeExclusion-36692`, `StudioAreaAppOpen-36906`, `studioAppEdit`, `studioAddress`, `DashboardView.inPageEdit-36372`, `urlParams`): lock VERDICT command-exit 0, 7 files, 99 tests passed. - At `727300e5`, the wider set: every `DashboardView*` and `Report*` test, every `ResourceEditPage*` test, every `runtime-metadata-persistence*` test, `views/studio-design/`, `views/studio-detail/`, `src/__tests__/`, `src/preview/`, `urlParams.test.ts` and `packages/i18n/`. Lock VERDICT command-exit 0, 585 of 585 files, 5,662 passed, 13 skipped. - `pnpm --filter @object-ui/app-shell run type-check`, both programs, at `08107d2f`: exit 0, 0 `error TS`. - eslint on the nine changed ui files: 0 errors. The warnings are existing ones. - Ablations, each through `scripts/ablation-replace.mjs` under the lock (anchor 1 to 0; restore proven by blob == HEAD and `git diff HEAD` empty). ui tests resolve `src` directly, so no `dist` leg applies: 1. New-report page, the ask removed: the two "x over unsaved edits" pins fail (2 of 13). 2. New-report page, `dirty &&` dropped (asks on a clean x): the two clean-x pins fail (2 of 13). 3. New-report page, the package resolve replaced by `null`: the package pin, the pair pin and the refusing-door CONTROL fail (3 of 13). The CONTROL fails because no door is asked at all. 4. Report builder, the ask removed: the Studio dirty pin and the new outside-Studio pin fail (2 of 8). 5. `StudioAreaAppOpen`, the no-published-version fallback disabled: the two draft-only pins fail (2 of 16). 6. `studioCreateLandsInApp` forced to `false`: the create-then-Back pin and the rule pin fail (2 of 16). Corrected in rework 2: this reaches the pure rule and the create stub's own copy of the landing in `StudioAreaAppOpen-36906`, not `ResourceEditPage`'s call site (the seat's call-site ablation left that file green, 16 of 16). Ablation 8 above reaches the call site. 7. Report New on a read-only base, the pair-door condition removed: the closed-door pin fails (1 of 16). </details> <details><summary>Local gates, rework 2 (`dispatch-gates.mjs --commands`, 73 families)</summary> - At `298361bd`: all 74 derived families exit 0, each recorded as `cmd :: exit N` and reconciled with `--ran`: "74 derived famil(ies) accounted for — 74 run, 0 NOT-MEASURED". The ui `scripts/` family ran under the lock with `--maxWorkers=1`: Test Files 172 passed, 2 skipped. (The same 72 non-ui families also ran at `35c94a71`, all exit 0 after `check:skill-examples` first refused with exit 3 because `@objectstack/client-react` was not built in this worktree, then exit 0 once built.) - Also at `298361bd`: `check:test-source-alias` exit 0, ui `check:i18n-keys` exit 0 (every call-site key resolves against the en pack), `check:nul-bytes` exit 0, `check-platform-checklist --changed-from origin/main` exit 0 (0 anchored files), and `overlap-check` VERDICT clean exit 0 (`origin/main` `057cedfa`, objectstack-ai#37249, objectstack-ai#37210, objectstack-ai#37169, objectstack-ai#37166). The same alias and overlap checks also ran clean before the push. - CI runs the full farm on this PR. </details> <details><summary>Local gates, previous round (`dispatch-gates.mjs --commands`, 73 families at that head)</summary> - At `08107d2f`: all 73 derived families exit 0, each recorded as `cmd :: exit N` and reconciled with `--ran`: "73 derived famil(ies) accounted for — 73 run, 0 NOT-MEASURED". Two needed a second run: `check:skill-examples` first exited 3 (it refused, measuring nothing, because `packages/client`'s source was newer than its build after a local history rebuild), then 0 after rebuilding `client`; the ui `scripts/` family ran under the lock with `--maxWorkers=1`: 172 files passed, 2 skipped. - `check:test-source-alias` first exited 1 at `727300e5`: the new-report page now imports the draft bar's package rule, which reaches `@objectstack/lint`. The test file pays that load at collection (`import '@objectstack/lint'`, the gate's prescription); exit 0 since, and at `08107d2f`. - Also at `08107d2f`: `overlap-check` VERDICT clean (main, objectstack-ai#37249, objectstack-ai#37210, objectstack-ai#37169, objectstack-ai#37168, objectstack-ai#37166), `@objectstack/spec check:generated` exit 0 after the merge, and `check-platform-checklist --changed-from origin/main` exit 0 (no anchored file changed). - CI runs the full farm on this PR. </details> ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. (eslint on the changed files locally; the repo-wide run is CI's.) - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. (Not touched.) - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. --- _Generated by [Claude Code](https://claude.ai/code/session_01QSeKYmSqW1KzbiTWCnSN1K)_ <!-- signed: repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…ress; no flow rail (objectstack-ai#36903) (objectstack-ai#37169) Fixes objectstack-ai#36903 Clause-②: yes (narrowing) Metadata-protocol: none Skills-docs: none — no page under `skills/` or `content/docs/` names the Automations rail's strings or teaches overriding a Studio console string ## 维护者速读 - 搭建者在 Studio 点开一个流程,会在右侧全屏打开它的设计器,左上角 × 回到流程列表,‹ › 按列表顺序看上一个、下一个;原来设计器左侧那一列流程列表没有了,组织级流程也在同样的新地址上打开。流程的“审阅草稿”链接打开通用详情页并显示审阅;权限集的审阅链接照旧打开它的权限矩阵页。 - 这是 Studio 重构专题(左侧菜单 → 列表 → 右侧全屏详情)里流程设计器的一张,和对象、权限集的设计器共用同一套“设计器页面”写法。 - 出错时最可能是旧书签没跳对、或某个流程打不开;不改数据和元数据协议。原流程列表专用的 9 条界面文字随 19.0.0 大版本退役,已在变更说明里逐条列出(若有人自定义过这几条翻译,自定义将不再显示),回退这个 PR 即可恢复。 - 这个 PR 超过 3000 行,按您的裁决在席位审核后请您审核;另有一个问题请您定:流程列表要不要加“触发对象”和“运行状态”两列(需要另开一张协议卡)。 ## What changes - **The flow designer is full-screen on its metadata address.** `/studio/PACKAGE/metadata/flow/NAME` mounts the designer (`AutomationsPillar`, now fixed on one flow named by the route). The area decides it through the shared designer-page helper in `metadataArea.ts` (`AREA_DESIGNER_PAGE_TYPES`, `areaItemOpensDesignerPage`, `areaDesignerItemOf`), now on main from objectstack-ai#37089; after the merges the list is `['permission', 'object', 'flow']`. Header: the shared full-screen item header (`ResourceDetailHeader`): × back to the list with its filters, ‹ › in the list's order (decision 10), title, type, package, and the flow's ⋯ (New similar, Delete). Tabs: Canvas, Variables, Runs, Problems, Debug, then References, History, Source from `item-tools/ItemToolTabs` (hand-off §2); the open tab is `?tab=` (`flowDesignerTabs.ts`). - **No flow rail.** The rail, its search, object groups, legend, status dots, contributed-flow rows and the pillar's own New dialog are deleted. Create is the list's 「新建」 (`MetadataListCreateDialog`, same presets). - **Nine released console strings are retired, declared (M1, ruling 7153171432 「B」 with 7153326968 「下一版是大版本 19.0.0」).** The nine `engine.studio.auto.*` keys only the rail read (`heading`, `none`, `emptyMain`, `group.noObject`, `kind.record`, `kind.scheduled`, `kind.screen`, `kind.autolaunched`, `legend`) are removed from `en` and `zh` of `@object-ui/i18n`'s studio namespace. The changeset declares `Clause-②: yes (narrowing)`, carries the BREAKING note, the ADR-0087 `not-required (no-migration-prescription)` disposition and a 「Removed translation keys」 list, and keeps `'@object-ui/i18n': patch` (the one `major` is objectstack-ai#37223's). `engine.studio.org.none` is kept: S5 reads it. - **Address switch.** `flow` leaves `STUDIO_ITEM_PILLAR` (with objectstack-ai#37168's `object` gone too, it is empty), so `studioItemPath`, ⌘K, the AI artifact links and the Changes drawer open the new address. Old addresses redirect (`automationsPillarRedirect.ts`): `/automations?surface=flow:NAME` to the flow, bare `/automations` to the list; `?view=`/`?nav=` dropped, everything else kept (including `?changes=review`). - **`~org` flows** live on the package-less scope's own area leg: list `/studio/~org/metadata/flow?source=runtime`, flow `/studio/~org/metadata/flow/NAME?source=runtime`. Its list offers no 「新建」, and when it is empty it says how a packaged flow is changed instead (`engine.studio.org.none`, ADR-0146 D11), through a new optional `emptyListHint` on the area host. An empty, unsearched list there reads as empty, not as "No matches for """. - **Copilot context** has the sisters' shape: a designer on its metadata address sends `{ pillar: STUDIO_METADATA_AREA, artifact }`, the same block as objectstack-ai#37089 (on main) and objectstack-ai#37168, plus `orgScopeFlowOf` for the `~org` leg. - **Review links, in plain words:** a flow's review link opens the general item page with its review; a permission set's review link keeps its matrix page; an object's opens the general item page with its review, as objectstack-ai#37168 shipped it. - **One predicate for the generic page.** `?review=1` and `?scope=environment` keep an item on the generic item page through `areaItemAsksGenericPage`, with objectstack-ai#37168's text, for a designer type whose generic page serves that review (the flow). A type whose item page is its own editor (`registerMetadataResource`'s `EditPage`: the permission set's matrix) has no generic review, so it keeps its designer page, exactly as main does. Seat 4 recorded this as the measured form of its ruling A (7157282796). See Acceptance notes. - **Taken name in this package.** The list dialog's flow create says 「This package already has an automation…」 (`engine.studio.auto.createTaken`) and offers Open, to the flow's address, when the flow holding the identifier is this package's; `createTakenElsewhere` otherwise. - **Kept (card item 6):** the copilot's refresh after its edits (`useMetadataRefreshNonce`) and its current-item report (`onSurfaceLabelChange`). objectstack-ai#36726's pinned publish on Save and on the switch is unchanged; the list dialog's flow create publishes with `publishCreated`. - **Run status (card item 2):** the list has no column for it or for the trigger object (the spec's flow columns are NAME, LABEL, type, DESCRIPTION). Both stay on the designer header's Trigger and Status pills. No `packages/spec` change; the column question is a fork for the maintainer. ## Empty state and old deep links (card item 7) - A package with no flow: the flow list's own empty state. The designer is never opened on nothing. - An address naming a flow the package does not hold: one block, 「The link names flow “NAME”, which is not here.」, nothing else opened. A package-less flow opens in `~org` instead (objectui#11553). - Old `/studio/PACKAGE/automations`, `/studio/BASE.custom/automations` and `/studio/~org/automations` links redirect as above. `…/metadata/flow/NAME/history` opens the History tab. - Delete returns to the flow list (its filters kept); no other flow is opened in the deleted one's place. ## Tests - This round: - `heldFlowLeave-26705`: an unsaved, NOT held edit. × asks, Cancel keeps the edit, OK lands on the list with nothing sent; › the same, onto the next flow; CONTROL: after Save neither asks. The Changes sheet's flow request: over a dirty or a held edit it asks, then lands; on the open flow it does nothing; CONTROL: no edit, no question. - `packageLessFlows-11553`, through the real surface: the old address of a package flow lands on its address with the designer open; a read-only base's old address naming a pair-added flow lands on the base's address, writable, with the pair chip; the pair's old address lands on the pair's own address; CONTROL: the base's own flow stays read-only. Also the `~org` Changes request landing on the scope's flow, and the empty `~org` list's guidance. - `tabs-12454`: `?tab=runs` and `?tab=history` open their panel on the real designer; CONTROL: no tab, Canvas. - `createTaken-26917`: a published flow in this package reads `createTaken` and Open lands on `/studio/PKG/metadata/flow/escalate`; another package's keeps `Elsewhere` and no Open. - `aiChipLabel`: repinned to `{ pillar: 'metadata', artifact }`. - `customizeFlow-28570`: the Restore dialog's label is read off the header's title. - Earlier rounds: the remaining `AutomationsPillar.*` suites and the `StudioDesignSurface.*` / `StudioMetadataArea.*` suites that open a flow, converted to the address. Deleted as rail-only, each with the pin that covers what is left: `AutomationsPillar.railSearch-11794`, `FlowStatusDot`, `FlowStatusDot.registration-12349`, `StudioDesignSurface.railUnboundReason-11281` (the unbound reason is on the header's Status pill, `flowStatusTruth-11779`), `.automationsRailOrder-12612`, `.draftObjectFlowGroup-29706`, and the rail cases in `.emptyStates-12514`, `.homeLoop-12513`, `.oneSurface-28572`, `.autosaveSwitch-11232`, `.heldFlowCreate-26845`, `StudioRail.noMatches-26733`. New pins: `automationsPillarRedirect.test.ts`, `flowDesignerTabs.test.ts`, the helper and predicate cases in `metadataArea.test.ts`, the designer and `/history` routes in `StudioMetadataArea.routes-28561`. <details><summary>Ablations (each: committed fix, anchored mutation through the ablation-replace script, restored to the HEAD blob)</summary> - M2, `dirty: autoDirty` → `dirty: false` at `AutomationsPillar.tsx:803`: the two new guard cases go red on `expected "vi.fn()" to be called 1 times, but got 0 times` (lines 315, 338), the CONTROL goes red on Save not offered, and the 5 held-step cases stay green (`Tests 3 failed | 5 passed (8)`). Restored: blob `068563e042de` == HEAD, `git diff HEAD` empty. - S4, `here: own.some(…)` → `here: false`: the in-package case goes red, the others stay green (`1 failed | 9 passed (10)`). Restored: blob `c5263910bff6` == HEAD. - S5, the area host's `emptyListHint` spread deleted: the empty `~org` list case goes red (`1 failed | 23 passed (24)`). Restored: blob `5386130ea404` == HEAD. - The first M2 run went red at the case's own precondition (Save not offered), not at the question; the precondition was moved out of the shared helper and the ablation re-run as above. Declared, not hidden. </details> <details><summary>Local readings (final head first; earlier heads named)</summary> - **Final head `9fcff540`** (the third merge of `origin/main`, at `1b91538b` with objectstack-ai#37168, in `7a7af7ad`; then the lint fix). CI on `7a7af7ad` was red in Lint UI only: three imports that the retired-pillar cases left unused (`fireEvent` and `screen` in `expectedMisses-11799`, `parseSurfaceParam` in `metadataArea.test`). `9fcff540` removes them; no source changed. Readings on that tree, each under the lock: - `pnpm --dir ui --filter @object-ui/app-shell run lint`: exit 0, 0 errors. - app-shell type-check (src and `tsconfig.test.json`): exit 0, 0 `error TS`. - Full run over `studio-design`, `metadata-admin`, `CommandPalette.studioScope-11863`, `console`, `packages/i18n/`, `clickableNonControlCensus-13461` and the console's `StudioRoute`: Test Files 1508 passed (1508); Tests 15400 passed, 14 skipped; VERDICT command-exit 0. - `check:i18n-keys`: exit 0. `check:test-source-alias`: exit 0 before the push. The 36 light derived families re-ran on `7a7af7ad`: all exit 0. `overlap-check`: `origin/main` and objectstack-ai#37226 merge cleanly; objectstack-ai#37166 conflicts. - Full dogfood battery on `7a7af7ad` (the lint fix changes no runtime file), `pnpm --filter @objectstack/dogfood test` under the lock: Test Files 487 passed, 3 skipped (490); Tests 4128 passed, 68 skipped (4196); VERDICT command-exit 0. - Ablation of the review rule after the merge: `const genericPage = areaItemAsksGenericPage(search) && !getMetadataResource(type)?.EditPage;` → `const genericPage = false;` in `StudioMetadataArea.tsx`. `routes-28561`: Tests 2 failed, 32 passed (34). The object's `?review=1` CONTROL and the flow's `?review=1` case go red (`expected 'flow-designer' to be 'item'`); the permission set's matrix pin stays green. Restored: blob `c3b2d2786f9f` == HEAD. - CI on `9fcff540`: 58 check-runs, all completed: 45 success, 13 skipped (path filters, opt-in and queue jobs), 0 failed. Lint UI, Type Check UI, Test UI (shards 1–16), Build & E2E UI, Live E2E UI, Lint & Repo Gates, TypeScript Type Check, Test Core, Dogfood Regression Gate, Governed Surface Queue Guard, Check Changeset and PR-body guards: success. - **Review-link round, head `d3e30576`** (on top of `3f65d38b`, below): app-shell type-check exit 0. `StudioMetadataArea.*`, `StudioPermissionSetPage.*`, `metadataArea.*`, `packageLessFlows-11553`, `heldFlowLeave-26705`, `oneSurface-28572` and `AppContent.setupMetadataStudio-28578`: Test Files 8 passed (8), Tests 218 passed (218). Ablation as above. Full dogfood battery on `d3e30576` under the lock: Test Files 487 passed, 3 skipped (490); Tests 4128 passed, 68 skipped (4196); VERDICT command-exit 0. `check:test-source-alias`: exit 0 before the push. CI on `d3e30576`: 58 check-runs, 45 success, 13 skipped, 0 failed. - **Final head `3f65d38b`** (the second merge of `origin/main`, at `6211ddf4`). app-shell type-check: exit 0. `studio-design`, `metadata-admin`, `CommandPalette.studioScope-11863`, `console/ai`, `packages/i18n/` and `clickableNonControlCensus-13461`: Test Files 1265 passed (1265), Tests 13230 passed, 14 skipped (VERDICT command-exit 0). Full dogfood battery, `pnpm --filter @objectstack/dogfood test` under the lock: Test Files 487 passed, 3 skipped (490); Tests 4128 passed, 68 skipped (4196); VERDICT command-exit 0. The derived gate list is unchanged (38); its 36 light families re-ran, all exit 0. `check:test-source-alias`: exit 0 before the push. `overlap-check`: `origin/main` merges cleanly; objectstack-ai#37168 and objectstack-ai#37166 conflict. - Diff against the merge base with `origin/main` at `3f65d38b`: 94 files, +2,235 / −2,787. - **M1 round, head `576f67d3`.** `check-adr-0087-registration --base origin/main`: exit 0, one declared-breaking changeset with `not-required (no-migration-prescription)`. `check-changeset-no-major`: exit 0. `check-empty-changeset`: exit 0. `ui` `check:i18n-keys`, `check:i18n-drift`, `check:i18n-dead-keys`: exit 0 each. `packages/i18n/` plus `plainLanguage-11659`, `studio-locale.i18n` and `packageLessFlows-11553`: Test Files 114 passed (114), Tests 2060 passed, 13 skipped (VERDICT command-exit 0). app-shell type-check: exit 0. The 36 light derived families re-run: all exit 0. Full dogfood battery (owed by the `(narrowing)` arm), `pnpm --filter @objectstack/dogfood test` under the lock: Test Files 487 passed, 3 skipped (490); Tests 4128 passed, 68 skipped (4196); VERDICT command-exit 0. `check:test-source-alias`: exit 0 before the push. - `pnpm --filter @object-ui/app-shell type-check` (src and `tsconfig.test.json`): exit 0 on `49bf2233`, after the `@object-ui/*` dependency closure was rebuilt from this tree (turbo, 68 tasks). - Full run on `1d6b2854` (the merge plus its seam fixes), over `packages/app-shell/src/views/studio-design`, `packages/app-shell/src/views/metadata-admin`, `CommandPalette.studioScope-11863`, `console/ai` and `clickableNonControlCensus-13461`: Test Files 2 failed, 1150 passed (1152); Tests 3 failed, 11175 passed, 1 skipped. The failures came from the merge: `homeLoop-12513` opened on `/access`, which objectstack-ai#37089 turned into a redirect; and `MetadataListCreateDialog.pairCreate-36897` mounts the dialog without a router, where this round's Open used `useNavigate`. Both are fixed at `49bf2233`, where the touched files re-ran: Test Files 24 passed (24), Tests 176 passed (176). - `dispatch-gates --commands`: 38 families. `--ran` reconciliation: 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN, all with exit codes, all 0. `pnpm --dir ui exec vitest run scripts/` was OOM-killed on its first run beside the full suite; re-run alone under the lock it exited 0 (Test Files 172 passed, 2 skipped). `check:type-check-debt` re-measured under the lock: OK, 0 raw errors. - `check:test-source-alias`: exit 0 before each push. `overlap-check`: `origin/main` merges cleanly; objectstack-ai#37168, objectstack-ai#37166 and objectstack-ai#37185 conflict (exit 1). - ESLint (`--no-inline-config`) over every changed `ui/` file: 0 errors, 59 warnings. </details> ## Acceptance notes - **M1, how it ended.** Round 2 first restored the ten released keys (the L1's preferred fix). The maintainer then ruled retire-and-declare (7153171432 「B」; next release is the major, 7153326968), so this round removes the nine keys no code reads and declares them; the tenth, `engine.studio.org.none`, is read again by the `~org` list (S5) and stays. `studioAutomationCopy.plainLanguage-11659`'s heading case went with its row (N1, first option). The ~35 keys main had already removed are objectstack-ai#37223's, not declared here. - **Merged `origin/main` at `bc3ec37a`, which holds objectstack-ai#37089 (the permission designer).** The merge unions the two designers: `AREA_DESIGNER_PAGE_TYPES = ['permission', 'flow']`, `STUDIO_ITEM_PILLAR` keeps `object` only, and `AreaItemOpen` mounts `AutomationsPillar` for a flow and `StudioPermissionSetPage` for a set. Two consequences, both deliberate: - **Declared deviation, accepted (seat 4, 7157282796): a permission set's `?review=1` keeps main's behaviour and opens the matrix page.** The ruling said uniform (A), on this branch's recommendation. Checking it showed the premise was false. For a type whose item page is its own editor, the generic page never draws: `MetadataResourceEditPage` hands the item to the registered `PermissionMatrixEditPage`, which has no draft review. Neither it nor main's `StudioPermissionSetPage` reads `?review=1`. Uniform would therefore have sent a set's review link to Setup's matrix editor, with no review sheet and outside the Studio page: a regression. So `AreaItemOpen` asks the generic page only for a type with no own `EditPage`. That is the flow here and the object in objectstack-ai#37168 (objectstack-ai#37168 should check the object's registry before relying on it). Pinned in `routes-28561` (`?review=1` keeps the matrix page), and ablated: dropping the `EditPage` guard reds it, `1 failed | 31 passed (32)`, restored to the HEAD blob. The flow's `?review=1` still opens the generic page and its review (the case beside it). - **Carrier for the permission set's review, objectstack-ai#37269.** Two live links write a permission set's `?review=1` today: the Packages page's per-draft review link (`PackagesPage.tsx:1317`) and the chat's 「Review N changes」 (`AppContent.tsx:286`). Both open the matrix page with no review, as on main. objectstack-ai#37269 makes the matrix page show the draft's changes; this PR does not change what those links open. - The census rows for `AccessPillar.tsx` and `AutomationsPillar.tsx` `setRailOpen` both go: both rails are gone. - **Merged `origin/main` again at `6211ddf4`**, after objectstack-ai#37185 (the authenticated fetch) and objectstack-ai#37232 (the menu's type table) landed and the PR showed a conflict. Two files conflicted, each resolved so both sides survive: `CommandPalette.studioScope-11863.test.tsx` (one comment above the shared `@object-ui/plugin-detail` warm-up; main's wording kept) and `FlowItemMoreMenu.tsx` (main's `authFetch` for the clone door kept; the `STUDIO_HEADER_ICON_BUTTON` import this branch had dropped as unused stays dropped). objectstack-ai#37168 had still not merged, so the exemption below stands. - **Merged `origin/main` a third time, at `1b91538b` (objectstack-ai#37168, the object designer).** This PR now lands second of the pair, so it carries the routing ruling. The 47 conflict hunks in 22 files were resolved so both designers survive: - `AREA_DESIGNER_PAGE_TYPES = ['permission', 'object', 'flow']`, and `STUDIO_ITEM_PILLAR` is empty. - `AreaItemOpen` mounts `DataPillar` for an object, `AutomationsPillar` for a flow and `StudioPermissionSetPage` for a set. objectstack-ai#37168's `type === 'object'` review gate is replaced by the one `EditPage` rule; it gives the object the same answer. - Both creates' `onOpenExisting` paths are kept: the object's at its target package, the flow's in this package. The prop, which both PRs added, is passed once. - Both old-pillar redirects (`/data`, `/automations`) are kept. - Two suites lost their last case, every one a retired pillar's in-place behaviour: `StudioRail.noMatches-26733` (all three rails are gone) and `StudioDesignSurface.autosaveSwitch-11232` (main kept only the Automations cases and this branch only the Data cases, and both pillars are gone). Each is deleted. What they pinned for items is pinned per item: the area keys each designer by item, and `heldFlowLeave-26705`'s › case pins that the next flow opens clean, with nothing sent. - **`AreaHistoryRedirect`'s designer-item exemption (`pillarItem`) is deleted** (seat 4's routing: the second lander of objectstack-ai#37168 and objectstack-ai#37169 deletes it). With `STUDIO_ITEM_PILLAR` empty it could no longer fire. `routes-28561`'s CONTROL keeps its own-`EditPage` leg (the standalone history page), and its object leg is repointed at the object designer's History tab; the flow's `/history` opens the flow designer's History tab (the case beside it). - The closing line on line 1 is kept this round (N4): the maintainer is still to answer card item 2. - N2: the stale `/studio/~org/automations` comments in `src/index.ts` and `studioScope.ts` now name the scope's area addresses. - N3: not changed. The caption's `title="API name: …"` predates this PR: main's pillar header set the same `titleProps.title`, and 20 test lookups across 15 suites key on it. A cut label's hover still shows the API name; the changeset now names the api-name chip instead of a tooltip. - N5 / `orgScopeFlowOf` (seat 4: keep it): a one-line comment at the leg says it is dormant because the package-less scope mounts no copilot (objectui#11553). No surface-level `~org` copilot case is possible: the package-less scope mounts no copilot (`slotHost` needs a package, objectui#11553; `packageLessFlows-11553` pins `chatDock.mounts === 0`). The `~org` leg's context is pinned on the pure `orgScopeFlowOf` in `metadataArea.test.ts`. - N6: four `docs/qa/platform-checklist/areas/studio-authoring.json` items still describe the deleted rail and the `~org` pillar: `automations-rail-and-new-flow`, `org-scope-flows`, `flow-status-matches-runtime`, `flow-edge-type-authoring`. They carry to objectstack-ai#36910, whose item 3 owns that rewrite. - N7: corrected. CI on `5d9bb8da` was 47 success and 15 skipped, and "Check PR Size" was skipped, not passed. - N8: the Restore case reads its label off the header's title (`auto-canvas-caption`), so it still cross-checks the dialog. - S6: `ui/packages/app-shell/README.md`'s package-less section describes the scope's area leg; the changeset is in user terms, with no route templates and no query parameters. - The suites this PR edits import `@objectstack/lint` and `@object-ui/plugin-detail` at module top, so the dynamic imports their source reaches are paid at collection (`check:test-source-alias`). - Overlaps at this head (`9fcff540`): objectstack-ai#37166 conflicts with this branch; `origin/main` and objectstack-ai#37226 merge cleanly. Whichever lands later merges main. - Left for objectstack-ai#36909 (pillar leftovers): `groupFlowsByObject`, `withContributedFlowGroups`, `ContributedRailRow`, `useOpenContributor`, the console's `/studio/~org` bare route, and producers still writing the old `/automations` (all redirect). ## Verification First read, by risk: `StudioMetadataArea.tsx` (`AreaItemOpen`: the designer decision for both types, the `~org` leg), `metadataArea.ts` (the shared helper and `areaItemAsksGenericPage`), `MetadataListCreateDialog.tsx` (the taken-name branch). Two-minute check: open `/studio/com.example.showcase/automations?surface=flow:showcase_urgent_task_alert`; expect the flow full-screen at `/studio/com.example.showcase/metadata/flow/showcase_urgent_task_alert?package=com.example.showcase`, with × to the list and ‹ › enabled. <details><summary>Live walk-through (showcase, earlier round, head 5d9bb8d)</summary> Stack: `pnpm dev -- --fresh -p 38917` after `pnpm build`, and the Console dev server, driven with Playwright. It covered the list, the full-screen canvas, › and ×, a `~org` flow, an old bookmark, bare `/automations` and `/history`. No page errors. HotCRM was not walked: this container holds only this repository. This round adds no new screen path that the cases above do not drive through the real surface; it was not re-walked. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01QSeKYnHH41MS5hWVGPia4F)_ <!-- signed: repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…or Setup > Packages (objectstack-ai#37166) Fixes objectstack-ai#36908 Clause-②: no Metadata-protocol: none ## 维护者速读 - 管理员和开发者打开 Studio 不再看到软件包卡片页:有上次用过的软件包就直接进它;没有的话,能打开设置软件包列表的人进那个列表,打不开的开发者进「全部元数据」;已安装应用「改了什么」挪到了设置里的软件包详情;「添加应用」菜单去掉了「用 AI 搭建」,「在 Studio 中新建」改名为「新建空白应用」,凡是开放了元数据编辑的环境都会出现。 - 这是 Studio 重构专题的「去掉 Studio 首页」一步:首页的入口大多已有去处,但软件包的「管理」和「全部软件包」要等 Studio 顶栏菜单那张卡(objectstack-ai#37139)补上,一步「新建应用」要等新建软件包对话框那张卡(objectstack-ai#37134);另有三个入口没能在真实环境走过,「添加应用」菜单这一轮的变化(去掉「用 AI 搭建」、改名「新建空白应用」)也没在真实环境走过,都只有自动测试覆盖。 - 维护者已裁定统一「已定制」的口径(objectstack-ai#37236),但设置里的软件包详情和本次更新说明里的一句话目前仍把标签页等排列调整算作「已定制」;改正由那张卡完成,本 PR 不妨碍它。 - 只有 Studio 权限、没有设置权限的开发者现在没有任何页面能新建软件包,因为新建入口只在设置里;这要等 Studio 顶栏菜单(objectstack-ai#37139)和新建软件包对话框(objectstack-ai#37134)两张卡落地。 - 如果出错,用户进 Studio 会落到软件包列表或「全部元数据」页,而不是首页;这次只改界面,不改数据,可以直接撤回。 - 服务器没有报告用户权限时,这些「新建」入口按有权限处理,把人带到设置里的新建软件包;真正能否创建仍由服务器判断,席位建议保持这样。 - 本 PR 超过 3000 行(主要是删除旧首页和它的测试),请您按大 PR 流程审核后再合并。 ## What changes Epic objectstack-ai#36890 decision 9: the package-card page at bare `/studio` (`BuilderLanding`) is removed. This PR finds a new home for every entry it carried and deletes the page, the code only it used, and its tests. Every Studio exit that names no package now makes one choice, `studioEntryFallbackPath`: Setup → Packages (`/apps/setup/component/developer/packages?face=admin`) for a principal holding `setup.access` and `manage_platform_settings`, and `/studio/~all/metadata` (the All metadata area) for one who may enter Studio but not that page. The capability set is the one Studio's entry gate read: app-shell now exports `StudioEntryPermissionsProvider` and `useStudioEntryPermissions`, and the console's `RequireStudioAccess` provides the set around the `/studio` subtree. Outside that provider the set reads as holding nothing, so nobody is sent to a page they may not open. | Entry the home carried | Where it goes now | |:---|:---| | bare `/studio` | `StudioEntryRedirect` (in the lazy Studio chunk). It opens the newest remembered package (the recent `package` entries `StudioRoute` records) that `GET /api/v1/packages` still lists, else `studioEntryFallbackPath`. If the list cannot be read, it opens the newest remembered package, and Studio reports the failed read itself. | | New package (`/studio?new=package`) | `SETUP_NEW_PACKAGE_PATH`: the admin face with `?new=package`. It opens New Package on arrival and drops the param with a replace. After create it lands in Studio on the new package (objectstack-ai#36834). Callers: Home's no-agent chip, the `/ai` no-assistant screen, the 「Add app」 menu and the no-apps screen, all labelled 「New blank app」 / 「新建空白应用」 now (below); for an author who may not open Setup → Packages each of them, like the bookmark, opens the All metadata area instead (`useNewPackageDoorPath`, `newPackageDoorPath`). An old `/studio?new=package` bookmark goes there for a holder of the pair, and to the All metadata area for anyone else (`studioNewPackageEntryPath`). One-step 新建应用 is objectstack-ai#37134. | | `~all` / `~org` cards | Already in the left menu (objectstack-ai#36899). Nothing more to do here. | | Per-app "n customized, m switched off" and the "Customizations in this environment" panel | `PackageCustomizationsPanel`, shown in a read-only base's detail sheet on the admin face. It is not shown for an authored package, a `.custom` pair or a kernel package. It has a summary line, rows with tabs (adds Layouts), search, Show all, and 「Customize in Studio」. **"Customized" now counts `counts.arrangements`.** This delivers objectstack-ai#36833's requirement in the panel's new home; objectstack-ai#36833 was closed as not planned (ruling 7125820739), so this PR does not close it. | | Card Manage and the All packages link (development face) | Not this card: the door is added by objectstack-ai#37139 (card note 7146329913). The development face stays reachable by its address. | | Recently viewed | Now Studio's entry itself: `/studio` opens the newest remembered package. | | 「包不存在」 → Studio home | The button follows `studioEntryFallbackPath`: 「Open the package list」 → Setup → Packages for a holder (`engine.studio.notFound.packageList`), 「Open All metadata」 → the All metadata area otherwise (new key `engine.studio.notFound.allMetadata`). | | `AppContent` fallbacks, `packagedActionsStudioPath` fallback with no package named | `SETUP_PACKAGES_PATH`. | | `studio:builder` (the `@objectstack/studio` app's 「应用构建」) | Forwards to `/studio`. | | 「Add app」 (sidebar app menu, and the no-apps screen's buttons) | Maintainer rulings 7153161067 and 7153400210 on objectstack-ai#36908: 「Build with AI」 (to bare `/studio`) is removed, and `new-in-studio` is pushed for every admitted viewer on a deployment that offers metadata authoring, whether or not the build agent is served. It is relabelled under its existing key `home.build.inStudio`: en "New blank app", zh-Hans 「新建空白应用」, zh-Hant regenerated (「新建空白應用」), and the eight other packs translated anew, as `check:i18n-drift` requires of an en change. Home's no-agent chip and the `/ai` button read the same key; their inline `defaultValue` now matches the en value (`check:i18n-keys`); the chip's condition and target are unchanged. It stays inside `isAiStudioEnabled()`, because with `features.aiStudio` false the runtime offers no metadata authoring; a viewer `useMayAddApp` admits there gets the marketplace's two entries, so the list is never empty for an admitted viewer. `SidebarAppMenu` reads the list itself and draws neither 「Add app」 nor its separator for an empty list. Home's 「Build an app」 chip and Home's 「Build with AI」 drawer button are untouched. | Removed: `BuilderLanding.tsx`, its `BuilderLanding.*` test files, `fetchInstalledPackageRow` (only the home's Manage called it) with its pin, and the home's console frame in `StudioRoute` (header and command palette). Two deleted suites still pinned code that stays, and those halves moved (see Tests): the permission matrix's read-only hint copy, and the three new-app door cases. `LandingCustomizationsPanel` and `landingCustomizations-io` were renamed and rewritten as `PackageCustomizationsPanel` and `packageCustomizationRows`. `newAppDoor.ts`, `PackageFormDialog`'s `newApp` branch and the `engine.studio.newApp.*` strings stay for objectstack-ai#37134; the branch keeps its three cases, now mounted on `PackageFormDialog` itself. **Strings.** The home's `engine.studio.landing.*` keys and `engine.studio.landingHome` that ship in the released `@object-ui/i18n@18.6.0` (71 in each of `en` and `zh`, measured against the published tarball; 3 of them are still read by the Packages page) stay, the other 68 no longer read. Removing a published key is a narrowing, so this PR removes none. The four landing keys added after 18.6.0 and never released (`manage`, `manageTitle`, `allPackages`, `allPackagesTitle`) are removed. `engine.packages.customizations.*`, `engine.studio.notFound.packageList` and `engine.studio.notFound.allMetadata` are added (38 keys per language). The PR changes no existing value. **Changesets.** `36908-remove-studio-home.md` (app-shell, console, platform-objects) says what users see, in their words. The i18n note is in its own `@object-ui/i18n`-only changeset, `36908-studio-home-strings.md`. Both carry the two declaration lines. Checklist: `studio-authoring.package-customization-counts-and-marks` (rev 4) and `studio-authoring.org-scope-flows` (rev 5) are re-pointed. The rev 4 note now says objectstack-ai#36833 was closed as not planned and this card delivers its requirement; its `acceptance[2].verify` names `PackageCustomizationsPanel.test.tsx` as the pin. Also re-pointed off the removed home: `automation.setup-packaged-automation-board` (rev 15: title, `steps[1]`, `acceptance[0]`; the packaged-actions bookmark with no `?package=` opens Setup → Packages), `studio-authoring.first-run-loop` (rev 16, `steps[1]`: 「Build an app」 opens the last package or Setup → Packages, the other chip reads 「New blank app」), and the fixture lines of `automation.packaged-flow-clone-contract` (rev 14), `studio-authoring.held-edit-leave-guard` (rev 12) and `ux-conventions.write-feedback` (rev 18), which made their scratch package on the Studio landing. Size at `54e4586e`: +2,306 / −5,217 across 101 files rename-aware (+2,680 / −5,591 across 103 without renames), mostly deletions. Per ruling 7145880574 on objectstack-ai#36890 this lands as one PR, reviewed by the maintainer after L1. **Overlaps** (overlap-check at `54e4586e`, against `origin/main` `4fb03ebb`, exit 1 for objectstack-ai#37249 below): origin/main merges cleanly. This round merged main six times: `cf77ecb9` (K 12) was clean, and `54e4586e` (K 9, with objectstack-ai#37169) is resolved below. Resolved: - objectstack-ai#37089 (landed as `886e9707`): conflicted in `StudioDesignSurface.notFound-26708`; both sides added the same `@object-ui/plugin-detail` import, main's comment kept. The same merge brought objectstack-ai#37198's address-guard fixtures spelling the removed `STUDIO_LANDING_PATH`; they are dropped here. - objectstack-ai#37185 (landed as `ad604c10`): `PackageSwitcher.tsx` keeps this branch's side (`fetchInstalledPackageRow` and `STUDIO_LANDING_PATH`, which objectstack-ai#37185 moved onto the authenticated fetch, are deleted here); its edits to the six test files this branch deletes were stub adaptations (a `headers` field, a module-top import, the gate's fetch double) with no subject left to pin. The new customizations read goes through `packageCustomizations-io.ts`, already on the authenticated fetch; `PackageCustomizationsPanel.test.tsx`'s stub now carries `headers: new Headers()`. - objectstack-ai#37204 (landed as `bd98dd12`): `StudioRoute.test.tsx` and `StudioRoute.lazyBuilder-11798` keep this branch's removal of the home-frame cases; `StudioRoute.metadataArea-28561` keeps this branch's comment line and objectstack-ai#37204's `app-bar-product-home` test-id absence, without the old-name check. - objectstack-ai#37241 (landed as `fc216747`): `SidebarAppMenu.tsx` takes its `AppMenuList` and keeps this branch's `offerAddApp` separator; its new `SidebarDocsPortalMenu` gets the same rule (the 「Add app」 list read there, nothing drawn for an empty list, `AddAppSubmenu entries={…}`), pinned in its `SidebarAppMenu-36112` block (「New blank app」 and no 「Build with AI」 with the build agent served; a Studio-only author to `~all`; the empty-list guard). - objectstack-ai#37168 (landed as `1b91538b`): `PackageFormDialog.newAppStep-36748` keeps this branch's host and adds objectstack-ai#37168's `/studio/:packageId/metadata/*` route; `notFound-26708` keeps this branch's provider and Setup / All metadata routes and adds objectstack-ai#37168's metadata-area route (the removed home's `/studio` route stays out). Its edits to the two `BuilderLanding.*` files this branch deletes were the switched-off action's new address; that pin now lives at `PackageCustomizationsPanel.test.tsx:188`, updated here to `/studio/APP/metadata/object/opportunity?action=clone_opportunity`. - objectstack-ai#37169 (landed as `4fb03ebb`; this PR is the second lander): `BuilderLanding.orgScope-11553` stays deleted. objectstack-ai#37169 only moved the removed home's ~org card to `/studio/~org/metadata/flow?source=runtime`, and the org-scope entry is pinned by `StudioDesignSurface.packageLessFlows-11553`, which objectstack-ai#37169 updated. `notFound-26708` keeps this branch's `StudioEntryPermissionsProvider` and Setup / All metadata routes, with objectstack-ai#37169's comment naming `/automations` too. Nothing else conflicted. `AREA_DESIGNER_PAGE_TYPES` and the removed `AreaHistoryRedirect` exemption came in untouched. The 18.6.0 studio key comparison was re-run against `4fb03ebb`: the branch removes only the four never-released keys, adds 38 per language and changes 0 values; all 71 released landing keys are present. Still open; whichever lands second merges main and resolves: - objectstack-ai#37249 (objectstack-ai#37227) conflicts in `HomePage.desktopNoApps-36732` and `HomePage.noAgentsBuildChip-26614` (this branch's Studio-only chip case). Beyond the text: its first case expects the no-apps doors `[template, marketplace]` with the build agent served, and 「New blank app」 now shows there too (ruling 7153400210), so the second lander keeps `new-in-studio` first. Its HomePage filter of `build-with-ai` becomes a no-op. It touches neither `home.build.inStudio`'s values nor the chip's lines (measured by `git merge-tree` against its branch). - objectstack-ai#37226, objectstack-ai#37215, objectstack-ai#37210, objectstack-ai#37165, objectstack-ai#37282 and objectstack-ai#37284 merge cleanly. ### Read first 1. `ui/packages/app-shell/src/views/studio-design/StudioEntryRedirect.tsx`: the whole `/studio` decision, and the two capability helpers. Risk: where a non-administrator lands (the `studioEntryFallbackPath` pair), now for the bookmark too. 2. `ui/packages/app-shell/src/views/studio-design/PackageCustomizationsPanel.tsx` and the mount in `PackagesPage.tsx` (`PackageDetailSheet`). Risk: the gate `!authoring && !writable && !isKernel && !isCustomizationPackage(id)`. 3. `ui/apps/console/src/components/StudioRoute.tsx` with `studioEntryPermissions.ts`: the index route and the capability set the entry gate provides to Studio (`StudioEntryPermissionsProvider`), which the not-found exit reads. ### Two-minute verification As the seeded admin with nothing remembered, open `/_console/studio`. Expected: you land on Setup → Packages (`…/developer/packages?face=admin`). Open the ObjectStack Showcase row: its detail shows "Customizations in this environment" with a Customize in Studio link. ## Tests New pins: - `StudioEntryRedirect.test.tsx` (12 cases): the newest remembered package the list still names opens; a package the list no longer names is skipped; nothing remembered leads to Setup → Packages, read without a list request; a Studio-only principal lands on `~all`; a failed list read opens the newest remembered package; the old new-package bookmark is forwarded for an administrator (CONTROL) and sends a Studio-only principal to `~all`, never to Setup; both helpers read the same capability pair. - `StudioDesignSurface.notFound-26708`: the not-found button opens Setup → Packages for an administrator (CONTROL), and for a Studio-only principal it reads 「Open All metadata」 and opens `~all`, never Setup. The harness provides the entry gate's set through `StudioEntryPermissionsProvider`. - `PermissionMatrixEditor.readOnlyHintCopy-12171.test.ts`: the half of the deleted `BuilderLanding.environmentOverlayCopy-12171` that covered `perm.readOnly.artifact.hint`, which `PermissionMatrixEditor` still draws. No table names the organization axis; lit control that it names the environment overlay in every table; lit control that `t()` serves the value the extractor read, for every declared locale. - `PackageFormDialog.newAppStep-36748.test.tsx`: the three `BuilderLanding.newAppDoor-36748` cases, moved onto `PackageFormDialog` with `newApp={newAppStep(client, locale)}`, mounted as the home mounted it (create mode, Studio on the new package after save): the dialog worded for an app in zh; package POST, app draft, app publish, then the Studio header names the app and 「‹ Back to app」 opens it; a taken app name refuses the confirm and writes nothing. - `PackageCustomizationsPanel.test.tsx`: the rows and counts, including the **objectstack-ai#36833 arrangement-only case**; the empty and failed states (never "0"); row and switched-off-action links; tabs, search and Show all; zh words; and the moved rows and labels io. - In the `PackagesPage` administration-face harness, two describes: "the new-package deep link" (3 cases) and "a read-only base's customizations in its detail" (6 cases: a code package draws the section with arrangements counted; an authored package does not; the development face does not; a read-only `.custom` pair draws none and sends no customizations request; a kernel package's detail, opened directly because the admin face lists none, draws none and sends no request; CONTROL, the same direct render of a code package draws it and reads once). - Unreported capability set on the doors: `HomePage.noAgentsBuildChip-26614` renders Home inside the real `MePermissionsProvider` with an authenticated answer that carries no `systemPermissions`; the chip opens Setup's New Package (the fail-open). CONTROL, the same provider with a reported set holding `manage_metadata` alone: the chip opens `/studio/~all/metadata`. - Studio-only author on the doors outside Studio: `SidebarAppMenu-36112` (「New blank app」 links to `/studio/~all/metadata`) and `HomePage.noAgentsBuildChip-26614` (the chip navigates there, never to Setup); `StudioEntryRedirect.test` holds `newPackageDoorPath` to the same two answers. - `SidebarAppMenu-36112` (the shared harness, new top-level describe): with build and ask, the legacy build id, ask only, other agents only, or no agent served, 「Add app」 offers `new-in-studio` ("New blank app", to New Package), the template and the marketplace, and never 「Build with AI」; never empty for an admitted viewer with authoring but no marketplace, or a marketplace but no authoring; CONTROL, with neither the viewer is not admitted; guard, an admitted viewer handed no entries gets no 「Add app」 and no separator. `HomePage.desktopNoApps-36732`: the no-apps doors are `[new-in-studio, template, marketplace]` with the build agent served. - Converted, not deleted: the StudioRoute gate, lazy-module, recent-visit and access-notice pins; `studio:builder` registration (now a forward); `setupMetadataRedirect`; `studioAddress` and its guard (the guard no longer names the deleted `STUDIO_LANDING_PATH`); the Home, sidebar 「Add app」 and `/ai` deep-link hrefs; the vocabulary census; `consoleTopBar.height-12639`; `AppContent.setupMetadataStudio-28578`. <details><summary>Local runs at this round's heads</summary> **Rework 2, objectstack-ai#37169's merge, head `54e4586e`** (after merging `origin/main` `4fb03ebb`, K 9, and `pnpm --filter '@object-ui/console^...' build`, lock VERDICT command-exit 0): - vitest over app-shell `views/studio-design`, `console/home`, `console/ai`, `console/__tests__`, `layout/`, `hooks/`, `PackagesPage*` and `PackageFormDialog*`, plus console `components/`: Test Files 826 passed (826); Tests 6948 passed; lock VERDICT command-exit 0. - type-check `@object-ui/app-shell` (src + `tsconfig.test.json`) and `@object-ui/console`: exit 0. eslint on the two touched test files: exit 0. - Exit 0: check:test-source-alias, check:nul-bytes, check:cross-package-test-inputs, `check-platform-checklist --changed-from origin/main` (11 anchors, 0 lost), and under `ui/` check:i18n-keys, check:i18n-drift, check:unreferenced-sources and the three vi-mock gates. - The full `check:platform-checklist` exits 1 on one finding, and `origin/main` `4fb03ebb` fails the same way: `automation.json` anchors `FlowItemMoreMenu.tsx#FlowItemMoreMenu`, which objectstack-ai#37169 removed. That is main's to fix, not this PR's. **Rework 2 (delta L1 S1, N4, N5), head `cf77ecb9`** (after merging `origin/main` `4ed453dc`, K 12, clean, and `pnpm --filter '@object-ui/app-shell^...' build`, lock VERDICT command-exit 0): - vitest over `console/home`, `console/ai`, `RequireAiSurface`, `AppContent.setupMetadataStudio-28578`, `setupMetadataRedirect.test`, `PackageCustomizationsPanel.test`, `StudioEntryRedirect.test`, `SidebarAppMenu-36112` and `hooks/`: Test Files 210 passed (210); Tests 1827 passed; lock VERDICT command-exit 0. - Mutation through `scripts/ablation-replace.mjs`: `useNewPackageDoorPath` made to fail closed (`Array.isArray(systemPermissions) && hasCapabilities(…)`) → `HomePage.noAgentsBuildChip-26614` 4 failed / 12: the new unreported case, plus the three no-agent cases whose stub leaves `systemPermissions` undefined; the reported-set control stayed green. Restored to the HEAD blob, `git diff HEAD` empty. - type-check `@object-ui/app-shell` (src + `tsconfig.test.json`): lock VERDICT command-exit 0. eslint `--no-inline-config` on the 4 touched ui files: exit 0. - Exit 0: check:platform-checklist, `check-platform-checklist --changed-from origin/main` (4 anchored files, 11 anchors, 0 lost), check:test-source-alias, check:nul-bytes, check:cross-package-test-inputs, check:issue-citations, and under `ui/` check:i18n-keys, check:vi-mock-specifiers, check:vi-mock-inherit, check:vi-mock-override-shape. `git grep -n "Studio landing" docs/qa/platform-checklist/areas`: history entries only, plus `studio-authoring.json:35` and `:2290`, already stale on main (the studio-home button). - overlap-check: exit 1, only for objectstack-ai#37249 and objectstack-ai#37169 (objectstack-ai#37169 has since landed; see Overlaps). **Third part (seat answers to N1 and N3, then objectstack-ai#37241's and objectstack-ai#37168's merges), final head `1c7f29cc`:** - After merging main with objectstack-ai#37241 and objectstack-ai#37168 (`2ae0823f`) and rebuilding (VERDICT command-exit 0): `views/studio-design`, `layout/`, `console/docs`, `console/home`, `console/ai`, `console/__tests__`, `hooks/`, `PackagesPage*`, `PackageFormDialog*`, `PermissionMatrixEditor*`, console `components/` and `pages/`, `packages/i18n/src/__tests__`: Test Files 1162 passed (1162); Tests 10870 passed, 13 skipped; VERDICT command-exit 0. type-check `@object-ui/i18n`, `@object-ui/app-shell`, `@object-ui/console`: VERDICT command-exit 0. Exit 0 at this head: check:test-source-alias, check:nul-bytes, check:cross-package-test-inputs, check:i18n-stale-fill, check:keyed-text-bounds, check:platform-checklist, check:issue-citations, check-changeset-no-major, check-empty-changeset, check-adr-0087-registration, `check-platform-checklist --changed-from origin/main`, and under `ui/` check:i18n-keys, check:i18n-drift, check:unreferenced-sources, check:phantom-deps, check:vi-mock-specifiers, check:vi-mock-inherit, check:vi-mock-override-shape. - After a fresh closure build (VERDICT command-exit 0): `layout/`, `console/home`, `console/ai`, `RequireAiSurface`, `hooks/`, `StudioEntryRedirect*`, `notFound-26708`, console `StudioRoute*`: Test Files 376 passed (376); Tests 3153 passed; VERDICT command-exit 0. - Mutation through `scripts/ablation-replace.mjs`: `useNewPackageDoorPath` forced to the Setup path (`true || hasCapabilities(…)`) → 2 failed / 43, exactly the two Studio-only door cases; restored to the HEAD blob, `git diff HEAD` empty. - type-check `@object-ui/app-shell` and `@object-ui/console`: VERDICT command-exit 0. eslint on the 7 touched files: 0 errors. Exit 0: check:test-source-alias, check:nul-bytes, check:cross-package-test-inputs, and under `ui/` check:i18n-keys, check:i18n-drift, check:unreferenced-sources, check:phantom-deps, check:vi-mock-specifiers, check:vi-mock-inherit, check:vi-mock-override-shape. **Second part of the round (the 「Add app」 rulings, then three main merges), head `64e7071b`:** - At `048a5a84` (rulings + first merge): `layout/`, `console/home`, `console/ai`, `RequireAiSurface`, `hooks/`, `packages/i18n/src`, `PackageCustomizationsPanel`, console `StudioRoute*`: Test Files 486 passed (486); Tests 5161 passed, 13 skipped; lock VERDICT command-exit 0. - At `fe78cd2b` (after objectstack-ai#37185's merge), the overlap: `views/studio-design`, `layout/`, `console/home`, `console/ai`, `console/__tests__`, `PackagesPage*`, `PackageFormDialog*`, `PermissionMatrixEditor*`, `sameServerFetch*` (objectstack-ai#37185's ratchet), `apps/console/src/components`, `packages/i18n/src`: Test Files 1 failed, 888 passed (889); Tests 2 failed, 8291 passed. The failures were two cases of `layout/__tests__/designModeMenuSave-36363`, a file this branch does not touch; run alone it read 47 passed (47), and it passed again in the run below, so it was load in the big run. - At `45e4a5eb` (after objectstack-ai#37204's merge and a rebuild): `apps/console/src/components`, `layout/`, `console/home`, `console/ai`, `RequireAiSurface`, `packages/i18n/src/__tests__`: Test Files 436 passed (436); Tests 4837 passed, 13 skipped; lock VERDICT command-exit 0. (A first attempt at this run hit a 590 s cap before its verdict and is not counted.) - Mutation checks through `scripts/ablation-replace.mjs` (blob moved, restored to the HEAD blob, `git diff HEAD` empty): the hook's entry key back to `build-with-ai` → `SidebarAppMenu-36112` 7 failed / 32; the empty-list guard removed (`offerAddApp = mayAddApp`) → 1 failed / 32, the guard case. - CI on `45e4a5eb` failed `Type Check UI` at `check:i18n-keys`: Home's chip kept `defaultValue: 'New in Studio'` against the new en value. Fixed at `64e7071b` with the chip's default and the eight packs (`check:i18n-drift`); locally at `64e7071b`, exit 0: `check:i18n-keys`, `check:i18n-drift`, and the job's other static steps (`check:phantom-deps`, `check:self-import`, `check:unreferenced-sources`, `check:doc-example-readers`, `check:side-effects-array`, `check:spec-symbols`, `check:icon-record-names`, `check:designer-field-key-parity`, `check:action-forward-parity`, `check:esm-specifiers`, `check:handler-key-reads`, `check:metadata-write-doors`, `check:control-bytes`, `check:shell-escape-residue`, `check:vi-mock-specifiers`, `check:vi-mock-inherit`, `check:vi-mock-override-shape`, `check:test-path-roots`, `check:prompt-keys`), plus `check:keyed-text-bounds` and `check:i18n-stale-fill`. Vitest over `packages/i18n/src`, `console/home`, `console/ai`, `RequireAiSurface`, `SidebarAppMenu-36112`: Test Files 213 passed (213), Tests 2745 passed, 13 skipped, lock VERDICT command-exit 0. - type-check at `45e4a5eb` after `pnpm --filter '@object-ui/console^...' build` (VERDICT command-exit 0): `@object-ui/i18n`, `@object-ui/app-shell` (src + `tsconfig.test.json`), `@object-ui/console` passed, VERDICT command-exit 0. eslint `--no-inline-config` on this part's 6 ui files: 0 errors. - Gates at `45e4a5eb`, all 0: check:test-source-alias, check:nul-bytes, check:cross-package-test-inputs, check:i18n-stale-fill, check:keyed-text-bounds, check:platform-checklist, check:issue-citations, check-changeset-no-major, check-empty-changeset, check-adr-0087-registration, `check-platform-checklist --changed-from origin/main` (11 anchors, 0 lost). `pnpm --filter @object-ui/i18n gen:zh-hant` after the merges: every target already current. - 18.6.0 studio-namespace comparison at `fe78cd2b`, unchanged: 71/71 published landing keys present in `en` and `zh`; 35 missing, all already missing on main; 0 values changed vs main, 4 never-released keys removed, 38 added. **First part of the round (L1 and contract-review fixes):** - Targeted vitest at `4121473e` (after the first main merge, K 26), one locked run over `apps/console/src`, `packages/i18n/src`, `views/studio-design`, `metadata-admin/PackagesPage*`, `PackageFormDialog*`, `PermissionMatrixEditor*`, `console/__tests__/AppContent*`, `console/home/__tests__/HomePage*` and `layout/`: Test Files 1 failed, 1050 passed (1051); Tests 1 failed, 10456 passed, 13 skipped. The failure was the moved new-app pin's own harness (it navigated to the bare package path, which only the console route table expands); fixed at `4121473e` by landing on the package's Studio home as the removed home did, then 3 passed (3). - After the second main merge (`df4a65cb`) and the guard fix (`329ddefc`), the overlap re-run under the lock: `views/studio-design`, `apps/console/src/components`, `PackagesPage*`, `PackageFormDialog*`, `PermissionMatrixEditor*`, `packages/i18n/src`, `consoleTopBar*`, `AppContent*`: Test Files 594 passed (594); Tests 6016 passed, 13 skipped; lock VERDICT command-exit 0. - Mutation checks, each through `scripts/ablation-replace.mjs` (anchor 1 → 0, blob verified moved, restored to the HEAD blob with `git diff HEAD` empty), at `4121473e`: - 「组织」 written into the zh `perm.readOnly.artifact.hint`: `PermissionMatrixEditor.readOnlyHintCopy-12171` 1 failed / 3 ("no table names the organization axis"). - `!isKernel` removed from the detail gate (`PackagesPage.tsx:1271`): 1 failed / 6, the kernel case only. - `!isCustomizationPackage(id)` removed: 1 failed / 6, the `.custom` pair case only. - The bookmark forward reverted to `SETUP_NEW_PACKAGE_PATH`: `StudioEntryRedirect.test` 1 failed / 11, the Studio-only bookmark case. - The not-found exit reverted to `SETUP_PACKAGES_PATH`: `notFound-26708` 1 failed / 14, the Studio-only case. No dist leg was needed: these tests import app-shell by relative path, and the ui vitest config aliases `@object-ui/i18n` to its `src`. - type-check at `329ddefc` after `pnpm --filter '@object-ui/console^...' build` (lock VERDICT command-exit 0): `@object-ui/i18n`, `@object-ui/app-shell` (src and `tsconfig.test.json`, which lists all six new or changed test files) and `@object-ui/console` passed, lock VERDICT command-exit 0. - eslint `--no-inline-config` on this round's 11 changed ui files: 0 errors, 15 warnings. - Gates at `329ddefc`, exit captured before any pipe, all 0: check:test-source-alias, check:nul-bytes, check:cross-package-test-inputs, check:i18n-stale-fill, check:keyed-text-bounds, check:platform-checklist, `check-platform-checklist --changed-from origin/main` (11 anchors, 0 lost). At `4121473e`, also 0: check:issue-citations, check:doc-authoring, check:gitlink-declared, check-changeset-no-major, check-empty-changeset, check-adr-0087-registration (2 non-breaking changesets), check-closing-keyword-parity, check:changeset-gate-self-tests, and the edited `ui/scripts/check-eager-closure-budget.mjs`'s tests (6 files, 305 passed). `check:i18n`: PREREQUISITE NOT MET locally (the CLI build closure is not built); it reads the platform translation bundles, which this round does not touch; its evidence is CI. `dispatch-gates --ran`: 57 of 74 derived families not run locally, declared; their evidence is this head's check-runs. - **i18n against the published `@object-ui/i18n@18.6.0`** (`npm pack`, read by AST, nothing evaluated), on the merged tree: all 71 published `engine.studio.landing*` keys are present in `en` and `zh`; 35 published keys are missing at this head and all 35 are already missing on `origin/main`; against `origin/main` this PR changes 0 values, removes exactly the four never-released keys, and adds 38 per language (`engine.packages.customizations.*`, `engine.studio.notFound.packageList`, `engine.studio.notFound.allMetadata`). </details> ## Acceptance notes - The environment-wide list the home drew across all installed apps (one list, a total, grouped by app) is now shown per app only, in each read-only base's detail in Setup → Packages. - "Customized" now has two meanings. The Setup detail counts tab, field-group and action-layout arrangements with overrides and extensions; the All metadata header still draws `customizationTotal` (overrides + extensions, `customizationMarks.ts:96-97`, drawn at `DirectoryPage.tsx:246-249`), and the same total gates the list filters in `ResourceListPage` and `useListOrderedNames`. Not aligned here: adding arrangements to that total would stop the header equalling the sum of its per-type tiles and change which lists offer the customized filter. Not aligned here (seat answer A): follow-up card filed: objectstack-ai#37236. objectstack-ai#37236 has since been ruled B (7158100447): 「已定制」 stays overrides + extensions, and the Setup detail's count changes there to match. Until it lands, the Setup detail counts arrangements as described here. - The new-package doors outside Studio (Home's no-agent chip, the `/ai` screen's door, 「Add app」's 「New blank app」 and with it the no-apps screen) make the same choice as Studio's entry, through `useNewPackageDoorPath` (seat answer to N1): Setup's New Package for a holder of `setup.access` + `manage_platform_settings`, the All metadata area for an author who may enter Studio but not open that page. They sit outside the entry gate's provider, where `useStudioEntryPermissions` holds nothing, so they read the session's own `usePermissions().hasCapabilities`, which fails open on an unreported set as the doors' own authoring gate does (the Setup app still refuses a non-holder). That is the doors' doctrine, judged A in contract review 7162083002 ④: the door is only a link, and the server still refuses a package create without `manage_metadata` (`package-routes.ts:102-106`). Pinned by the unreported-set case in `HomePage.noAgentsBuildChip-26614` (the real `MePermissionsProvider`, no `systemPermissions`, the chip opens Setup's New Package; control: a reported set without the pair opens `/studio/~all/metadata`). - A Studio-only author (`studio.access` + `manage_metadata`, without the Setup pair) has no screen that creates a package at this head: 「New blank app」 opens All metadata, which has no New Package, where on main the same door opened the dialog inside Studio. The server still admits the create. This follows ruling N1 (a), and waits for objectstack-ai#37134 / objectstack-ai#37139. - Two console test files pinned only the home's frame and are deleted: `StudioRoute.landingI18n.test.tsx` (its header crumb) and `StudioRoute.searchPalette-11863.test.tsx` (⌘K on the home; ⌘K inside Studio is objectstack-ai#36900). The other StudioRoute pins now stub the entry. - Duplicate pins named for deleted tests (AGENTS.md, ruling 6120820653): the new-package deep link is pinned in the `PackagesPage` admin harness; the customization counts, rows and labels in `PackageCustomizationsPanel.test.tsx`; the org-scope entry by `StudioDesignSurface.packageLessFlows-11553` and the menu pins from objectstack-ai#36899; the permission hint copy and the new-app step moved, above. The home's own layout, ordering, Duplicate form, recent cards and Manage pins have no remaining surface to pin. - Possibly orphaned now that the frame is gone, not removed here: `AppHeader` `variant="studio"` and `CommandPalette` `scope="studio"` (objectstack-ai#36900 may reuse the scope). - 「Build with AI」 is gone from the 「Add app」 menu and the no-apps screen (ruling 7153161067). Home's 「Build an app」 chip still targets bare `/studio`, and Home's own 「Build with AI」 drawer button is untouched; objectstack-ai#37227 / objectstack-ai#37249 removes both from Home. - The kept-unread released studio keys stay as they are this round (the seat made dropping them optional under the 19.0.0 ruling); `home.buildWithAI` is still read by Home and is untouched. - Recents are read local-first, and the server copy arrives after first render (`RecentItemsProvider`). On a device with no local copy, `/studio` falls back before that copy arrives; "opens the package you were last in" holds on a device that already has it. - The 68 published landing keys are kept and unread. `check-i18n-dead-keys` (report-only, not in CI) will list them as candidates, and a later change can decide to retire them. - `docs/qa/platform-checklist/FOLLOW-UPS.md` still names `BuilderLanding` in a dated follow-up entry; it is a log and was left as written. ## Verification Walked on a live stack at `a21c7b6f` (the previous head). Server: `pnpm -C examples/app-showcase exec objectstack dev --seed-admin -p 4710` (CLI and showcase closure built in a worktree). Console: this branch's `ui/apps/console` under Vite on 4711, proxied to it. Signed in as the seeded admin and driven with Playwright; key screens confirmed by screenshot. | Entry | Observed | |:---|:---| | `/studio`, nothing remembered | → `/apps/com.objectstack.setup/component/developer/packages?face=admin` | | `/studio?new=package` (old bookmark) | → same page, `new=package` dropped, New Package dialog open | | `/apps/setup/component/automation/packaged-actions` (no package) | → Setup → Packages (admin face) | | `/studio/no_such_pkg_36908` | 「Package not found…」 with 「Open the package list」 → Setup → Packages | | ObjectStack Showcase (code) row → detail | "Customizations in this environment", "No changes in this environment yet", Customize in Studio → `/studio/com.example.showcase/data` | | `/studio` after visiting that package | → back into `/studio/com.example.showcase/data…` (remembered) | | Sidebar app menu → 「Add app」 | New in Studio (the label at `a21c7b6f`; 「New blank app」 now) → `…packages?face=admin&new=package`; clicked, it lands there with the dialog open | | `/ai` (no assistant on this stack) | 「New in Studio」 (the label at `a21c7b6f`; 「New blank app」 now) → `…packages?face=admin&new=package` | | New Package dialog → Create package | → `/studio/com.default.walk-pkg-36908/data` | | That authored package's detail | no customizations section (count 0); Open in Studio present | | `/studio/~all/metadata` | renders the All Metadata Types area | Not walked live, each pinned by unit tests: - Home's 「New blank app」 chip (「New in Studio」 at `a21c7b6f`): its condition does not hold on this seeded stack (`HomePage.noAgentsBuildChip-26614`, `HomePage.desktopNoApps-36732`). - A non-administrator's landings (bare `/studio`, the old bookmark and the not-found button for a Studio-only principal): no such principal is seeded (`StudioEntryRedirect.test.tsx`, `StudioDesignSurface.notFound-26708`); their target `~all` renders above. - `studio:builder`: the `@objectstack/studio` app does not load on a stock boot (`registerStudioComponents.builderLazy-11798`). This round's changes were not walked live: the Studio-only exits, the moved pins and the changesets change no administrator-visible entry above; the 「Add app」 menu's new contents (no 「Build with AI」, 「New blank app」 always) and the relabel are pinned in `SidebarAppMenu-36112` and `HomePage.desktopNoApps-36732`. --- _Generated by [Claude Code](https://claude.ai/code/session_01QSeKYkEULEjF814KSPBLVC)_ <!-- signed: repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…actions and OWD rows (objectstack-ai#38285) <!-- claude-projects-attribution: {"github_login":"os-tesla"} --> _Requested by **Tesla** · [project thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6Jao153cRYFjsg9HJ2VwLVqVbD)_ Fixes objectstack-ai#36660 repo:objectstack#3 · os-tesla · session_01L9qibxGxp6swERUK2T9NML Clause-②: no Metadata-protocol: none ## 维护者速读 - 在对象设计器的「钩子」页、只读基础对象「动作」页里的配套包动作、以及共享默认值总览的每一行上,如果 AI 助手留下了未发布的改动,现在会显示一行提示,说明保存会让 AI 的改动一起生效,并给一个「放弃 AI 的改动」按钮;以前保存会悄悄把它们一起发布。 - 属于「AI 改动要让人看见再生效」这条线:权限集和从左侧菜单打开的钩子、动作已经有这行提示,这次补齐剩下的三处。 - 只在草稿确实来自 AI 助手时才显示,人自己的草稿不受影响;放弃只丢这一项(共享默认值这一行是整个对象)的草稿,有没保存的编辑时会先确认。如果提示出现得不对,只是多一行文字和按钮,可以直接撤回。 - 无 ## What changes - **Object designer, Hooks tab** (`objectHooksBuffer.ts`, `ObjectHooksPanel.tsx`): - The buffer's load records which hooks have a pending draft whose provenance (`readDraftChanges`) names the AI assistant (`isAgentDraftSurface`: copilot or MCP). The set clears on an object switch and on a successful save. - The open hook shows `StudioAiDraftNotice` when its draft is the AI's and the hook is not a new one. The notice's discard calls the buffer's new `discardAiDraft`. - `discardAiDraft` asks `engine.studio.aiDraft.discardConfirmUnsaved` only when the hook holds unsaved edits. It then calls `client.reset('hook', name, { state: 'draft', packageId })`, the hook's own package, re-reads the list and emits the metadata refresh. A failure reads `engine.studio.aiDraft.discardFailed`. - **Paired package's actions on a read-only base object** (`pairObjectActions.ts`, `ObjectActionsPanel.tsx`): - A draft row whose provenance names the AI assistant carries `aiDraft`. A successful save, and a discard, put the row back to its live form. - The selected row shows the notice above the inspector. Discard is offered only where the row is editable. - `discardAiDraft(name)` asks only when that row holds an unsaved edit. It resets at the package the ensure door answers (`pairForWrite()`), never a hand-built `<base>.custom` name, then reloads. - **Organization-wide defaults overview** (`PackageOwdOverviewPanel.tsx`), seat ruling Q1 = A: - Each row reads its object's draft provenance. When the AI assistant wrote it, the row shows the notice with the OWD sentence, `engine.studio.owd.aiDraftNotice`: the whole object has the AI's unpublished changes, and saving this row makes all of them live. The plain "unpublished" chip is not shown beside it. - Discard drops that object's whole draft at the package (`client.reset('object', name, { state: 'draft', packageId })`). It asks `engine.studio.owd.aiDraftDiscardConfirmUnsaved` only when that row holds an unsaved edit. Other rows' unsaved edits are kept across the re-read. - `StudioAiDraftNotice.tsx`: an optional `text` prop, for a page that names what the draft covers. Without it the item sentence shows, as before. - i18n (`studio` namespace, en + zh): the two OWD keys above. Changeset `36660-owd-ai-draft-notice.md`: `@object-ui/i18n` patch. `@object-ui/app-shell` is private. - The hook list rows get no AI marker (seat ruling). ## Tests Three new files, 19 cases. Each covers the AI line for copilot and for MCP, no line for a person's draft or for a draft read with no provenance, discard with nothing unsaved (no confirm, one reset at the right package), and discard over an unsaved edit both declined and confirmed. - `ObjectHooksPanel.aiDraftNotice-36660.test.tsx` (7): through the Hooks tab host and the top bar's Save. Save publishes the AI version and the line goes away. - `DataPillar.pairActionsAiDraft-36660.test.tsx` (6): a read-only base object with a paired package. The reset names the door's pair. - `PackageOwdOverviewPanel.aiDraftNotice-36660.test.tsx` (6): the row's OWD sentence, the whole object's reset, and another row's unsaved edit surviving a discard. ## Acceptance notes - **Premise corrected at the claim:** the permission set and the hook and action opened from the left menu already carry the notice (objectstack-ai#37089, objectstack-ai#36902). This PR covers the three surfaces left. - **Out of scope, for the seat to decide on filing:** for an item the AI created and never published, the notice's discard tooltip reads "Drop this item’s unpublished draft and go back to the live version", while the discard removes the item. Seat ruling Q2: not in this card. - The local test run was narrowed to the files these changes reach (below). CI runs the whole app-shell suite. - The browser reading used a writable package made for the run, since the showcase package is managed (its writes answer `ITEM_LOCKED`). The HTTP doors refuse a copilot surface, so the draft's provenance was stamped as copilot in the stored draft row, and the served read confirmed `draftChanges[].by = copilot`. ## Verification <details><summary>Failing first, then green</summary> - On the base sources with the new tests: 15 failed, 4 passed. The 4 are the person's-draft and no-provenance controls. Failures: `Unable to find … studio-ai-draft-discard` ×9, `studio-ai-draft-notice` ×6. - With the change: 3 files, 19/19 passed. </details> <details><summary>Ablation</summary> Two parts removed on disk and restored (blob equal to HEAD afterwards): the OWD put-back of other rows' edits, and the hooks agent-surface check (any draft counts). 3 failed, 10 passed: OWD "another row keeps its edit", and hooks "a person's own pending draft" and "no provenance". </details> <details><summary>Wider runs</summary> - Affected test files: 328/328 files, 2574/2574 tests. - `@object-ui/app-shell` `tsc --noEmit` exit 0, `tsc -p tsconfig.test.json` exit 0. ESLint on the changed files: 0 errors, 5 warnings that were already there. - Derived gates at 4fd9904: 38 of 38 run, all exit 0, `dispatch-gates --ran` accounted. `pnpm --dir ui exec vitest run scripts/`: 172 files passed, 2 skipped. - `overlap-check`: clean against `origin/main` and objectstack-ai#38204 (shares the studio i18n files). </details> <details><summary>Browser reading, real console build</summary> Vite console against a showcase backend, signed in, Studio → package → organization-wide defaults. Two objects in the package. The one with a copilot-stamped draft shows under its name: "This object has unpublished changes from the AI assistant. Saving this row makes all of them live too." with "Discard the AI’s changes" (1 line, 1 button). The other object's row shows no line. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01L9qibxGxp6swERUK2T9NML)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L9qibxGxp6swERUK2T9NML --------- Co-authored-by: Claude <noreply@anthropic.com>
Fixes #36905
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
A permission set now opens full-screen at its metadata address, and the organization-wide default sharing overview has a route of its own. The Access pillar draws no page any more: every address it answered redirects.
Three facts for the reviewer, up front:
engine.studio.access.*of its rail and create dialog, andengine.studio.owd.railLabel, en and zh) ship in the released@object-ui/i18n, so they stay inui/packages/i18n/src/namespaces/studio/en.tsandzh.ts, byte-for-byte as onmain, unread.check:i18n-dead-keyslists them as candidates (report only), as it does other unread rows.origin/mainis merged at709d2c1e, and feat(studio): ⌘K on every Studio design page lists the package's menu and items #37108's palette and ⌘K pins now expect the set's address and the overview's route.StudioPermissionSetPage, new). On a package's leg,/studio/PACKAGE/metadata/permission/NAMEopens the matrix (PermissionMatrixEditPage, its Studio presentation) in the area instead of sending the set to the Access pillar (AREA_DESIGNER_PAGE_TYPES/areaItemOpensDesignerPageinmetadataArea.ts). The header is the full-screen detail's (ResourceDetailHeader, from Studio 重构(0-2):全屏详情的头部组合件——用 StudioItemHeader 的插槽放 ×、来源包、‹ › 加序号、⋯ 和主按钮 #36892/Studio 重构(2-1):通用详情换新头部,六个侧边抽屉改成页签(详情、预览、相关、被引用、历史、源码),出一套设计器也能用的页签组件 #36901): × back to the list with its context, ‹ › through it, label (the machine name on its tooltip), type and package, ⋯. The tab row is the matrix's five sections, thenItemToolTabs' References, History (with the audit log) and Source; a tool tab is addressable (?tab=) and keeps the matrix mounted and hidden. The matrix gains one optional seam for this,studio.frame(renderHeader,toolOpen,toolPanel,onDraftChangesRead); without it the matrix draws its own header exactly as before. The cross-package leg (/studio/~all/...) keeps the matrix's environment page.ResourceListPage; not on its pair's rows). The copy opens at its own metadata address with the strip saying where it landed (permissionNewSimilar.tsx, shared by the page and the list). Unsaved edits: the matrix registers with the shell's leave guard and the top bar's Save, so ×, ‹ ›, the menu, a reload and a tab close ask first; the browser's Back is not guarded (epic decisions 1 and 12). A discard sends a never-published set back to the list only when the package's sets were read and it is not among them: an unanswered read keeps the page on the set.StudioAiDraftNotice) with 「放弃 AI 的改动」, which drops that one set's draft at its package and asks first only when the matrix holds unsaved edits: the rule feat(studio): the generic item page's Save takes effect at once; an AI draft gets the designers' notice and discard #37026 applied to the generic item page. A person's own leftover draft keeps Discard draft (decision 14). The matrix reports the draft'sdraftChangesfrom the read it already makes; no new request. Issue Studio: a person's Save on a permission set, hook, added action or OWD row publishes a pending AI draft of that item with no notice (the AI notice and its discard exist only on objects and flows) #36660 stays open: this PR applies its rule on the permission set page only; hooks, added actions and the sharing overview's rows are still its scope./studio/PACKAGE/owd(StudioOwdOverviewPage, new;studioOwdOverviewPath,STUDIO_OWD_SECTION), the Access group's menu entry (studioMenuModel.ts: itstoand the current-entry mapping). A set's per-object visibility badge opens it on that object (?object=NAME). Its one read-only mark is the header's (objectui#12453), so the panel's own duplicate is gone.permissionleavesSTUDIO_ITEM_PILLAR, sostudioItemPath(the palette, the AI artifact links, every producer) answers the metadata address; the menu's designer types are named explicitly so a permission set keeps its entry./studio/PACKAGE/access?surface=permission:NAMEredirects to the set's address,?surface=owd:overviewto the overview, a bare/accessto the list of sets, other parameters kept (accessPillarRedirect.ts). A set a read-only base's.custompair adds (every "New similar" copy among them) was listed on the base's pillar and opened at the pair, writable, while the address named the base: its old address now opens at the pair's,/studio/PAIR/metadata/permission/NAME?package=PAIR. For an address that names a set,AccessPillarLanding(accessPillarLanding.tsx, new) reads the base's and the pair's sets, published and draft, as the pillar listed them, andaccessPillarSetHolderdecides: the base when it holds the name, else the pair when it does, else the base; a failed pair read lists none of the pair's sets, a failed base read stays on the base. The pair is the spec's pairing rule (customizationPackageId), as the list of sets derives it. Every other address redirects at once..../permission/NAME/historyopens the History tab:AreaHistoryRedirect's own-editor exemption no longer covers a designer page. The address table's rows say where each moved (redirectsTo).?surface=; the page's address carries it in the path, so the copilot's surface context reads a designer page's address too (areaDesignerItemOf, pillarmetadata), and the page reports its label, so the chip still reads 「正在看:权限 · 组织成员」 (objectstack#35018). Only designer-page types are read this way, andPACKAGE/metadata/permission/new(the area's create page) is no item; every other area item is unchanged.AccessPillar.tsx, maintainer's answer on epic 专题:Studio 重构——某个应用的开发界面:左侧按类型分组的菜单 → 列表 → 右侧全屏详情(去掉顶部分区) #36890, comment 7145880574: this card, reviewed by the maintainer as Tier H by size). Five test files go with it (accessCreateTaken-26836,accessGuard,accessRailLabelLive-26846,accessRailLabels-11862,accessTabs-12456), and the Access cases ofStudioRail.noMatches-26733,emptyStates-12514,readOnlyWording-11781. Not all of that was pillar-only:accessTabs-12456's matrix cases (the five tabs and sections, the facet panels kept mounted for the Save gate, the bulk strip with keyboard focus, the CRUD write, the sharing chip and the object count) andaccessCreateTaken-26836's discard cases (a declined question, a never-published set, a read-only package) moved to the page's pin; what went is the rail, the pillar's own header and its create dialog. The other pins of behaviour that lives on moved to the page too: the matrix's Studio Save (studioSave-36511,saveSurface-12725), New similar (accessNewSimilar-28573, now through ⋯), the suggestions strip on a read-only package (accessSuggestionsReadOnly-33158), the zh wording (accessWording-34795), the status place (statusPlace-12524) and the read-only banner. The page keeps objectstack#34795's ruling: the set's machine name is the title's tooltip, so its header draws no API-name chip.Tests
New pins
StudioPermissionSetPage.fullScreen-36905.test.tsx(26 in round 1): the detail header and no matrix header; section and tool tabs; a tool tab addressable and the matrix kept mounted; × to the list; Discard draft at the set's package, CONTROL none without a draft; a declined question discards nothing; a never-published set's question and its discard back to the list, CONTROL a published set stays and re-reads; no discard on a read-only package; an unanswered sets read keeps the AI discard on the set; the AI notice for copilot and mcp drafts and its discard without a question on a clean page, CONTROL a person's draft; New similar in ⋯ landing at the copy's address with the strip, the no-package answer, CONTROL none on a writable package; the matrix's five sections (order and landing, each section, facets kept mounted, the bulk strip on every row, keyboard focus, CRUD and the header's count, the sharing chip opening the overview on its object and the object count).metadataAreaHost.scope-28561.test.tsx(+4, "New similar" on a read-only base's rows): the base's row offers it and its pair's row does not; the copy opens at its metadata address in the package the clone door names; an answer naming no package opens nothing and says so; CONTROL a writable package offers none. The list's create button is queried by its new test id (metadata-list-create), not its label, which "New similar" no longer collides with.accessPillarRedirect.test.ts(7): set, overview, bare and unknown surfaces, parameters carried; a set held in the pair opens at the pair's address while the overview and the list stay on the base; the set name an address opens; the holder decision (the pair's set, CONTROL the base's own set even when the pair holds the name too, neither, a failed pair read, a failed base read).StudioDesignSurface.accessPairCopy-29674.test.tsx(+4, the retired pillar's address through the real surface):/studio/BASE/access?surface=permission:COPYlands on/studio/PAIR/metadata/permission/COPY?package=PAIR, the copy reads Custom and an edit saves at the pair; a set created in the pair, still a draft, lands there too; the address's other parameters reach the redirect and ride along (?ref=bookmark;?changes=reviewis consumed by the surface, which opens the drawer); CONTROL the base's own set's old address stays on the base and reads Package.StudioPermissionSetPage.fullScreen-36905.test.tsx(+3, the sharing chip's leave guard): with a dirty matrix the chip asks the unsaved-edits question once, and declined the page stays on the set with the edit; confirmed it opens the overview on its object; CONTROL a clean matrix asks nothing.StudioMetadataArea.routes-28561.test.tsx(+4): the set opens in place on writable and read-only packages, CONTROL the cross-package leg keeps the generic page, the old history address opens the History tab.metadataArea.test.ts,studioAddress.test.ts,studioMenuModel.test.ts: the predicate, the address reader (the create page is no item),studioOwdOverviewPath, the moved rows agree with the redirect, the menu entry and current key.Pins moved to the new addresses
StudioDesignSurface.metadataArea-28561(⌘K's Default sharing from a set's page opens/studio/PACKAGE/owd),StudioPaletteGroups.surfaceScope-36900(an item opens at/studio/PACKAGE/metadata/permission/NAME?package=PACKAGE, the menu entry at/studio/PACKAGE/owd),studioPaletteModel-36900(leave, re-enter and stay read on the set's address; the overview's route is a leave).StudioRoute.metadataArea-28561(console): the Studio gate refuses/studio/PACKAGE/owdas it refuses the old overview address.StudioDesignSurface.pillarNavGuard.test.tsx: decision 12 on the set page and the overview page (menu, Back to app, the shell seam; dirty matrix and dirty overview rows; CONTROL clean).StudioDesignSurface.accessPairCopy-29674.test.tsx: a pair's copy at the pair's address lists the base's objects, saves at the pair, names the base by its label, reads Custom; CONTROL the base's own set. Its docstring now claims only the header's half it reads.StudioItemHeader.statusPlace-12524: the read-only link is a direct child of the page's action group, the group a direct child of the actions slot.StudioDesignSurface.aiChipLabel.test.tsx: the chip and the agent's surface context on the set page.accessSegment-12452: the old Access address lands on the list of sets with its entry current.notFound-26708,readOnlyPosture-12453,pillarsClaimSlot-12725,rightSlot-12725,backToApp-36501,changesCount-11787,copilotDraftBadge-12725,publishPosture-12517used the Access pillar as "a package page that claims nothing"; they use the overview page now.Ablations (four, each reverted)
const aiDraft = …forced tofalsethroughscripts/ablation-replace.mjs: anchor 1 → 0, blob3dc44aa6→fdd76cfd; the AI-draft describe went 2 failed, 1 passed (the CONTROL); restored blob == HEAD3dc44aa6,git diff HEADempty.11aaddcc: the never-published test put back to!read?.published.has(name)throughscripts/ablation-replace.mjs: anchor 1 → 0, blob3ac18e32→0923112b; the page's discard cases went 1 failed (the unanswered-read pin), 9 passed (the published CONTROL among them); restored blob == HEAD3ac18e32,git diff HEADempty. A first pass on3d7c1d00stayed green: the pin asserted the address right after the reset and raced the navigation, so it now waits for the re-read only a page that stays makes.7d5d87bd(tree identical to79987757): the landing's holder ignored ({ setHeldIn: holder ?? packageId }→{ setHeldIn: packageId }inaccessPillarLanding.tsx) throughscripts/ablation-replace.mjs: anchor 1 → 0, blobf9502964→169d7fcc;accessPairCopy-29674went 3 failed (the copy, the pair's draft, the carried query), 8 passed (the base's CONTROL among them); restored blob == HEADf9502964,git diff HEADempty.7d5d87bd: the chip's guard removed (confirmUnsavedLeave(() => navigate(…))→ a barenavigate(…)inStudioPermissionSetPage.tsx) throughscripts/ablation-replace.mjs: anchor 1 → 0, blob3ac18e32→2b68c388;fullScreen-36905went 2 failed (declined and confirmed both ask once), 27 passed (the clean CONTROL among them); restored blob == HEAD3ac18e32,git diff HEADempty. A first spelling was refused by the tool before anything ran (its replacement was a substring of the anchor, so the replacement count could not rise).Acceptance notes
StudioDesignSurface'sPILLAR_FOR_SURFACE_TYPEstill routes apermissionsurface request through/access?surface=, and its "open Access" toast action through bare/access; both now land via the redirect. They go with the pillar routes in Studio 重构(4-1):删掉分区路由和残留(:packageId/:tab 路由、AREA_PILLAR_FOR_TYPE、pillar 文案、旧 Studio 应用的菜单项) #36909.PermissionMatrixEditor's Studio header without aframe(its ownStudioItemHeader, History button and ⋯) has no Studio host since the pillar is gone; 13 of the matrix's own unit tests still render it, so it stays this round and its doc comments say so. Deleting it with those tests' rewrite goes with Studio 重构(4-1):删掉分区路由和残留(:packageId/:tab 路由、AREA_PILLAR_FOR_TYPE、pillar 文案、旧 Studio 应用的菜单项) #36909. The matrix's prop docs no longer name the Access pillar as their host.customizationMark: 'added'): a permission set takes no override (ADR-0005), so a set the pair holds is one it adds.node scripts/pm/overlap-check.mjson7d5d87bd(tree identical to79987757):origin/main(3b4f0b98) merges cleanly; fix(app-shell,console): the shell package list, AI chat lists and studio-design reads and writes send the stored bearer token #37185 merges cleanly; feat(studio): the object designer opens full-screen on its metadata address, tabs in #36513's order #37168 and feat(studio): the flow designer opens full-screen on its metadata address; no flow rail (#36903) #37169 (open) conflict onStudioAiCopilot.tsx,StudioDesignSurface.tsx,StudioMetadataArea.tsx,metadataArea.ts,studioAddress.ts,studioMenuModel.tsand their tests; feat(studio): remove the Studio home; /studio opens the last package or Setup > Packages #37166 now conflicts onStudioDesignSurface.notFound-26708.test.tsx, a file this round does not touch. Whichever lands second rebases.accessPairCopy-29674andaccessPillarRedirect.test.ts, ablated); S1 fixed (the chip's dirty-matrix cases, ablated); N1 fixed (the carried-query case through the real surface). The pair redirect reads the spec's pairing rule rather than the surface'spairId: that value is set only once the package list and its manifests answer, and a failed manifests read leaves it unset, which would hold the redirect forever.areaDesignerItemOfreadspermission/newas no item); N6 fixed and pinned (the unanswered-read case, ablated above); N9 in item 3.Verification
First to read:
ui/packages/app-shell/src/views/studio-design/StudioPermissionSetPage.tsx— the page; the discard paths (dropDraft) and the New similar landing.ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.tsx— theframebranch ofrenderStudio: the sections stay mounted under a tool tab.ui/packages/app-shell/src/views/studio-design/StudioAiCopilot.tsx— the copilot's context now reads a designer page's path.Two-minute check: on HotCRM, open
/studio/PACKAGE/access?surface=permission:NAMEfrom an old bookmark — it lands on/studio/PACKAGE/metadata/permission/NAME?package=PACKAGE, the matrix full-screen with × in the header (for a "New similar" copy on a read-only base, on/studio/PACKAGE.custom/metadata/permission/NAME?package=PACKAGE.custom, writable); the menu's Access group opens 「谁能看到哪些记录」 at/studio/PACKAGE/owd.Local runs
Round 3, head
79987757(tree identical to7d5d87bd, where these ran; only the two commit messages' trailer pair was reworded), throughscripts/pm/os-verify-lock.sh:ui/packages/app-shell/src/views/studio-design/whole directory: 299 files passed, 2206 tests.ui/packages/app-shelltype-check(bothtscprograms): exit 0, 0 errors.--no-inline-configon the six touched source and test files: exit 0, 0 errors (11 warnings, every one on an untouched line ofStudioDesignSurface.tsx).check:test-source-alias(also on79987757),check:nul-bytes,check:cross-package-test-inputs,check:undeclared-dep-imports,check:tier-file-adoption,check:published-files,check-empty-changeset.mjs,check-adr-0087-registration.mjs,check-changeset-no-major.mjs,check-closing-keyword-parity.mjs. The other 28 families of the same 38-family derivation read no file this round changes and were green onbcde26a0; CI runs them all.Round 2:
objectstack-ai/objectstack, headbcde26a0(origin/main merged at709d2c1e), throughscripts/pm/os-verify-lock.sh:80bd343a(73 files: every test this PR adds or edits, plus each that names the page, the list page, the area's address reader, the palette or the overview's route): 73 passed, 938 tests; the 15 filesbcde26a0then edited re-run there: 15 passed, 108 tests. CI runs the whole UI farm.ui/packages/app-shelltype-check(bothtscprograms) onbcde26a0: exit 0.check-i18n-call-site-keys.mjsexit 0;check-i18n-dead-keys.mjsexit 0 (report only; the 15 restored rows are listed as candidates).dispatch-gates.mjs --commands(same 38 families on80bd343aandbcde26a0): run one by one, exit captured before any pipe.check:test-source-aliasexit 1 on80bd343a(15 surface tests this PR edits now reach the palette'simport('@object-ui/plugin-detail')since feat(studio): ⌘K on every Studio design page lists the package's menu and items #37108; collection-time import added inbcde26a0), re-run exit 0; every other family exit 0;pnpm --dir ui exec vitest run scripts/172 files passed, 2 skipped, 5130 tests.--ranreconciliation: 38 derived, 38 run, 0 NOT-MEASURED, every line with its exit code. Onbcde26a0re-run:check:test-source-alias,check:undeclared-dep-imports,check:cross-package-test-inputs,check:type-check-debt,check:nul-bytes, each exit 0.Generated by Claude Code