Skip to content

Track Store for Sessions#150

Open
BuffMcBigHuge wants to merge 6 commits into
mainfrom
marco/feat/session-mods
Open

Track Store for Sessions#150
BuffMcBigHuge wants to merge 6 commits into
mainfrom
marco/feat/session-mods

Conversation

@BuffMcBigHuge
Copy link
Copy Markdown
Collaborator

@BuffMcBigHuge BuffMcBigHuge commented May 26, 2026

Summary

This PR adds browser-local saved sessions to the realtime motion graph performance UI. A performer can save the current session, reopen it later from the same browser, rename/delete saved sessions, and see an always-visible dirty/save status pill while performing.

The saved session snapshot captures the active runtime config, selected fixture, uploaded custom track metadata, stem overlay state, and local audio assets needed to restore the performance state without requiring a fresh upload.

What Changed

  • Added a local saved sessions controller that manages save, save-copy, open, rename, delete, active-session tracking, dirty-state detection, and user-facing errors.
  • Added SavePill and SessionsTile UI surfaces so saved sessions are available directly from the performance screen and drawer.
  • Added IndexedDB-backed persistence for session records, decoded upload PCM, original upload files, and cached stem assets.
  • Added session snapshot capture/restore helpers that serialize performance state and hydrate custom tracks back into the live store.
  • Extended custom track metadata with stable asset IDs, trim windows, original filenames, stem asset IDs, and a restored-session flag.
  • Added skip_stem_extraction through the frontend protocol and backend swap/start paths so restored sessions with cached stems do not re-run the backend stem extraction path.

Notes

Saved sessions are intentionally local to the browser/device. The audio assets live in IndexedDB, while a legacy localStorage read path keeps older lightweight saved session records from disappearing. Saved custom-track stems must be ready before saving a non-full source mode, because restore depends on the cached stem PCM.

Deleting a session removes the session record but leaves shared cached audio assets untouched, which avoids breaking other saved sessions that may reference the same uploaded audio.

Test Plan

No automated checks are currently reported on this PR branch.

Recommended manual validation:

  • Upload and trim a custom track, choose full, save the session, reload the page, and reopen it from Local Saved Sessions.
  • Upload a custom track, choose vocals or instruments, wait for stem extraction, save, reload, and confirm restore uses cached stem audio without triggering backend extraction again.
  • Verify Save, Save copy, Rename, Delete, and Open flows from the drawer.
  • Verify the SavePill transitions between unsaved, saving, and saved states after control changes.
  • Exercise IndexedDB unavailable/quota failure paths enough to confirm the UI surfaces an error instead of silently losing the session.

Signed-off-by: BuffMcBigHuge <marco@bymar.co>
Signed-off-by: BuffMcBigHuge <marco@bymar.co>
@BuffMcBigHuge BuffMcBigHuge marked this pull request as ready for review May 26, 2026 20:37
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