Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .changeset/35685-list-cell-undo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
'@object-ui/plugin-grid': patch
'@object-ui/react': patch
---

feat(list): undo a list cell save from its toast or with Ctrl+Z

Clause-②: yes (widening) — `toastRecordSave` in `@object-ui/react` takes an optional fourth argument, an `action` button the toast carries (new exported type `RecordSaveToastAction`), and `RecordSaveSink`'s options accept that `action`; nothing removed or renamed
Metadata-protocol: none

In a grid that mounts `GridCellSelection` (the select-first grid every `ListView` draws), a landed cell save can be taken back:

- **The save toast has an Undo button**, and **Ctrl+Z** (Cmd+Z on macOS) on a cell of the grid undoes the newest save, then the one before it. Each save is taken back once.
- **An undo is a new update, not a local rollback.** It writes the value each saved field held before the save (a relation as its stored id), with the version this grid's own newest write of the record answered as `If-Match`, so a change someone else made since answers 409 and opens the same conflict dialog as a save instead of being overwritten. A refused or cancelled undo is used up; the next Ctrl+Z undoes the save before it. The server's history records the save and its undo as two changes. Only the row is redrawn, as for a save.
- Inside an open editor Ctrl+Z stays the editor's own text undo. On a cell, the grid's key is handled by the grid alone: the console's shared Ctrl+Z undo stack is not popped by it.
- A save of a field the row did not read offers no Undo, rather than a partial one.

A grid without `GridCellSelection` (a related list in a record drawer, for one) now re-reads on every write of its object again, including a write the list around it draws itself: before, it skipped the writes that list held while they ran.
11 changes: 11 additions & 0 deletions content/docs/frontend/plugins/plugin-grid.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,17 @@ row whose new value would sort it elsewhere stays in place until the next load
- **A newer version** (409) still opens the conflict dialog: "Reload latest"
re-reads the list, "Overwrite anyway" writes over it and keeps the row in
place.
- **Undo** takes a save back: the save toast's Undo button, or Ctrl+Z (Cmd+Z on
macOS) on a cell of the grid, newest save first. An undo is a new update that
writes the value the record held before the save, guarded by the version
this grid's own newest write of the record answered: if someone else changed
the record since, the 409 dialog opens instead of their change being
overwritten. The record's history shows the save and its undo as two
changes. Each save is taken back once, and a refused or cancelled undo is
used up too, so the next Ctrl+Z undoes the save before it. A toast's Undo
takes back that toast's save, while Ctrl+Z always goes newest first. Inside
an open editor Ctrl+Z stays the editor's own text undo. A save of a field the
row did not read offers no Undo.

### Keyboard navigation

