Skip to content

Commit 7dae7a7

Browse files
authored
Merge pull request #53 from boostcampwm-snu-2026-1/feat/47-indexeddb-project-persistence
feat: persist active project in IndexedDB
2 parents c6755dc + bed5f32 commit 7dae7a7

14 files changed

Lines changed: 750 additions & 17 deletions

File tree

PLANS.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,10 @@ M1 should include:
2929

3030
Use this section as the current execution order for agent work. Feature document numbering describes the planned product sequence, but actual issue order may change as dependencies, review feedback, or implementation risks become clearer.
3131

32-
1. #43 Mixer audio routing and track controls -> `docs/features/17-mixer-audio-routing-and-track-controls.md`
33-
2. #47 IndexedDB project persistence -> `docs/features/18-indexeddb-project-persistence.md`
34-
3. #48 Variable hybrid clip length -> `docs/features/19-variable-hybrid-clip-length.md`
35-
4. #49 Adjustable arrangement length -> `docs/features/20-adjustable-arrangement-length.md`
36-
5. #50 Arrangement WAV export -> `docs/features/21-arrangement-wav-export.md`
32+
1. #47 IndexedDB project persistence -> `docs/features/18-indexeddb-project-persistence.md`
33+
2. #48 Variable hybrid clip length -> `docs/features/19-variable-hybrid-clip-length.md`
34+
3. #49 Adjustable arrangement length -> `docs/features/20-adjustable-arrangement-length.md`
35+
4. #50 Arrangement WAV export -> `docs/features/21-arrangement-wav-export.md`
3736

3837
## Planned Milestones
3938

docs/audio-engine.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ In the browser implementation, decoded buffers should live in the audio engine r
3434

3535
Imported WAV files should follow the same runtime rule. The file picker may provide a `File` or `Blob`, but the audio engine should only keep decoded buffers in a runtime cache keyed by a stable imported sample ID. Project JSON stores metadata such as file name, MIME type, and duration, not the `File`, `Blob`, object URL, or `AudioBuffer`.
3636

37-
IndexedDB persistence may store imported file bytes outside project JSON. After restore, the audio engine should rebuild decoded buffers from those persistent blobs on demand. If project metadata references an imported sample whose bytes are unavailable, the engine should fail clearly instead of silently skipping playback.
37+
IndexedDB persistence may store imported file bytes outside project JSON. After restore, the app passes those persistent blobs back through the audio engine's typed import API so decoded buffers can be rebuilt on demand. The audio engine should not depend on IndexedDB directly. If project metadata references an imported sample whose bytes are unavailable, the engine or feature orchestration should fail clearly instead of silently skipping playback.
3838

3939
## Imported Audio Clip Playback
4040

docs/data-model.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ The model should keep these concepts separate:
131131

132132
Imported file bytes and decoded sample data are not project JSON. IndexedDB persistence may store imported blobs outside the project document and connect them back through stable sample IDs. Until that persistence feature exists, imported audio clips may be session-only and should be documented in the UI.
133133

134+
The first IndexedDB persistence implementation stores the active project document separately from imported sample blobs. The project document may include clips, arrangement tracks, clip instances, loop range, sample metadata, tempo, track mixer state, and master mixer state. Imported sample blobs are stored in a blob store keyed by `sampleId` and are not embedded inside the project document.
135+
134136
Illustrative shape:
135137

136138
```ts
@@ -542,3 +544,5 @@ export interface SamplerEnvelopeMeta {
542544
`AudioBuffer` and decoded sample data are runtime-only. Project files should reference samples by stable IDs, paths, or metadata. They must not embed `AudioBuffer`, `AudioNode`, object URLs, or decoded sample contents.
543545

544546
Use a runtime sample cache keyed by `sampleId` when playback needs decoded audio.
547+
548+
After restoring an imported audio clip from IndexedDB, the app should decode the stored blob back into the audio engine runtime cache on demand, such as when previewing the clip or starting arrangement playback.

docs/features/18-indexeddb-project-persistence.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Feature: 18 IndexedDB Project Persistence
22

33
## Status
4-
Planned
4+
In Review
55

66
## Goal
77

docs/testing.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ CI uses `--if-present` while the repository is still before the Vite scaffold.
2424
- Arrangement clip instance creation, movement, deletion, and snapping: unit tests.
2525
- Arrangement scheduler event expansion from clip instances: unit tests where practical.
2626
- IndexedDB persistence adapters, migrations, and serialization boundaries: unit or integration tests with mocked storage where practical.
27+
- Project autosave/manual restore checks should verify that imported audio metadata and blobs remain separated.
2728
- WAV encoder header, duration, and sample conversion helpers: unit tests.
2829
- Pitched instrument metadata and sample-zone mapping: unit tests.
2930
- Tempo control and scheduler tempo update behavior: unit tests where practical.

docs/ui-design.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ The first audio clip selected view may be a simple placeholder or detail panel:
294294

295295
Use clear copy for limitations. If imported files are not persisted yet, the UI should not imply that they survive refresh or project export.
296296

297+
When IndexedDB persistence is available, imported audio clip details may indicate that the clip is stored locally. The top transport/status area should show minimal project save status such as loading, saving, saved, or save failed.
298+
297299
Future arrangement duration resizing should happen in the arrangement view, not during import. The UI should treat that as non-destructive trimming or clip-instance length editing unless a later time-stretching feature explicitly adds stretch behavior.
298300

299301
## Sample Display Names

0 commit comments

Comments
 (0)