Uh oh!
There was an error while loading. Please reload this page.
feat(metadata-admin): variable data-picker for flow expression/template fields (#1934) - #1973
Merged
Conversation
…te fields (#1934) Business users authored CEL expressions and {var} templates in the flow builder by typing reference names from memory — there was no way to discover or insert the references actually in scope. Add a "{x}" data-picker (like Power Automate "Dynamic content" / Salesforce resource picker) to every expression / template config surface. - flow-scope.ts: pure, GRAPH-AWARE scope resolution at a node — flow variables, upstream node outputs (ancestors only, found by walking edges back), enclosing loop/map iterators, and the trigger record. Trigger fields are bare on the start node's own entry condition and record.<field> downstream (matching the showcase flows / engine context). A node's own and downstream outputs are excluded, so a downstream output is never offered upstream. - useFlowScope.ts: React adapter that lazily fetches the trigger object's field catalog and expands record.<field> refs, grouped for the picker. - VariableTextInput.tsx: input / textarea + searchable, grouped popover (cmdk). Inserts the correctly-braced token at the cursor — bare CEL in `expression` fields, `{var}` in template (text / textarea / value) fields — handling the ADR-0032 brace-in-CEL trap for the author. Free-text typing is untouched and an empty scope degrades to a plain input. - Wired into decision Branches, edge Condition, assignment / CRUD / subflow values, screen description, and http fields. - Unit tests for the scope-resolution graph-walk. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
os-zhuang added a commit
that referenced
this pull request
Jun 24, 2026
…array assignments + script bare mode (#1934) (#1975) 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>
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>
This was referenced Jun 24, 2026
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.
Closes#1934.
What
Business users authored CEL expressions and
{var}templates in the Studio flow builder by typing reference names from memory — there was no way to discover or insert the references actually in scope. This adds a{x}data-picker (like Power Automate "Dynamic content" / Salesforce's resource picker) to every expression / template config surface.A trigger button on the field opens a searchable, grouped popover of the references in scope at that node, and picking one inserts the correctly-braced token at the cursor.
In scope (graph-aware)
Resolved by walking the flow graph back from the current node, so only what's reachable is offered:
draft.variables[].outputVariable(s)/ collected screenfields[].name/assignmentskeys /idVariable. A node's own and any downstream output is excluded — a downstream output is never offered upstream.iteratorVariable.objectNameschema is fetched and expanded: bare<field>on the start node's own entry condition,record.<field>(+record/previous) downstream — matching how the showcase flows and the engine reference the record.Brace handling (ADR-0032)
Insertion handles the recurring
{record.x}brace-in-CEL trap for the author:expressionfields → bare CEL (record.name){record.company}Free-text typing is untouched, and an empty scope degrades to a plain input.
Surfaces
decision Branches (
expression), edge Condition, Assignment / CRUD / subflow values, screen description, andhttpfields — via one sharedVariableTextInput.Code
inspectors/flow-scope.ts— pure, framework-free graph-walk + ref resolution (unit-tested).inspectors/useFlowScope.ts— React adapter; lazily fetches + expands the trigger object's fields.inspectors/VariableTextInput.tsx— input/textarea + cmdk popover; cursor insertion + brace rule.FlowNodeConfigField,FlowNodeInspector,FlowObjectListField,FlowKeyValueField,FlowEdgeInspector.Tests / verification
flow-scope.test.ts— 24 unit tests for the scope-resolution graph-walk (ancestors, downstream-not-upstream, trigger prefix, de-dup, loop iterator, non-record trigger).pnpm build(tsc) clean; fullmetadata-adminsuite green (442 tests).lead_qualification_conversionflow: picker lists flow variables +record.<field>(fromcrm_lead); bare insertion in the decision Branches expression and{record.company}in the http URL field; graph-aware trigger scoping.🤖 Generated with Claude Code