Repository navigation
feat(list): undo a list cell save from its toast or with Ctrl+Z - #35898
Conversation
Claude-Session: https://claude.ai/code/session_01L6bhgVGwmuaJgApFaitJDY Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgVGwmuaJgApFaitJDY Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Posted 2026-11-20T17:29Z. The brief handed to the isolated declaration-face reviewer for PR #35898 (owed by the PR's Contract review brief — PR #35898 @
|
|
repo:objectstack#1 · os-sales · session_01L6bhgTcFanGhTvqS1V2Q4U 维护者速读
席位核对 — ACCEPT (L1-a) · repo:objectstack#1 · head
|
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Contract reviewServed-tier: Inputs read: card #35685 (body and all seven comments, including the maintainer rulings 7039615827, the seat ruling 7042779557, the S2 claim 7043863808 and the S2 os-dev-report 7046151458); PR #35898 (body and its eight-file list); the net diff from the merge base Gate verdicts (check-runs on this head): 62 check-runs, all completed: 52 success, 10 skipped, 0 failed. The success set includes Type Check UI, Lint UI, all sixteen Test UI shards, Build & E2E UI, Live E2E UI, Check Changeset, the PR-body guards, Governed Surface Queue Guard and Dogfood Regression Gate. The skipped ten are opt-in or not triggered by this diff (UI Published Artifacts, Dogfood Verify CLI, the Dogfood matrix shards, Build Core, Temporal Conformance, the schedule gate, Queue verdict, Borrowed queue verdict, the 18.x upgrade harness, the packed-tarball smoke). No derived gate is red. ① Derived judgmentsPublic surface and accept-set changes the diff implies:
Against the card: the two acceptance lines this slice owns (Undo or Ctrl+Z brings the value back on the server; one audit row per submit, the undo counted apart) are covered by unit cases and the browser record in the PR body. The undo is a new guarded update, not a local rollback, as the card requires. Relations go back as stored ids through Findings (none is a must-fix; neither should-fix breaks the contract the card or the changeset publishes):
② Semver levelThe changeset Clause-②: the line ③ Boundary flags
Implemented-by: VERDICT: PASS |
…; checklist follows the undo Claude-Session: https://claude.ai/code/session_01L6bhgVGwmuaJgApFaitJDY Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-sales · session_01L6bhgTcFanGhTvqS1V2Q4U 席位核对 — delta ACCEPT (L1-a)维护者速读
Delta: from my ACCEPT 7046240159 at Code (
|
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Posted 2026-11-20T18:51Z. The DELTA brief handed to the same isolated declaration-face reviewer for PR #35898 (delta of its record 7046653227 on Contract review brief — PR #35898 @
|
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Contract reviewServed-tier: This is a delta review of the new head against my record on Gate verdicts (check-runs on this head): 68 check-runs, all completed: 56 success, 12 skipped, 0 failed. Check Changeset, the PR-body guards, Governed Surface Queue Guard and Lint · repo and tooling gates are among the successes. ① Derived judgmentsThe delta adds no public surface. Earlier findings, closed by id:
Checklist moves (requested by L1-a):
② Semver levelUnchanged from the earlier record and still right. The changeset still bumps ③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob L2 adoption and landing · 2026-11-20T18:53Z · The seat adopts the isolated declaration-face L2 delta record 7047953597 on head Scope is slice S2 of #35685 under the seat's split (undo, plus the own-writes fix deferred to this slice in 7042779557) and the maintainer's ruling record 7039615827. L1-a ACCEPT 7046240159 at |
Requested by Sales · project thread
repo:objectstack#1 · os-sales · session_01L6bhgVGwmuaJgApFaitJDY
Part of #35685 (slice S2 of three: undo, plus the own-writes fix the seat deferred to this slice in 7042779557; S3, the state-machine confirm and the drawer sync, follows in its own pull request, so the card stays open)
Clause-②: yes (widening) —
toastRecordSavein@object-ui/reacttakes an optional fourth argument, anactionbutton the toast carries (new exported typeRecordSaveToastAction), andRecordSaveSink's options accept thataction; nothing removed or renamedMetadata-protocol: none
Skills-docs:
content/docs/frontend/plugins/plugin-grid.mdx— the "On an object's list page" section gains the Undo bullet (toast button, Ctrl+Z / Cmd+Z, a new guarded update, once per save, an editor keeps its own Ctrl+Z). No skill underskills/teaches the list's save or undo, so nothing there moves.Flow: dev-thread rule (maintainer 2026-11-20 09:22:50Z 「所有 p1 都按照新规则执行」): the card thread builds itself; L1 and the isolated L2 run in parallel at hand-back (deviates from the rule in
contract-review.mdthat the dispatching seat starts the L2, until the skill card lands).维护者速读
What changes
Undo of a select-first cell save (
@object-ui/plugin-grid,ObjectGrid). Only a grid withcellSelectionchanges: every gridListViewdraws (the scope Sales ruled in 7035276698).captureUpdateUndoData(@object-ui/core, the rule the record page's Undo uses), so a relation goes back as its stored id, never the$expandrecord. ItsIf-Matchis the version this grid's own newest write of the record answered (writtenVersionsRef, else the save's own answer), never a version a later load read: a change someone else made since then answers 409 and opens the same conflict dialog as a save instead of being overwritten (review round 1); an earlier save's Undo after a newer save of ours on the same record is guarded by that newer write's version. Cancel writes nothing, and a refused or cancelled undo is spent, so the next Ctrl+Z undoes the save before it. Each entry records its object, so a grid pointed at another object never aims an old entry there. The undo redraws only its row, from the write's answer, holding the record in the list's own-writes registry exactly as a save does, so nothing else is read again and a sorted row stays put.actions.undone, the key the record page and the action runtime already raise). A refused undo: the toast "Save failed" with the server's message, and the row keeps the saved value.data-object-grid-root). When the grid takes the key it stops it, so the console's shared Ctrl+Z stack (useGlobalUndo, which ignores input targets but not a focused cell) is not popped by the same press. With nothing to undo, the key goes on to whoever else listens.defaultRowSaveis split:writeRowInPlace(the S1 select-first write and in-place redraw, unchanged in behaviour) is now shared by the save and its undo. The staged path for grids withoutcellSelectionis unchanged.toastRecordSavetakes an optionalaction(@object-ui/react): the button rides the success or the warning variant alike; without it every call is byte-for-byte what it was.Carried fix (seat ruling 7042779557, found by L1-a 7041864536 and the declaration L2 on #35864).
ObjectGridhanded the host list's own-writes registry to its own row load even withoutcellSelection.ListView's provider also wraps its record drawer, so a same-object related grid inside that drawer skipped the re-read of a record the outer grid was writing. The row load now takes the registry only undercellSelection; a grid without it re-reads on every write of its object again.English fallbacks added to
objectGridTranslations.ts, byte-identical to theenpack:actions.undo,actions.undone,table.saveFailed(all three already exist in every locale; no locale file changes).Acceptance notes
globalUndoManager. The shared stack's runner writes with noIf-Match, no conflict dialog and no in-place redraw, and the card requires the guarded update; so a cell save is not pushed there and the grid's Ctrl+Z does not pop it. Ctrl+Z works while focus is on one of the grid's cells.onBatchSave(DataTable: retire the onBatchSave slot once list inline edit saves each cell on its own #35827).Tests
New, in the existing harness file
ui/packages/plugin-grid/src/__tests__/ObjectGrid.autosave-35685.test.tsx(its@object-ui/componentsmock reads the toast; the five S1 cases are unchanged):cellSelectionthe save toast carries no Undo;cellSelection, inside a list's own-writes registry) reads again while the outer grid holds the record.ui/packages/react/src/record-save-feedback.test.ts: an action rides the toast on either variant.Ablation (each committed first, mutated through
scripts/ablation-replace.mjs, restored to the HEAD blob withgit diff HEADempty):row load handed
ownWritesunconditionally again → "the record drawer's related grid reads again" fails (1 failed / 11 passed), restored → 12/12;the undo's row taken from the save's leftover row instead of the row drawn now → "an earlier save's Undo is guarded by the newest version" fails (1 / 11), restored → 12/12.
review round 1: the undo sent without its own-write guard → "someone else's later change answers 409" fails (1 / 13), restored → 13/13.
Migrated or voided: none.
Review round 1 (head
e92be60e, after43e54611)If-Matchis now the version this grid's own write answered, so a re-read that brought someone else's change no longer lets the undo overwrite it. Should-fix 2: the conflict case above (dialog, Cancel keeps the value). Nits: each undo entry records its object; the docs and changeset say a refused or cancelled undo is used up and that a toast's Undo takes back its own save while Ctrl+Z goes newest first.docs/qa/platform-checklist/areas/records-forms.json›records-forms.record-edit-undo(revision 8: fixtures.requires[0] and knownGaps[1] say a list cell save has its own guarded Undo, on the grid's stack, not the shared one these clauses read;blockedunchanged) andux-conventions.json›ux-conventions.write-feedback(revision 16: knownGaps[3] names the list cell save beside the import).node scripts/check-platform-checklist.mjs: OK.e92be60e:ObjectGrid.autosave-3568513/13; all ofplugin-gridandplugin-list476 files, 4530 tests passed;plugin-gridtype-check clean; eslint 0 errors;dispatch-gates --commands73 families (the checklist edit addscheck:platform-checklist), rerun on this head: see the seat's thread for the reconcile.Verification
Local runs (head 1837a4a, before the main merge 43e5461, which brought four commits touching none of these packages)
vitestfromui/overpackages/plugin-grid/ packages/plugin-list/ packages/react/ packages/app-shell/(app-shell included because its tests pin list keyboard behaviour): Test Files 2965 passed, 1 skipped (2966); Tests 28161 passed, 9 skipped (28170); 0 failed.type-check(tsc --noEmitand the test tsconfig) for@object-ui/reactand@object-ui/plugin-grid: clean.eslinton every changed source and test file: 0 errors.node scripts/pm/dispatch-gates.mjs --commands: 72 derived families, each run with its exit captured before any pipe, all exit 0 (check:type-check-debtandcheck:skill-examplesre-run after the full package build their prerequisite needed;vitest run scripts/underui/re-run with one worker after the container's memory limit killed the first two runs).--ran: 72 derived, 72 run, 0 NOT-MEASURED, 0 UNRUN.node scripts/pm/overlap-check.mjs: VERDICT clean.Browser (after only; the before state is "no Undo" by construction)
examples/app-showcase(objectstack dev --fresh --seed-admin, own port and temp DB) with theui/apps/consoleVite dev server over it, headless Chromium 1600×1000, zh-CN, head 1837a4a. Project list:PATCH{"name":"Data Platform U"}withIf-Matchthe read version; the toast 「1行已保存」 carries one 「撤销」 button.PATCH{"name":"Data Platform"}withIf-Matchthe save's answered version; the cell reads "Data Platform"; the toast 「已撤销更改」.PATCH{"name":"Data Platform"}with the second save's answered version; the cell reads "Data Platform".sys_audit_logfor the record: fourupdaterows, one per submit (U, back, K, back).Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses. (eslint on the changed files: 0 errors)main, one pull request. (The branch is the platform-assignedclaude/project-thread-ld7kcq, named in the claim 7043863808.)packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgVGwmuaJgApFaitJDY