Skip to content

feat(studio): the generic item page's Save takes effect at once; an AI draft gets the designers' notice and discard - #37026

Merged
objectstack-fleet[bot] merged 10 commits into
mainfrom
claude/issue-36902-detail-save-at-once
Nov 24, 2026
Merged

objectstack-fleet[bot] merged 10 commits into
mainfrom
claude/issue-36902-detail-save-at-once

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Yibo Wang · project thread
Fixes #36902

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:管理员在 Studio 的通用详情页(钩子、选项集、视图等)改完点「保存」,改动立刻生效;不再有自动保存开关,也不用再点一次「发布」。
  • 为什么做:Studio 重构专题里「通用详情保存即生效」这一项,让通用详情和各个设计器的保存方式一致。
  • 出错会怎样:发布被拒时,页面上方写明原因,什么都不生效,页面上的修改保留可以再存;AI 留下的草稿保留并有提示,可以一键放弃;本改动可以直接撤回。
  • 要你做什么:无

What changes

Studio's generic item page (ResourceEditPage, every type without its own designer: hook, picklist, view, page, app, doc…) now saves the way the designers do (#36511, epic decisions 1, 12, 14).

  1. Save = draft + this one item's publish. Save writes the draft (PUT /meta/:type/:name?mode=draft, If-Match / If-None-Match pin and conflict dialog unchanged), then publishes that one item (POST /meta/:type/:name/publish) at the same ?package= and bundle member. The publish is pinned to the published version the page loaded, through the existing DraftSaveGuard.publish (Studio save goes live: two admins saving the same published object, the later save silently overwrites the earlier one (the published layer has no version a save can pin) #36601), so a Save over a row another editor published since opens the same conflict dialog (reload, overwrite, keep editing). The auto-save switch, its 1.5 s debounce and the metadata-admin:autosave browser setting are gone; the header's Publish and discard-draft buttons are gone.
  2. Create publishes after its first save (If-None-Match *, then the publish).
  3. AI draft (draftChanges[].by is copilot or mcp): the page shows the AI's version under the designers' StudioAiDraftNotice; a person's Save makes it live together with their edits; "Discard the AI's changes" drops that one item's draft at its package and member, and asks first (in the page's own dialog, objectui#13333) when the page holds unsaved edits.
  4. A person's pending draft from before this change is marked "This item has unpublished changes" with its own Publish (pinned) and Discard for that one item.
  5. Leave guard: ×, ‹ ›, the side menu, in-app links, reload and close ask first when the page holds unsaved edits; browser Back is not intercepted (decision 12). The seam was already in place (chrome/unsavedEdits.ts); this PR pins it on this page.
  6. A refused publish shows its reason above the editor in the designers' words (publishRefusal, server text under Details). Nothing goes live; the draft the Save wrote is taken back when no draft was pending before, and the edits stay on the page, unsaved. A draft that was pending before (the AI's or a person's) is kept.
  7. @object-ui/data-objectstack: MetadataClient.layered() now forwards overlayVersion. The client rebuilt its answer field by field and dropped it, so a publish pin read off layered() was always null. This is why the Save's publish could not be pinned; it also made the object page's Studio save goes live: two admins saving the same published object, the later save silently overwrites the earlier one (the published layer has no version a save can pin) #36601 publish pin a no-op on a server that serves the field. Fixed in place (bounded fix: same defect class as the card's pin, mechanical, the file had no other claim, no new gate surface) and pinned in metadata-client.layeredDraft-29793.test.ts. Clause-② yes (widening): the published package's exported MetadataLayered type gains the optional member overlayVersion?: string | null (claim amendment on Studio 重构(2-2):通用详情改成保存即生效,AI 草稿照设计器的规则提示和放弃;离开时拦未保存(浏览器后退除外) #36902, 7137741670; L1-b (3) S1, 7137721696).

New shared piece: detailSaveAtOnce.ts (publishDetailSave, isAiDraft). The designers' publishSavedItem (studioSaveBar.tsx) names no bundle member, so this page carries its own instead of changing that file. StudioDesignSurface.tsx, DraftConflictDialog.tsx and studioSaveBar.tsx are unchanged (reused as they are).

How this relates to #36726 and #36350

Read first (by risk)

  1. ResourceEditPage.tsx doSave: the draft save → publishDetailSave → refresh sequence, and the refused branch (take-back only when hadDraft is false).
  2. detailSaveAtOnce.ts: the take-back on a refused or conflicted publish.
  3. metadata-client.ts layered(): the two overlayVersion forwards.

