Skip to content

feat(apollo-wind): host-rendered variable picker for Insert variable and Variable mode [MST-17134] - #1444

Merged
BenGSchulz merged 1 commit into
mainfrom
feat/variable-picker-host-slot
Oct 23, 2026
Merged

BenGSchulz merged 1 commit into
mainfrom
feat/variable-picker-host-slot

Conversation

@BenGSchulz

@BenGSchulz BenGSchulz commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Lets a host render its own variable picker inside apollo-wind's popovers, for Insert variable and the Variable mode (MST-17134, D48). flow-workbench's canvas VariablePicker (virtualization, an Assets tab, LiveBadge, node-source scoping) stays in flow-workbench. Wind keeps the trigger, popover, anchoring, chip, compact collapse, focus return, a11y and strings, and the host renders only what is inside.

Components

  • RenderVariablePicker in ui/variable-picker: ({ value?, onSelect(value, item?), close }) => ReactNode. onSelect commits and closes. The slot is rendered as an element, so it is only called once the popover mounts its content.
  • VariablePicker takes renderPicker and shows it in place of the search and tree. A host pick reaches onSelect as the host's item, or one made from the value, with the picked value as its value.
  • InsertVariableAction passes renderPicker through to VariablePicker; variables becomes optional when it is set. onInsert is unchanged.
  • VariableValueControl takes renderPicker, which is handed the bound reference as value, and describeReference(reference) => { label, icon? } | undefined for the chip's label and type icon. Returning nothing shows the raw reference.

MetadataForm, through factories only:

  • createInsertVariableAction({ renderPicker }). It wins over variables, and a host pick goes through the same path as a picked variable, so it still inserts at the caret or asks before replacing.
  • createVariableModeControl({ renderPicker, describeReference }) returns a control registration for FormPlugin.valueModes.definitions.variable.control, which the existing control lookup already prefers over the built-in.
  • Both factories bind the picker to each field once (a WeakMap per factory), so the props they pass stay stable across renders (D25).

Decisions worth a look

  • No new FormPlugin or FormContext fields. The ticket proposed FormPlugin.variablePicker. A host that only sometimes uses its own picker now passes it to the two factories instead, so the plugin surface does not grow. A host that wants both passes one shared constant.
  • ReferenceChip's label widens from string to ReactNode, since a host label can be a node. The default remove label falls back to "Remove" when the label is not a string.
  • onInsert(value, item) keeps a required item. A host pick without an entry gets one made from the value, so existing handlers typed with item: VariablePickerItem still compile.

Test plan

  • apollo-wind UI and form suites: 2,414 tests pass, typecheck clean, Biome clean on changed files
  • VariablePicker, InsertVariableAction, VariableValueControl: a host pick writes, closes and returns focus to the trigger; close writes nothing; the slot is not called before opening
  • describeReference: its label reaches the chip and the trigger's accessible name, its icon replaces the generic one, and an unknown reference falls back to the raw value
  • MetadataForm: a host pick inserts at the caret, the Replace confirm still applies, renderPicker wins over variables, and the Variable mode binds a host pick through createVariableModeControl
  • Existing tests unchanged
  • Storybook: Field Actions "Host panels", Variable Value Control "Host picker", Forms/Value modes "Host variable picker" and Forms/Field actions "Host panels"

Stack

  1. feat(apollo-wind): host-rendered variable picker for Insert variable and Variable mode [MST-17134] #1444: Host-rendered variable picker ← this PR
  2. feat(apollo-wind): host-rendered content for AI assist [MST-17134] #1445: Host-rendered content for AI assist
  3. feat(apollo-wind): warning severity for FormFieldError [MST-17134] #1446: Warning severity for FormFieldError

…and Variable mode

A host with its own variable picker can render it inside wind's popover, keeping wind's
trigger, anchoring, chip, collapse, focus return and strings.

- RenderVariablePicker slot type in ui/variable-picker; onSelect commits and closes
- VariablePicker, InsertVariableAction and VariableValueControl take renderPicker; the actions
  then need no variables
- VariableValueControl takes describeReference for the chip's label and type icon
- ReferenceChip's label widens to ReactNode
- createInsertVariableAction({ renderPicker }) wins over variables; picks still insert at the
  caret or ask before replacing
- createVariableModeControl({ renderPicker, describeReference }) registers through
  valueModes.definitions.variable.control
