Skip to content

feat(list): confirm a state-machine move before a list cell saves it; the drawer says when the record changed - #35972

Merged
objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/project-thread-f8vhdm
Nov 21, 2026
Merged

objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/project-thread-f8vhdm

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

repo:objectstack#1 · os-sales · session_01L6bhgVhAK4uNYvjNY3H7XU

Fixes #35685
(slice S3, the last of three: the state-machine confirm and the drawer sync. S1 #35864 and S2 #35898 are merged. Retiring onBatchSave stays with #35827.)

Clause-②: yes (widening) — GridCellSelection in @object-ui/components takes an optional confirmCommit(row, columnKey, value) member; nothing removed or renamed
Metadata-protocol: none
Skills-docs: content/docs/frontend/plugins/plugin-grid.mdx — the "On an object's list page" section gains two bullets (a state-machine field asks first; the record drawer follows a list save and keeps a draft). No skill under skills/ teaches the list's save, so nothing there moves.
Follow-up: #35928 (the confirm names the automation that would run; the ruling asked for a card, not this slice)
Flow: dev-thread rule (maintainer 2026-11-20 09:22:50Z): the card thread builds itself; L1 by L1-a, the declaration L2 by the seat on the green head.

维护者速读

What changes

A state-machine move asks first (@object-ui/plugin-grid, ObjectGrid; only a grid with cellSelection, i.e. every grid ListView draws).

  • A field is a state-machine field when an active state_machine validation rule of the object names it and its events cover update (the spec default ['insert','update'] when absent). Severity does not matter: a move along the machine is what related automation listens for, blocking or not. Which moves are legal stays the server's call. (objectGridStateConfirm.ts)
  • A new value committed into such a cell (picked in its editor, or pasted) opens an in-app confirm: title Change {{field}}?, body {{field}} changes from {{from}} to {{to}}. Saving may trigger related automation. (ruling 7039615827), buttons Cancel / Change. The values are shown as their option labels as the host translates them, the stored code when no option declares it, and the grid's Empty word for no value.
  • Cancel writes nothing: nothing is staged, nothing is sent, the cell keeps what it showed. Change saves the value as any S1 commit is saved (one guarded update). Focus goes back to the selected cell either way. A second ask while one is open answers the first one No; unmounting the grid answers No.
  • A commit that changes nothing, and any cell the host does not ask about, is written at once, as before.

The generic seam (@object-ui/components): GridCellSelection.confirmCommit is asked at the table's commit point, before a value that changes what the cell shows is staged or saved, for the editor's commit (saveEdit) and for commitCellValue (paste, toggle). A promise holds the write until it settles: true writes, false or a rejection writes nothing; null / undefined means no question. Only an autosaving select-first table asks; a table outside a provider is byte-for-byte what it was. exitEdit's snapshot revert is factored out as revertEditSession so the held commit closes the editor the way Esc does.

The record drawer follows a list save (@object-ui/plugin-detail, InlineEditSaveBar). The drawer already re-reads the record when the list saves it (the data-invalidation bus from S1), so the new value shows. What is new: while an inline edit session is open and the record is read again at another version, the save bar says so (detail.inlineEditRecordChanged, a role="status" note). The draft stays as typed and Save writes it with If-Match the version now read, as before (the drawer's draft wins, as the brief asked); only the note is new.

Strings: grid.stateChange.{title,description,confirm,cancel} and detail.inlineEditRecordChanged in all eleven locale packs (zh-Hant regenerated by gen:zh-hant), with English fallbacks in objectGridTranslations.ts and useDetailTranslation.ts, byte-identical to en.

Acceptance notes

  • The card's parts this slice owns, as the seat's S3 brief words them: (1) a new state picked in a list cell for a state-machine field is confirmed first, Cancel saves nothing; (2) the drawer follows a list save, and when it holds unsaved edits the drawer wins and says so. Both measured in the browser below.
  • Reading I chose: the confirm does not list the flows that would run; the ruling's words are "may trigger related automation", and naming the flows is Stage-change confirm: list the automations a state change will actually trigger (needs a server read), in the list cell and on the record page #35928.
  • Reading I chose: at 375 px the list draws cards, not table cells, so there is no list cell to commit into and no confirm there. The phone list's own edit path is not this card.
  • Platform checklist: no clause moves. ux-conventions.write-feedback variants[1] edits a Priority cell (no state machine), and its steps[4] already says the grid editor offers only legal moves.

Tests

  • ui/packages/components/src/__tests__/data-table-autosave-35685.test.tsx, new block "a commit the host asks to confirm first": No writes nothing, the editor closes, focus returns to the cell; Yes gives exactly one update of that cell; a paste is asked as an editor commit is; an unchanged commit and a cell the host does not ask about are not held.
  • ui/packages/plugin-grid/src/__tests__/ObjectGrid.autosave-35685.test.tsx, new block: the dialog names the field and both labels and says automation may run, Cancel sends nothing; Change sends one guarded update; a field with no machine, and an inactive machine, is not asked; a machine bound to insert alone is not asked; a warning-severity machine is asked (round 1).
  • ui/packages/plugin-detail/src/__tests__/InlineEditSaveBar.test.tsx, new block: the note appears when the record is read again at another version during the session, the draft is kept and Save sends ifMatch the new version; no note while the version is the one the edit began on, nor in the next session.

Ablation (committed first, mutated through scripts/ablation-replace.mjs, restored to the HEAD blob with git diff HEAD empty):

  • commitConfirmationOf returns null unconditionally → 6 failed / 27 passed across the two confirm files; restored → green.

  • the save bar's note never rendered → 2 failed / 9 passed in InlineEditSaveBar.test.tsx; restored → green.

  • round 1: isStateMachineField returns true instead of reading events → "a machine bound to insert alone" fails (1 failed / 17 passed); it refuses a severity: 'warning' rule → "an advisory (warning-severity) machine still asks" fails (1 / 17); each restored → 18/18.

Migrated or voided: none.

Review round 1 (head c904bd92, after 1ef49fae)

  • L2 7055688534 F2 should-fix: two cases added to the ObjectGrid block (insert-only machine not asked; warning-severity machine asked), so the events.includes('update') branch and the ignored severity are both measured; ablated as above. F3 nit: the confirmCommit JSDoc now says only a table wired with onRowSave asks, and one on onBatchSave alone never does. F4 nit left, as the seat ruled.
  • L2 F1 should-fix, traced in the browser (log f1-trace.log beside the other evidence; every fetch to the object wrapped to print its call stack): with the list alone, a confirmed list cell save sends exactly one request, the PATCH, and no read. With the record drawer open on the same row, the PATCH is followed by three requests, all for that one record: GET /api/v1/data/showcase_project?populate=…&top=1&filter=["id","=","<the record id>"] (the adapter's findOne with $expand, readOne → rawFindWithPopulate, which reads one record through the collection route), POST …/<id>/page and GET …/<id>/field-access. That is the drawer re-reading its own record, which is the drawer sync this slice delivers; it is not S2's related-grid re-read (7042779557) and not a reload of the list's other rows. S1's acceptance holds; nothing to file.
  • Local on c904bd92: ObjectGrid.autosave-35685 18/18; eslint on the two changed files 0 errors; check:nul-bytes exit 0; overlap-check VERDICT clean.

Verification

Local runs
  • vitest from ui/, one package at a time under os-verify-lock.sh on head 44ec496a (before the main merge): plugin-grid 294 files / 2562 tests passed; plugin-detail 393 / 3601 passed (1 file skipped); components 493 / 4747 passed (1 file skipped); plugin-list 182 / 1971 passed; i18n 104 / 1956 passed with one red, the zh-Hant generated-catalogue pin, fixed by running gen:zh-hant and re-run green (11/11).
  • After merging main (1ef49fae; conflicts only in the locale packs and useDetailTranslation.ts, all adjacent additions, both sides kept, zh-Hant regenerated): app-shell whole package 2356 files: the first run read a stale @objectstack/spec dist (83 files red on exports main had just added, e.g. readFieldGroupMembership); after rebuilding @objectstack/spec those 83 files re-ran 83/83 passed (627 tests). The confirm and drawer tests plus i18n and every data-table / ObjectGrid / InlineEditSaveBar test file re-ran on the merged head: 184 files / 2496 tests passed.
  • type-check (tsc --noEmit) for @object-ui/components, @object-ui/plugin-grid, @object-ui/plugin-detail, @object-ui/i18n: clean on the merged head (after rebuilding the packages' dependency dists). eslint on every changed source and test file: 0 errors.
  • node scripts/pm/dispatch-gates.mjs --commands: 73 families, each run with its exit captured before any pipe. 71 ran on 8620e49e (before the zh-Hant regeneration and the main merge, which touch no gate input beyond the locale packs) and 2 on the merged head (check:type-check-debt under the verify lock, vitest run scripts/ under ui/ with one worker), all exit 0. --ran on the merged head: 73 derived, 73 run, 0 NOT-MEASURED, 0 UNRUN.
  • node scripts/pm/overlap-check.mjs: VERDICT clean (main and feat(app-shell): connect your Slack account on the notification settings page, and an admin Slack page in Setup (Part of #34730) #35968, feat(list): a two-row list toolbar — View settings beside the view name, a resident condition row, ⋮ More at the far right #35918, feat(console)!: one way to open a record from an object's list; navigation.mode deprecated there #35910 merge cleanly).
  • Changed lines about 640 vs the 3000 threshold: under.
Browser

examples/app-showcase (objectstack dev --fresh --seed-admin, own port and temp DB) with the ui/apps/console Vite dev server over it, headless Chromium, zh-CN, light and dark, desktop 1600×1000 and 375×812. Project list, status (governed by project_status_flow):

  • Pick 「进行中」 for a 「已暂停」 project: the confirm reads 「更改状态? 状态从 已暂停 改为 进行中,保存后可能触发相关自动化。」; 0 writes while it is open.
  • Cancel: 0 writes, the cell still reads 「已暂停」, focus is back on the cell.
  • Again, Change: one PATCH {"status":"active"} with If-Match; the cell reads 「进行中」.
  • Dark theme: the same, the dialog in dark tokens.
  • 375 px: the list draws cards; no table cells, no confirm (see Acceptance notes).
  • Drawer open on the record, list cell saved: the drawer re-reads and shows the new status.
  • Drawer with an unsaved owner draft, list cell saved: the draft is kept, the note shows, the drawer's status follows the list; drawer Save sends PATCH {"owner":…} with the latest If-Match, no 409.
  • Not measured: Safari / WebKit (no WebKit build in the container).

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (not touched)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes. (eslint on the changed files: 0 errors)
  • 4. One issue, one branch off an up-to-date main, one pull request. (The branch is the platform-assigned claude/project-thread-f8vhdm, named in the claim.)
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (not touched)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English. (the 维护者速读 block and the maintainer's quotes are Chinese by the maintainer's standing rule)
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgVhAK4uNYvjNY3H7XU

…dit; tests for the S3 confirm

Claude-Session: https://claude.ai/code/session_01L6bhgVhAK4uNYvjNY3H7XU
Co-authored-by: Claude <noreply@anthropic.com>
…-f8vhdm

# Conflicts:
#	ui/packages/i18n/src/locales/ar.ts
#	ui/packages/i18n/src/locales/de.ts
#	ui/packages/i18n/src/locales/en.ts
#	ui/packages/i18n/src/locales/es.ts
#	ui/packages/i18n/src/locales/fr.ts
#	ui/packages/i18n/src/locales/ja.ts
#	ui/packages/i18n/src/locales/ko.ts
#	ui/packages/i18n/src/locales/pt-BR.ts
#	ui/packages/i18n/src/locales/ru.ts
#	ui/packages/i18n/src/locales/zh-Hans.ts
#	ui/packages/i18n/src/locales/zh-Hant.ts
#	ui/packages/plugin-detail/src/useDetailTranslation.ts
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 21, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Posted 2026-11-21T02:04Z. The brief handed to the isolated declaration-face reviewer for PR #35972 (owed by the PR's Clause-②: yes line). The record follows as its own comment.

Contract review brief — PR #35972 @ 1ef49faedba2a6e3f236ba190ed3aa1dbc47572a (card #35685)

You review at TIER_DEFAULT. Render ONE ## Contract review record on this head — its shape is
node scripts/pm/record-recognisers.mjs --template --face declaration — with a PASS or FAIL verdict, and post it as ONE comment
on the PR or its card.

Inputs — these and nothing else:
· card #35685: its body and EVERY comment (rulings and earlier records included)
· PR #35972: its body, its file list, and the net diff against main at 1ef49faedba2a6e3f236ba190ed3aa1dbc47572a
· the check-runs on 1ef49faedba2a6e3f236ba190ed3aa1dbc47572a: their conclusions ARE the gate verdicts
⛔ Not the dispatch order, ⛔ not the dispatching seat's own conclusions — this brief is adversarial by design.

⛔ READ-ONLY. No worktree, no checkout, no build, no test run, no gate re-run, no ablation: the check-runs
on the head already answered every derived gate family, and a local run costs more than it returns.
If ONE probe is unavoidable, the record's Local-runs: line says probe — REASON; otherwise none.
Scratch space is /tmp/claude-0/-home-user/3d3cbaf6-4903-5fed-92d4-c2b94a45e868/scratchpad/pr-35972/ alone; nothing there you did not write this round is read.

Judge, in the record's own sections:
① Derived judgments — every accept-set and public-surface change the diff implies, each named right or wrong.
② Semver level — the changeset (or skip-changeset) matches what the diff publishes, and the Clause-②: line.
③ Boundary flags — every dev flag and every open_questions entry answered, or escalated.
On every face, SQL push-down: a new id materialisation or in-app join where SQL could push down is a
finding unless a reason is given (AGENTS.md, Prime Directive 5: SQL first).
Sign Implemented-by: with the dev's branch and Reviewed-by: with your session id — the value is the FIRST
thing after each colon.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Posted 2026-11-21T02:09Z.

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 1ef49faedba2a6e3f236ba190ed3aa1dbc47572a
Local-runs: none

Inputs: card #35685 body and all 9 comments (rulings 7039615827 and 7042779557, the S1/S2/S3 claims, the S1/S2/S3 os-dev-reports), the PR #35972 body, its 23-file list, git diff origin/main...1ef49fae, and the check-runs on the head. Check-runs: every completed run is success (Check Changeset, Type Check UI, Test UI 1-16/16, Lint UI, Build & E2E UI, Live E2E UI, Governed Surface Queue Guard, PR-body guards, Spec property liveness among them); the rest are skipped opt-in or path-gated jobs. None failed, none pending.

① Derived judgments

  • GridCellSelection.confirmCommit?(row, columnKey, value), a new optional member on a type @object-ui/components exports from its index. It is a widening, and that is right: the member is optional, nothing is renamed or removed, and a host that leaves it out gets null from commitConfirmationOf, which writes exactly as before.
  • The data-table commit gate. saveEdit and commitCellValue (paste, toggle) ask only when autosaves holds (select-first plus onRowSave) and the committed value differs from what the cell shows. A table outside a provider, or one wired with onBatchSave alone, never reaches the ask. Right. A No restores the edit session's snapshot through the extracted revertEditSession and stages nothing. A Yes re-enters through the newest commitCellValue with confirmed = true, so it is not asked twice and the held row is resolved again. Right. The exitEdit refactor keeps the same behaviour (the snap null check moved into the helper). commitCellValue's new fourth parameter is local to the renderer and not exported.
  • Which fields ask (the accept set). isStateMachineField matches an object validations rule with type: 'state_machine', field equal to the column, and active !== false, whose events (defaulting to the spec's ['insert','update']) include update. Severity is ignored on purpose. That fits the spec (packages/spec/src/data/validation.zod.ts) and ruling 7039615827 item 2 ("a field governed by the object's state_machine validation rule"). Right; see F2 for what the tests do not measure.
  • The dialog wording. The title is Change {{field}}?. The body names the field, the old value and the new value, and says "Saving may trigger related automation", without listing flows, as ruling 7039615827 item 2 orders. Listing the flows is open card Stage-change confirm: list the automations a state change will actually trigger (needs a server read), in the list cell and on the record page #35928. The en and zh-Hans strings match the ruling's text. Right.
  • objectGridStateConfirm.ts is new and is not re-exported from ui/packages/plugin-grid/src/index.tsx, so it adds no public surface.
  • InlineEditSaveBar note. It is a new role="status" note that appears when data.updated_at differs from the version the edit session began on, and it is hidden while saving. Its hooks sit above the early return. The Save path is unchanged: ifMatch is still read from the current data.updated_at, so the drawer's draft wins over the version now read, as the card asks (「抽屉里有未保存修改时,以抽屉为准并提示」). Right.
  • i18n. The diff adds grid.stateChange.{title,description,confirm,cancel} and detail.inlineEditRecordChanged to all 11 locale packs that exist under ui/packages/i18n/src/locales/ (the S3 claim said "12", a miscount with no effect). The fallbacks in objectGridTranslations.ts and useDetailTranslation.ts are byte-identical to en. These are additive. Right.
  • Docs. The two new bullets in content/docs/frontend/plugins/plugin-grid.mdx describe what the code does. The PR touches no reference, release or CHANGELOG path.
  • Card closure. The PR carries Fixes #35685. S1 (feat(list): a list cell saves the moment it is committed, and Space types into the selected cell #35864) and S2 (feat(list): undo a list cell save from its toast or with Ctrl+Z #35898) are merged, S3 delivers the two parts still open (the state-machine confirm and the drawer sync), and the flow listing is split out to Stage-change confirm: list the automations a state change will actually trigger (needs a server read), in the list cell and on the record page #35928 under the ruling. Right; see F1 for the one loose end that closing the card would drop.

F2 · should-fix: the PR's Tests claim is not met. The body's Tests line says the ObjectGrid block shows that "a field with no machine, and one whose machine is inactive or insert-only, is not asked". The block covers only a field with no machine and active: false (makeMachineDataSource({ active: false })). No case uses events: ['insert'], and no case uses a warning-severity machine (which, by design, should ask). The events.includes('update') branch of isStateMachineField is therefore unmeasured, and the recorded ablation (commitConfirmationOf returning null) cannot reach it. Fix: add an insert-only case (not asked) and a severity: 'warning' case (asked), or correct the body to what is measured.

F3 · nit. The JSDoc on the exported confirmCommit says it is "Asked when a value is committed into a cell". It does not say what the changeset and PR body do: only an autosaving select-first table (one wired with onRowSave) asks. A host on onBatchSave alone that implements the member is never asked. One clause in the JSDoc would fix this.

F4 · nit. isStateMachineField re-implements the rule-applicability read that @object-ui/core already has (isBlockingMachine in ui/packages/core/src/validation/validators/state-machine-next-values.ts), with its own DEFAULT_EVENTS copy and without the severity check. The difference is deliberate and documented. Exporting a predicate that ignores severity from core would keep one reader of the rule's active / events semantics instead of two.

② Semver level

  • The changeset .changeset/35685-list-state-confirm.md sets patch on @object-ui/components, @object-ui/plugin-grid, @object-ui/plugin-detail and @object-ui/i18n. Those are exactly the four published packages whose src/ the diff changes; the docs path publishes nothing.
  • The declaration Clause-②: yes (widening) appears line-initial in both the PR body and the changeset body. It is correct: there is one optional member on an exported interface, additive locale keys and new UI behaviour, and nothing is removed, renamed or narrowed.
  • Metadata-protocol: none appears in both and is correct. The diff adds a consumer of the existing state_machine rule keys (field, active, events), with no new key, no newly accepted value, no refusal and no changed default.
  • Under AGENTS.md (Post-Task Checklist step 3), a kind of none takes patch, and a non-protocol widening ships patch. The level matches, and Check Changeset is green on the head.

③ Boundary flags

  • open_questions. The S3 os-dev-report (7055359442) lists [], so there is nothing to answer.
  • Dev flags.
  • F1 · should-fix (escalated to the seat). out_of_scope_findings in 7055359442 reports that after a list-cell PATCH, the browser showed one GET of the list collection with populate, "noted here, not filed". Its carrier note says the PR's Acceptance notes omit it.
    • The S3 diff touches no load path, so this does not block the PR.
    • But the card's S1 acceptance says the other rows do not reload (「表格其他行不重新加载」), and this PR's Fixes #35685 closes that card. Left unfiled, the observation disappears with the card.
    • The seat should trace it before the card closes, or file a follow-up card with the dedupe words the dev gave. One explanation to rule out first: S2's carried fix (ruling 7042779557), under which a same-object related grid inside the open drawer is meant to re-read.
  • SQL push-down (Prime Directive 5). There is no finding. The diff is client-only. isStateMachineField reads the object schema the grid has already loaded, and the confirm reads the row the grid already holds. Nothing materialises ids or joins records in the app where SQL could push down.

Implemented-by: claude/project-thread-f8vhdm
Reviewed-by: session_01L6bhgUkbQqRUUFSiu2HGob

VERDICT: PASS

…doc says who asks

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Posted 2026-11-21T02:41Z. The DELTA brief handed to the same isolated declaration-face reviewer for PR #35972 (delta of its record 7055688534 on 1ef49fae: the fix for F2 and F3, and the F1 trace in the PR body's "Review round 1" section). The record follows as its own comment.

Contract review brief — PR #35972 @ c904bd9223f526584caf0c7db57bd24c8148c52c (card #35685)

You review at TIER_DEFAULT. Render ONE ## Contract review record on this head — its shape is
node scripts/pm/record-recognisers.mjs --template --face declaration — with a PASS or FAIL verdict, and post it as ONE comment
on the PR or its card.

Inputs — these and nothing else:
· card #35685: its body and EVERY comment (rulings and earlier records included)
· PR #35972: its body, its file list, and the net diff against main at c904bd9223f526584caf0c7db57bd24c8148c52c
· the check-runs on c904bd9223f526584caf0c7db57bd24c8148c52c: their conclusions ARE the gate verdicts
⛔ Not the dispatch order, ⛔ not the dispatching seat's own conclusions — this brief is adversarial by design.

⛔ READ-ONLY. No worktree, no checkout, no build, no test run, no gate re-run, no ablation: the check-runs
on the head already answered every derived gate family, and a local run costs more than it returns.
If ONE probe is unavoidable, the record's Local-runs: line says probe — REASON; otherwise none.
Scratch space is /tmp/claude-0/-home-user/3d3cbaf6-4903-5fed-92d4-c2b94a45e868/scratchpad/pr-35972/ alone; nothing there you did not write this round is read.

Judge, in the record's own sections:
① Derived judgments — every accept-set and public-surface change the diff implies, each named right or wrong.
② Semver level — the changeset (or skip-changeset) matches what the diff publishes, and the Clause-②: line.
③ Boundary flags — every dev flag and every open_questions entry answered, or escalated.
On every face, SQL push-down: a new id materialisation or in-app join where SQL could push down is a
finding unless a reason is given (AGENTS.md, Prime Directive 5: SQL first).
Sign Implemented-by: with the dev's branch and Reviewed-by: with your session id — the value is the FIRST
thing after each colon.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Posted 2026-11-21T02:43Z.

Contract review

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

This is a delta of record 7055688534, which reviewed head 1ef49fae.

Inputs

  • Delta. git diff 1ef49fae..c904bd92 is one commit, c904bd922, touching two files (+24 / -2): ui/packages/components/src/context/gridCellSelection.tsx, a JSDoc-only change, and ui/packages/plugin-grid/src/__tests__/ObjectGrid.autosave-35685.test.tsx, which gains two cases.
  • Net diff against main. The merge base is unchanged (7de1bad5), so the net diff is the reviewed one plus this delta: 23 files, +644 / -16.
  • PR and card. I read the PR body's new "Review round 1" section and the card's comments; the card has none newer than the S3 os-dev-report.
  • Trace log. /mnt/project-files/build-seat1/35685/s3/f1-trace.log.
  • Check-runs on c904bd92. 54 are success and 12 are skipped; none failed and none are pending.

① Derived judgments

  • The delta changes no public surface and no accept set. confirmCommit keeps its signature, and the only edit to it is its comment. The production source is unchanged, and every ① judgment of 7055688534 stands on this head.
  • F2: closed. The ObjectGrid block now measures both branches it lacked:
    • makeMachineDataSource({ events: ['insert'] }): the paste saves at once with { stage: 'won' } and no dialog opens. This measures the events.includes('update') branch.
    • makeMachineDataSource({ severity: 'warning', events: ['update'] }): the dialog opens with "Stage changes from New to Won." and nothing is sent. This measures that severity is ignored.
    • Both spread into the fixture's rule (...rule). The PR body's Tests claim now matches the tree.
  • F3: closed. The JSDoc on GridCellSelection.confirmCommit now says "Only a table that saves each cell as it is committed (one wired with onRowSave) asks; a table on onBatchSave alone never does". That matches the autosaves guard in commitConfirmationOf.
  • F4: open (nit, no effect on the verdict). isStateMachineField still reads the rule's active / events apart from core's isBlockingMachine. The body says it was left "as the seat ruled". No such ruling is in this round's inputs (the card or the PR), so the nit stays on the record as written.

② Semver level

  • The changeset is unchanged: patch on @object-ui/components, @object-ui/plugin-grid, @object-ui/plugin-detail and @object-ui/i18n.
  • The delta adds a comment in @object-ui/components and a test in @object-ui/plugin-grid. It publishes no new behaviour, so the existing changeset still covers what ships.
  • The declaration Clause-②: yes (widening) and Metadata-protocol: none still hold in the PR body and the changeset, and both are still correct. Check Changeset is green on c904bd92.

③ Boundary flags

  • F1: closed. The trace log records two runs, with every request to the object printed with its call stack.
    • (A) List alone, confirmed move. The only request after the confirm is the PATCH from writeRowGuarded.
    • (B) Drawer open on the same row. The PATCH is followed by three requests, all for that one record:
      • a GET of the collection route with top=1 and filter=["id","=",…], the same id as the PATCH (through readOne and then rawFindWithPopulate);
      • POST …/{id}/page (readRecordPage);
      • GET …/{id}/field-access.
    • The GET the dev flagged is therefore a one-record read, not a reload of the list's rows. The A/B difference ties it to the open drawer.
    • The printed stacks stop at the adapter, so "the drawer" is inferred from that difference rather than read off a frame. The inference is sufficient here, because the filter rules out other rows either way.
    • S1's acceptance (「表格其他行不重新加载」) holds, and nothing needs filing before Fixes #35685 closes the card.
  • open_questions. None is new; the list was [].
  • SQL push-down (Prime Directive 5). There is no finding. The delta is a test and a comment, and the reads in the trace are the adapter's existing single-record path.

Implemented-by: claude/project-thread-f8vhdm
Reviewed-by: session_01L6bhgUkbQqRUUFSiu2HGob

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgTcFanGhTvqS1V2Q4U

席位核对 — ACCEPT (L1-a)

维护者速读

  • 在列表里直接改「状态」这类受流转规则管的字段时,保存前会先弹确认框:「状态从 搁置 改为 进行中,保存后可能触发相关自动化。」点取消,什么都不写,格子保持原值;点确认更改,照常保存。这是照你的裁决(记录 7039615827)写的,不去服务端查具体有哪些流程。
  • 抽屉跟着变:列表里改了抽屉正打开的那条记录,抽屉会重新读取。如果抽屉里有没保存的修改,修改保留,保存条上提示「此记录已在别处被修改」,保存时以抽屉的修改为准。
  • 这是「行内编辑」卡 行内编辑保存:逐格自动保存,失败保留并整行一起发,可撤销,只更新当前行;去掉保存栏和行尾按钮 #35685 的最后一片,合并后关卡。
  • 风险:最坏是某个状态字段该问没问,或者不该问却问了,数据保存逻辑本身不变,撤回即可。
  • 要你做什么:无。

Head reviewed: c904bd9223f526584caf0c7db57bd24c8148c52c.

  • 6 commits on main 7de1bad5, including one main merge, 23 files, +644/−16.
  • git merge-tree onto current main is clean.
  • Fixes #35685. Clause-②: yes (widening) (GridCellSelection.confirmCommit, optional, nothing removed or renamed). Metadata-protocol: none.
  • The changeset is a patch for @object-ui/components, plugin-grid, plugin-detail and i18n, which is right for an additive optional member.
  • check-governed-merges --pr 35972, run from a worktree at this head: not governed. Size 660 lines.

Against the S3 brief (card #35685 body lines 25, 27, 41; ruling 7039615827)

  1. Confirm before a state-machine move.
    • The seam. confirmCommit is asked in data-table.tsx only when autosaves holds (select-first plus onRowSave), and only for a value that changes what the cell shows (isUnchangedCellValue against the staged-or-loaded value). It is asked on all three write paths:
      • the editor's commit (saveEdit): the edit session is rolled back and the editor closed before the ask;
      • a toggle;
      • a paste (commitCellValue via writeCell).
    • Settling. A true re-enters commitCellValue(…, confirmed = true) through a ref, so the newest closure writes on the newest held row. A false or a rejection writes nothing. Focus returns to the cell either way.
    • The host side. ObjectGrid returns null unless isStateMachineField: an active state_machine rule on the field whose events (default insert, update) cover update.
      • Including warning severity is deliberate and documented ("a move along a machine is the change that related automation listens for"). This is wider than core's blocking-only stateMachineNextValues, and a test pins it.
      • Legal moves stay the editor's and the server's call.
    • The dialog. One AlertDialog. A newer ask answers the older one false, and the grid's unmount answers false, so no commit is left hanging. This is the same pattern as the S1 row-conflict dialog.
    • The copy follows ruling 7039615827: the field, from X to Y, and "Saving may trigger related automation". No server read of flows is made. Labels come from the option label through resolveFieldOptionLabel, with the code and then grid.empty as fallbacks.
  2. Drawer sync.
    • The drawer's re-read on a grid write is the existing notifyDataChanged → useDataInvalidation path, and the S1 own-writes rules are unchanged.
    • The new part is InlineEditSaveBar. It takes the updated_at at session start, and while the draft is open and not saving, a re-read at another version shows a role="status" note. The draft is kept, and Save behaves as before. This is the brief's "the drawer wins and shows a notice". The note resets when the session ends.
  3. Not in S3: onBatchSave retirement (DataTable: retire the onBatchSave slot once list inline edit saves each cell on its own #35827). The brief puts it outside. The PR carries Fixes #35685 because S1, S2 and S3 close every item in the card body. That is the seat's reading, and the brief allows it.

Tests and evidence

  • New ObjectGrid.autosave-35685 cases:
    • the confirm names the field and both values, and Cancel saves nothing;
    • Change sends one guarded update;
    • an ungoverned or inactive machine saves without asking;
    • an insert-only machine does not ask;
    • a warning-severity machine asks.
  • New InlineEditSaveBar cases:
    • the draft is kept, the note is shown, and Save writes over the version now read;
    • there is no note on the same version, nor in the next session.
  • data-table-autosave-35685 adds the component-level seam tests.
  • i18n: grid.stateChange.* and detail.inlineEditRecordChanged are in all 11 locales. The two default-translation maps are byte-identical to en, and zh-Hant is regenerated.
  • Docs: plugin-grid.mdx documents both behaviours and the seam.
  • Browser evidence is in /mnt/project-files/build-seat1/35685/s3/:
    • light and dark: the confirm, Cancel saving nothing, and the confirmed save;
    • the drawer following, the draft being kept with the note, and the draft saved over the latest version;
    • 375 px.
  • vitest is NOT MEASURED here (no node_modules locally). CI on this head reports 66 runs: 54 success, 12 skipped, 0 failed. Not re-read here.

Reviews of record

  • Declaration L2 (TIER_DEFAULT, for Clause-②: yes): PASS 7055688534 on 1ef49fae, then delta PASS 7056128535 on c904bd92, which closes F1–F3. F4, a nit, is left by the seat.
  • L1 does not replace them.

Nits (no action needed)

  • N1. isStateMachineField re-reads the rule shape (type, field, active, events) beside core's isBlockingUpdateMachine. The severity difference justifies a second predicate. If core later changes how events defaults, both need the edit. A shared governsUpdate(rule, field) in core could carry the common part in a later card.
  • N2. The confirm's "from" label reads the row's loaded value, not a value staged earlier for the same cell. Under per-cell autosave, a staged value normally lands before the next edit, so the two rarely differ.
  • N3. The drawer note keys on updated_at alone. An object with no updated_at shows no note, and the draft is still kept.

Landing terms

  • Not governed: the seat lands on this ACCEPT, the declaration L2 delta PASS on this head, and a green head.
  • A new push needs a delta L1 unless it is a clean main merge.
  • This review does not approve, mark ready, enqueue or request review.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Seat landing · 2026-11-21T02:47Z · Slice S3 of #35685 (area b1-I4): editing a state-machine field from a list cell now asks for confirmation first, with the wording of maintainer ruling 7039615827 item 2, and the record drawer re-reads its record after a save. Clause-②: yes (widening) (the optional GridCellSelection.confirmCommit member), so a declaration L2 at TIER_DEFAULT was owed: PASS 7055688534 on 1ef49fae with two should-fix findings, then delta PASS 7056128535 on c904bd92 (this head) closing F1, F2 and F3. F4 (a duplicated rule reader beside core's isBlockingMachine) stays an accepted nit. L1-a ACCEPT 7056160293 on this head. check-governed-merges --pr 35972 reads NOT governed (+644/−16). landing-k reads K = 0. On this head, 54 check-runs are success, 12 are skipped and none failed, and the PR is mergeable clean. The seat readies this PR and arms auto-merge in the same step. The PR carries Fixes #35685; #35827 continues on its own card.

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 tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

行内编辑保存:逐格自动保存,失败保留并整行一起发,可撤销,只更新当前行;去掉保存栏和行尾按钮

2 participants