You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# PR_26146_045 MIDI Studio V2 Canonical Song Model Cleanup Validation
2
+
3
+
Status: PASS
4
+
5
+
## Scope
6
+
- Continued from PR_26146_044.
7
+
- Audited MIDI Studio V2 primary workflow data/UI surfaces for duplicate song, instrument, section, and timeline state.
8
+
- Removed the duplicate primary Song Sheet Summary panel.
9
+
- Consolidated selected song state so `selectedSongId` derives from `payload.activeSongId`.
10
+
- Kept instrument grid, song details, playback, diagnostics, manifest serialization, and save/export flows derived from the canonical selected song model.
11
+
- Preserved piano-style octave grid, manifest import, multiple songs, GM controls, playback, Play/Stop, section/loop behavior, export Type + Save behavior, and roadmap status rules.
npx.cmd playwright test tests/playwright/tools/MidiStudioV2.spec.mjs -g "derives primary song, instrument, grid, playback, and diagnostics views from the canonical selected song|keeps selected song details editable and nests Song Sheet under the details panel|octave timeline freezes compact headers and note labels while active cells stay textless|fast octave note editing supports drag painting keyboard shortcuts selection and timeline scroll sync|renders timing ruler, section navigation, and loop region visualization" --config=codex_playwright_system_chrome.config.cjs --reporter=list --workers=1 --timeout=60000
35
+
```
36
+
37
+
Result:
38
+
39
+
```text
40
+
Running 5 tests using 1 worker
41
+
ok 1 fast octave note editing supports drag painting keyboard shortcuts selection and timeline scroll sync
42
+
ok 2 octave timeline freezes compact headers and note labels while active cells stay textless
43
+
ok 3 keeps selected song details editable and nests Song Sheet under the details panel
44
+
ok 4 derives primary song, instrument, grid, playback, and diagnostics views from the canonical selected song
45
+
ok 5 renders timing ruler, section navigation, and loop region visualization
46
+
5 passed
47
+
```
48
+
49
+
## Required Assertions Covered
50
+
- PASS: only one canonical selected song state is used (`selectedSongId` is derived from `payload.activeSongId`, not stored as an own app property).
51
+
- PASS: song details update from the canonical selected song model.
52
+
- PASS: instrument rows update from the canonical selected song model.
53
+
- PASS: octave grid renders from the canonical selected song model.
54
+
- PASS: playback reads playable events from the canonical selected song model.
55
+
- PASS: diagnostics are read-only and derived.
56
+
- PASS: duplicate Song Sheet Summary/stale duplicate primary panel is removed.
57
+
- PASS: switching songs does not leave stale duplicated data visible.
58
+
- PASS: Play and Stop still work through preserved targeted playback/editing tests.
59
+
60
+
## Diff Hygiene
61
+
PASS:
62
+
63
+
```text
64
+
git diff --check
65
+
```
66
+
67
+
Git reported line-ending normalization warnings for touched files, but no whitespace errors.
68
+
69
+
## Not Run
70
+
- Full samples smoke test was not run, per PR instructions.
71
+
72
+
## Result
73
+
PR_26146_045 is marked PASS. No duplicate song/instrument/timeline state remains in the primary workflow based on changed-file implementation and targeted Playwright validation.
-`lastInstrumentGridResult` held unscoped parsed timeline state that could be mistaken for canonical song data.
33
+
-`lastSongSheetResult` held parser state outside the selected song arrangement even though BPM/key/style belong to `song.studioArrangement`.
34
+
- Guided Song Sheet inputs and Timeline source inputs could diverge from `song.studioArrangement` unless normalization pushed edits back into the selected song.
35
+
36
+
## Duplicate UI Found
37
+
38
+
-`#songSheetSummary` repeated parser-only section/chord metadata in the primary Song Setup flow while Timeline Diagnostics already reports the active normalized grid.
39
+
- Previous raw Song Sheet and duplicate Song Sheet summary surfaces remain absent.
40
+
- MIDI source inspection is kept as a read-only source diagnostic, not a primary runtime model.
41
+
42
+
## Removals Made
43
+
44
+
- Removed `#songSheetSummary` from Selected Song Details.
45
+
- Removed required bootstrap dependency on `#songSheetSummary`; Song Sheet summary rendering is now optional.
46
+
- Removed stored `selectedSongId` app state in favor of `payload.activeSongId`.
47
+
- Removed stored `lastSongSheetResult` app state.
48
+
- Replaced unscoped `lastInstrumentGridResult` storage with selected-song-scoped derived grid results.
49
+
50
+
## Canonical Derivation
51
+
52
+
- Song list derives from `payload.songs[]` and `payload.activeSongId`.
53
+
- Selected Song Details derive from the selected canonical `song`.
54
+
- Song Sheet controls derive from `song.studioArrangement`.
55
+
- Instrument rows derive from `song.studioArrangement.lanes` and `song.studioArrangement.previewInstruments`.
56
+
- Octave Timeline derives from parsing `song.studioArrangement` through `InstrumentGridParser`.
57
+
- Playback derives from the selected song's current parsed grid result and selected lane settings.
58
+
- Rendered export status derives from `song.rendered` and `song.defaultRuntimeFormat`.
59
+
- ToolState export serializes the canonical `payload`.
60
+
- Diagnostics are read-only derived views.
61
+
62
+
## Remaining Intentional Derived Views
63
+
64
+
-`InstrumentGridParser` output is retained as a selected-song-scoped derived view for rendering and playback scheduling.
65
+
-`SongSheetParser` output is used transiently for validation/status and then synced into `song.studioArrangement`.
66
+
- Audio Diagnostics derive from Preview Synth state, selected song, selected section, and selected instrument lane settings.
67
+
- MIDI Source Details are read-only inspection results for the selected song source; imported MIDI remains a conversion/input source into the canonical song payload, not a second primary runtime model.
68
+
69
+
## UAT Risk
70
+
71
+
No UAT-blocking duplicate song, instrument, or timeline state remains in the primary workflow after this PR. If a future parser adds new conversion data, it must write into `payload.songs[]` / `song.studioArrangement` before becoming editable or playable.
0 commit comments