Skip to content

feat(AppShell): add Show Library Elements toggle to editor tree - #1961

Merged
alexwarren merged 1 commit into
mainfrom
feat/show-library-elements
Jul 29, 2026
Merged

feat(AppShell): add Show Library Elements toggle to editor tree#1961
alexwarren merged 1 commit into
mainfrom
feat/show-library-elements

Conversation

@alexwarren

Copy link
Copy Markdown
Contributor

Summary

  • Adds a "Show Library Elements" toggle (tree header's view-options dropdown, next to the Filter box) that reveals elements loaded from Core.aslx/included libraries in the tree, greyed out and with no context menu.
  • Selecting a library element shows a banner in the properties panel ("This element comes from a library and can't be edited directly.") with a "Copy into your game" action; while unconverted, the property controls are visually inert.
  • "Copy into your game" calls MakeElementLocal() in place, matching the old v5 desktop editor's behavior — the element becomes a normal, locally-saved, fully editable override of the library original (verified the element shows up in the saved XML afterwards).
  • Also gates the toolbar's standalone Delete button and its context-sensitive "Add Object/Room/Command/Verb in X" options on library-origin, since those bypass the tree's own per-node menu (which already excludes library nodes).

This is almost entirely plumbing: EditorController/EditorData in EditorCore already had IsLibraryElement, Filename, MakeElementLocal(), and a "libraries" filter option (all ported from the old v5 editor), but none of it was ever wired through WasmEditorBridge to the Svelte UI. The one new piece of logic is EditorController.MakeElementLocal(string key), which wraps the existing MakeElementLocal() in an undo transaction (its raw field sets are otherwise silently dropped — nothing else was starting one) and refreshes that one tree node.

Test plan

  • Full solution dotnet build --configuration Release — 0 errors/warnings
  • dotnet test tests/EditorCoreTests — 19/19 passed
  • npm run check / npm run lint in src/AppShell — clean
  • Manually verified in the AppShell dev server: toggled library elements on, saw greyed nodes with no "…" menu, selected one, saw the banner + inert controls, clicked "Copy into your game", confirmed it un-greyed/became editable/deletable, confirmed via Code View that it now appears in the saved XML, then toggled the filter back off and confirmed the now-local element stays visible while the rest of the library elements hide again

🤖 Generated with Claude Code

Wires up the "Show Library Elements" filter, IsLibraryElement flag, and
MakeElementLocal() that already existed in EditorCore/Engine (ported from
the old v5 desktop editor) but were never exposed through WasmEditorBridge
to the new Svelte tree/properties UI. Library-origin elements from
Core.aslx and included libraries can now be shown greyed-out and read-only
in the tree via a view-options dropdown, with a banner and "Copy into your
game" action in the properties panel that turns one into a normal, locally
saved, editable override — matching the old editor's behavior.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@alexwarren
alexwarren merged commit b77467f into main Jul 29, 2026
7 checks passed
@alexwarren
alexwarren deleted the feat/show-library-elements branch July 29, 2026 22:42
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