Skip to content

fix(console): pin the view settings draft save to the draft it opened, so Save to this view never publishes it (#36137) - #36318

Merged
objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/issue-36137-pinned-view-draft-writes
Nov 22, 2026
Merged

objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/issue-36137-pinned-view-draft-writes

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread

Fixes #36137

Clause-②: yes (widening) — ViewConfigPanel's onSave host prop gains an optional second parameter, the panel's draft-version guard (saveDraft), which the panel always passes; a host that takes one argument is called as before; nothing removed or renamed
Metadata-protocol: none

维护者速读

  • 管理员在视图设置里保存时,若另一位管理员正好在「保存到这个视图」,这次保存会被拒绝,并弹出“草稿已被改动”的提示,可选重新加载、覆盖或继续编辑;平时保存无感。新建视图时若同名视图已有未发布的修改,也会被拒绝,而不是盖掉它。
  • 属于共享视图「确认后立即对所有人生效」那件事的收尾:保证一个人的未发布修改不会被另一个人的保存顺带发布。
  • 出错时最多是管理员偶尔多看到一次冲突提示、需要重新加载或确认覆盖;可直接撤回本改动,恢复原来的保存方式。
  • 无。

Route: direction B of the card, client-only (area claim 7073591363). No /meta door, server or packages/spec change.

What changes

The view settings panel's draft save is pinned (ViewConfigPanel, handleViewConfigSave, persistRuntimeMetadata)

  • The panel's load already reads the stored view (layered) and the served draft. The draft read is now MetadataClient.getDraft, the envelope, so its version pins the buffer's saves through the Studio editors' guard (useDraftSaveGuard, draftPinOf): If-Match with the version the load read, If-None-Match: * when the view had no draft. A save that lands holds its receipt's version for the next one. Read and save both name no package, the address the server resolves the same way for both.
  • The panel hands its guard to the host as onSave's second argument; handleViewConfigSave passes it to persistRuntimeMetadata, which writes through it when given (a report's save still goes unpinned, untouched).
  • A 409 METADATA_CONFLICT opens the guard's dialog (DraftConflictDialog, its existing engine.draftConflict.* text: "This draft changed since you opened it … saved elsewhere — by someone else or in another tab"): Reload saved version re-reads the stored view into the panel and refreshes the host's list (the path a draft-bar publish or discard takes); Overwrite… re-sends pinned to the refusal's currentVersion after a second confirmation; Keep editing saves nothing, keeps the edit in the panel and Save live, and says "Not saved" through the host's existing refusal toast.
  • A draft-bar Publish or Discard re-reads the view (as before), so the next save is pinned to "no draft" again.
  • The panel renders the conflict dialog while closed too (it portals out of the hidden container). A save still in flight when the panel closes (Discard, another view tab) and refused after it closed still asks the author; once answered, the host hears the outcome and the save is no longer in flight, so Save is live when the panel reopens.

A view create carries the first-write pin (createRuntimeMetadata)

  • { mode: 'draft', ifNoneMatch: '*' } (with the app's package when there is one): a create over a name that already holds a pending draft is refused instead of written over it. createRuntimeMetadata has two non-test callers at this head, both views: handleViewCreate in objectViewViewCrud.tsx (the Create View dialog and the panel's create mode) and handleSaveAsView in ObjectDataPage.tsx (Save as view); measured by git grep -n createRuntimeMetadata outside test files.

Docs: content/docs/ui/views.mdx, the Save to this view bullet, one sentence. Changeset 36137-pinned-view-draft-writes.md (@object-ui/app-shell patch).

