Repository navigation
feat(detail): the record header's stage menu asks for the fields a stage needs through the shared fill-in dialog - #36032
Conversation
…fill-in dialog The stage menu beside the record's name now judges which fields a stage makes required with `collectRequiredWhenPromptFields` and collects them in `RequiredFieldsDialog` from `@object-ui/fields`, the pair the list cell, the record page's inline Save and the kanban drop use. Its own pre-check (`fieldsNeededAt`), field form and `confirmWithFields` in `recordPathStageChange.tsx` are deleted. A stage that needs nothing opens the same dialog as the move's confirmation; the dialog focuses its submit button when it shows no field, so Enter still confirms. `record:path` keeps its plain confirmation. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgWV6ouxRg2fByapa6F
…mit button Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgWV6ouxRg2fByapa6F
|
repo:objectstack#1 · os-sales · session_01L6bhgTcFanGhTvqS1V2Q4U 席位核对 — ACCEPT (L1-a)维护者速读这个 PR 是「补填必填字段」的最后一步:把记录页头部的阶段下拉也换成和列表、记录页行内保存、看板同一个补填框,原来那份自带的判断和表单删掉了。现在仓库里只剩一份判断、一个框。 我核过以下几点:
没有需要修的问题。有一个小问题记在下面,供以后跟进。这个 PR 不属于受管面,不需要 L2,可以按普通队列合并,合并后卡 #35956 关闭。 Head reviewed: What holds
Nit (does not block)
Observations (no change asked)
Landing terms
|
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Seat landing · 2026-11-21T09:29Z · The b1-CX card thread's PR 2 of #35956: the record header's stage menu now uses the shared required-field prediction and fill-in dialog ( |
Requested by Sales · project thread
repo:objectstack#1 · os-sales · session_01L6bhgWV6ouxRg2fByapa6F
Fixes #35956
(PR 2 of 2. PR 1 #35994, merged
9a98a467, made the pre-check and the dialog shared and wired the list cell, the record page's inline Save and the kanban drop. This PR moves the last surface, the record header's stage menu, onto them and deletes its own copy. The record drawer's per-field save is #35995, its own card, not in this card's acceptance.)Clause-②: no
Metadata-protocol: none
Skills-docs: none. No skill under
skills/and no page undercontent/docs/describes the stage menu's dialog.Flow: dev-thread rule (maintainer 2026-11-20 09:22:50Z): the card thread builds itself; L1 by L1-a. The seat's claim names no L2 while Clause-② stays
no.维护者速读
record:path)的确认框原样保留。What changes
The stage menu on the shared pair (
@object-ui/plugin-detail,renderers/recordPathStageChange.tsx,useStageChangewithcollectFields, which onlyRecordStageMenuturns on):collectRequiredWhenPromptFields(objectFields, record, { [statusField]: value }, { fillable })from@object-ui/fields, the evaluator PR 1 shared. The menu's ownfieldsNeededAtloop overresolveFieldRuleStateis deleted.fillableis the question the menu already asked (not the stage field, not read-only, computed or a system field, the reader'srecordEditgrant), the same oneInlineEditSaveBarasks.RequiredFieldsDialog. The menu's own field form (InlineFieldInputrows,data-stage-change-field*), its refusal routing andconfirmWithFieldsare deleted. The menu passes the record's name (getRecordDisplayName), one change row (the stage field's label and the picked stage's label),moreFieldsfor chained requirements,refusalField(a field the refusal names that the reader may fill and that has an in-place editor), and its own title, description and移动label, which are the strings it used before (detail.pathStageChangeTitle,detail.stageMenuFieldsDescription/detail.pathStageChangeDescription,detail.pathStageChangeConfirm). No new string.updateViawith{ ...typedValues, [statusField]: value }andifMatchset to the record'supdated_at, then a re-read. On a rejection, a refusal that names fields goes to the dialog as it came. Every other refusal becomes the menu's own line fromstageRefusalLines, which is unchanged: a 409 re-reads the record and says so, a permission refusal reads the stage line and never the raw 403, an external source reads the read-only line. That line goes to the dialog's foot. The stage does not move.record:path(collectFieldsoff) keeps itsAlertDialogconfirmation and its refusal under the rail, unchanged.The shared dialog, one behaviour (
@object-ui/fields,RequiredFieldsDialog). When it opens with no field to fill, its submit button takes the focus instead of Radix's first tabbable (Cancel), so Enter confirms the change the reader just picked. This is the #35891 keyboard contract the stage menu'sAlertDialogcarried. With fields, the first field still takes the focus as before. No prop changed. The other hosts open it only with fields, so they see no difference.Acceptance notes
The card's acceptance items, as they stand after both PRs:
requiredWhenPrompt.test.ts). B is rich text: not asked, and the refusal reads in the dialog's foot (test and browser below). The list's 「打开记录」 link was delivered by S1 feat(list): a list cell saves the moment it is committed, and Space types into the selected cell #35864 (PR 1's item 7).recordPathStageChange.tsxno longer readsresolveFieldRuleState,isMissingForRequiredorInlineFieldInput. ItsfieldsNeededAtis now one call of the shared collector.confirmWithFieldsand thedata-stage-change-field*rows are gone; the only remaining mention is the migrated test asserting their absence.collectRequiredWhenPromptFieldsandRequiredFieldsDialogare defined only inui/packages/fields/src/.Readings I chose (seat claim, items 1–3):
Platform checklist: no clause moves.
Tests
Migrated:
ui/packages/plugin-detail/src/__tests__/RecordStageMenu-35891.test.tsx. The stage menu's dialog is nowrole="dialog"(the sharedDialog), notalertdialog, and its rows aredata-required-fields-field/data-required-fields-errorinstead ofdata-stage-change-field*. The rest is unchanged. One assertion moved: "left empty, the server refusal names the field" now first meets the shared dialog's own presence check ("Required", nothing written). The server refusal under the field is then asserted after a value is typed. The record:path control (alertdialog, Cancel focused) is untouched.New:
RecordStageMenu-35891.test.tsx,#35956 the stage menu opens the shared fill-in dialog(7 tests):{ stage, loss_reason, loss_detail }withifMatch;ui/packages/fields/src/__tests__/RequiredFieldsDialog.inPlace-35956.test.tsx(2 tests): with nothing to fill, the submit button is focused and submits{}; control: with a field, that field is focused.Ablation (on committed code, each restored with
git checkout --,git diffempty afterwards):if (true || …) return) → 2 failed: the new fields test, and the stage menu's "Enter confirms the stage it names". Restored → green.fillableforcedfalse(nothing is ever asked) → 7 failed / 22 inRecordStageMenu-35891. Restored → green.if (false) throw err) → 2 failed / 22. Restored → green.fields={[]}alone keeps the suite green. The dialog'smoreFieldsre-collects against the stored record and finds the same fields. Thefillableablation above is the one that removes the asking.Verification
Local runs
vitestfromui/, one package at a time, on5e61f1e9:fields: 316 files, 4748 tests passed (1 file skipped);plugin-detail: 396 files, 3643 tests passed (1 skipped);plugin-kanbanplusplugin-grid'sObjectGrid.requiredPrompt-35956: 82 files, 546 tests.On
0477e86e(test-only commit): the two changed files, 29/29.tsc --noEmitfor@object-ui/plugin-detailand@object-ui/fields: clean.eslinton the changed files: 0 errors. The 9no-explicit-anywarnings are on lines this PR did not touch.Clause-②
no: no export added, removed or retyped.RecordStageMenuProps,useStageChange's signature andStageChange, andRequiredFieldsDialogPropsare unchanged.StageTargetis module-private.node scripts/pm/overlap-check.mjs: VERDICT clean (main9a98a467, 0 open PR heads share a file).Changed lines: 6 files, +379 / −217, under the 3000 threshold.
Browser
Setup:
examples/app-showcase,objectstack dev --seed-admin -p 43956on its own temp DB.ui/apps/consoleVite dev server over it (workspace sources).requiredWhen, so for the run onlyshowcase_projectgained PR 1's three probe fields (not committed):completion_noterequired on 已完成,follow_uprequired when the note ispartial, rich-textcancel_memorequired on 已取消.Before (main
9a98a467's two files restored for the run): on 「Website Relaunch」 (进行中), the tag's menu → 已完成 opens the menu's own form 「更改阶段? 改为已完成前,请先填写: Completion Note*」. It shows no record name and no change row. Move with the field empty sendsPATCH {"status":"completed"}→ 400 「Completion Note不能为空」, which then shows under the field.After (light; the same in dark on 「Data Platform」 and at 375 px):
partial→ 「Follow-up Owner*」 joins.PATCH {"completion_note":"partial","follow_up":"ops@example.com","status":"completed"}withIf-Match→ 200. The tag reads 已完成.PATCH {"status":"active"}→ 200.PATCH {"status":"cancelled"}→ 400. The dialog stays with 「Cancel Memo: Cancel Memo不能为空」 at its foot, and the tag still reads 进行中.Screenshots and journey logs are with the seat. Not measured: Safari / WebKit (no WebKit build in the container).
Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses. (eslint on the changed files: 0 errors)main, one pull request. (The branch is the platform-assignedclaude/project-thread-9k8n3l, named in the claim.)packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgWV6ouxRg2fByapa6F