Repository navigation
fix(fields): the fill-in dialog judges option visibleWhen on the record the write would leave - #37264
Draft
objectstack-fleet[bot] wants to merge 2 commits into
Draft
objectstack-fleet[bot] wants to merge 2 commits into
objectstack-fleet[bot] wants to merge 2 commits into
Conversation
…rd the write would leave The required-fields fill-in dialog rendered each control with no record, so an option visibleWhen reading the field the change writes (a loss reason shown only while stage is closed_lost) was judged on an empty record and every option was hidden. The collector already judges the prompt on the stored record merged with the change; each returned field now carries that record, and the dialog hands it, with the values typed so far, to every control as dependentValues. Claude-Session: https://claude.ai/code/session_01QSeKYpEsWWE9Y5YtSsDgqZ Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — REWORK · L1 · head
|
…the dialog's record now resolves The changeset declares Clause-② yes (widening) for the optional `record` member on the exported RequiredWhenPromptField, and states the defect as the dialog handing its controls no record: option visibility, dependsOn gates, dependent-lookup filters and a record-following currency now resolve on the record the change would leave. Adds the win_reason mirror pin (a move to closed_won offers the won-only reasons). Claude-Session: https://claude.ai/code/session_01QSeKYpEsWWE9Y5YtSsDgqZ Co-authored-by: Claude <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ
Fixes #37250
Clause-②: yes (widening) — the exported
RequiredWhenPromptFieldof@object-ui/fieldsgains one optional member,record?: Record<string, unknown>Metadata-protocol: none
维护者速读
What changes
The required-fields fill-in dialog rendered each control with no record at all, so an option
visibleWhenreadingrecord.*was judged on an empty record. An option list whose every option reads the field the change writes (hotcrm'scrm_opportunity.loss_reason, shown only whilestage == "closed_lost") offered nothing: the select drew its empty state and the change could not be saved.collectRequiredWhenPromptFieldsalready judges the prompt on one merge, the stored record with the change (next = { ...record, ...changes }). Each field it returns now carries that record asrecord(new optional member ofRequiredWhenPromptField).RequiredFieldsDialoghands every controldependentValues= that record with the values typed into the dialog on top, i.e. the record the write would leave. A row a host builds itself (a refusal-named field) reads the same record whenever any shown field carries one.requiredWhen/ fieldvisibleWhen/readonlyWhen: already judged onnextby the collector (unchanged); the new collector assertion pins that the carried record is that same merge.Tests
ui/packages/fields/src/__tests__/RequiredFieldsDialog.inPlace-35956.test.tsx, new top-level describe (objectstack#37250), four cases: the collector carries the merged record; a select whose options read the changed field offers them instead of the empty state; a radio offers exactly the options visible on the merged record (a won-only option stays hidden); a value typed into the dialog joins the record the other rows read.Acceptance notes
refusalFieldrows are built as{ name, def }with no record. With at least one collected field shown they now read the dialog's record; with zero collected fields (the record header's stage menu opening the dialog as a pure confirmation) a refusal-added option row reads only the typed values. Hosts:ui/packages/plugin-detail/src/renderers/recordPathStageChange.tsx,ui/packages/plugin-detail/src/InlineEditSaveBar.tsx,ui/packages/plugin-grid/src/objectGridRequiredPrompt.tsx(kanban passes norefusalField).ui/packages/plugin-timesheet/src/ObjectTimesheet.tsxadd-row dialog rendersFieldEditWidgetwith nodependentValues, so an optionvisibleWhenreading a sibling row field is judged on an empty record there too. Not a pending-change case; noted only.Verification
Two-minute check:
cd ui && pnpm --filter @object-ui/fields exec vitest run --root ../.. --maxWorkers=2 packages/fields/src/__tests__/RequiredFieldsDialog.inPlace-35956.test.tsx— expect 11/11 passed.Read first:
ui/packages/fields/src/RequiredFieldsDialog.tsx(theliveRecordmemo and thedependentValuesprop), thenui/packages/fields/src/requiredWhenPrompt.ts(record: next).Rework round 1 (head
f731d2461f2)Per the seat L1 7158746595: M1 — the widening is declared here and in the changeset; S1 — the changeset now states the condition as "the dialog handed its controls no record" and names what now resolves (option visibility,
dependsOngates, dependent-lookup filters, a money field's followed currency); N1 — awin_reasonmirror pin. Dialog file 12/12;@object-ui/fields5021 passed; type-check 0; 38/38 derived gates exit 0. Follow-up for host refusal rows: #37270.Provenance
Opened by seat repo:objectstack#4 on the maintainer's authorization in the seat session (「#37250(推送被拦):放行」). The seat's os-dev subagent's first push was refused by its permission check; it stopped without retrying. Branch
claude/issue-37250-fill-in-dialog-pending-values@57e988ac224.🤖 Generated with Claude Code
https://claude.ai/code/session_01QSeKYpEsWWE9Y5YtSsDgqZ