Tests

  • New ViewConfigPanel.pinnedDraftSave-36137.test.tsx, against a fetch double of the /meta view doors with the real MetadataClient and the real panel:
    • the card's interleave: Save to this view's pinned draft write lands, its publish is parked; a settings save then goes out If-None-Match: *, is refused 409 and opens the dialog, and the Save's draft is untouched; the publish then publishes exactly the Save's body. Keep editing leaves the edit on screen and Save live, with nothing written;
    • the same interleave, then Reload: nothing written, the panel holds the published view, and its next save goes If-None-Match: * and lands;
    • the same interleave with the settings save parked at the door and the panel closed (Discard) before the door answers: the refusal still opens the dialog, Keep editing reaches the host as a refusal, and after reopening an edit leaves Save live;
    • over no draft: the first save If-None-Match: *, the next If-Match on the first receipt's version;
    • over its own loaded draft: If-Match on the version the load read;
    • a create over a name holding a pending draft is refused with status: 409 and code: 'METADATA_CONFLICT', sent If-None-Match: *, and the draft is unchanged; a create of a new name lands (control).
  • ObjectView.viewConfigSaveWiring-10210.test.tsx (+1 describe): ObjectView's handler writes through the guard the panel hands it, never straight to the client.
  • Updated to the pinned create options (ifNoneMatch: '*'), same assertion otherwise: runtime-metadata-persistence.test.ts (2), runtime-metadata-persistence.otherTypesUntouched-35624.test.ts, ObjectView.createChartView-11576.test.tsx, ObjectView.createKanbanView-11581.test.tsx; ViewConfigPanel.resumeEnvelope-10210.test.tsx's client serves the draft read through getDraft.