Two-minute check

Open Studio → All metadata → any view, change its label, press Save. Expected: one PUT …?mode=draft and one POST …/publish in the network panel, the Unsaved chip clears, no "unpublished changes" line, and GET /api/v1/meta/view/NAME already serves the new label.

Tests

Acceptance run (the card's 验收 scenario, real browser, self-built stack)

Backend examples/app-showcase (objectstack dev --seed-admin --fresh) and the console dev server, both built from this branch, on per-agent ports. The items are my own, authored into the showcase's customization package (com.example.showcase.custom): a hook, a shared option set (picklist) and two views. The backend ran with OS_METADATA_WRITABLE=picklist: the picklist type is not runtime-creatable by default (NOT_CREATABLE, its registry entry), so the option-set leg needs that operator setting. Each leg edits the label and presses Save once; the network log is the page's own requests.

Item Before Save Writes after Save Live read after Save
hook s36902_stamp_title chip unsaved, no request in 2.5 s PUT …?mode=draft&package=…custom then POST …/publish?package=…custom (200) new label served; no unpublished-changes line
picklist s36902_priority same same pair (200) same
view showcase_task.s36902_triage same same pair (200) same
Screenshots: hook, option set, view (unsaved, then saved and live)

hook, unsaved
hook, saved and live
option set, unsaved
option set, saved and live
view, unsaved
view, saved and live

AI draft. Written through the real MCP door, not faked: an OAuth client (dynamic registration, PKCE, consent, metadata:write) called save_metadata_draft on showcase_task.s36902_ai; the draft read then carried draftChanges: [{path: ["label"], by: "mcp", …}].

  • The page shows the AI's version under the notice (4). An edit then "Discard the AI's changes" asks in the page's own dialog (5); confirming sends one DELETE …?state=draft&package=…custom, the draft read answers 404 and the live version is back (6).
  • A second MCP draft, then an edit and Save: PUT draft + POST …/publish (200), the draft read answers 404, the live label is the AI's change plus the person's edit (7).
  • Leave guard: with an unsaved edit, × asked "You have unsaved changes. Leave this page anyway?", and Cancel stayed on the item.
Screenshots: AI draft notice, discard, save

AI draft notice
discard asks first with unsaved edits
AI draft discarded, live version back
AI draft saved live with the person edit

Images: orphan branch claude/issue-36902-screenshots at 566b916.

Live e2e

LIVE_APP_URL=… LIVE_API_URL=… pnpm exec playwright test -c playwright.live.config.ts e2e/live/studio-detail-save-at-once.spec.ts e2e/live/studio-editor.spec.ts: 3 passed (the new spec: no auto-save in 2.5 s, × asks, Save sends exactly PUT + POST …/publish, the live page has the added block, the draft read is 404, browser Back is not intercepted; studio-editor.spec.ts's Add-block round trip now reads the published item after Save).

Unit

At head 09693db5c, under the shared verify lock, one run: every test file under metadata-admin/ plus every other ui test file that mentions publish, draft, auto-save or the detail page (338 files), then type-check (which compiles the test files too) of @object-ui/data-objectstack, @object-ui/i18n and @object-ui/app-shell.

Readings
Test Files  338 passed (338)
     Tests  2918 passed (2918)
packages/data-objectstack type-check: Done
packages/i18n type-check: Done
packages/app-shell type-check: Done
os-verify-lock: VERDICT command-exit 0

New: ResourceEditPage.saveAtOnce-36902.test.tsx (19 cases over the real MetadataClient and an in-memory server that honours If-Match / If-None-Match on the draft door and on the publish door: items 1–6, the leave guard on ×, ‹ ›, links, beforeunload, Back unguarded, create publishes, refused create). metadata-client.layeredDraft-29793.test.ts gains the overlayVersion forward on both answer shapes (served value, served null, absent).

Acceptance notes

  • 'Changes 1' in shots 1–3 is the AI draft of showcase_task.s36902_ai, written through MCP before the save leg for shots 4–7; it clears in shot 6 once that draft is discarded (not the hook: its Save sent PUT ?mode=draft then POST /publish 200).

  • Existing detail-page suites that waited out the auto-save or clicked the header's Publish / Discard draft now press Save and read the Save's own publish, or use the unpublished-changes line's buttons (14 files). Their doubles gained a publish that drains the draft, as the real door does; assertions that only held because a draft stayed pending after Save were rewritten to the live result. layersUnsaved-11799's SAVE case now expects one /layers re-read: a Save publishes, so the item has a layer afterwards.

  • Leftover localStorage.setItem('metadata-admin:autosave', '0') lines in suites this PR does not otherwise touch are now no-ops; left as they are to keep the diff to the card.

  • The platform checklist step that says the ResourceEditPage draft auto-saves and is then published (docs/qa/platform-checklist/areas/studio-authoring.json, the page Add-block item) is now stale. carrier: Studio 重构(4-2):新形态的端到端测试、总走查,更新平台测试清单、文档和技能里的 Studio 地址与说法 #36910 (the epic's checklist-and-docs card).

  • The designers' own auto-save (Data / Automations / Access pillars) is unchanged: out of this card.

Verification

Local gates (derived for this diff) and reconciliation

Changed lines: 1,650 over 24 files (1,317 added, 333 removed), one PR.

🤖 Generated with Claude Code

Save writes the item's draft, then publishes that one item, pinned to
the published version the page loaded. The auto-save switch is gone.
An AI-written draft shows the designers' notice and its discard; a
person's pending draft is marked as unpublished changes with its own
Publish and Discard. A refused publish shows its reason.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufziBCAytAzzCu3iPBFR
The client rebuilt the layered answer field by field and dropped
overlayVersion, so a Studio Save's pinned publish never had a pin.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufziBCAytAzzCu3iPBFR
…gle-item publish

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufziBCAytAzzCu3iPBFR
The detail page asks every confirmation in its in-app dialog, never the
browser's confirm(). The touched test files pay the lint module's first
load at collection.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufziBCAytAzzCu3iPBFR
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt

席位核对 — REWORK · repo:objectstack#3 · head 09693db · 2026-11-24T16:28Z

L1: REWORK
Head-sha: 09693db5c2212b0f86d54427ea2fbd8c828ca617
Reviewer: L1-b (3) (seat 3, area ux-E).
Tier: not Tier H. This is card #36902's only PR: 24 files, +1317/−333 (1,650 lines, under the 3,000-line per-card line). Not governed.

Read

Checklist

Findings

No must-fix.

Delta read owed: L1 on the new head plus a TIER_DEFAULT L2 (S1).

The published MetadataLayered type gains an optional overlayVersion member.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufziBCAytAzzCu3iPBFR
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt

Contract-review-claim: session_01WGufzhjqviExWpzQMm57Mt · head f8e4b50 · 2026-11-24T16:32Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt

Contract review

Served-tier: TIER_DEFAULT
Head-sha: f8e4b50162a1bdfb8e45f58893a8d28b5e33bc42
Local-runs: none

This is the declaration face. The review is owed by the Clause-②: yes (widening) line alone: the PR's 24 committed paths hold no published schema, no governed path and no narrowing. Claim 7137838833.

Inputs read:

  • Card Studio 重构(2-2):通用详情改成保存即生效,AI 草稿照设计器的规则提示和放弃;离开时拦未保存(浏览器后退除外) #36902, claim 7133542157 and amendment 7137741670. readClause2Line on 7137741670 gives declared · yes · widening (line Clause-②: yes (widening) (was no)). The amendment adds ui/packages/data-objectstack/src/metadata-client.ts and its test to the file surface.
  • Dev report 7137086408, and the PR body (line 5: Clause-②: yes (widening); item 7 names the widening).
  • The net diff against merge base c75453e2, and git diff 09693db5 f8e4b501: the changeset's declaration line and its data-objectstack sentence only. Every code file is byte-identical to the head L1 read in 7137721696.
  • Check-runs: green on 09693db5 (45 success, 13 expected skip, 0 failed). On this head they are still running, and the L1 ACCEPT waits for them.

Nothing was built, run or re-run.

① Derived judgments

② Semver level

③ Boundary flags

Implemented-by: claude/issue-36902-detail-save-at-once
Reviewed-by: session_01WGufzhjqviExWpzQMm57Mt

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt

席位核对 — ACCEPT · repo:objectstack#3 · head f8e4b50 · 2026-11-24T16:54Z

L1: ACCEPT
Head-sha: f8e4b50162a1bdfb8e45f58893a8d28b5e33bc42
Reviewer: L1-b (3) (seat 3, area ux-E). This is the delta read of REWORK 7137721696.
Tier: not Tier H. This is card #36902's only PR: 1,650 lines. Not governed.
Contract review: TIER_DEFAULT PASS on this head, 7137872253 (claim 7137838833).

Read

Findings

  • S1: closed. Clause-②: yes (widening) reads the same in the changeset, PR body line 5, and claim amendment 7137741670 (readClause2Line: declared · yes · widening). The amendment adds metadata-client.ts and its test to the file surface. The changeset now names the exported MetadataLayered type's optional overlayVersion member. Metadata-protocol: none and patch are kept. The owed TIER_DEFAULT L2 is 7137872253.
  • N1: closed. The body's Acceptance notes say the "Changes 1" in shots 1–3 is the run's AI draft of showcase_task.s36902_ai, which clears in shot 6.
  • N2: unchanged (the old pillar switcher in the shots, expected until feat(studio): a collapsible left menu of six groups replaces the top pillar nav #36985 lands).

Landable on full green. Sequencing stays as recorded: if #36958 lands first, this PR adds the beforeReload 'kept' line in publishDetailSave before landing; if this lands first, #36958 adds it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt

Contract-review-claim: session_01WGufzhjqviExWpzQMm57Mt · head 8a036c9 · 2026-11-24T17:25Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 8a036c91012fe78d92d0998aaeba1457c7a76dd9
Local-runs: none

This is the declaration face. The review is owed by the Clause-②: yes (widening) line alone: the PR's 24 committed paths hold no published schema, no governed path and no narrowing. Claim 7139188418. This is the fresh record after the merge-main round (landing rule ①); the record on f8e4b501 was 7137872253.

Inputs read:

  • Card Studio 重构(2-2):通用详情改成保存即生效,AI 草稿照设计器的规则提示和放弃;离开时拦未保存(浏览器后退除外) #36902, claim 7133542157 and amendment 7137741670. readClause2Line on 7137741670 gives declared · yes · widening (line Clause-②: yes (widening) (was no)). The amendment adds ui/packages/data-objectstack/src/metadata-client.ts and its test to the file surface.
  • Dev report 7137086408, and the PR body (line 5: Clause-②: yes (widening); item 7 names the widening).
  • The merge, 8a036c91. Its parents are f8e4b501 (the head PASSed in 7137872253) and bfd1049f (main, 17 commits after c75453e2). The sorted changed lines of git diff c75453e2 f8e4b501 and of git diff bfd1049f 8a036c91 are both 1,650 lines and identical, line for line. So the merge carries the branch over unchanged. In metadata-client.ts, main's changedAt work and this PR's overlayVersion forward sit side by side, and the PR's own diff there is the same two forwards and the interface member.
  • Check-runs on 8a036c91: still running, and the L1 ACCEPT waits for them. f8e4b501 was green (47 success, 15 expected skip, 0 failed).

Nothing was built, run or re-run.

① Derived judgments

② Semver level

③ Boundary flags

Implemented-by: claude/issue-36902-detail-save-at-once
Reviewed-by: session_01WGufzhjqviExWpzQMm57Mt

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt

席位核对 — ACCEPT · repo:objectstack#3 · head 8a036c9 · 2026-11-24T17:47Z

L1: ACCEPT
Head-sha: 8a036c91012fe78d92d0998aaeba1457c7a76dd9
Reviewer: L1-b (3) (seat 3, area ux-E). This is the merge-main round read. The last ACCEPT was 7138410788 on f8e4b501.
Tier: not Tier H. This is card #36902's only PR: 1,650 lines. Not governed.
Contract review: a fresh TIER_DEFAULT PASS on this head, 7139209286 (claim 7139188418), per landing rule ①.

Read

  • The merge, 8a036c91. Its parents are f8e4b501 and bfd1049f (main, 17 commits after the old base c75453e2). The hand-off named 5ff858b7 as the merged main; the commit's own second parent is bfd1049f, so that is what I read. I sorted the changed lines of git diff c75453e2 f8e4b501 and of git diff bfd1049f 8a036c91. Both are 1,650 lines and identical, so the merge carries the branch over unchanged, with no conflict resolution in the PR's own lines. metadata-client.ts keeps main's changedAt work beside this PR's overlayVersion forward. The studio en/zh catalogues differ from main only by this PR's two added and three removed keys.
  • Check-runs on 8a036c91: 45 success, 13 expected skip, 0 failed, 0 pending. Mergeable clean.

Findings

No must-fix, no should-fix. S1 and N1 stay closed (7138410788). N2 is unchanged.

Landable on full green. #36958 has not merged, so the beforeReload 'kept' line stays with whichever of the two lands second.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufziBCAytAzzCu3iPBFR

Landing · 2026-11-24T17:48Z · ACCEPT 7139710251 at head 8a036c9

reading value
check-governed-merges.mjs --pr 37026 NOT governed · +1317/−333 (1,650 ≤ 3000; card total 1,650, one PR)
landing-k.mjs --pr 37026 CAN'T ANSWER on the earlier head (UI-only, no Test Core planner). K read via merge-base: base bfd1049 (the merge-main round), main ahead by 4. Their file sets meet this PR's only on the studio en/zh catalogues (key additions on both sides; the merge queue re-tests the merged tree). K = 4 < 15. Before the merge round K was 17, which is why main was merged first
contract review Clause-②: yes (widening) (claim amendment 7137741670) · TIER_DEFAULT L2 PASS on this head 7139209286 (claim 7139188418); earlier records 7137872253 at f8e4b50
L1 REWORK 7137721696 → ACCEPT 7138410788 (f8e4b50) → merge-round ACCEPT 7139710251 (8a036c9)
checks at 8a036c9 45 success, 13 expected skip, 0 failed, 0 pending; mergeable clean

Open findings are nits only:

Sequencing (seat note 7137138620 on #36958): #36958 has not merged, so it is the second lander and adds the one-line beforeReload 'kept' for the hadDraft case in publishDetailSave.

State: ready + auto-merge (Tier S). On MERGED, #36902 closes by Fixes, and area ux-E removes pm:dispatched.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 24, 2026 17:48
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit 1e96009 Nov 24, 2026
59 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-36902-detail-save-at-once branch November 24, 2026 18:11
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…ess; the sharing overview gets its own route (objectstack-ai#37089)

Fixes objectstack-ai#36905

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户能看到什么变化:管理员在 Studio 里点开一个权限集,右侧整块显示权限矩阵,左上角 ×
回到权限集列表,页签里能看引用、历史和源码;「谁能看到哪些记录」有了自己的页面,在左侧菜单「访问」里;旧书签自动跳到新地址。
- 为什么做:Studio 重构专题里「权限集矩阵全屏、默认共享总览独立」这一项,让权限集和其他元数据一样从列表点开、全屏编辑。
- 出错会怎样:有未保存修改时点 ×、切菜单、刷新或关标签页会先问(浏览器后退键不问);AI 留下的草稿有提示并可一键放弃;本改动可以直接撤回。
- 要你做什么:这个改动超过 3,000 行(主要是删掉旧的权限侧栏和只为它服务的测试),按您的安排开发完等您审核合入。

## 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:

- **No published string is removed.** The 15 studio catalogue rows only
the pillar read (`engine.studio.access.*` of its rail and create dialog,
and `engine.studio.owd.railLabel`, en and zh) ship in the released
`@object-ui/i18n`, so they stay in
`ui/packages/i18n/src/namespaces/studio/en.ts` and `zh.ts`,
byte-for-byte as on `main`, unread. `check:i18n-dead-keys` lists them as
candidates (report only), as it does other unread rows.
- **Merged with objectstack-ai#37108** (⌘K on every Studio design page): `origin/main`
is merged at `709d2c1e`, and objectstack-ai#37108's palette and ⌘K pins now expect the
set's address and the overview's route.
- **The browser's Back button is not guarded** (epic objectstack-ai#36890 decision
12): ×, ‹ ›, the left menu, ⌘K, Back to app, a reload and a tab close
ask before unsaved edits are dropped; Back does not.

1. **The set's full-screen page** (`StudioPermissionSetPage`, new). On a
package's leg, `/studio/PACKAGE/metadata/permission/NAME` opens the
matrix (`PermissionMatrixEditPage`, its Studio presentation) in the area
instead of sending the set to the Access pillar
(`AREA_DESIGNER_PAGE_TYPES` / `areaItemOpensDesignerPage` in
`metadataArea.ts`). The header is the full-screen detail's
(`ResourceDetailHeader`, from objectstack-ai#36892/objectstack-ai#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, then
`ItemToolTabs`' 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.
2. **What the pillar drew around the matrix comes along.** Discard
draft, Explain access, the suggested-audience strip, and on a read-only
base "New similar": in ⋯ on the page, and as a row action on the base's
own rows in the list of sets (`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.
3. **Card item 6, decided here.** An AI-written pending draft (copilot
or MCP) gets the designers' notice (`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 objectstack-ai#37026 applied to the
generic item page. A person's own leftover draft keeps Discard draft
(decision 14). The matrix reports the draft's `draftChanges` from the
read it already makes; no new request. Issue objectstack-ai#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.
4. **The sharing overview's own route**, `/studio/PACKAGE/owd`
(`StudioOwdOverviewPage`, new; `studioOwdOverviewPath`,
`STUDIO_OWD_SECTION`), the Access group's menu entry
(`studioMenuModel.ts`: its `to` and 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.
5. **Address switch.** `permission` leaves `STUDIO_ITEM_PILLAR`, so
`studioItemPath` (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:NAME` redirects to the set's
address, `?surface=owd:overview` to the overview, a bare `/access` to
the list of sets, other parameters kept (`accessPillarRedirect.ts`). A
set a read-only base's `.custom` pair 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, and
`accessPillarSetHolder` decides: 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/history` opens the History tab:
`AreaHistoryRedirect`'s own-editor exemption no longer covers a designer
page. The address table's rows say where each moved (`redirectsTo`).
6. **The copilot keeps its context.** The pillar put the set in
`?surface=`; the page's address carries it in the path, so the copilot's
surface context reads a designer page's address too
(`areaDesignerItemOf`, pillar `metadata`), and the page reports its
label, so the chip still reads 「正在看:权限 · 组织成员」 (objectstack#35018). Only
designer-page types are read this way, and
`PACKAGE/metadata/permission/new` (the area's create page) is no item;
every other area item is unchanged.
7. **Card item 5: the Access pillar and its rail are deleted**
(`AccessPillar.tsx`, maintainer's answer on epic objectstack-ai#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 of
`StudioRail.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) and
`accessCreateTaken-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

<details><summary>New pins</summary>

- `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:COPY` lands 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=review` is 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.

</details>

<details><summary>Pins moved to the new addresses</summary>

- From objectstack-ai#37108 after the merge: `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/owd` as 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-12517`
used the Access pillar as "a package page that claims nothing"; they use
the overview page now.

</details>

<details><summary>Ablations (four, each reverted)</summary>

- Round 1: `const aiDraft = …` forced to `false` through
`scripts/ablation-replace.mjs`: anchor 1 → 0, blob `3dc44aa6` →
`fdd76cfd`; the AI-draft describe went 2 failed, 1 passed (the CONTROL);
restored blob == HEAD `3dc44aa6`, `git diff HEAD` empty.
- This round, on `11aaddcc`: the never-published test put back to
`!read?.published.has(name)` through `scripts/ablation-replace.mjs`:
anchor 1 → 0, blob `3ac18e32` → `0923112b`; the page's discard cases
went 1 failed (the unanswered-read pin), 9 passed (the published CONTROL
among them); restored blob == HEAD `3ac18e32`, `git diff HEAD` empty. A
first pass on `3d7c1d00` stayed 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.
- Round 3, on `7d5d87bd` (tree identical to `79987757`): the landing's
holder ignored (`{ setHeldIn: holder ?? packageId }` → `{ setHeldIn:
packageId }` in `accessPillarLanding.tsx`) through
`scripts/ablation-replace.mjs`: anchor 1 → 0, blob `f9502964` →
`169d7fcc`; `accessPairCopy-29674` went 3 failed (the copy, the pair's
draft, the carried query), 8 passed (the base's CONTROL among them);
restored blob == HEAD `f9502964`, `git diff HEAD` empty.
- Round 3, on `7d5d87bd`: the chip's guard removed
(`confirmUnsavedLeave(() => navigate(…))` → a bare `navigate(…)` in
`StudioPermissionSetPage.tsx`) through `scripts/ablation-replace.mjs`:
anchor 1 → 0, blob `3ac18e32` → `2b68c388`; `fullScreen-36905` went 2
failed (declined and confirmed both ask once), 27 passed (the clean
CONTROL among them); restored blob == HEAD `3ac18e32`, `git diff HEAD`
empty. 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).

</details>

## Acceptance notes

- `StudioDesignSurface`'s `PILLAR_FOR_SURFACE_TYPE` still routes a
`permission` surface 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 objectstack-ai#36909.
- `PermissionMatrixEditor`'s Studio header without a `frame` (its own
`StudioItemHeader`, 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 objectstack-ai#36909. The matrix's prop docs no longer name
the Access pillar as their host.
- On a pair's leg the provenance chip reads Custom for every set
(`customizationMark: 'added'`): a permission set takes no override
(ADR-0005), so a set the pair holds is one it adds.
- The suggested-audience strip draws on every set page, as it drew above
every set in the pillar.
- `node scripts/pm/overlap-check.mjs` on `7d5d87bd` (tree identical to
`79987757`): `origin/main` (`3b4f0b98`) merges cleanly; objectstack-ai#37185 merges
cleanly; objectstack-ai#37168 and objectstack-ai#37169 (open) conflict on `StudioAiCopilot.tsx`,
`StudioDesignSurface.tsx`, `StudioMetadataArea.tsx`, `metadataArea.ts`,
`studioAddress.ts`, `studioMenuModel.ts` and their tests; objectstack-ai#37166 now
conflicts on `StudioDesignSurface.notFound-26708.test.tsx`, a file this
round does not touch. Whichever lands second rebases.
- The seat's L1 REWORK (7150986891) on the contract review (7150969735):
M1 fixed (item 5, pinned in `accessPairCopy-29674` and
`accessPillarRedirect.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's `pairId`: 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.
- Review nits from the seat's L1 (7147848289): N1 above; N2, N3, N4, N7,
N8 and N10 fixed in the pins and comments named in Tests; N5 fixed
(`areaDesignerItemOf` reads `permission/new` as no item); N6 fixed and
pinned (the unanswered-read case, ablated above); N9 in item 3.

## Verification

First to read:
1.
`ui/packages/app-shell/src/views/studio-design/StudioPermissionSetPage.tsx`
— the page; the discard paths (`dropDraft`) and the New similar landing.
2.
`ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.tsx`
— the `frame` branch of `renderStudio`: the sections stay mounted under
a tool tab.
3. `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:NAME` from 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`.

<details><summary>Local runs</summary>

Round 3, head `79987757` (tree identical to `7d5d87bd`, where these ran;
only the two commit messages' trailer pair was reworded), through
`scripts/pm/os-verify-lock.sh`:

- `ui/packages/app-shell/src/views/studio-design/` whole directory: 299
files passed, 2206 tests.
- `ui/packages/app-shell` `type-check` (both `tsc` programs): exit 0, 0
errors.
- eslint `--no-inline-config` on the six touched source and test files:
exit 0, 0 errors (11 warnings, every one on an untouched line of
`StudioDesignSurface.tsx`).
- Run one by one, exit captured before any pipe, each exit 0:
`check:test-source-alias` (also on `79987757`), `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 on `bcde26a0`; CI runs them all.

Round 2:

`objectstack-ai/objectstack`, head `bcde26a0` (origin/main merged at
`709d2c1e`), through `scripts/pm/os-verify-lock.sh`:

- Affected UI set on `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 files `bcde26a0` then edited re-run there: 15 passed, 108 tests. CI
runs the whole UI farm.
- `ui/packages/app-shell` `type-check` (both `tsc` programs) on
`bcde26a0`: exit 0.
- `check-i18n-call-site-keys.mjs` exit 0; `check-i18n-dead-keys.mjs`
exit 0 (report only; the 15 restored rows are listed as candidates).
- `dispatch-gates.mjs --commands` (same 38 families on `80bd343a` and
`bcde26a0`): run one by one, exit captured before any pipe.
`check:test-source-alias` exit 1 on `80bd343a` (15 surface tests this PR
edits now reach the palette's `import('@object-ui/plugin-detail')` since
objectstack-ai#37108; collection-time import added in `bcde26a0`), re-run exit 0;
every other family exit 0; `pnpm --dir ui exec vitest run scripts/` 172
files passed, 2 skipped, 5130 tests. `--ran` reconciliation: 38 derived,
38 run, 0 NOT-MEASURED, every line with its exit code. On `bcde26a0`
re-run: `check:test-source-alias`, `check:undeclared-dep-imports`,
`check:cross-package-test-inputs`, `check:type-check-debt`,
`check:nul-bytes`, each exit 0.

</details>

---
_Generated by [Claude
Code](https://claude.ai/code/session_01QSeKYocL4fDtJqdSgFrR6h)_

<!-- signed: repo:objectstack#4 · os-justin ·
session_01QSeKYkkwuF6UuFtu85Yd5H -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants