feat(spec): blueprint dashboard widget condition slot (threshold/status filter)#2381
Merged
Conversation
…atus filter)
A widget whose title restricts WHICH records it counts — "库存低于10的备件预警",
"overdue work orders", "金额超过 2000" — has no way to say so: the `measure`/
`groupBy` slots choose the NUMBER and the axis, not the row set. So the builder
emits a plain count and a "low stock" card counts EVERY part.
Add an optional `condition {field, op, value}` (op ∈ lt|lte|gt|gte|eq|ne) to the
blueprint widget — lenient + strict variants — that the builder compiles to the
framework widget's presentation-scope `filter` (runtimeFilter). Kept to a single
comparison so the model emits it reliably and a bad guess can be dropped rather
than producing an empty card.
Pairs with the cloud dashboardBody mapping + prompt guidance (separate PR).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 91 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
…urface
The strict SolutionBlueprintStrictSchema makes every widget key required-present
(nullable for optionality), so the new `condition` slot must appear in the strict
widget fixtures — one null, one a real {field,op,value}. Regenerate api-surface.json
to register the new BlueprintWidgetCondition export.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Problem
A dashboard widget whose title restricts which records it counts — "库存低于10的备件预警", "overdue work orders", "金额超过 2000" — has no slot to express that.
measure/groupBy(cloud#476) only choose the NUMBER and the axis, not the row set, so the builder emits a plaincountand the card counts every row. Confirmed live: a "库存低于10的备件预警" card showed 12 (all parts) when only 2 are below 10.Change
Add an optional
condition {field, op, value}(op ∈lt|lte|gt|gte|eq|ne) to the blueprint dashboard widget — lenient + strict variants — which the cloud builder compiles to the framework widget's existing presentation-scopefilter(DashboardWidgetSchema.filter→runtimeFilter, ANDed into the dataset query).Deliberately a single comparison: the model emits it reliably, and the builder drops an unresolvable field/op rather than yielding a mysteriously empty card.
Pairs with
Cloud
dashboardBodymapping + propose_blueprint prompt guidance +resolveConditionFilterunit tests (separate cloud PR). Same cross-repo shape as #476 (framework slot → cloud honors it).@objectstack/specbuilds clean (DTS incl. deps).🤖 Generated with Claude Code