Skip to content

fix(AppShell): wire up <minimum>/<maximum>/<increment> control hints - #2148

Merged
alexwarren merged 2 commits into
mainfrom
fix/editor-number-min-max-increment
Aug 26, 2026
Merged

fix(AppShell): wire up <minimum>/<maximum>/<increment> control hints#2148
alexwarren merged 2 commits into
mainfrom
fix/editor-number-min-max-increment

Conversation

@alexwarren

@alexwarren alexwarren commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Part of Editor: several v5 .aslx control hints not wired through to AppShell (freetext, min/max/increment, nullable, width, ...) #2116.
  • IEditorControl.GetInt/GetDouble already existed but nothing in WasmEditorBridge.cs called them for numeric control hints - <minimum>/<maximum>/<increment> were fully dead (34+9+2 uses across 11 .aslx files), e.g. Timer's interval (minimum=1), Game's background opacity (minimum=0.0 maximum=1.0 increment=0.1), Grid_DrawShape's opacity script parameter (minimum=0.0 maximum=1.0 increment=0.1).
  • Property panel: adds Minimum/Maximum/Increment to ControlInfo, read for number/numberdouble controls in ToControlInfo (tries GetDouble then GetInt, since a hint may be authored as either), threaded into min/max/step on the number <input> in PropertyEditor.svelte.
  • Script editor (added after initial review feedback - the first version of this PR missed this half): adds the same three fields to ScriptControlData, read in BuildScriptControlData for a "number"/"numberdouble" simpleeditor on an expression control, threaded into min/max/step on the number input in ScriptEditor.svelte. This is a separate rendering pipeline from the property panel, so needed its own fix - script command parameters like Grid_DrawShape's opacity were still unbounded until this.
  • Out of scope, flagged separately (background task in progress): simpleeditor="number" inside the expression template picker (RandomChance's percentile) is a third, distinct rendering pipeline that isn't even given a number <input> today - a pre-existing, unrelated gap, not touched here.

Test plan

  • dotnet build --configuration Release
  • dotnet test --configuration Release (all passing)
  • npm run check / npm run lint in src/AppShell (clean)
  • node tests/e2e/find-affected-tests.mjs + ran the relevant flagged scripts (verify-advanced-tree, verify-appshell-attributes-panel-pinned, verify-appshell-gamebook-mode, verify-appshell-object-pickers-exclude-pages, verify-appshell-code-view, verify-appshell-scriptadder-advanced-commands, verify-appshell-switch-cases-editor, verify-appshell-verbs-editor, verify-appshell-script-label-stacks-below, verify-appshell-scripteditor-row-buttons) against a local dev server - all pass.
  • Manual check in-browser: Timer's Interval field has min="1"; Game's background Opacity field has min="0" max="1" step="0.1"; an unrelated number field (Font size) is unaffected (no min/max/step); Grid_DrawShape's Opacity script parameter now has min="0" max="1" step="0.1" too (previously unbounded).

🤖 Generated with Claude Code

alexwarren and others added 2 commits August 26, 2026 16:41
IEditorControl.GetInt/GetDouble already existed but nothing called them -
number/numberdouble controls in the property panel had no bounds or step,
silently dropping every <minimum>/<maximum>/<increment> hint in the .aslx
(e.g. Timer's interval >= 1, Game's background opacity 0.0-1.0 step 0.1).
Threads them through ToControlInfo/ControlInfo into native min/max/step
attributes on the number <input>.

Part of #2116.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The original commit only threaded these into the property panel
(ToControlInfo/PropertyEditor.svelte) - script command parameters using
an expression's "number"/"numberdouble" simpleeditor (e.g. Grid_DrawShape's
opacity, 0.0-1.0 step 0.1) went through a separate path
(BuildScriptControlData/ScriptEditor.svelte) that never read them at all.

Adds Minimum/Maximum/Increment to ScriptControlData, reads them in
BuildScriptControlData for a "number"/"numberdouble" simpleEditor, and
applies them as min/max/step on the script editor's number input.

Reported by the user testing this PR.
@alexwarren
alexwarren force-pushed the fix/editor-number-min-max-increment branch from 8ed30c8 to bd9c087 Compare August 26, 2026 15:43
@alexwarren
alexwarren merged commit f12b8fe into main Aug 26, 2026
16 checks passed
@alexwarren
alexwarren deleted the fix/editor-number-min-max-increment branch August 26, 2026 16:24
alexwarren added a commit that referenced this pull request Aug 27, 2026
main independently added an identical GetNumericHint(IEditorControl, string)
helper via #2148 while this branch had its own copy for the expression-
template code path, causing a CS0111 duplicate-member build failure once
merged. Drop this branch's copy and keep main's.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant