Repository navigation
fix(plugin-detail): the record drawer's per-field save asks for the fields a change makes required - #36298
Conversation
… change makes required Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5oLLK7uoxp33riiBJL
…s ask Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5oLLK7uoxp33riiBJL
…ordDetailPanel Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5oLLK7uoxp33riiBJL
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5oLLK7uoxp33riiBJL Final green head for L1: |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5ozidcgr4FYrKfmrjD 维护者速读
席位核对 — ACCEPT (L1-d) · repo:objectstack#4 · head
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5oLLK7uoxp33riiBJL Landing · head
State: ready + auto-merge; on MERGED |
Requested by Leehom · project thread
Fixes #35995
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
InlineEditSaveBar's callback mode (the record overlay,RecordDetailPanel/RecordDetailDrawer) now runs the samecollectRequiredWhenPromptFieldscheck with the samefillabletest as the atomic mode before its firstonFieldSave. When fields come back it writes nothing and opens the sharedRequiredFieldsDialog; Save sends the changed field plus the typed values in ONEdataSourceupdate withIf-Matchat the version the edit session began on; Cancel closes the dialog and keeps the draft; a 409 opens the same conflict dialog the atomic mode opens, over the fill-in dialog (Cancel comes back to the typed values, Overwrite resends both at the server's version). A change that makes nothing required still goes throughonFieldSaveat once.ui/packages/plugin-detail/src/InlineEditSaveBar.tsx— the ask runs in both modes when the DataSource props are present; the callback mode's ask carries the edit session's starting version (RequiredAsk.ifMatch); the plain callback save's 409 still reads as a refusal (the conflict dialog's overwrite writes through the DataSource, which is not the path that refused). The edit-base block moved abovehandleSaveunchanged so the save can read it.ui/packages/plugin-detail/src/RecordDetailPanel.tsx— hands the bardataSource,objectName,recordIdanddata(all existing props) and wraps the bar alone in aRecordContextProvidercarrying the panel'sobjectSchema, so the bar knows the object's fields. No new prop, no new callback shape.@object-ui/plugin-detailpatch changeset.Measured caller set (Zone 2.1): the callback mode has exactly one caller,
RecordDetailPanel(RecordDetailDrawerrenders it). It is the overlay ofObjectKanban,ObjectCalendar,ObjectGanttandObjectTree(the tree passes noonFieldSave, so it is read-only) when the host routes no row click. Inside the console a list row click opensRecordDetailViewin the drawer stack (objectViewRecordOverlay.tsx), whose bar is the atomic mode and already asks since the shared prompt landed; that file is untouched here.Tests
InlineEditSaveBar.requiredPrompt-35956.test.tsxthat said the callback mode never asks now says it asks and writes nothing yet.describein the same file (the component's shared harness, per the ruling that a new pin goes into that file): Save writes once with both fields andifMatchand never callsonFieldSave; the guard is the version the edit began on even after the host re-reads the record mid-edit; Cancel writes nothing and keeps the edit; CONTROL — a change that makes nothing required goes throughonFieldSaveat once; a 409 keeps the fill-in dialog open under the conflict dialog and Overwrite resends both at the server's version; CONTROL — with no data source handed over it never asks; and one test through the realRecordDetailPanel+DetailView(double-click, edit, Save → dialog → one guarded update).Readings
Recorded at the commit named in the report; see the
os-dev-reportcomment on the card for the full gate list.vitest run InlineEditSaveBar.requiredPrompt-35956.test.tsx— Test Files 1 passed, Tests 15 passed.InlineEditSaveBar/RecordDetailPanel/RecordDetailDrawer— Test Files 25 passed, Tests 163 passed, 10 skipped.scripts/ablation-replace.mjs, restored to the HEAD blob withgit diff HEADempty): restoring the old!onFieldSave &&guard turns 6 tests red (the flipped pin, Save, the version guard, Cancel, the 409 and the panel test) while both CONTROLs stay green.Acceptance notes
onFieldSave. The kanban and the calendar re-read on the data source's mutation event, as they do for any write; a host that only patches its own list insideonFieldSavedoes not see that patch for this one write. The panel'srecordis the host's snapshot (navigation.selectedRecord) either way, as it already is after a per-field save.dataalso turns on two existing behaviours in the overlay: the changed-elsewhere notice, and a server refusal naming a record field reading as a field hint (labelled with the machine name, since the panel passes nofieldLabelFor).Verification
Files to read first, by risk:
InlineEditSaveBar.tsx(handleSave's ask and the 409 gate),RecordDetailPanel.tsx(the record context around the bar), the newdescribeat the end of the test file.Two-minute check:
cd ui && pnpm exec vitest run packages/plugin-detail/src/__tests__/InlineEditSaveBar.requiredPrompt-35956.test.tsx— expect 15 passed.🤖 Generated with Claude Code
https://claude.ai/code/session_01FEkQ5oLLK7uoxp33riiBJL