Expand Down
12 changes: 9 additions & 3 deletions docs/qa/platform-checklist/areas/records-forms.json
Original file line number Diff line number Diff line change
Expand Up @@ -4067,7 +4067,7 @@
"title": "Record edit undo: toast Undo / Ctrl+Z restores the prior value through the API and logs a revert; undo after a concurrent change must not silently clobber",
"since": "v16",
"status": "active",
"revision": 7,
"revision": 8,
"priority": "P2",
"surface": "browser",
"personas": [
Expand All @@ -4077,11 +4077,11 @@
"fixtures": {
"app": "showcase",
"requires": [
"a writable record and an action that declares `undoable: true` with operation 'update' (a patch of one field) — at objectui 1fb1ced36243, and still on main f2fdac5d under ui/, the ONLY path that pushes an Undo op: useConsoleActionRuntime and RecordDetailView attach the toast Undo for `undoable` actions, while inline grid and form edits push none. objectui react/src/hooks/useGlobalUndo.ts + core globalUndoManager hold the stack. ⚠ The stock showcase declares NO undoable action (examples/app-showcase has zero `undoable` keys), and a runtime-authored action is not joined into the served object's actions[] (records-forms.action-location-matrix knownGaps), so the action must ship PACKAGED in the showcase — see `blocked`"
"a writable record and an action that declares `undoable: true` with operation 'update' (a patch of one field) — at objectui 1fb1ced36243, and still on main f2fdac5d under ui/, the ONLY path that pushes an Undo op: useConsoleActionRuntime and RecordDetailView attach the toast Undo for `undoable` actions, while form edits push none and inline grid edits push none onto that stack. Since #35685 a list grid's cell save (every grid a ListView draws) offers an Undo of its own — the save toast's Undo button and Ctrl+Z / Cmd+Z on a cell, a new If-Match update of the prior value — but on the grid's own stack (ObjectGrid), not globalUndoManager, with no redo; it is not this item's fixture, whose clauses read the shared stack and its redo. objectui react/src/hooks/useGlobalUndo.ts + core globalUndoManager hold the stack. ⚠ The stock showcase declares NO undoable action (examples/app-showcase has zero `undoable` keys), and a runtime-authored action is not joined into the served object's actions[] (records-forms.action-location-matrix knownGaps), so the action must ship PACKAGED in the showcase — see `blocked`"
],
"knownGaps": [
"AUTOMATION LIVES IN THE objectui TREE, WHICH IS ui/ IN THIS CHECKOUT — `automated.ref` names objectui specs exclusively, by objectui-relative paths that resolve under ui/ (a unit suite at ui/packages/…, a Playwright spec at ui/e2e/…). They run from that tree: a unit suite with cwd ui/ (pnpm exec vitest run FILE), a live spec only against a booted stack serving a console built by pnpm console:build. Drive the item by hand in the browser and score it as a manual run, OR run the pin from ui/ and cite its output naming the framework commit it ran at. ⛔ Never score it as covered on the strength of the `automated` field alone — an unrun pin is a claim, not evidence. Full protocol: RUNNER.md, the objectui-pinned-automation standing fact, whose 'none of those specs exist here' predates the ui/ import.",
"BLOCKED(fixture) on stock, all four clauses (QA run #23163, objectstack 36b2889c, objectui 1fb1ced36243). Inline edits push no Undo op at this pin — only actions declaring `undoable` do — and the showcase declares none, while a runtime-authored undoable action is not served. The item becomes runnable when examples/app-showcase ships a packaged undoable update action on a writable object (operation 'update' with a patch, so the Undo captures the prior value of every written field — ActionSchema.undoable in packages/spec/src/ui/action.zod.ts). Lift `blocked` in the revision that names that fixture. ⛔ Do not score an inline edit's missing Undo as this item's FAIL: the console never offers one by design. Re-checked at main f2fdac5d (wave anchor #25807, slice C): the premise holds — examples/ carries zero `undoable` keys and no packaged action in packages/ declares `undoable: true`, and inline edits still push no Undo op (ui/packages/core/src/actions/ActionRunner.ts pushes only an action result's undo onto globalUndoManager). Since the spec's semantic migration ui-action-undoable-unfulfillable-refused (packages/spec/src/migrations/entries/semantic/18.ui-action-undoable-unfulfillable-refused.ts), `undoable: true` parses only on the two shapes some runtime fulfils — operation 'update' with a patch (the framework runtime snapshots the prior value, packages/runtime/src/action-execution.ts#DeclarativeUpdateUndo) or type 'api' (the console builds the undo envelope) — so the lifting fixture may be either"
"BLOCKED(fixture) on stock, all four clauses (QA run #23163, objectstack 36b2889c, objectui 1fb1ced36243). Inline edits push no Undo op at this pin — only actions declaring `undoable` do — and the showcase declares none, while a runtime-authored undoable action is not served. The item becomes runnable when examples/app-showcase ships a packaged undoable update action on a writable object (operation 'update' with a patch, so the Undo captures the prior value of every written field — ActionSchema.undoable in packages/spec/src/ui/action.zod.ts). Lift `blocked` in the revision that names that fixture. ⛔ Do not score an inline edit as this item's FAIL or PASS: a form edit offers no Undo by design, and a list cell save's Undo (since #35685) is the grid's own guarded stack, not the shared stack these clauses read. Re-checked at main f2fdac5d (wave anchor #25807, slice C): the premise holds — examples/ carries zero `undoable` keys and no packaged action in packages/ declares `undoable: true`, and inline edits still push no Undo op (ui/packages/core/src/actions/ActionRunner.ts pushes only an action result's undo onto globalUndoManager). Since the spec's semantic migration ui-action-undoable-unfulfillable-refused (packages/spec/src/migrations/entries/semantic/18.ui-action-undoable-unfulfillable-refused.ts), `undoable: true` parses only on the two shapes some runtime fulfils — operation 'update' with a patch (the framework runtime snapshots the prior value, packages/runtime/src/action-execution.ts#DeclarativeUpdateUndo) or type 'api' (the console builds the undo envelope) — so the lifting fixture may be either"
]
},
"steps": [
Expand Down Expand Up @@ -4178,6 +4178,12 @@
"date": "2026-11-20",
"change": "steps[2] re-pointed (#35595, #35596): the stream opens from the Activity tab of the record's tab row, from the title of the Overview rail's 最近动态 card (the right column's 动态 panel is retired), or ?related=timeline. No clause changed. Read from source at the PR's head.",
"ref": "#35595"
},
{
"revision": 8,
"date": "2026-11-20",
"change": "fixtures.requires[0] and knownGaps[1] follow #35685: a list grid's cell save now offers its own Undo (the save toast's button and Ctrl+Z / Cmd+Z on a cell, a new If-Match update of the prior value), so 'inline grid edits push none' is narrowed to the shared globalUndoManager stack these clauses read. That Undo is the grid's own stack, with no redo, and is not this item's lifting fixture; `blocked` unchanged. No clause changed. Read at the PR's head",
"ref": "#35898"
}
]
},
Expand Down
10 changes: 8 additions & 2 deletions docs/qa/platform-checklist/areas/ux-conventions.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"title": "Every user-initiated write answers visibly — success names what changed, a refusal says why, and a no-op claims nothing",
"since": "v17.7",
"status": "active",
"revision": 15,
"revision": 16,
"priority": "P1",
"surface": "browser",
"personas": [
Expand All @@ -27,7 +27,7 @@
"FIXED, regression row, expected PASS (objectui#11817): Setup → Users → Invite User toasts the copy of the delivery outcome the server answers (#27843): on a deployment that does not deliver mail the declared outcomeMessages.link_only, 'Invitation created for EMAIL. Mail is not configured on this server, so no email went out. Use Copy Invite Link on the invitation to share it.' (QA run #29890 read it verbatim), and 'Invitation sent to EMAIL' (outcomeMessages.sent) only where mail is delivered (packages/platform-objects/src/identity/invite-outcome-messages.ts#INVITE_USER_OUTCOME_MESSAGES on packages/platform-objects/src/identity/sys-user.object.ts#invite_user, whose successMessage `Invitation sent to {{ result.email }}` is the fallback for an answer without an outcome), interpolating the invitee from the action result — while the sys_invitation and sys_email rows are written (QA run #23163 at objectui 1fb1ced36243; pin ObjectView.inviteFeedback-11817.test.tsx)",
"FIXED, regression rows, expected PASS (QA run #23953 at objectui daeb77fc84dd): Studio Publish gives a success confirmation (objectui#11807); the task grid's row save toasts '1 row saved' (objectui#12303 fixed for this row; since #35685 it is the save each committed cell makes, with no Save All); the approval decision's Approve toasted the framework-declared successMessage, read in the approvals drawer that route no longer has (variants[6]) `Approved \"{{ result.request.record_title }}\"` (packages/plugins/plugin-approvals/src/sys-approval-request.object.ts), e.g. Approved \"EXP-2001\" (#23157, closed). Studio's 'Discard draft' toast and its confirm now name the item by its LABEL — QA run #24570 at objectui 4016370a read 'Draft discarded: QA Widget' — a regression row, expected PASS (objectstack-ai/objectui#12690, closed by objectui PR #12830, 0f42aaf8, in the console pin 4016370a and on objectui main; ResourceEditPage.tsx falls back to type/name only for an item with no label)",
"FIXED, regression row, expected PASS (objectui#11816): leaving an inline editor with no value change no longer reads '1 row modified · Save All (1)' (QA run #23163 at objectui 1fb1ced36243; pin data-table-noop-edit-11816.test.tsx) — negative[1]",
"Undo is scored only where a surface offers it, and on stock ONE surface does: the import. An import run as a job (the wizard's 'runs as an undoable job' option) is listed in the import history with 'Undo import', which deletes the records it created and restores the records it updated to their previous values; QA run #25817 at 6679644a read it working in both create and update modes. Elsewhere no stock surface offers Undo: only an action declaring `undoable` pushes an Undo op (inline and form edits push none), and the showcase declares no undoable action (records-forms.record-edit-undo, blocked(fixture)). So acceptance[5] is scored on the import variant. Undo's absence elsewhere is recorded in the evidence and is never a FAIL of this item: which writes should offer Undo is a product decision, not this item's oracle"
"Undo is scored only where a surface offers it, and on stock TWO surfaces do: the import, and since #35685 a list cell save (the save toast's Undo button, or Ctrl+Z / Cmd+Z on the cell, sends a new If-Match update of the prior value and toasts 'Change undone'; the grid's own stack, not the shared one). An import run as a job (the wizard's 'runs as an undoable job' option) is listed in the import history with 'Undo import', which deletes the records it created and restores the records it updated to their previous values; QA run #25817 at 6679644a read it working in both create and update modes. Elsewhere no stock surface offers Undo: only an action declaring `undoable` pushes an Undo op onto the shared stack (form edits push none, and a list cell save's Undo is its grid's own), and the showcase declares no undoable action (records-forms.record-edit-undo, blocked(fixture)). So acceptance[5] is scored on the import variant, and may be read on variants[1]'s cell save too. Undo's absence elsewhere is recorded in the evidence and is never a FAIL of this item: which writes should offer Undo is a product decision, not this item's oracle"
]
},
"variants": [
Expand Down Expand Up @@ -195,6 +195,12 @@
"date": "2026-11-20",
"change": "variants[1] and knownGaps[1] follow #35685: a list cell saves the moment it is committed, with a saving and a saved mark on the cell and the '1 row saved' toast, and there is no Save row or Save All to press. The clauses are unchanged. Read at base 2ad42b5d",
"ref": "#35864"
},
{
"revision": 16,
"date": "2026-11-20",
"change": "knownGaps[3] follows #35685: a list cell save now offers Undo (the save toast's button and Ctrl+Z / Cmd+Z on a cell, a new If-Match update of the prior value), so the stock surfaces with an Undo are the import and the list cell save, and 'inline edits push none' is narrowed to the shared stack. The clauses are unchanged. Read at the PR's head",
"ref": "#35898"
}
]
},
Expand Down
Loading
Loading