Repository navigation
feat: asset library (VPS-136) - #552
Open
hazikchaudhry wants to merge 1 commit into
Open
hazikchaudhry wants to merge 1 commit into
hazikchaudhry wants to merge 1 commit into
Conversation
Adds a per-user library of reusable files (/api/assets) and an Asset Library panel in the editor, with search by name and tag, upload with tags, and built-in preset buttons, icons and sounds. Refs VPS-136
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This branch had an error being deployed
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.
Stacked on the debug panel PRs (#550 and #551): merge those first.
Issue
Uploads belong to one scenario, so reusing a logo or sound in another scenario means uploading it again, and authors have no ready-made buttons, icons or sounds to build scenes from (VPS-136).
Solution
A per-user asset library, with an API and an editor panel.
API (
/api/assets): list with type, tag and search filters; upload with tags; rename and re-tag; remove; use in a scenario. Using an asset creates a scenario-scopedUploadedFilethat points at the same stored object, so scenes, reference counting and orphan tracking work unchanged. Removing an asset only deletes the stored file if no scenario still uses it. The multer config moved fromfiles.jsintoutil/upload.jsso both routes enforce identical limits.Panel: an Asset Library in the editor sidebar.
Uploads are private to the uploader. Preset colours live in
library/palette.js, mirrored from the theme, andpresets.test.jsfails if they drift fromindex.css. The preset images and sounds are generated byscripts/generate-library-assets.mjs, so there is nothing to license. Docs:wiki/Specifications/Asset Library.mdand the new section inBackend API.md.yarn testnow runs every*.test.jsundersrc(it listed files before).Risk
UploadedFiles can now share one stored object.UploadedFile.assetIdmarks them, and any future orphan cleanup must not delete apaththat something still points at.files.jswas refactored (config extraction only); its tests are unchanged and pass.addImageToScene(accepts an image with nofileId, returns the new id) andCanvasSideBar(one more panel).public/library(about 220 KB).yarn testfor the frontend.Checklist