Repository navigation
fix(studio): hold a dashboard Global Filter whose Options From is begun but not finished - #29300
Merged
Merged
Conversation
…s begun to fill listItemHeldInput now walks each refusal's path down from the item, so a dashboard Global Filter with Options From given its Object but not yet its Value Field and Label Field is held like an empty item instead of being autosaved for the draft door to refuse. A value the author gave that the spec refuses, at any depth, still sends the item. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jSRsNRkCr8sZjG6Cpz
…begun one Unit cases on listItemHeldInput (nested unset held, direct unset still held, set-but-refused nested value not held) and the Interfaces pillar on its real autosave path: a begun Options From and a Label edit send nothing until Options From is finished, then one save carries both. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jSRsNRkCr8sZjG6Cpz
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jSRsNRkCr8sZjG6Cpz
Contributor
Author
|
domain:ui#2 · zhuangjianguo · session_01QsR2jRFuJz9QBZqPVHYVhJ 维护者速读
席位意见: 修在共享判定处,仪表盘组件列表和报表列表同样受益;对照用例证明「填了但错」的值仍被发送。无公开面变化, 席位核对 — ACCEPT ·
|
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 Steedos · project thread
Fixes #29006
Clause-②: no
Metadata-protocol: none
Claim 6574490931.
维护者速读
listItemHeldInput:条目里任何一层「尚未填写」的输入都算未完成;作者已经填了值但值不合法的情况照常发送并显示红色拒收,不会被藏起来。仪表盘与报表的列表条目都走这条规则。回滚即 revert 本 PR。ui/packages/app-shell/src/views/studio-design/metadataError.ts的listItemHeldInput(向下逐层找未填写值的循环);metadataError.heldNestedInput-29006.test.tsx(保留与不保留两侧,以及真实自动保存路径)。What changes
listItemHeldInputfollows each refusal down from the item. It held an item only when every issue named an unset input directly below it (path[at + 1]). A Global Filter withoptionsFrom: { object }draws issues atoptionsFrom.valueFieldandoptionsFrom.labelField, whose direct inputoptionsFromholds a value, so the item read as finished but wrong and was sent. The rule now walks the issue's path down from the item, through objects and list indexes, and holds the item when it meets a value left unset (absent, or a text cleared to blank) at any depth. A step through a value the author gave that has no such key (a text, a number) meets none.optionsFrom, shown as "Options From"), soheldListItemand the clause are unchanged: "Options From on item Add metamodel interfaces for ObjectQL/ObjectUI contract #1 of “Global Filters” needs a value".dashboardHeldEdit) and the report list callers (reportHeldEdit) get it through the same function. No per-field case foroptionsFrom.GlobalFilterSchema.optionsFrominpackages/specis unchanged.StudioDesignSurface.tsxis unchanged: the surface's existing hold (leafIncomplete, the autosave'sblocked, the held line, the leave guard, Publish) applies as it does to the empty item.Tests
metadataError.heldNestedInput-29006.test.tsx(new). Unit cases onlistItemHeldInput/dashboardHeldEdit, each paired withDashboardSchema's own verdict on the same body:optionsFrom.valueFieldandlabelField), named "Options From"; Options From missing only its Label Field;field), the empty-item case;labelField: 42); an unset nested input beside a refused nested value;optionsFromgiven a text where the spec wants an object; a Label Field cleared to blank, which the spec takes; a finished Options From.DashboardDefaultInspector(asInterfacesPillar.heldListItem-27459.test.tsxdoes): a saved select filter, then Options From → Object and a Label edit send no dashboard save, show no red strip, show the held line and report the clause to the surface; filling Value Field and Label Field sends one save carrying the Label edit and the finished filter, whichDashboardSchemaaccepts.Acceptance notes
HeldListItem.input("the item's input the spec refuses it without") and the section header above it still read as direct-input wording; both are outside this card's surface (listItemHeldInputand its doc comment only) and were left as they are.Verification
Live, on the showcase (before = main's metadataError.ts, after = this branch)
Scratch writable package with a dashboard holding one metric widget, the console on source via Vite. Steps 3 to 5 of the card, then a reload:
INVALID_METADATA(optionsFrom.valueField,labelField), red stripAblation
scripts/ablation-replace.mjsput back the direct-input check (!itemInputUnset(item[input])for!unset; anchor 1 to 0, blob60f02752to63e45cd0) and ran the new file withmetadataError.heldListItem-27459.test.ts: 3 failed, 20 passed. The failures are the two nested held cases and the pillar case; the controls and every empty-item case pass. Restored: blob equals HEAD andgit diff HEADis empty.Suites, type-check and gates
All on head
7559e61b(this branch merged withorigin/main47ee57fe; base45e9b2f1).metadataError, a held-edit function orheldListItem(21 files, including both 27459 files and the 27785 and 29022 report files): 202/202 passed.turbo run type-check --filter=@object-ui/app-shell(tsc for src and the test tsconfig): 65/65 tasks, exit 0.eslinton both touched files: exit 0.dispatch-gates --commands: 34 derived families, all exit 0, includingcheck-sdui-manifest,check-changeset-no-major,check-adr-0087-registration,check:type-check-debtandpnpm --dir ui exec vitest run scripts/(169 files passed, 2 skipped).dispatch-gates --ran: 34 derived, 34 run, 0 NOT-MEASURED.check-closing-keyword-parityand the changeset gates were also run against this body.36e3a484merges 20 moreorigin/maincommits (among themStudioDesignSurface.tsxandpackages-io.ts), none touching this diff's files. The 21-file neighbour sweep was re-run there: 202/202 passed.🤖 Generated with Claude Code
https://claude.ai/code/session_01QsR2jSRsNRkCr8sZjG6Cpz