Repository navigation
fix(plugin-grid): the row menu offers no Delete on a line whose master is held - #37296
objectstack-fleet[bot] merged 2 commits into
Conversation
… held Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D Final head for L1 (p2) · area a4-U · 2026-11-25T13:42Z Card #37231. Dev report: 7163984482.
Handed to the seat session for L1. |
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — ACCEPT · L1 · head
|
|
repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D Landing · area a4-U · 2026-11-25T14:28Z · head
State change: ready for review, and auto-merge is armed. The queue lands it. On MERGED, #37231 closes through |
Fixes #37231
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
useRowApprovalLocksnow keeps the batch lock door'slockSource('record'or'master') for a row answeredlocked: true, and exposesheldByMaster(recordId). It answerstrueonly for a row a read answeredlockSource: 'master'. A 501, anullentry, a failed or unasked read, and a record-held row all answerfalse.objectGridActionsColumn.tsx) ANDs!heldByMasterintocanDelete. The row menu, the row context menu and the list page's single-row selection bar all read the samerowActionMenuProps, so they all drop Delete on a master-held line. A record-held row keeps Delete and loses Edit, as before ([finding] 删除记录后,它的审批单仍留在审批收件箱:pending 与 approved 两种都留,记录引用退化为原始 id #13568).ObjectGrid.tsx: the lock hook is also enabled, and the demand probe also sent, on a grid whose rows offer Delete but no Edit (rowMenuReadsLocks = (canEdit && onEdit) || (canDelete && onDelete)). Without this, a Delete-only grid never read the lock and kept Delete on a master-held line. The read is still sent only on demand, never on first paint.ObjectGrid.tsxhook comment no longer say that a master-held line keeps Edit and Delete.patchchangeset for@object-ui/plugin-grid.Read first, in order of risk:
ui/packages/plugin-grid/src/ObjectGrid.tsx, therowMenuReadsLockshunk: a Delete-only grid now sends a lock read when a row's actions are reached for.ui/packages/plugin-grid/src/hooks/useRowApprovalLocks.ts, theanswered.sethunk:lockSourceis kept only on alocked: trueentry, and only for one of the two values.ui/packages/plugin-grid/src/objectGridActionsColumn.tsx, thecanDeleteline.Two-minute check:
cd ui && pnpm exec vitest run packages/plugin-grid/src/__tests__/rowMenuApprovalLock-36911.test.tsxshould report 10 passed, including the three tests underobjectstack#37231.Tests
The new pins are a top-level
describein the existing harnessrowMenuApprovalLock-36911.test.tsx:onDeleteand noonEditreads the lock on demand and drops Delete on the master-held line. The open row keeps Delete.nulland failed-read controls now include a master-held line, and each leaves its menu unchanged.Acceptance notes
describeCell→approvalLocked) still reads only the boolean. Both lock kinds refuse an update, so the boolean is enough there.locked: trueentry with nolockSource(an older server) reads as record-held, which is the behaviour before this PR.ObjectGridagainst a fake lock door.rowMenuReadsLockswidening has no ablation of its own. Its pin is the Delete-only test, which went red under the column ablation only because that ablation removes the downstream effect.Verification
All readings below were taken at commit 929d5f0 in objectstack.
Harness file, plugin-grid suite, type-check
Ablation: drop the master arm
Two earlier attempts were refused or invalid and are not counted. The first used the anchor with a trailing comma and the replacement
,: the tool refused it as a no-op and restored the file before any test ran. The second deleted the comma along with the anchor: that broke the syntax, so the file collected no tests.Generated by Claude Code