Skip to content

feat(apollo-wind): built-in variable and prompt modes in QuickFormField [MST-16146] - #1440

Open
BenGSchulz wants to merge 1 commit into
fix/field-header-action-sizesfrom
feat/quick-form-field-value-modes
Open

BenGSchulz wants to merge 1 commit into
fix/field-header-action-sizesfrom
feat/quick-form-field-value-modes

Conversation

@BenGSchulz

@BenGSchulz BenGSchulz commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

QuickFormField now renders every value mode itself, so a consumer no longer has to supply its own variable and prompt controls through renderModeControl (MST-16146, items 1, 6, 7, 12 and 16).

  • valueModes lists the modes the built-in menu offers, in order. It defaults to Fixed value and Expression, as before. With fewer than two modes the menu offers no switch.
  • Variable mode is a picker over variables, using VariableValueControl.
    • When onInsertVariable is supplied, a pick goes there with the consumer's own entry (type included) and caret: null, so a consumer can adopt the variable's type. Otherwise it calls onValueChange.
    • The header's Insert action is hidden while the picker is the value control. It is keyed on whether the header receives onInsertVariable.
    • VariableValueControl's onChange now also receives the picked item, as a second argument.
  • Prompt mode is PromptValueControl in an InputGroup with variant="agent", which grows with the prompt.
  • confirmModeChange(from, to) asks before a switch the consumer knows would lose the value, using ValueModeSwitchDialog. It returns false, true, or the dialog's wording. Picking the active mode never asks.
  • Multi-select stays on one row with overflow="collapse" and shows the rest as "+N more".
  • Clear value is styled as destructive again.
  • New strings: valueModes (ValueModeStrings), multiSelect (MultiSelectStrings), and the multi-select's search, empty and Clear all text.
  • renderModeControl still replaces the control for any mode.

Decisions worth a look

  • Variable mode is picker-only. hitl currently types variable references by hand. Picker-only was the agreed direction; a consumer that needs typing can keep its own control through renderModeControl.
  • Lossiness is the consumer's call. The component holds one string across modes and can't know how a value maps between them. For hitl, only switches into or out of Prompt lose anything.
  • Focus on a mode switch now waits one frame. Radix's PopoverTrigger remounts once its anchor registers, which dropped focus given straight away to the variable trigger.
  • A switch keeps focus on the new control. Radix returns focus to the menu or dialog trigger once its close animation ends, which pulled it out of a prompt box just switched to. A switch from the menu or the confirm dialog now holds focus on the new control; picking the active mode still returns it to the trigger.
  • Multi-select no longer grows. This changes the row height for existing multi-select fields.

Demo

Screen.Recording.2026-10-21.at.5.32.41.PM.mov

Test plan

  • apollo-wind: 2,988 tests pass, typecheck clean, Biome clean on changed files
  • New tests: mode list and order, single-mode menu, destructive Clear, the variable picker (both pick paths, disabled, consumer override keeping Insert), the prompt box, focus on switch and not on mount, focus kept on the new control after a menu or dialog switch, every confirmModeChange path, and the new strings
  • Storybook: in "Variable and prompt modes", picked a variable, typed a prompt, and confirmed the dialog on leaving a filled prompt

Stack

  1. fix(apollo-wind): build the field header actions on the 3xs Button [MST-16146] #1456: Field header actions on the 3xs Button
  2. feat(apollo-wind): built-in variable and prompt modes in QuickFormField [MST-16146] #1440: Built-in variable and prompt modes ← this PR
  3. feat(apollo-wind): EditableText, and an editable label in QuickFormField [MST-16146] #1441: EditableText and an editable label
  4. refactor(apollo-react): build the canvas EditableText on apollo-wind's [MST-16146] #1442: Canvas EditableText on apollo-wind's

🤖 Generated with Claude Code

Copilot AI balanced review requested due to automatic review settings October 21, 2026 23:51

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-vertex October 21, 2026 23:52 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-landing October 21, 2026 23:52 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-design October 21, 2026 23:52 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-docs October 21, 2026 23:52 Destroyed
@github-actions github-actions Bot added the size:XL 500-999 changed lines. label Oct 21, 2026
@BenGSchulz
BenGSchulz added this pull request to stack #1443 October 21, 2026 23:52
@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

@github-actions

Copy link
Copy Markdown
Contributor

Storybook visual diff

⚠️ Visual changes detected: 2 changed (of 92 compared, 90 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, 05:03:28 PM

@github-actions

github-actions Bot commented Oct 22, 2026 •

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.2% — 8.14 MB 32.18 MB +84 B
@uipath/apollo-ui-icons — — 2.86 MB 6.97 MB ±0
@uipath/apollo-vertex — — — — —
@uipath/apollo-wind 79.5% 100.0% (50/50) 817.4 KB 4.71 MB +2.6 KB
@uipath/ap-chat 85.8% — 40.42 MB 45.72 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.

…ld [MST-16146]

QuickFormField now renders every value mode itself. Variable mode is a
picker over `variables` (VariableValueControl), and prompt mode is a
PromptValueControl in the agent-tinted InputGroup, which grows with it.
`renderModeControl` still replaces the control for any mode.

- `valueModes` lists the modes the built-in menu offers, in order. It
  defaults to literal and expression, as before.
- `confirmModeChange(from, to)` asks before a switch the consumer knows
  is lossy, through ValueModeSwitchDialog. It returns true, false, or the
  dialog's wording.
- A variable-mode pick goes to `onInsertVariable` when supplied, with the
  consumer's own entry, so a consumer can adopt its type. The header's
  Insert action is hidden while the picker is the value control.
- VariableValueControl's `onChange` also gets the picked entry when its
  own picker made the pick. A host picker reports only the reference, so
  its pick has none.
- Multi-select keeps to one row with `overflow="collapse"`.
- New strings: `valueModes` (ValueModeStrings), `multiSelect`
  (MultiSelectStrings), and the multi-select's search, empty and
  Clear all text.
- Clear value is styled as destructive.
- Focus on a mode switch waits a frame: a popover trigger remounts once
  its anchor registers, which dropped focus given straight away.
- The menu and the confirm dialog leave focus on the new control as they
  close, instead of returning it to the trigger after their exit
  animation. FieldMenu and ValueModeSwitchDialog gain `onCloseAutoFocus`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@BenGSchulz
BenGSchulz force-pushed the feat/quick-form-field-value-modes branch from c71e7b4 to ecc072a Compare October 26, 2026 18:23
Copilot AI balanced review requested due to automatic review settings October 26, 2026 18:23

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 insufficient remaining quota.

@github-actions
github-actions Bot had a problem deploying to preview/apollo-landing October 26, 2026 18:25 Failure
@github-actions
github-actions Bot had a problem deploying to preview/apollo-design October 26, 2026 18:25 Failure
@github-actions
github-actions Bot had a problem deploying to preview/apollo-vertex October 26, 2026 18:25 Failure

This branch had an error being deployed

4 failed deployments
preview/apollo-docs — ecc072ad Deployed Oct 26, 2026 by github-actions[bot]
preview/apollo-vertex — ecc072ad Deployed Oct 26, 2026 by github-actions[bot]
preview/apollo-design — ecc072ad Deployed Oct 26, 2026 by github-actions[bot]
preview/apollo-landing — ecc072ad Deployed Oct 26, 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