fix(AppShell): wire up <width/> control hint to the frontend - #2150
Open
alexwarren wants to merge 1 commit into
Open
fix(AppShell): wire up <width/> control hint to the frontend#2150alexwarren wants to merge 1 commit into
alexwarren wants to merge 1 commit into
Conversation
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>
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.
Summary
IEditorControl.Widthwas already parsed on the backend (EditorControl.cs) butControlInfohad no field for it andToControlInfonever read it, so every<width>hint (24 uses across 13.aslxfiles, 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.ctrl.WidththroughControlInfo(including the early-return "filter" branch, which also uses it) into an inline pixel-widthstyleonnumber/numberdouble/dropdown/dropdowntypes/objects/textbox/filtercontrols inPropertyEditor.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.sveltegains an optionalstyleprop (applied to its<input>) for thedropdown/objectscases.filecontroltype's 2 uses (CoreEditorJavascript.aslx,CoreEditorIncludedLibrary.aslx) -AssetPicker.sveltehas no style passthrough yet. Left as a small follow-up rather than expanding this PR's surface.Test plan
dotnet build --configuration Releasedotnet test --configuration Release(all passing)npm run check/npm run lintinsrc/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-editorsfails identically onmainbefore this change - pre-existing, unrelated.)width: 200px(matching<width>200</width>), its "Type:" dropdown measureswidth: 150px(matching<width>150</width>), and an unrelated select with no<width>tag has no inline style at all.🤖 Generated with Claude Code