feat(AppShell): add Included Library upload flow, sync asset/element deletes - #2001
Merged
Conversation
…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>
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
<source>libraries</source>inCoreEditorIncludedLibrary.aslxdidn't match any real extension), so the only affordance was creating a blank element and hoping the property panel worked. NewAddLibraryModal(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'slockedaftercreateshape.LocalDraftAdapter.listAssets()blanket-excluded every.aslxfile (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. LeftBrowserFileAdapter/ElectronAdapteras-is, since a real folder can legitimately contain unrelated.aslxfiles.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— cleandotnet test tests/EditorCoreTests— all passing, including updatedIncludedLibraryTestssvelte-check/eslintinsrc/AppShell— cleanCore.aslx/English.aslx) remain protected throughout