Uh oh!
There was an error while loading. Please reload this page.
fix(metadata-admin): flow data-picker — scope-aware ref validation + array assignments + script bare mode (#1934) - #1975
Merged
Conversation
…array assignments + script bare mode (#1934) Follow-ups to the variable data-picker (#1973): - Scope-aware "unknown reference" warning — pairs the picker with the inline validation the issue asked for: flags a typed reference whose ROOT isn't in scope at the node, with a nearest-match "did you mean?" hint. Deliberately conservative to avoid false positives (root-only so `record.<anything>` is fine when `record` is in scope; skips function/macro calls, string literals, CEL keywords and runtime globals like `env` / `$error`; typo hint only within edit distance 2). Non-blocking amber; the ADR-0032 brace error still wins. CEL for expression fields, `{…}` holes for templates. New pure `flow-ref-check` module with unit tests. - Assignment values authored in the array form `[{ variable, value }]` now render in the key/value editor (and so get the picker) instead of falling back to the Advanced JSON block. The editor reads BOTH the object-map and array shapes and preserves whichever was authored. Round-trip unit tests. - A script `code` body (JS/TS, not a `{var}` template) now inserts BARE references via a new `refMode` field-schema override — `{x}` is a syntax error in a script. Fixes a brace-mode regression from #1973 where every textarea was treated as a template. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
os-zhuang added a commit
that referenced
this pull request
Jun 24, 2026
…previous.<field> picker refs (#1934) (#1978) Follow-ups to the data-picker (#1973) and its inline validation (#1975): - Surface the brace (ADR-0032) + scope-aware "unknown reference" validation on the repeater surfaces that carry the picker but previously had NO inline check: decision Branches expressions and screen field "visible when" (objectList expression columns) and assignment / CRUD / subflow key-value values. Extracted a shared <FlowExprIssue> line so all four surfaces validate identically — CEL brace + scope for expression columns, {…}-hole scope for template values (single-brace is legal in a template, so it is never brace-flagged). - The trigger-record picker now offers `previous.<field>` references (not just the whole `previous`) on update / change / before-update triggers. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
os-zhuang added a commit
that referenced
this pull request
Jun 24, 2026
…s panel + canvas badges (#1934) (#1980) Build on the inline data-picker validation (#1975 / #1978) by feeding client-side expression issues into the unified flow-problems list (#1972), so they show as Problems-panel rows and on-canvas node/edge badges — discoverable at the flow level, not only when a node is open. - New pure `flow-expr-problems.ts`: scans every CEL surface (decision conditions + branch expressions, screen visibleWhen, loop collection, edge guards) for ADR-0032 brace / shape ERRORS (deterministic, scope-free) and scope-aware unknown-reference WARNINGS. The START node is skipped for the ref check — its entry condition references trigger-record fields bare, indistinguishable from a typo without the object schema (the inline check, which fetches it, still covers the start node). Template (`{var}`) values are left to the inline check. - buildFlowProblems merges them as a third source ('expression'); ProblemsPanel labels those rows "· expression". 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 freeto 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.
Follow-ups to the flow-builder variable data-picker (#1973), addressing #1934's "pair the picker with inline validation" AC plus two gaps found while dogfooding it.
1. Scope-aware "unknown reference" warning
Pairs the picker with the inline validation the issue called for: a typed reference whose root isn't in scope at the node is flagged inline, with a nearest-match "did you mean?" hint.
Deliberately conservative — a warning that cries wolf is worse than none:
record.<anything>is accepted whenrecordis in scope (no need to enumerate fields);daysFromNow(90),has(...)), string literals, CEL keywords, and runtime globals (env,$error,data, …);CEL for
expressionfields,{…}holes for templates. New pureflow-ref-check.tsmodule (findUnknownRefs/scopeRoots/describeUnknownRefs) with 13 unit tests; wired intoFlowNodeConfigField+FlowEdgeInspector.2. Assignment array-form values get the picker
Assignment values authored in the array form
[{ variable, value }](used by the showcaselead_qualification_conversion) silently fell back to the Advanced-JSON block — the key/value editor only understood the object-map shape, so those values got no picker. The editor now reads both shapes and preserves whichever was authored on write. Round-trip unit tests (FlowKeyValueField.shape.test.ts).3. Script code inserts bare references
A script
codebody is JS/TS, not a{var}template —{x}is a syntax error there. #1973 treated everytextareaas a template, so the picker inserted{record.x}into script code. Added arefModefield-schema override and set the scriptcodefield to'expression'so it inserts bare refs. Validation is skipped for that free-form field.Tests / verification
flow-ref-check.test.ts(13),FlowKeyValueField.shape.test.ts(6). Fullmetadata-adminsuite green (161),pnpm build(tsc) clean.{var}) was browser-verified in feat(metadata-admin): variable data-picker for flow expression/template fields (#1934) #1973 against the same components; these changes compose on that proven base (the amber warning mirrors the proven brace-error render; array rows reuse the proven value-cell picker; bare insertion is the provenformatTokenpath). Note: incremental browser re-verification was constrained by a contended shared browser under parallel-session load, so coverage rests on the unit tests above + the feat(metadata-admin): variable data-picker for flow expression/template fields (#1934) #1973 browser run.🤖 Generated with Claude Code