Skip to content

fix(AppShell): wire up <filefiltername> hint, remove dead <preview/> - #2152

Open
alexwarren wants to merge 1 commit into
mainfrom
fix/editor-file-picker-hints
Open

fix(AppShell): wire up <filefiltername> hint, remove dead <preview/>#2152
alexwarren wants to merge 1 commit into
mainfrom
fix/editor-file-picker-hints

Conversation

@alexwarren

Copy link
Copy Markdown
Contributor

Summary

<filefiltername> (13 uses, e.g. "Picture Files" on cover art/background image pickers) was fully dead. HTML file inputs have no native filter-name UI the way v5's WPF file-open dialog did, so this is surfaced as the upload button's tooltip instead (e.g. "Upload a new file (Picture Files)"). Threaded through both the property panel (ToControlInfo/PropertyEditor.svelte) and script editor (BuildScriptControlData/ScriptEditor.svelte) file/simpleeditor="file" pickers into a new filterName prop on AssetPicker.svelte.

<preview/> (8 uses) turns out to already be fully redundant, not just dead. Every single usage pairs it with an image-only <source> filter ([EditorImageFormats] or an explicit *.jpg;*.png;... list), and AssetPicker.svelte already auto-shows a thumbnail for any picker whose extension filter is all-image (parseAssetSource's kind === "image", AssetPicker.svelte:80-88) - completely independent of this tag, which is never read anywhere in EditorCore/WasmEditorBridge.cs. Rather than wire up a no-op, removed the now-pointless tag from the 4 .aslx files it appeared in (CoreEditorGame.aslx x3, CoreEditorObjectRoom.aslx, CoreEditorScriptsOutput.aslx x2, GamebookCoreEditor.aslx x2), and confirmed by hand that the thumbnail preview still works identically without it.

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-library-editor, verify-appshell-library-xml-extension, verify-preview-custom-library, verify-appshell-gamebook-mode) against a local dev server - all pass.
  • Manual check in-browser: the game's Cover art upload button now tooltips "Upload a new file (Picture Files)". Uploaded a synthetic red PNG as the cover art and confirmed the thumbnail preview still renders correctly next to the filename, proving the removal of <preview/> didn't regress anything - the thumbnail was never driven by that tag in the first place.

🤖 Generated with Claude Code

<filefiltername> was fully dead (13 uses) - HTML file inputs have no
native filter-name UI like v5's WPF file dialog did, so this is surfaced
as the upload button's tooltip instead (e.g. "Upload a new file (Picture
Files)"), threaded through both the property panel (ToControlInfo) and
script editor (BuildScriptControlData) "file" pickers into AssetPicker.

<preview/> (8 uses) turns out to already be fully redundant, not dead:
every usage pairs it with an image-only <source> filter, and AssetPicker
already auto-thumbnails any picker whose extension filter is all-image
(parseAssetSource's kind === "image"), regardless of this tag. Rather than
wire up a no-op, removed the now-pointless tag from the .aslx files it
appeared in - confirmed by hand that the thumbnail preview still works
identically without it.

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