Skip to content

fix(AppShell): wire up <width/> control hint to the frontend - #2150

Open
alexwarren wants to merge 1 commit into
mainfrom
fix/editor-width-control-hint
Open

fix(AppShell): wire up <width/> control hint to the frontend#2150
alexwarren wants to merge 1 commit into
mainfrom
fix/editor-width-control-hint

Conversation

@alexwarren

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, which described this one as "half-wired": IEditorControl.Width was already parsed on the backend (EditorControl.cs) but ControlInfo had no field for it and ToControlInfo never read it, so every <width> hint (24 uses across 13 .aslx files, e.g. an exit's "to" object picker at 200px, a function's return type at 150px) was silently dropped before ever reaching the frontend.
  • Threads ctrl.Width through ControlInfo (including the early-return "filter" branch, which also uses it) into an inline pixel-width style on number/numberdouble/dropdown/dropdowntypes/objects/textbox/filter controls in PropertyEditor.svelte. A plain Tailwind class can't express this since the value is only known at runtime (Tailwind's static class scanning can't see a dynamically-interpolated pixel value) - an inline style is required, and it overrides the existing default-sizing Tailwind classes since inline style always wins in the cascade.
  • Combobox.svelte gains an optional style prop (applied to its <input>) for the dropdown/objects cases.
  • Not covered: the file controltype's 2 uses (CoreEditorJavascript.aslx, CoreEditorIncludedLibrary.aslx) - AssetPicker.svelte has no style passthrough yet. Left as a small follow-up rather than expanding this PR's surface.

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-appshell-exits-editor, verify-appshell-unlock-exit-picker, verify-appshell-verbs-editor) against a local dev server - all pass. (verify-appshell-multi-control-editors fails identically on main before this change - pre-existing, unrelated.)
  • Manual check in-browser: an exit's "To:" object picker now measures width: 200px (matching <width>200</width>), its "Type:" dropdown measures width: 150px (matching <width>150</width>), and an unrelated select with no <width> tag has no inline style at all.

🤖 Generated with Claude Code

Half-wired per #2116: IEditorControl.Width was already parsed on the
backend but ControlInfo had no field for it and ToControlInfo never read
it, so every <width> hint (e.g. an exit's "to" object picker, a function's
return type) was silently dropped before reaching the frontend.

Threads ctrl.Width through ControlInfo into an inline pixel-width style on
number/dropdown/dropdowntypes/objects/textbox/filter controls in
PropertyEditor.svelte (a plain Tailwind class can't express a value only
known at runtime). Combobox.svelte gains a `style` prop for the
dropdown/objects cases. The "file" controltype's 2 uses aren't covered -
AssetPicker has no style passthrough yet, left as a follow-up.

Part of #2116.

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