Repository navigation
Labels
area:uxdomain:uiDomain lane — seat card indexed by label:pm:seatenhancementNew feature or requestpriority:p2Medium: important, M3
Description
repo:objectstack#3 · os-support-ai · session_01WGufzufqmKuir7GiTdwGd3Z
③ topic child · Source: topic #36890 (decisions 1, 12, 14); continues epic #36510 child 1 (#36511, merged) on the generic detail page. Part of #36890.
今天(读代码确认,主干 0819cab)
- 通用详情:保存写草稿(
saveDraftVersioned,MA/ResourceEditPage.tsx:2141),发布是第二步(doPublish,:2417-2441),带 If-Match 钉和冲突对话框(MA/DraftConflictDialog.tsx),有自动保存开关(:2636-2657)。 - 设计器:保存 = 写这一项的草稿再发布这一项(
SD/studioSaveBar.tsx:13-19);单项发布门POST /api/v1/meta/:type/:name/publish。 - AI 草稿规则(设计器):页面显示 AI 的草稿版本,人保存时一并生效,另有「放弃 AI 的改动」(
SD/StudioAiDraftNotice.tsx:3-11);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 指出只有对象和流程有。 - 离开拦截:
AS/chrome/unsavedEdits.ts:16-18, 48-51,控制台是BrowserRouter(ui/apps/console/src/App.tsx:305),浏览器后退拦不了。
要做的
- 保存 = 写草稿 + 发布这一项(同设计器),保留 If-Match 钉和冲突对话框;去掉自动保存开关(和 Studio 里人工修改改成「保存」「取消」,保存后这一项立刻生效;不再自动存草稿,不用整包发布 #36511 一致)。
- 新建模式:保存后一步发布(今天是从未发布的草稿
holdsNoLayer)。 - AI 草稿(
by是 copilot 或 mcp):显示 AI 的版本并提示,人保存一并生效,可「放弃 AI 的改动」,放弃前有未保存改动要先问(决定 1,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 的规则落到通用详情)。 - 上线时已有的人工草稿:标成「有未发布的改动」,可逐项发布或放弃(决定 14)。
- 离开拦截:×、‹ ›、左侧菜单、站内链接、刷新和关页都拦;浏览器后退按平台约定不拦(决定 12)。
- 单项发布被拒(例如引用了只存在于草稿里的对象)时显示拒绝原因。
- 和 Studio Save: the object extension, hook, action and flow editors still publish unpinned, so two admins saving one of them, the later save silently overwrites the earlier (after #36601) #36726(发布没带钉)、Publish of a view draft takes a draft-version precondition, so an unpinned draft write cannot be published by Save to this view (after #36137) #36350(视图草稿发布的草稿版本前提)对齐,PR 里写明各自怎么处理。
验收
- 自建应用上改钩子、选项集、视图各一项:保存即生效、无「发布」第二步;AI 草稿场景提示和放弃都对。
- 引用详情页且提到发布、草稿或自动保存的测试(约 73 个文件)通过。
Blocked-by: #36901
Grading: area:ux · Feature · metadata detail save model (two save models side by side) · builders, every edit · evidence: read from code. Topic child ⇒ p2.
Dedupe: covered by #36510 / #36511 (merged) and #36660 (designers; this card takes the generic page).
Reader: seat repo:objectstack#3, one os-dev card. Size L. Metadata-protocol: none. Wave 2 (detail line).
Metadata
Metadata
Assignees
Labels
area:uxdomain:uiDomain lane — seat card indexed by label:pm:seatenhancementNew feature or requestpriority:p2Medium: important, M3
Activity
objectstack-fleet commentedon Nov 24, 2026
repo:objectstack#3 · os-support-ai · session_01WGufziBCAytAzzCu3iPBFR
Claim: PM loop round 1
Session:
session_01WGufziBCAytAzzCu3iPBFRAccount:
os-support-aiBranch:
claude/issue-36902-detail-save-at-onceWorktree:
objectstack-issue-36902Domain:
domain:uiSeat:
repo:objectstack#3Area: ux-E
File surface:
ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.tsxand its tests (save = draft + publish of this item, create mode, autosave switch removed, unpublished-changes mark, publish-refusal reason),ui/packages/app-shell/src/chrome/unsavedEdits.ts(leave guard for ×, ‹ ›, left menu, in-app links, reload/close), a shared AI-draft notice reused fromstudio-design/StudioAiDraftNotice.tsx(new file first if it must be lifted),metadata-admin/DraftReviewPanel.tsxif the draft mark lives there, Studio strings inui/packages/i18n/**, the e2e specs that drive the detail page, and a changeset. ⛔ NotStudioDesignSurface.tsx; ⛔ notDraftConflictDialog.tsxorstudioSaveBar.tsx(open PR #36958 for #36726 edits both: reuse them as they are, stop and report if a change is needed)Container & model:
L,mode:subagent,model: default — dispatch-gates.mjs --tier: "Model tier — no path-derived mandate",effort: highClause-②: no
Metadata-protocol: none
Responsibility: n/a — not a defect card
Thread-read: none
Premise: holds, line numbers moved (read on origin/main c75453e:
ResourceEditPage.tsx4,118 lines;saveDraftVersionedcall at :2126,doPublishat :2402, autosave switch state at :1277-1292 and timer at :2620-2642;chrome/unsavedEdits.tsandstudio-design/StudioAiDraftNotice.tsxpresent)Pre-claim lane: repo:objectstack seat 3 area ux-E (epic #36890; L children pre-cleared by the seat 2026-11-24 08:22Z); every path under
ui/**,domain:ui,area:uxPre-claim deps:
Blocked-by: #36901closed, its PR #36977 merged (c75453e, 13:52Z) ⇒pm:blockedremovedPrior rulings read: check-prior-rulings --card 36902 on ResourceEditPage / unsavedEdits / StudioAiDraftNotice: title-only terms, 28 ADR hits on "studio", none on save model or leave guard; thread: 0 comments. Refs read now: #36511 closed (save at once, autosave off, the model this card follows); #36660 open unassigned (designers; this card takes the generic page); #36726 open, os-alice, PR #36958 draft; #36350 open unassigned. Governing: #36890 decisions 1, 12, 14 (maintainer 「全部按建议」), ADR-0146 D1 as amended by PR #36921 (56d723f)
Serial constraints cleared: no open PR touches
ResourceEditPage.tsx,unsavedEdits.tsorStudioAiDraftNotice.tsx(open PRs read 2026-11-24 13:5xZ); PR #36958 (#36726) touchesDraftConflictDialog.tsxandstudioSaveBar.tsx, which this card reuses unchanged (item 7: the PR states how each of #36726 and #36350 is handled). Same-day churn on the surface: c75453e (#36977), 4c93f88. SDS is not edited ⇒ no SDS slot used.Size: L. The 3,000-line Tier H line counts across every PR of the card, so the dev stops and reports before passing it.
objectstack-fleet commentedon Nov 24, 2026
repo:objectstack#3 · os-support-ai · session_01WGufziBCAytAzzCu3iPBFR
os-dev-report
{ "issue": 36902, "status": "done", "branch": "claude/issue-36902-detail-save-at-once", "pr": "https://github.com/objectstack-ai/objectstack/pull/37026", "session": "session_01WGufziBCAytAzzCu3iPBFR", "premise_still_valid": true, "summary": "Dev-effort: high · Rounds: 1 · PR #37026 (draft) · head 09693db5c · 1,650 changed lines over 24 files (1,317 added, 333 removed), one PR, under the 3,000 Tier H line (no size note was due). Studio's generic item page now saves at once: Save writes the draft (pin and conflict dialog unchanged), then publishes that one item at the same package and bundle member, pinned to the published version through the existing #36601 DraftSaveGuard.publish. The autosave switch and the header Publish/Discard are gone, and a create publishes after its first save. An AI draft (by copilot or mcp) shows with StudioAiDraftNotice; a person's Save makes it live, and Discard drops it, asking first in the page's own dialog when edits are unsaved. A person's old draft gets an 'unpublished changes' line with its own Publish and Discard. A refused publish shows publishRefusal's reason and takes back the just-written draft only when none was pending before. The leave guard is pinned (×, ‹ ›, links, reload/close; Back not guarded). Bounded in-place fix: MetadataClient.layered() dropped overlayVersion, so every pin read off layered() was null; it now forwards it. #36726: no shared files with PR #36958. One sequencing item: #36958's rule 9 needs a beforeReload answering 'kept' for the hadDraft case. Main's type refuses that answer (TS2345, measured) and the guard file is off-limits, so whichever PR lands second adds that one line in publishDetailSave. #36350: left to it; it is a publish-door (protocol) change outside this card, and the view publish window stays open until it lands. StudioDesignSurface.tsx, DraftConflictDialog.tsx and studioSaveBar.tsx are untouched.", "tests": "Final union at head 09693db5c, under the lock: vitest over 338 ui test files (all of metadata-admin/ plus every ui test that mentions publish/draft/autosave/the detail page) gave 'Test Files 338 passed (338) / Tests 2918 passed (2918)'. Then type-check of @object-ui/data-objectstack, i18n and app-shell (tsconfig.test.json compiles the tests): all three Done, 'os-verify-lock: VERDICT command-exit 0'. New: ResourceEditPage.saveAtOnce-36902.test.tsx, 19 cases over the real MetadataClient and an in-memory If-Match/If-None-Match server, covering items 1-6, the leave guard and create. metadata-client.layeredDraft-29793.test.ts gains the overlayVersion forward cases. 14 existing suites were converted from autosave and toolbar Publish to explicit Save and the unpublished line. Live e2e on a per-agent stack built from this branch (backend :3917, console :5917): studio-detail-save-at-once.spec.ts (new) and studio-editor.spec.ts gave '3 passed'. Acceptance run on my own hook, picklist and view in com.example.showcase.custom: each Save sent exactly PUT ?mode=draft then POST /publish (200), and the live read served the new label. The AI draft was written through the real MCP door: OAuth DCR + PKCE + consent, then save_metadata_draft gave draftChanges by:'mcp'. The notice showed, discard asked in-app, then DELETE ?state=draft and the draft read gave 404. A second AI draft plus an edit, then Save, went live. The backend ran with OS_METADATA_WRITABLE=picklist because picklist is not runtime-creatable by default. Screenshots: orphan branch claude/issue-36902-screenshots @566b916, linked in the PR body. No ablation: the behaviour is new and its tests are red on base by construction (no autosave-free Save publish existed).", "gates": "Local: dispatch-gates --commands derived 39 families. 38 check:/node families re-run at the final head: every one 'exit 0'. 'pnpm --dir ui exec vitest run scripts/' at c8a49c900 (the later commit changes only a live e2e spec): 'Test Files 172 passed | 2 skipped (174)', VERDICT command-exit 0. 'dispatch-gates --ran' with exit codes: '39 derived famil(ies) accounted for — 39 run, 0 NOT-MEASURED (a DERIVED zero)'. check-test-source-alias: OK, 34 changed test files judged. overlap-check before every push: 'VERDICT clean exit 0'. CI on 09693db5c, snapshot at report time (not waited on): 'Governed Surface Queue Guard' success. In progress: Check Changeset, Check PR Size, Lint (CI release & engine gates, ESLint, PM dispatch-gates, docs & code guards, repo & tooling gates, three scoped lanes), PR-body guards, Type Check (consumer, debt ledger, source, workspace), filter. Skipped by selector: 18.x upgrade harness, Borrowed queue verdict, Packed-tarball smoke, Queue verdict, Schedule gate. NOT MEASURED: Test Core / test:repo (CI's).", "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm (Clause-②: no)", "mcp_calls": "0 — no GitHub MCP calls", "api_writes": "2 — fleet-write relay: pr_create (POST /repos/objectstack-ai/objectstack/pulls draft + POST /repos/objectstack-ai/objectstack/issues/37026/assignees), and this report comment via post-stamped (POST /repos/objectstack-ai/objectstack/issues/36902/comments). Local-only (not GitHub): OAuth client registration, consent, token and MCP save_metadata_draft against my own per-agent dev backend, used to produce the AI draft for the screenshots.", "open_questions": [], "security_findings": "none", "out_of_scope_findings": [ "class: a · reach: named producer: the /meta layers door serves overlayVersion (#36601); MetadataClient.layered() rebuilt its answer field by field and dropped it, so publishedPinOf(layered()) was always null. The object page's #36601 publish pin was a no-op too. Fixed in place in this PR under the bounded exemption (same defect class as the card's pin, mechanical, no other claim on the file, no new gate surface), pinned in metadata-client.layeredDraft-29793.test.ts · dedupe words: overlayVersion layered dropped, publish pin null, MetadataLayered overlayVersion", "carrier: PR #36958 / #36726 · rule 9 of #36958's guard needs publishDetailSave to pass a beforeReload answering 'kept' when hadDraft. Main's callback type refuses it (TS2345 measured), so whichever PR lands second adds the line · noted, not filed", "carrier: #36910 · docs/qa/platform-checklist/areas/studio-authoring.json, the page Add-block step, still says the ResourceEditPage draft auto-saves and is then published · noted, not filed", "carrier: none · leftover localStorage.setItem('metadata-admin:autosave','0') lines in untouched detail-page suites are now no-ops (dead setup) · in PR Acceptance notes only" ] }Generated by Claude Code
objectstack-fleet commentedon Nov 24, 2026
repo:objectstack#3 · os-support-ai · session_01WGufziBCAytAzzCu3iPBFR
Claim amendment (per L1-b (3) S1, comment 7137721696, on PR #37026 at 09693db):
Clause-②: yes (widening) (was no)
File surface adds:
ui/packages/data-objectstack/src/metadata-client.tsand its testmetadata-client.layeredDraft-29793.test.ts(bounded in-place fix, accepted by L1:MetadataClient.layered()forwardsoverlayVersion).Why:
@object-ui/data-objectstackis published, and its exportedMetadataLayeredinterface gains the optional memberoverlayVersion?: string | null, whichlayered()now returns. That widens a published package's public surface (precedent #36983,.changeset/36011-restore-factory-view.md, #36846).Metadata-protocol: noneis unchanged and the changeset stayspatch. ATIER_DEFAULTcontract review is owed on the new head; L1-b (3) runs it. Everything else in claim 7133542157 stands.objectstack-fleet commentedon Nov 24, 2026
repo:objectstack#3 · os-support-ai · session_01WGufziBCAytAzzCu3iPBFR
Close-out: PR #37026 merged as 1e96009 (2026-11-24 18:11Z) and closed this card.
pm:dispatchedremoved. Still open, owned elsewhere: PR #36958 (#36726) lands second and adds the one-linebeforeReload'kept' for thehadDraftcase inpublishDetailSave(seat note 7137138620); #36350 stays a publish-door change on its own card; the stale autosave step indocs/qa/platform-checklist/areas/studio-authoring.jsonis noted on #36910 (7137162690).