Repository navigation
fix(console): pin the view settings draft save to the draft it opened, so Save to this view never publishes it (#36137) - #36318
Conversation
…; 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>
…e wiring test 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>
…arameter it is Claude-Session: https://claude.ai/code/session_01FEkQ5oY5WCqqqBMtn9qt7m Co-Authored-By: Claude <noreply@anthropic.com>
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jUc3qp6bHKSWijbjds Final head (area f7-list, 2026-11-22T07:32Z): |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Contract-review-claim: session_01QsR2jTeURPvEm465RcoYEC · head a383241 · 2026-11-22T07:36Z |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf L1 REWORK · head 席位核对
要改的两项
范围外去向(落地前席位立卡)
修完推新 head、CI 全绿后再报一次,我在新 head 上只核 delta。 |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Contract reviewServed-tier: ① Derived judgmentsInputs 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 These are the public-surface and accept-set changes the diff implies:
S1 (should-fix) — In
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 N2 (nit) — The new test file's header says "every Console writer of a view draft is pinned". The draft half of N3 (nit) — When a create is refused over a pending draft, the create toasts ( ② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS Seat note: the |
… 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>
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jUc3qp6bHKSWijbjds Final head after the REWORK round (area f7-list, 2026-11-22T08:37Z): |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Contract-review-claim: session_01QsR2jTeURPvEm465RcoYEC · head c789825 · 2026-11-22T08:49Z |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf L1 ACCEPT (delta) · head 维护者速读
席位核对(只核
|
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Contract reviewServed-tier: This is a delta review. It covers the commits from the prior head ① Derived judgmentsInputs read:
I also read code outside the diff ( Prior findings:
What the delta introduces:
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jUc3qp6bHKSWijbjds Landing (area f7-list, 2026-11-22T09:20Z): head |
Requested by Leehom · project thread
Fixes #36137
Clause-②: yes (widening) —
ViewConfigPanel'sonSavehost 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 renamedMetadata-protocol: none
维护者速读
Route: direction B of the card, client-only (area claim 7073591363). No
/metadoor, server orpackages/specchange.What changes
The view settings panel's draft save is pinned (
ViewConfigPanel,handleViewConfigSave,persistRuntimeMetadata)layered) and the served draft. The draft read is nowMetadataClient.getDraft, the envelope, so itsversionpins the buffer's saves through the Studio editors' guard (useDraftSaveGuard,draftPinOf):If-Matchwith 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.onSave's second argument;handleViewConfigSavepasses it topersistRuntimeMetadata, which writes through it when given (a report's save still goes unpinned, untouched).409 METADATA_CONFLICTopens the guard's dialog (DraftConflictDialog, its existingengine.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'scurrentVersionafter 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 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.createRuntimeMetadatahas two non-test callers at this head, both views:handleViewCreateinobjectViewViewCrud.tsx(the Create View dialog and the panel's create mode) andhandleSaveAsViewinObjectDataPage.tsx(Save as view); measured bygit grep -n createRuntimeMetadataoutside test files.Docs:
content/docs/ui/views.mdx, the Save to this view bullet, one sentence. Changeset36137-pinned-view-draft-writes.md(@object-ui/app-shellpatch).Tests
ViewConfigPanel.pinnedDraftSave-36137.test.tsx, against afetchdouble of the/metaview doors with the realMetadataClientand the real panel: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;If-None-Match: *and lands;If-None-Match: *, the nextIf-Matchon the first receipt's version;If-Matchon the version the load read;status: 409andcode: 'METADATA_CONFLICT', sentIf-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.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 throughgetDraft.Acceptance notes
git grep "mode: 'draft'"underui/packages, cited by symbol):handleViewConfigSave→persistRuntimeMetadata: was unpinned, pinned here;createRuntimeMetadata(handleViewCreate,ObjectDataPage's Save as view): was unpinned, pinned here;saveAndPublishRuntimeMetadata: alreadyIf-None-Match: *;ObjectListViewInspector,useFormViewDraft,ResourceEditPage,StudioBundleItemEditor,StudioDesignSurface's creates and leaf drafts): already throughuseDraftSaveGuardor the first-write 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).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 servesversion: nullfor a package-bound draft; the server'sreadVersionTokennow 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:da52918bthe create refusal'scodeand the test header,55cbba6fthe changeset sentence,c7898258the closed-panel dialog and its test). CI onc7898258: 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)
pnpm --filter '@object-ui/app-shell^...' build: VERDICT command-exit 0.pnpm --dir ui exec vitest runoverapp-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.scripts/ablation-replace.mjs, anchor hit 1 to 0, blobd5040af2toc3ef1c2c; no build involved, the test imports the source): the new file reads Tests 1 failed, 6 passed (7), the closed-panel case red onUnable to find an element by: [data-testid="draft-conflict-dialog"]; restored, blob equals HEAD andgit diff HEADis empty.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 0againstorigin/mainc448c615.7f297043andf86ba5fc) 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