Copilot AI balanced review requested due to automatic review settings October 22, 2026 01:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions
github-actions Bot temporarily deployed to preview/apollo-landing October 22, 2026 01:26 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-design October 22, 2026 01:26 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-docs October 22, 2026 01:26 Destroyed
@github-actions github-actions Bot added the size:XL 500-999 changed lines. label Oct 22, 2026
@github-actions
github-actions Bot temporarily deployed to preview/apollo-vertex October 22, 2026 01:26 Destroyed
@github-actions

Copy link
Copy Markdown
Contributor

Dependency License Review

  • ✅ 1957 package(s) scanned
  • ✅ No license issues found
  • ⚠️ 2 package(s) excluded (see details below)
License distribution
License Packages
MIT 1721
ISC 91
Apache-2.0 57
BSD-3-Clause 28
BSD-2-Clause 23
BlueOak-1.0.0 8
MPL-2.0 4
CC0-1.0 4
MIT-0 3
MIT OR Apache-2.0 2
(MIT OR Apache-2.0) 2
Unlicense 2
LGPL-3.0-or-later 1
Python-2.0 1
CC-BY-4.0 1
(MPL-2.0 OR Apache-2.0) 1
Unknown 1
Artistic-2.0 1
(WTFPL OR MIT) 1
(BSD-2-Clause OR MIT OR Apache-2.0) 1
CC-BY-3.0 1
0BSD 1
(MIT OR CC0-1.0) 1
MIT AND ISC 1
Excluded packages
Package Version License Reason
@img/sharp-libvips-linux-x64 1.3.4 LGPL-3.0-or-later LGPL pre-built binary, not linked
khroma 2.1.0 Unknown MIT per GitHub repo, missing license field in package.json

@BenGSchulz
BenGSchulz added this pull request to stack #1447 October 22, 2026 01:35
@github-actions

Copy link
Copy Markdown
Contributor

Storybook visual diff

⚠️ Visual changes detected: 8 added (of 162 compared, 154 unchanged). View report

Baseline is the deployed main Storybook, so changes merged to main after this branch was last updated can also appear here. Logs

Updated (PT): Oct 21, 2026, 06:37:21 PM

@github-actions

Copy link
Copy Markdown
Contributor

📊 Coverage + size by package

Per-package coverage and bundle size on this PR. New-line coverage = of the source lines this PR adds or changes, the % hit by tests.

Package Coverage New-line coverage Packed (gzip) Unpacked vs main
@uipath/apollo-core — — 42.02 MB 50.17 MB ±0
@uipath/apollo-react 58.4% — 8.14 MB 32.17 MB ±0
@uipath/apollo-ui-icons — — 2.86 MB 6.97 MB ±0
@uipath/apollo-vertex — — — — —
@uipath/apollo-wind 79.5% 100.0% (40/40) 813.5 KB 4.69 MB +3.0 KB
@uipath/ap-chat 85.8% — 40.42 MB 45.71 MB ±0

"Coverage" is each package's own coverage.include scope (e.g. apollo-core instruments only scripts/). "Packed"/"Unpacked" come from npm pack --dry-run and only cover built packages — "—" means not measured this run (package not affected / not built). "vs main" is the packed (gzipped) delta against the last successful main build (the package-sizes artifact from the Release workflow); "—" there means no main baseline was available this run. The baseline is main's latest build, not this PR's exact merge-base, so it includes any drift since the branch diverged. Packages with no vitest config are omitted.

@BenGSchulz
BenGSchulz marked this pull request as ready for review October 23, 2026 17:36
@BenGSchulz
BenGSchulz merged commit cb005d3 into main Oct 23, 2026
38 of 40 checks passed
@BenGSchulz
BenGSchulz deleted the feat/variable-picker-host-slot branch October 23, 2026 20:14

This branch was successfully deployed

No deployments
preview/apollo-vertex — 0f59e9e7 Deployed Oct 22, 2026 by github-actions[bot]
preview/apollo-docs — 0f59e9e7 Deployed Oct 22, 2026 by github-actions[bot]
preview/apollo-design — 0f59e9e7 Deployed Oct 22, 2026 by github-actions[bot]
preview/apollo-landing — 0f59e9e7 Deployed Oct 22, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg:apollo-wind size:XL 500-999 changed lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants