Skip to content

feat: asset library (VPS-136) - #552

Open
hazikchaudhry wants to merge 1 commit into
vps-122-debug-panel-uifrom
vps-136-asset-library
Open

hazikchaudhry wants to merge 1 commit into
vps-122-debug-panel-uifrom
vps-136-asset-library

Conversation

@hazikchaudhry

Copy link
Copy Markdown
Contributor

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-scoped UploadedFile that 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 from files.js into util/upload.js so both routes enforce identical limits.

Panel: an Asset Library in the editor sidebar.

  • My uploads (images, audio, documents) plus built-in presets (8 buttons, 10 icons, 3 sounds)
  • Search across names and tags, and kind filters
  • Upload with tags, by button or drag and drop
  • Click to add: buttons and images land on the canvas selected, sounds become audio elements, documents go to the scenario's resources

Uploads are private to the uploader. Preset colours live in library/palette.js, mirrored from the theme, and presets.test.js fails if they drift from index.css. The preset images and sounds are generated by scripts/generate-library-assets.mjs, so there is nothing to license. Docs: wiki/Specifications/Asset Library.md and the new section in Backend API.md.

yarn test now runs every *.test.js under src (it listed files before).

Risk

  • Several UploadedFiles can now share one stored object. UploadedFile.assetId marks them, and any future orphan cleanup must not delete a path that something still points at.
  • files.js was refactored (config extraction only); its tests are unchanged and pass.
  • Touches addImageToScene (accepts an image with no fileId, returns the new id) and CanvasSideBar (one more panel).
  • Preset PNGs and WAVs are committed under public/library (about 220 KB).
  • CI doesn't run yarn test for the frontend.

Checklist

  • Acceptance criteria met
  • Wiki documentation is written and up to date
  • Unit tests written and passing
  • Integration tests written and passing
  • Continuous integration build passing

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
@linear

linear Bot commented Oct 12, 2026

Copy link
Copy Markdown

VPS-136

@vercel

vercel Bot commented Oct 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
vps Error Error Oct 12, 2026 12:19am UTC

@coderabbitai

coderabbitai Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d0071128-e5a6-45a9-a863-87a57845bb63

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch had an error being deployed

1 failed deployment
Preview — 0b507652 Deployed Oct 12, 2026 by vercel[bot]
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