Inline variable declaration in expression fields#11
Merged
Conversation
Free-SAIL `expression` slots (Condition, True/False values, local-variable values, loop bodies) were bare text inputs with no variable assistance, so referencing or declaring a variable meant a trip to the Variables tab. They now get an insert-at-caret variable picker: - Type a domain-qualified token (`ri!`, `local!tot`) and a dropdown offers matching declared variables plus one-click "Create ri!/local!" rows. A bare identifier does not auto-open (it is as likely a function name); the `!` is the unambiguous "writing a reference" signal. A braces button opens the menu on demand to browse/insert any declared variable. - The choice replaces exactly the analyzed token, not the whole field, because an expression is a full formula. The replaced span is fixed to the token `[start, start+len)` rather than the live caret, so a caret that drifts (arrow keys / a reposition click) while the menu is open never duplicates the token. The dropdown machinery (option ranking, portaled-panel anchoring, list rendering) is factored into a shared `variableMenu` module so ExpressionInput and the existing VariableCombobox stay behaviour- and pixel-identical from one source of truth. Text and record-reference fields are deliberately excluded: text serializes to a quoted literal and record refs are not variables. Adds 5 UI acceptance tests (incl. a caret-drift regression); 179 passing. Docs updated.
creativeskyai
force-pushed
the
ux/variable-assist-expression-fields
branch
from
July 16, 2026 00:24
f594403 to
f5552d0
Compare
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.
Inline variable declaration in expression fields
Free-SAIL
expressionslots (Condition, True/False values, local-variablevalues, loop bodies) were bare text inputs with no variable assistance, so
referencing or declaring a variable meant a trip to the Variables tab. They now
get an insert-at-caret variable picker:
ri!,local!tot) and a dropdown offersmatching declared variables plus one-click "Create ri!/local!" rows. A bare
identifier does not auto-open (it is as likely a function name); the
!is theunambiguous "writing a reference" signal. A braces button opens the menu on
demand to browse/insert any declared variable.
an expression is a full formula. The replaced span is fixed to the token
[start, start+len)rather than the live caret, so a caret that drifts (arrowkeys / a reposition click) while the menu is open never duplicates the token.
The dropdown machinery (option ranking, portaled-panel anchoring, list
rendering) is factored into a shared
variableMenumodule so ExpressionInputand the existing VariableCombobox stay behaviour- and pixel-identical from one
source of truth. Text and record-reference fields are deliberately excluded:
text serializes to a quoted literal and record refs are not variables.
Adds 5 UI acceptance tests (incl. a caret-drift regression); 179 passing. Docs
updated.