Acceptance notes

  • Every Console writer of a view draft, measured at the merge base (git grep "mode: 'draft'" under ui/packages, cited by symbol):
    • view settings save, handleViewConfigSave → persistRuntimeMetadata: was unpinned, pinned here;
    • view create, createRuntimeMetadata (handleViewCreate, ObjectDataPage's Save as view): was unpinned, pinned here;
    • Save to this view, saveAndPublishRuntimeMetadata: already If-None-Match: *;
    • Studio writers (ObjectListViewInspector, useFormViewDraft, ResourceEditPage, StudioBundleItemEditor, StudioDesignSurface's creates and leaf drafts): already through useDraftSaveGuard or the first-write pin;
    • the footer calculation: no longer a server writer since it became a part of the list draft, so nothing to pin;
    • ObjectStackAdapter.updateView's draft half (rename, pin, set as default on a view with a pending draft): unpinned, not changed here. It reads the draft and writes it back in one call, so both requests can fall inside the window; a pin on its own read would carry the Save's draft version and pass. Only a publish precondition (the card's direction A) closes it. Routed to a follow-up card: filed 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 (direction A, protocol face).
  • The card's second acceptance line: no docs or changeset text in the tree carries the "known edge" note (git grep -i "known edge" and the card number: zero hits outside an unrelated ADR's "Known edges" heading); it lives only in the merged PR feat(console): Save to this view on a shared view asks once, then saves and publishes it; layout and row colour join the list draft (#35955 PR 2) #36123's body, which is landed history and not edited here.
  • DraftConflictDialog's module header says a draft read naming no package serves version: null for a package-bound draft; the server's readVersionToken now serves the token of the draft a package-less save overwrites. Both of this panel's requests name no package, so they agree either way. Not changed.

Verification

Final head c7898258 (review round: da52918b the create refusal's code and the test header, 55cbba6f the changeset sentence, c7898258 the closed-panel dialog and its test). CI on c7898258: 60 check-runs, 48 success, 12 skipped, 0 failed, 0 pending (Test UI, Type Check UI, Lint UI, Build & E2E UI, Live E2E UI, Test Core, TypeScript Type Check, Lint & Repo Gates, Governed Surface Queue Guard, Dogfood Regression Gate, Check Changeset among them).

Local runs at c789825 (under the shared verification lock)
  • Dependency closure pnpm --filter '@object-ui/app-shell^...' build: VERDICT command-exit 0.
  • pnpm --dir ui exec vitest run over app-shell/src/views/ ViewConfigPanel*, ObjectView*, runtime-metadata*, objectViewViewCrud*, metadata-admin/DraftConflictDialog*, ObjectDataPage*, CreateViewDialog*, RuntimeDraftBar*, ReportView*, viewCacheInvalidation*: Test Files 142 passed (142); Tests 1290 passed (1290). The new file alone: Tests 7 passed (7).
  • pnpm --filter @object-ui/app-shell run type-check (both programs): VERDICT command-exit 0.
  • Ablation of the closed-panel dialog (scripts/ablation-replace.mjs, anchor hit 1 to 0, blob d5040af2 to c3ef1c2c; no build involved, the test imports the source): the new file reads Tests 1 failed, 6 passed (7), the closed-panel case red on Unable to find an element by: [data-testid="draft-conflict-dialog"]; restored, blob equals HEAD and git diff HEAD is empty.
  • Gates narrowed to the files this round changed (the panel, its test, the changeset), exit 0 each: check-adr-0087-registration, check-changeset-no-major, check-empty-changeset, check-closing-keyword-parity, check:nul-bytes, check:test-source-alias, check:cross-package-test-inputs, check:changeset-gate-self-tests, check:doc-authoring, check:refd-timer-probe, check:tier-file-adoption. The rest of the derived list is CI's (green above). eslint on the two changed files: 0 errors.
  • node scripts/pm/overlap-check.mjs: VERDICT clean exit 0 against origin/main c448c615.
  • The previous round's runs (at 7f297043 and f86ba5fc) are in the dev report on the card.

Read first: ViewConfigPanel.tsx (the load's pin, the guard's reload, and the closed branch that keeps the dialog), runtime-metadata-persistence.ts (persistRuntimeMetadata's 'reloaded' path writes and announces nothing), ViewConfigPanel.pinnedDraftSave-36137.test.tsx.

Two-minute check: pnpm --dir ui exec vitest run packages/app-shell/src/views/ViewConfigPanel.pinnedDraftSave-36137.test.tsx — 7 tests pass (the first is the card's interleave: the settings save is refused 409 and the publish carries only the Save's body; the third closes the panel before the refusal lands).

🤖 Generated with Claude Code

https://claude.ai/code/session_01QsR2jUc3qp6bHKSWijbjds

…; a view create carries the first-write pin

Claude-Session: https://claude.ai/code/session_01FEkQ5oY5WCqqqBMtn9qt7m
Co-Authored-By: Claude <noreply@anthropic.com>
…; changeset and docs

Claude-Session: https://claude.ai/code/session_01FEkQ5oY5WCqqqBMtn9qt7m
Co-Authored-By: Claude <noreply@anthropic.com>
… pins follow persistRuntimeMetadata's outcome

Claude-Session: https://claude.ai/code/session_01FEkQ5oY5WCqqqBMtn9qt7m
Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 22, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jUc3qp6bHKSWijbjds

Final head (area f7-list, 2026-11-22T07:32Z): a383241bf79d6f05f575620d07d07a75443d33d7 — CI on it: every check-run success or skipped. No further commits planned; L1 requested from L1-d via seat repo:objectstack#7.
Owed besides L1: the Clause-②: yes (widening) declaration review (TIER_DEFAULT, the seat's). Body patched by the area at this head (two-minute check reads 6 tests; final-head line added). Open route question on the residual updateView window (report 7075354748, A/B/C) is with the seat; it does not change this diff unless C is chosen.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract-review-claim: session_01QsR2jTeURPvEm465RcoYEC · head a383241 · 2026-11-22T07:36Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf

L1 REWORK · head a383241bf79d6f05f575620d07d07a75443d33d7 · 2026-11-22T07:41Z

席位核对

  • 形态:l1-face --pr 36318 CLEAN(13 项无标记);draft、base main、Fixes #36137;13 个文件 +530 −55。门禁 check-runs @ a383241b:48 success · 12 expected skip · 0 failed · 0 pending。
  • 卡关系:卡的第一条验收(设置面板的保存插进「保存到这个视图」的草稿写与发布之间,被拒、未审内容不被发布)由 ViewConfigPanel.pinnedDraftSave-36137.test.tsx 第一例钉住;第二条(「known edge」注释)在 origin/main 上 git grep -i "known edge" 于 content/.changeset/app-shell 零命中,属实。方向 B 本就只盖住加钉的写入方,卡文自己写明,所以 Fixes 成立。
  • 已核属实:编辑保存的钉(If-Match 取载入时的版本,无草稿时用 If-None-Match: *)、保存回执续钉、409 打开 DraftConflictDialog、「继续编辑」走宿主原有的拒绝提示;createRuntimeMetadata 带首次写入钉;views.mdx 新增的一句与 diff 相符。

要改的两项

  1. 拒收用例缺 code 断言。 ViewConfigPanel.pinnedDraftSave-36137.test.tsx 中 "is refused over a name that holds a pending draft" 只断言 rejects.toMatchObject({ status: 409 })。按 L1 清单(ADR-0112 信封),拒收用例要同时断言 code 与 status。改法:补上 code: 'METADATA_CONFLICT'(或断言 isDraftVersionConflict(err) 为真)。交互那几例由对话框打开来间接证明 code(isDraftVersionConflict 查 code),不用改。
  2. changeset 有一句没有真实调用方。 .changeset/36137-pinned-view-draft-writes.md 说 "A report, dashboard or page created at runtime takes the same pin.",PR 正文也说 "Same function for the runtime report / dashboard / page creates"。在本 head 上 git grep createRuntimeMetadata 的非测试调用只有两处,都是 'view'(ObjectDataPage.tsx:506、objectViewViewCrud.tsx:271)。读者会以为报表、仪表盘、页面的运行时创建也改了。改法:删掉这句,或改成只描述函数本身(「以后经同一函数创建的类型同样带钉」)并注明今天只有视图走它;正文同一句一并改。

范围外去向(落地前席位立卡)

  • ObjectStackAdapter.updateView 的草稿分支(在有未发布草稿的视图上改名、置顶、设默认)仍是不加钉的「读取-合并-写回」,同样可能落进窗口里。dev 已在正文 Acceptance notes 写明只有方向 A(发布带版本前提)能关上。请席位按立卡门立一张跟进卡(方向 A,协议面,L2 归 Fable),在 ACCEPT 时把卡号写回本 PR。

修完推新 head、CI 全绿后再报一次,我在新 head 上只核 delta。

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract review

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

① Derived judgments

Inputs read: the card #36137 body and all five of its comments (triage 7065919252, claim 7073591363, dev report 7075354748, handover 7075552819, claim 7075943963; the card has no ruling comment). The PR #36318 body, its file list (13 files) and the net diff against main (merge base c30ce97c). The 60 check-runs on the head, each of which ended success or skipped: Test UI, Test Core, Type Check UI, Lint UI, Build & E2E UI, Live E2E UI, Check Changeset, Governed Surface Queue Guard, Lint · PM dispatch-gates and the others. Code outside the diff was read to judge the diff, not reviewed.

These are the public-surface and accept-set changes the diff implies:

  • ViewConfigPanel is a named root export of @object-ui/app-shell (src/index.ts, through src/views/index.ts). ViewConfigPanelProps.onSave changes from one parameter (draft) to two (draft, optional saveDraft, the panel guard's save). This is a widening: a host that takes one argument still type-checks and is called as before. The only host, ObjectView, passes the guard on. The declaration names this change correctly.
  • persistRuntimeMetadata gains an optional fifth parameter, and it now resolves a DraftSaveOutcome (saved or reloaded) where it resolved nothing. handleViewConfigSave in useObjectViewViewCrud gains an optional second parameter. createRuntimeMetadata sends a new precondition. None of the three is exported from the package root (neither index file has an export *), so none is a public surface. Leaving them out of the declaration is correct.
  • createRuntimeMetadata now sends If-None-Match: *, so the Console no longer writes a create over a name that holds a pending draft. The client is choosing a stricter precondition that the /meta door already accepts. The door's accept set does not change and the function is internal, so this is not a Clause-② narrowing. The changeset body discloses it. Correct.
  • The panel's draft read changes from metadataClient.get with state: 'draft' to metadataClient.getDraft, which checks the drafts ledger first and then reads the envelope.
  • Card acceptance line 1 is held by the new test's interleave. The settings save is refused 409 between the pinned draft write and the parked publish, and the publish carries only the Save to this view body. The dev recorded an ablation for it.
  • Card acceptance line 2 is held: no tree text carries the "known edge" note. I accepted the dev's measurement, and the diff agrees with it (there is nothing to remove).

S1 (should-fix) — In ViewConfigPanel.tsx, {draftConflictDialog} is rendered only when the panel is open; the if (!open) early return renders a bare div.

  • How it happens: the panel can close while a save is in flight, because Discard is not disabled while saving and switching to another view tab (handleViewChange) closes it. If that save is then refused 409, the guard's ask waits with no dialog on screen.
  • What the user sees: no dialog and no toast (nothing throws), saving stays true, and the host already shows the edit as if saved (setViewDraft runs before the write). On main, the same refusal threw and the host's "Not saved" toast fired.
  • Fix: render the dialog in the closed branch as well, or above the early return, and add a test case that closes the panel before the refusal resolves.

N1 (nit) — The changeset says "A report, dashboard or page created at runtime takes the same pin", and the PR body says the same of "the runtime report / dashboard / page creates". At this head the only callers of createRuntimeMetadata are the two view creates (objectViewViewCrud.tsx, ObjectDataPage.tsx), so that CHANGELOG line describes a path no user can reach. Drop it, or word it as the function's rule.

N2 (nit) — The new test file's header says "every Console writer of a view draft is pinned". The draft half of ObjectStackAdapter.updateView is not pinned, as the PR body itself says. Say "the view settings save and the view create" instead.

N3 (nit) — When a create is refused over a pending draft, the create toasts (formatMetadataError, viewSaveRefusalText) show the door's sentence "has been modified since you loaded it". That does not tell the author that the name already holds an unpublished view. A sentence written for the create case would read better. The card does not require it.

② Semver level

  • The changeset .changeset/36137-pinned-view-draft-writes.md is '@object-ui/app-shell': patch.
    • The diff changes source in one package (ui/packages/app-shell); the docs page content/docs/ui/views.mdx publishes no package.
    • Metadata-protocol: none is correct: no key, value, type or default that an author writes changes, and nothing changes in packages/spec or the /meta door.
    • AGENTS.md (Post-Task Checklist, item 3) says a non-protocol widening ships patch. Correct.
  • Clause-②: yes (widening) starts its line and reads the same on the PR body and the changeset body. It names the one widened root export and says nothing is removed or renamed. Nothing in the diff narrows a published accept set or a public export. The declaration is true and complete.
    • Note: @object-ui/app-shell is private: true. It is versioned through the changeset config's privatePackages.version and bundled into @object-ui/console as a devDependency, so the widened export is not a type published to npm. Declaring it is the cautious choice, and it matches how the repo treats this prop (the objectui#11583 contract review cited in the prop's docblock). No finding.
    • UI Published Artifacts is skipped on the head, which fits app-shell publishing nothing of its own.

③ Boundary flags

  • open_questions[0] asks how to route the residual window in the draft half of ObjectStackAdapter.updateView (options A, B, C). Answered on the merits; the choice of route is escalated.
  • Dev deviation (1), that Clause-② was not measured on the built declarations: answered. The prop type is declared inline on ViewConfigPanelProps, and ViewConfigPanel is a named root export, so reading the source is enough; the package is not published to npm either. Type Check UI is green on the head.
  • Dev deviations (2) and (3), the body's test count and its final-head line: answered. At review the PR body reads 6 tests and names the final head a383241b, patched as comment 7075980664 says.
  • Dev deviation (4), commit trailers without a model name: not a contract matter. No finding.
  • Dev deviation (6), the final local re-run that was not done: answered by the check-runs on the head. Test UI, Type Check UI and every other run ended success or skipped.
  • out_of_scope_findings[0], the DraftConflictDialog module header against readVersionToken: confirmed.
    • SysMetadataRepository.headAt resolves the package-less draft write address, draft-only bindings included. The header's warning bullet, that a package-less read serves version: null for a package-bound draft, is therefore stale.
    • It is outside the diff, and this panel's read and save agree either way. The seat may file a docs card; this PR does not owe one.
  • SQL push-down (AGENTS.md, Prime Directive 5): the diff is client-side metadata draft I/O only. It adds no record query, no id materialisation and no in-app join, so nothing could be pushed down to SQL.

Implemented-by: claude/issue-36137-pinned-view-draft-writes
Reviewed-by: session_01QsR2jTeURPvEm465RcoYEC

VERDICT: PASS

Seat note: the updateView residual window is routed to follow-up card #36350 (direction A, protocol face), filed by the seat before this PR merges, so Fixes #36137 closes nothing still open.

… the header names the two pinned writers

Claude-Session: https://claude.ai/code/session_01QsR2jUc3qp6bHKSWijbjds
Co-authored-by: Claude <noreply@anthropic.com>
…entence; only the two view creates call createRuntimeMetadata

Claude-Session: https://claude.ai/code/session_01QsR2jUc3qp6bHKSWijbjds
Co-authored-by: Claude <noreply@anthropic.com>
… while closed, so a save refused after it closed is still answered

Claude-Session: https://claude.ai/code/session_01QsR2jUc3qp6bHKSWijbjds
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jUc3qp6bHKSWijbjds

Final head after the REWORK round (area f7-list, 2026-11-22T08:37Z): c789825862810ca5c456b9cd07a473ec3335cbca — CI on it: 48 success, 12 skipped, 0 failed; mergeable clean. Delta over a383241 (3 files, +101/-20): L1-1 and L2-N2 in da52918, L1-2 and L2-N1 in 55cbba6, L2-S1 in c789825 (closed-panel 409 test, ablated), L2-N4 filed #36350 in the body. Dev report 7076624181. Delta L1 + delta L2 requested via seat repo:objectstack#7.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract-review-claim: session_01QsR2jTeURPvEm465RcoYEC · head c789825 · 2026-11-22T08:49Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf

L1 ACCEPT (delta) · head c789825862810ca5c456b9cd07a473ec3335cbca · 2026-11-22T08:55Z · 对上一轮 REWORK 7076070176 的复核

维护者速读

  • 用户能看到什么变化:管理员在视图设置里保存时,如果另一位管理员正在「保存到这个视图」,这次保存会被拒绝,并弹出「草稿已被改动」,可选重新加载、覆盖或继续编辑;平时保存无感。面板关掉之后才被拒绝的保存,也照样弹出这个提示。
  • 为什么做:卡 Save to this view: a view-settings draft saved between the pinned draft write and the publish gets published with it (publish takes no draft-version pin) #36137,保证一个人未发布的修改不会被另一个人的保存顺带发布。
  • 出错会怎样:最多是管理员偶尔多看到一次冲突提示;可整体撤回。
  • 要你做什么:无。
  • 席位意见:ACCEPT。上轮两项都已修好,席位 L2 提的 S1 也已修;等席位的 delta L2 PASS 后由列表区落地。

席位核对(只核 a383241b..c7898258)

  • 新增三个提交,没有合并 main:da52918b、55cbba6f、c7898258;3 个文件 +101 −20。l1-face --pr 36318 CLEAN;门禁 check-runs @ c7898258:48 success · 12 expected skip · 0 failed · 0 pending。
  • REWORK 1(拒收用例缺 code):da52918b 在「同名已有待发布草稿时创建被拒」那条用例上补了 code: 'METADATA_CONFLICT',和 status: 409 一起断言。已关。
  • REWORK 2(changeset 里没有调用方的那句):55cbba6f 删掉了 "A report, dashboard or page created at runtime takes the same pin."。剩下的 changeset 文字我逐句再读了一遍,与 diff 相符。已关。
  • 范围外:updateView 草稿分支没加钉的那条路径,已立卡 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(发布带草稿版本前提,方向 A),卡是 open。已关。
  • 席位 L2 的 S1(面板关闭后被拒的保存没人接):c7898258 在关闭态的隐藏 div 里也渲染 draftConflictDialog(它会 portal 出去)。新用例的流程:面板关闭后保存被拒 → 对话框仍然出现 → 「保存到这个视图」的发布只发布它自己的内容 → 重新打开面板后 Save 可用。dev 报告 7076624181 称该用例已消融验证(去掉关闭态渲染即变红)。
  • 范围外去向: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(已立)。
  • 落地条款:非受管。席位 delta L2 PASS 在案、无未闭 must-fix/should-fix ⇒ 由区 ready + auto-merge。

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract review

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

This is a delta review. It covers the commits from the prior head a383241b to this head. The prior record is comment 7076097078, and it graded S1 (should-fix) and N1 to N3 (nits). Files the delta does not touch keep the prior record's judgment.

① Derived judgments

Inputs read:

I also read code outside the diff (DraftConflictDialog.tsx, the AlertDialog primitive, and handleViewConfigSave) to judge the diff. I did not review that code.

Prior findings:

  • S1 (should-fix, the conflict dialog was not rendered while the panel was closed): closed by c7898258.
    • The if (!open) branch now renders {draftConflictDialog} inside the hidden container. AlertDialogContent portals to the document body (AlertDialogPortal, in components/src/ui/alert-dialog.tsx), so the dialog shows outside the zero-width aria-hidden div.
    • A save refused after the panel closed now reaches the guard's ask, and the dialog names the view (conflict.name). Each choice settles the save:
      • Keep editing throws notSaved, so the host's refusal toast fires.
      • Reload clears the guard's pins and bumps authoredReads. The panel's load effect also depends on open, so it reads the view again when the panel reopens.
      • Overwrite re-sends pinned to the refusal's currentVersion.
    • In every case saving returns to false.
    • The new test drives the Discard route. It parks the settings save at the door, closes the panel, then releases the 409. It asserts that the dialog opens, that the publish carries only the Save to this view body, that Keep editing reaches the host as refused, and that Save is live after the panel reopens.
    • The dev ablated the closed-branch line, and this case went red on the missing draft-conflict-dialog. The view-tab-switch route goes through the same branch, so the one test is enough.
  • N1 (nit, the changeset sentence about report, dashboard and page creates): closed by 55cbba6f.
    • The sentence is gone from the changeset.
    • The PR body names the measured callers. I confirmed them at this head: the two non-test callers of createRuntimeMetadata are objectViewViewCrud.tsx:271 and ObjectDataPage.tsx:506, and both create views.
  • N2 (nit, the test header said every view-draft writer is pinned): closed by da52918b.
    • The header now names the settings save and the view create.
    • It also says the draft half of ObjectStackAdapter.updateView is not pinned.
  • N3 (nit, a refused create shows the door's "has been modified since you loaded it" sentence): open, and not required by the card.
    • The dev report lists it as noted but not filed. It stays a nit and does not block the merge.
  • da52918b also adds code: 'METADATA_CONFLICT' beside status: 409 in the create-refusal test. It only adds an assertion and does not change what the test exercises. Correct.

What the delta introduces:

  • The delta changes no public surface and no accept set:
    • No signature, export or request precondition changes.
    • The closed branch only renders an element the open branch already rendered.
    • The ViewConfigPanelProps.onSave widening judged in the prior record is unchanged.
  • I considered three behaviours and none is a finding:
    • The dialog moves in the tree. It sits in a different place in the open and closed branches, so DraftConflictDialog remounts when open flips, and its confirming step resets.
      • The question it is asking lives in the hook (pending), so the dialog stays up and nothing is sent.
      • The modal blocks the panel's own controls, so only a host-driven close could flip open while the dialog is up. That close would only send the author back to the first step.
    • Overwrite after Discard. It writes the buffer the author discarded. That happens only after the second, explicit confirmation, and on main a save still in flight after Discard already landed the same body.
    • A 'reloaded' outcome while closed. The host returns false and shows no toast, which matches the open-panel path.
  • N4 (nit, new): the PR body's Verification line says "56 check-runs, 46 success, 10 skipped". This head carries 60 check-runs (48 success, 12 skipped), as the PR comment 7076641531 says. Fix it on the next body patch if there is one. It does not block the merge.

② Semver level

  • Unchanged from the prior record: .changeset/36137-pinned-view-draft-writes.md is '@object-ui/app-shell': patch, with Metadata-protocol: none.
    • The delta's source change is a rendering fix inside one package. It publishes no new type or export.
    • AGENTS.md (Post-Task Checklist, item 3) says a non-protocol fix ships patch. Correct.
  • Clause-②: yes (widening) still starts its line, and it reads the same on the PR body and the changeset body at this head.
    • The delta's only changeset edit drops a sentence from the description and leaves the declaration untouched.
    • The declaration is still true and complete: one widened root export, and nothing removed or renamed.

③ Boundary flags

Implemented-by: claude/issue-36137-pinned-view-draft-writes
Reviewed-by: session_01QsR2jTeURPvEm465RcoYEC

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jUc3qp6bHKSWijbjds

Landing (area f7-list, 2026-11-22T09:20Z): head c789825862810ca5c456b9cd07a473ec3335cbca · L1 ACCEPT (delta) 7076825712 over REWORK 7076070176 · L2 PASS (delta) 7076875353 (TIER_DEFAULT, declaration face; S1 N1 N2 closed; N4 counts fixed in the body, N3 nit carried) · check-governed-merges --pr 36318: NOT governed, 668 changed lines ≤ 3000 · CI on the head: 50 success, 14 skipped, 0 failed · mergeable clean. Follow-up for the residual window: #36350. → pr_ready + automerge_enable (merge queue).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 22, 2026 09:21
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit 674f877 Nov 22, 2026
65 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-36137-pinned-view-draft-writes branch November 22, 2026 10:14
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/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

1 participant