Skip to content

feat(AppShell): add Included Library upload flow, sync asset/element deletes - #2001

Merged
alexwarren merged 1 commit into
mainfrom
feat/appshell-add-library-flow
Aug 7, 2026
Merged

feat(AppShell): add Included Library upload flow, sync asset/element deletes#2001
alexwarren merged 1 commit into
mainfrom
feat/appshell-add-library-flow

Conversation

@alexwarren

Copy link
Copy Markdown
Contributor

Summary

  • Included Library elements had no proper "add" flow — the manual file picker was broken (<source>libraries</source> in CoreEditorIncludedLibrary.aslx didn't match any real extension), so the only affordance was creating a blank element and hoping the property panel worked. New AddLibraryModal (upload-only, since a library can only ever come from an existing file, unlike Javascript's "type a new name" option) plumbs a filename through at creation time, matching the JS element's lockedaftercreate shape.
  • Deleting a Javascript/Included Library element now cascades to delete its underlying asset too (with a confirmation, since asset deletes live outside Quest's undo system and are permanent) — previously the file was silently orphaned. The reverse direction also works: deleting the file from the Asset Manager now removes the owning element instead of leaving it pointing at a missing file.
  • Found and fixed a related bug along the way: LocalDraftAdapter.listAssets() blanket-excluded every .aslx file (to hide the game's own file), which also hid library files — silently breaking both the delete cascade and the "pick an existing library" picker. Narrowed the exclusion to just the draft's own filename, since that OPFS directory is exclusively app-owned. Left BrowserFileAdapter/ElectronAdapter as-is, since a real folder can legitimately contain unrelated .aslx files.
  • undo()/redo() now detect when Quest's own undo restores an element whose file was cascade-deleted outside that system (undo only rewinds the WorldModel transaction, not the out-of-band asset delete) and toast a warning instead of leaving a silently broken element sitting in the tree.

Test plan

  • dotnet build --configuration Release — clean
  • dotnet test tests/EditorCoreTests — all passing, including updated IncludedLibraryTests
  • svelte-check / eslint in src/AppShell — clean
  • Manually verified in-browser (WasmEditor Debug build + AppShell dev server): add-library-from-upload, add-library-from-existing-picker, delete-with-confirm cascading the asset, cancel preserves both, Asset-Manager-side delete removing the owning element, and the undo-after-cascade-delete toast — all working; built-in libraries (Core.aslx/English.aslx) remain protected throughout

…ement deletes

Included Library elements previously had no proper "add" flow (the manual file
picker was broken — its <source> filter didn't match any real extension) and
deleting one left its underlying .aslx file orphaned in storage forever, since
asset deletion has always lived outside Quest's own undo system.

- New AddLibraryModal (upload-only, matching Javascript's lockedaftercreate
  shape but without the "type a new name" affordance, since a library can
  only ever come from an existing file); CreateNewIncludedLibrary/
  CreateIncludedLibrary now take a filename so the element is created with it
  already set.
- Fixed CoreEditorIncludedLibrary.aslx's <source>libraries</source> to
  <source>*.aslx</source>.
- deleteElement() now cascades to the underlying asset for Javascript/
  Included Library elements (with confirmation, since that deletion is
  permanent), and the reverse direction — deleting the asset from Asset
  Manager — now also removes the owning element instead of leaving it
  pointing at a missing file.
- LocalDraftAdapter.listAssets() was blanket-excluding all .aslx files
  (to hide the game's own file) — since that also hid library files, making
  the delete cascade and "pick existing" picker both silently no-op, narrowed
  it to exclude just the draft's own filename. BrowserFileAdapter/
  ElectronAdapter are left as-is since a real folder can legitimately contain
  unrelated .aslx files.
- undo()/redo() now detect when an element restored by Quest's own undo
  still has a file that was cascade-deleted outside it — undo only rewinds
  the WorldModel transaction, not the out-of-band asset delete — and toast a
  warning instead of leaving a silently broken element in the tree.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@alexwarren
alexwarren merged commit 9b3d0c0 into main Aug 7, 2026
7 checks passed
@alexwarren
alexwarren deleted the feat/appshell-add-library-flow branch August 7, 2026 13:33
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