Repository navigation
fix(studio): hold a report whose new Order or Blocks item, or a chart picked before its axes, is unfinished - #27824
Merged
Conversation
… of autosaving it "Add item" under a dashboard's Global Filters or header Actions appends an item with every input unset; the draft door refused it with a 422 and every later save of the same body was refused for it too. The Interfaces pillar now holds such an item the way it holds a widget waiting for its binding: judged by the spec's own DashboardSchema, unsent while every issue on the item is an input it leaves unset, with a held line naming it and "Show me" opening the dashboard's properties. Claude-Session: https://claude.ai/code/session_01Utp6CZQGM7KwDbfPanMns3 Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CZQGM7KwDbfPanMns3 Co-authored-by: Claude <noreply@anthropic.com>
…-0gr0r6 Claude-Session: https://claude.ai/code/session_01Utp6CZQGM7KwDbfPanMns3 Co-authored-by: Claude <noreply@anthropic.com>
…icked before its axes, is unfinished Claude-Session: https://claude.ai/code/session_01Utp6CaQABe2o9G1TyQ3LTx Co-authored-by: Claude <noreply@anthropic.com>
…angeset Claude-Session: https://claude.ai/code/session_01Utp6CaQABe2o9G1TyQ3LTx Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CaQABe2o9G1TyQ3LTx Co-authored-by: Claude <noreply@anthropic.com>
…-h27bhe # Conflicts: # ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx # ui/packages/app-shell/src/views/studio-design/metadataError.ts # 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
维护者速读
order:[{}]、blocks:[{}]、chart:{type}),草稿门 422;之后每次保存都带着它继续 422,期间改的其他内容重载后全丢。仪表盘同类问题已由 fix(studio): an item just added to a dashboard list property is held until it is filled in, not autosaved and refused (#27459) #27784 修好,这张卡把同一规则用到报表上。ReportSchema,不另存必填清单;只有「所有报错都落在还没填的输入上」才暂缓,填了错值的(如排序字段不在报表里、图表类型非法)照常发送并显示红色拒绝条。最坏情况是多暂缓一次(提示行 + Show me 可解)。回滚即 revert 本 PR。ui/packages/app-shell/src/views/studio-design/metadataError.ts(reportHeldEdit/objectHeldInput)、StudioDesignSurface.tsx(界面支柱leafIncomplete加报表分支)、InterfacesPillar.reportHeld-27785.test.tsx。pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/metadataError.reportHeld-27785.test.ts packages/app-shell/src/views/studio-design/InterfacesPillar.reportHeld-27785.test.tsx,预期 2 个文件 23 条全部通过。Fixes #27785
Clause-②: no
Metadata-protocol: none
What changes
Built on PR #27784. This branch started from #27784's head
7ff9cb5cwhile it was in the merge queue, reusing itslistItemHeldInput/heldListItem, and mergedorigin/mainafter #27784 landed (head93747963). The diff againstmainis this card's 7 files only.Measured first, on the spec this branch builds (
ReportSchema.safeParse,packages/spec/dist), all three cases of the card reproduce:ReportSchemarefuses atorder: [{}]order.0.byblocks: [{}]blocks.0.name, thenblocks.0.datasetonce namedchart: { type: 'bar' }chart.xAxis,chart.yAxisOn the pillar, the gate was
leafType === 'dashboard', so a report was never held: with the new report branch removed (the ablation below) the pillar sends theorder: [{}]body the card saw.The hold.
reportHeldEdit(draft, locale)(inmetadataError.ts, besidedashboardHeldEdit) is the report's leaf rule, and the Interfaces pillar'sleafIncompletenow asks it for areportleaf:listItemHeldInput(draft, ReportSchema)from fix(studio): an item just added to a dashboard list property is held until it is filled in, not autosaved and refused (#27459) #27784, unchanged, with the report form (getReportForm()) for the labels. The line reads "Order By on item Add metamodel interfaces for ObjectQL/ObjectUI contract #1 of “Order” needs a value" with the existingengine.studio.held.listItemNeedsInputclause.objectHeldInput(body, schema, key), asked forchart). Only issues underchartare this rule's; the chart is held only when every one of them names an input directly below it that the chart leaves unset. A chart refused for a value it holds (an unknowntype) is sent and its refusal shows as before.listItemHeldInputto every nested object: that would change what the dashboard holds too (itsheader,dateRangeand other nested objects), with no measurement behind it; and the chart's inputs live in the report inspector's own chart panel, not in the spec form whose rowsheldListItemreads its labels from.engine.inspector.report.chartX/chartY), the text "Show me" then focuses. That table names labels only; which inputs are required is stillReportSchema's answer. One new clause,engine.studio.held.reportChartNeedsInput(en, zh), becauselistItemNeedsInputnames an item number and a list a chart does not have.target: null), so "Show me" goes through the pillar's existingshowLeafRefusal, as the dashboard's list items do. A list item is named before the chart when both are unfinished.The autosave block, the Publish refusal and the leave guard read the same
leafIncomplete/ reported clause as before, unchanged.Tests
metadataError.reportHeld-27785.test.ts(16 cases). Every held case is paired withReportSchema's verdict on the same report: Order's new item (the repeater's all-undefinedrow and the stored{}), joined Blocks' new item (held for Name, then for Dataset), a chart with only its type (held for the X axis), then with only its X axis (held for Y), zh-CN naming. Controls: Order By filled, a block named and bound, both axes picked are accepted and not held; an Order By naming something the report does not select, a block with an unset Dataset and a malformed Name, and a chart with an unknown type are sent; a report with no chart holds nothing;objectHeldInputignores a refusal outside its key.InterfacesPillar.reportHeld-27785.test.tsx(7 cases), the realReportDefaultInspectorover a recording metadata client: Order → Add item, then a Label edit sends no PUT past the debounce, shows no red strip, names the Order By, and reports the clause to Publish; "Show me" focuses a control in the Order row; filling Order By sends one save carrying the item and the Label edit, whichReportSchemaaccepts; joined Blocks → Add item is held for the block's Name; a chart type picked first is held for the X axis, "Show me" focuses the X-axis picker, the X axis alone is still held for Y, and both axes send one save with the whole chart; control: a Label edit alone saves at once.Readings below are on the final head
93747963(this branch merged withorigin/mainafter #27784 landed) unless a line says otherwise.Ablations (ablation-replace, restored blob == HEAD, pre-merge head dae6776)
StudioDesignSurface.tsx: the pillar's newif (leafType === 'report') return reportHeldEdit(draft, locale);line deleted (the gate as it was, dashboard only) → 5 failed / 7 inInterfacesPillar.reportHeld-27785: every case that needs a hold. The first one shows the body the card saw going out:expected [ { name: 'sales_report', … "order": [ … ] } ] to deeply equal []. The control (a Label edit alone saves at once) and "both axes picked: one save" stay green. Restored: blob064578278d42== HEAD,git diff HEADempty.metadataError.ts: inobjectHeldInput,if (input === undefined || !itemInputUnset(object[input])) return null;replaced byif (input === undefined) return null;(a chart input holding a value no longer makes it finished but wrong) → 1 failed / 16 inmetadataError.reportHeld-27785: "a chart refused for a value it holds is finished but wrong: not held". Restored: blob90e17158edd5== HEAD,git diff HEADempty.srcdirectly, so no dist build sits between the mutation and the run.Affected suites: 120 files / 1631 tests passed (before and after the merge)
Every app-shell test file naming
metadataError,reportHeldEdit,dashboardHeldEdit,StudioHeld,ReportDefaultInspectororheld.listItem(30 files, the two new ones included), plus the wholepackages/i18n/directory, under the verification lock:Test Files 120 passed (120) · Tests 1631 passed | 13 skipped (1644), lock VERDICT command-exit 0, ondae67768and again on93747963. The rest of the ui tree is left to CITest UI.Acceptance notes
ReportSchemajudges a joined container'schartonly once the chart parses, so it names the unset axes first. The report inspector hides the chart panel on a joined report and clearschartwhen the type switches to joined, so the Studio cannot produce this body; noted, not changed.orderis not held.listItemHeldInputplaces an issue on the outermost list item (the block), whoseorderinput holds a value, so the block counts as finished but wrong and is sent. Whether the block repeater's Order column can append an empty nested sort key was not measured here; noted as the boundary of fix(studio): an item just added to a dashboard list property is held until it is filled in, not autosaved and refused (#27459) #27784's rule, not filed.order key "…" is not selected by this report).Derived gates (dispatch-gates --commands on this diff, head 9374796): 34 / 34 exit 0
dispatch-gates --ran: 34 derived families accounted for, 34 run, 0 NOT-MEASURED.node scripts/check-sdui-manifest.mjs(the ui card gate) is among them. The same 34 also ran 34 / 34 exit 0 on the pre-merge headdae67768. CI runs the type-check lanes, the artifact-roster and wide-population families andTest UI.Generated by Claude Code