Skip to content

fix(plugin-detail): the record drawer's per-field save asks for the fields a change makes required - #36298

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-35995-drawer-required-prompt
Nov 22, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-35995-drawer-required-prompt

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

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 same collectRequiredWhenPromptFields check with the same fillable test as the atomic mode before its first onFieldSave. When fields come back it writes nothing and opens the shared RequiredFieldsDialog; Save sends the changed field plus the typed values in ONE dataSource update with If-Match at 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 through onFieldSave at 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 above handleSave unchanged so the save can read it.
  • ui/packages/plugin-detail/src/RecordDetailPanel.tsx — hands the bar dataSource, objectName, recordId and data (all existing props) and wraps the bar alone in a RecordContextProvider carrying the panel's objectSchema, so the bar knows the object's fields. No new prop, no new callback shape.
  • One @object-ui/plugin-detail patch changeset.

Measured caller set (Zone 2.1): the callback mode has exactly one caller, RecordDetailPanel (RecordDetailDrawer renders it). It is the overlay of ObjectKanban, ObjectCalendar, ObjectGantt and ObjectTree (the tree passes no onFieldSave, so it is read-only) when the host routes no row click. Inside the console a list row click opens RecordDetailView in 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

  • The pin in InlineEditSaveBar.requiredPrompt-35956.test.tsx that said the callback mode never asks now says it asks and writes nothing yet.
  • A new top-level describe in 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 and ifMatch and never calls onFieldSave; 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 through onFieldSave at 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 real RecordDetailPanel + DetailView (double-click, edit, Save → dialog → one guarded update).
Readings

Recorded at the commit named in the report; see the os-dev-report comment on the card for the full gate list.

  • vitest run InlineEditSaveBar.requiredPrompt-35956.test.tsx — Test Files 1 passed, Tests 15 passed.
  • 25 plugin-detail test files naming InlineEditSaveBar / RecordDetailPanel / RecordDetailDrawer — Test Files 25 passed, Tests 163 passed, 10 skipped.
  • Ablation (via scripts/ablation-replace.mjs, restored to the HEAD blob with git diff HEAD empty): 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

  • The dialog's single write goes through the data source, not through the host's 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 inside onFieldSave does not see that patch for this one write. The panel's record is the host's snapshot (navigation.selectedRecord) either way, as it already is after a per-field save.
  • Without a data source on the overlay there is no one write to put the values in, so it saves field by field as before (pinned as a CONTROL).
  • Handing the bar data also 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 no fieldLabelFor).
  • 375 px / dark: the dialog is the shared one, unchanged here; no browser check was run for this PR.

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 new describe at 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

@github-actions github-actions Bot added size/m 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 22, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5oLLK7uoxp33riiBJL

Final green head for L1: c03f926b7596274f3a8b0abd22aa2a35afb25bb0. Check-runs on it (pr-state 05:28Z): 42 success, 13 expected skip, 0 unexpected skip, 0 failed, 0 pending; no commit status; mergeable state clean. Report: #35995 comment 7074757038. Sent to L1-d.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5ozidcgr4FYrKfmrjD

维护者速读

  • 看板、日历、甘特图、树形视图里打开的记录浮层:改一个字段导致另一个空字段变成必填时,现在先弹出填写框,填好后一次保存;以前会直接被服务器拒绝。
  • 取消不写任何东西,保留刚才的修改;不涉及必填的修改照旧立即保存。控制台列表行点开的抽屉早已如此,这次补的是剩下的浮层。
  • 结论:通过。有一条范围外问题(浮层里报错和冲突框显示字段内部名而不是中文标签)交区线程走立卡门。
  • 要你做什么:现在不需要。

席位核对 — ACCEPT (L1-d) · repo:objectstack#4 · head c03f926b75 · 2026-11-22T05:31Z

Read at c03f926b75: 4 files, +252/−53. The face is Clause-②: no, Metadata-protocol: none. No contract face and not Tier H, so no L2 is owed.

