Repository navigation
fix(studio): hold a Rollup field until it is set up, and offer only the child fields the spec accepts for its function - #27720
Merged
Conversation
…d picker by the spec The Data pillar holds a summary field until the spec's judges accept its roll-up (the field/summary-without-operations completeness rule and FieldSchema), naming the missing input on the held line. The "Child field to aggregate" picker offers only the child fields isAggregateCompatibleWithFieldType accepts for the chosen function. Claude-Session: https://claude.ai/code/session_01Utp6CZHqtPBzmpQCLhHKuR Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CZHqtPBzmpQCLhHKuR Co-authored-by: Claude <noreply@anthropic.com>
… popover Claude-Session: https://claude.ai/code/session_01Utp6CZHqtPBzmpQCLhHKuR Co-authored-by: Claude <noreply@anthropic.com>
…-g43cz2 # Conflicts: # ui/packages/i18n/src/namespaces/studio/en.ts # ui/packages/i18n/src/namespaces/studio/zh.ts
Contributor
Author
|
domain:ui#3 · os-bill · session_01Utp6CaJoinvGQSbHeDaWBe 席位核对ACCEPT · head
Generated by Claude Code |
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.
Requested by Bill · project thread
维护者速读
{ type: 'summary' }、没有summaryOperations的字段写进草稿,服务端照收,这个字段处处读 0;子字段下拉不按汇总方式过滤,作者能选出运行时拒收的组合。checkFieldCompleteness、FieldSchema、isAggregateCompatibleWithFieldType),不另存类型清单;最坏情况是多拦一次(提示行 + Show me 可解)。回滚即 revert 本 PR。ui/packages/app-shell/src/views/studio-design/metadataError.ts(summaryHeldInput/summaryHeldEdit)、ui/packages/app-shell/src/views/metadata-admin/inspectors/ObjectFieldInspector.tsx(aggregandOptions)、DataPillar.summaryHeld-27461.test.tsx。pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/metadataError.summaryHeld-27461.test.ts packages/app-shell/src/views/metadata-admin/inspectors/ObjectFieldInspector.summaryAggregand-27461.test.tsx packages/app-shell/src/views/studio-design/DataPillar.summaryHeld-27461.test.tsx,预期 3 个文件 13 条全部通过。Fixes #27461
Clause-②: no
Metadata-protocol: none
What changes
Held half (card steps 2 to 4). The Data pillar's autosave already holds an edit the object write guard would refuse (a choice field before its options, a relationship before its target). The guard lets a roll-up through at every stage, and the server saves a
summarywith nosummaryOperations(it reads 0 everywhere), so the card's draft PUT went out the moment the field was created.objectHeldEditnow also holds the first namedsummaryfield that is still being set up, once the guard lets the fields through and before an unfinished action:field/summary-without-operations(checkFieldCompleteness,@objectstack/spec/kernel) for a roll-up with nosummaryOperations, andFieldSchemafor what a started one still lacks. Unfinished means every issueFieldSchemanames undersummaryOperationsis the child object, the function, or the child field (which the schema requires exactly whensummaryFunctionReadsFieldsays the function reads one), each still absent. Any other issue (an unknown function, say) is finished but wrong: the save is sent and its refusal shows as before.Child object,Aggregation,Child field to aggregate). "Show me" reopens the field. The Studio Publish refusal and the held-edit report read the sameobjHeld, unchanged.engine.studio.held.fieldNeedsInput(en, zh): the existingneedsOptions/needsTarget/ step / action / widget clauses do not name a field input.Picker half (card steps 5 to 7). "Child field to aggregate" now offers only the child fields
isAggregateCompatibleWithFieldType(@objectstack/spec/data, the aggregate × field-type table the dataset compiler and the engine's aggregate door read) accepts for the chosen function. Before a function is picked, it offers a field some value-reading summary function accepts. The filter rows keep offering every child field: a filter reads any.Tests
metadataError.summaryHeld-27461.test.ts(8 cases): each held case is paired with the spec's verdict on the same field (the completeness rule fires, orFieldSchemarefuses at that path); controls: a count without a field and a sum with one are accepted by the spec and not held, an unknown function is sent, and a choice field the guard refuses is named first.ObjectFieldInspector.summaryAggregand-27461.test.tsx(3 cases): the card's child object (text, textarea, datetime, lookup, master_detail, number, percent, boolean, formula); for each of sum, avg, min, max the picker offers exactly what the rule accepts, and before a function, the union.DataPillar.summaryHeld-27461.test.tsx(2 cases): the card's path (Form tab, Add field, Label "Child Count", Type Rollup, Create) sends no PUT past the debounce and names the child object; after the child object it names the aggregation and still sends nothing; picking Count sends one PUT with{ object, function: 'count' }and clears the line. "Show me" reopens the closed field.Readings below are on the final head
6f387b30(this branch merged withorigin/mainate35db835) unless a line says otherwise.Ablations (one per half, ablation-replace, restored blob == HEAD)
metadataError.ts:return summaryHeldEdit(body, locale) ?? actionHeldEdit(body, locale);replaced byreturn actionHeldEdit(body, locale);(the behaviour onmain) → 7 failed / 10 across the two held suites (the 5 held predicate cases and both pillar cases; the 3 controls stay green); restored,git diff HEADempty.ObjectFieldInspector.tsx: the picker'soptions={aggregandOptions}replaced by the unfilteredaggregateOptions(the behaviour onmain) → 3 failed / 3; restored,git diff HEADempty.srcdirectly, so no dist build sits between the mutation and the run.Affected suites (pre-merge head bfe95a6): 200 files / 2360 tests passed
Every app-shell test file naming
ObjectFieldInspector,metadataError,objectHeldEditorDataPillar, plus the wholepackages/i18n/directory, under the verification lock:Test Files 200 passed (200) · Tests 2360 passed | 13 skipped (2373), lock VERDICT command-exit 0. The rest of the ui tree is left to CITest UI.After merging origin/main
Derived gates (dispatch-gates --commands on this diff)
dispatch-gates --ran: 34 derived, 34 run, 0 NOT-MEASURED, 0 UNRUN. Alsonode scripts/check-new-cross-file-line-citations.mjs(ui): 0 new citations, exit 0. Families CI runs beyond the derived set are read from this PR's check-runs.Acceptance notes
percentwhile Avg accepts it. The picker follows the rule as written.designer.field.hint.addOption/pickTarget); a held roll-up shows the held line only. The acceptance asks for the held line and "Show me", which this delivers; an inspector hint would be a new string beside a different input per stage, left out of this card.summaryOperations.fieldnames a child field the rule refuses for the function (for example after switching Sum to Max), the picker no longer lists it but the stored value is not rewritten; the server's diagnostics remain the judge of a finished roll-up.Verification
Run the three new suites (command in 维护者速读). In a running Console: Studio, Data, a parent object, Form, Add field, Label "Child Count", Type Rollup, Create: no draft PUT goes out and the line "Not saved yet: Child object on the field “Child Count” needs a value. …" appears; set Child object and Aggregation = Sum, then open "Child field to aggregate": only the child's number (and boolean) fields are listed.
Generated by Claude Code