Checked and fine

  • Shape. Draft, base main, first line Fixes #35995. Fixes is right: To-do 1–3 and the first two acceptance lines are delivered and pinned. l1-face is CLEAN.
  • Premise. The dev's reading holds: the callback mode's one caller is RecordDetailPanel (inside RecordDetailDrawer), the overlay of kanban, calendar, gantt and tree when the host routes no row click; the console's list-row drawer is RecordDetailView in the atomic mode and already asks since feat(list,detail): a change that makes other fields required asks for them in place #35994. The card's "the drawer" is this overlay.
  • The fix. handleSave now asks in both modes when canAtomic (data source, object, record id) and data are present; nothing is written before the dialog. In the callback mode the dialog's Save writes draft + typed values in ONE updateVia with ifMatch = the version the edit session began on (editBase, moved above handleSave unchanged), which is what To-do 2 asks. A draft needing nothing still loops onFieldSave (the if (onFieldSave) branch is unchanged). The plain callback save's 409 stays a refusal (&& !onFieldSave), since its writes are the host's. RecordDetailPanel passes its existing dataSource/objectName/recordId/record and wraps the bar alone in a RecordContextProvider with objectSchema; no new prop shape on a published component.
  • Host refresh after the one write. It goes through the data source, not onFieldSave. Checked: ObjectKanban, ObjectCalendar, ObjectGantt and ObjectTree all re-read through useDataInvalidation, so no host misses it. The panel's record is the host's snapshot either way.
  • Tests. In the shared harness InlineEditSaveBar.requiredPrompt-35956.test.tsx (placement accepted under the shared-harness rule): the feat(list,detail): a change that makes other fields required asks for them in place #35994 pin flipped to "asks, writes nothing yet"; Save writes once with both fields at v1 and never calls onFieldSave; the guard stays the edit-begin version after a mid-edit re-read; Cancel keeps the draft; 409 keeps the fill-in dialog under the conflict dialog and Overwrite resends both; CONTROLs for nothing-required and no data source; one leg through the real RecordDetailPanel. Ablation (callback mode not asking) turned 6 red, both CONTROLs green; restored.
  • Changeset. Read sentence by sentence against the diff: the overlay story, "Save writes the change and the typed values in one update guarded with If-Match at the version the edit began on, Cancel writes nothing and keeps the edit", "a change that makes nothing required still saves at once through onFieldSave", the four-prop condition, the data-source mutation-event sentence and "without a data source the overlay saves field by field as before" all match.
  • Overlap. No RecordDetailView.tsx/RelatedList.tsx touch. No other open PR touches InlineEditSaveBar.tsx or RecordDetailPanel.tsx (all 64 open PRs' file lists read). overlap-check.mjs --pr=36236,36208 against current origin/main: clean.
  • Gates. At c03f926b75: 42 success, 13 expected skip, 0 unexpected skip, 0 failed, 0 pending; Lint & Repo Gates and TypeScript Type Check success; mergeable_state clean. The full plugin-detail package ran in CI Test UI, green; locally the 25 files naming these components passed and type-check exited 0.

Acceptance line not measured

Out-of-scope items

  1. Machine names in the overlay's refusals. RecordDetailPanel passes no fieldLabelFor, so the bar's labelOf falls back to the field's name. On main the overlay already prefixed a per-field refusal with the machine name; handing data now also draws it as a field hint, and the new conflict dialog's rows fall back to row.field. Route: Acceptance notes — the area takes it through the filing gate as an area:ux card (the bar already reads objectFields from the new record context, so a label fallback there would cover it).
  2. Host-patch gap for the one data-source write: dropped — no defect: all four hosts re-read through useDataInvalidation (checked above).
  3. The changed-elsewhere notice now also shows in the overlay: the record page's existing 行内编辑保存:逐格自动保存,失败保留并整行一起发,可撤销,只更新当前行;去掉保存栏和行尾按钮 #35685 behaviour, whose own comment names "a list cell beside the drawer"; parity, no decision owed.

Landing

  • Fixes #35995: merging closes the card; the area clears pm:dispatched at close per landing rule B. Non-governed, the area lands it.

Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5oLLK7uoxp33riiBJL

Landing · head c03f926b7596274f3a8b0abd22aa2a35afb25bb0 · ACCEPT → PR #36298 comment 7074798693 (L1-d)

Probe Reading
check-governed-merges.mjs --pr 36298 NOT governed; 305 changed lines (+252 / −53), under 3000
check-runs on the head 42 success, 13 expected skip, 0 unexpected skip, 0 failed, 0 pending; mergeable clean

State: ready + auto-merge; on MERGED Fixes #35995 closes the card and the area clears pm:dispatched. The ACCEPT's out-of-scope item 1 (machine names in the overlay's refusals and conflict rows) goes through the area's filing gate.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 22, 2026 05:32
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit 0d0ed81 Nov 22, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-35995-drawer-required-prompt branch November 22, 2026 06:44
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/m 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.

The record drawer's per-field save asks for the fields a change makes required, like the record page does

1 participant