Commit fe613b5
feat(queue): backend queue state machine replacing frontend shuffle, navigation, and play-next logic (#42)
* feat(queue): backend queue state machine replacing frontend shuffle, navigation, and play-next logic
Move ~500 lines of queue state machine from JS frontend to Rust backend.
Frontend queue store becomes a thin reactive layer calling backend commands
and applying returned state snapshots.
Backend:
- Extend queue_state table with play_next_offset, play_history_json,
play_next_track_ids_json, repeat_one_pending columns
- Add toggle_shuffle (Fisher-Yates with play-next pinning),
add_play_next (move semantics + offset tracking),
advance_to_next/previous (repeat-one two-phase, loop modes, history),
skip_to_next/previous (override repeat-one), check_integrity
- Register 6 new Tauri commands, enhance queue_set_shuffle to return
QueueStateSnapshot
- 773 Rust tests pass
Frontend:
- Remove _shuffleItems, _reshuffleForLoopRestart, _originalOrder,
_playHistory, _playNextTrackIds, _playNextOffset, _repeatOnePending,
_syncQueueToBackend, _validateQueueIntegrity
- Add _applySnapshot and _applyNavigationResult
- Update queue-builder and queue.props tests for backend-delegated pattern
- 444 Vitest tests pass
Closes TASK-328
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(queue): resolve deno lint errors in queue store
Remove unnecessary async from _applyNavigationResult (no await inside).
Prefix unused fromNavigation parameter with underscore.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(lint): collapse nested if in watcher scan completion
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(queue): optimistic shuffle toggle and aria-pressed for accessibility
toggleShuffle now sets this.shuffle before the backend call (like
cycleLoop does for loop mode), reverting on failure. Add aria-pressed
to the shuffle button so the E2E accessibility test detects state change.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 980c9ba commit fe613b5
File tree
22 files changed
+2168
-1191
lines changed- app/frontend
- __tests__
- js
- api
- components
- mixins
- stores
- utils
- views
- backlog/completed
- crates/mt-tauri
- gen/schemas
- src
- commands
- db
22 files changed
+2168
-1191
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | 49 | | |
55 | 50 | | |
56 | 51 | | |
| |||
131 | 126 | | |
132 | 127 | | |
133 | 128 | | |
134 | | - | |
| 129 | + | |
135 | 130 | | |
136 | 131 | | |
| 132 | + | |
137 | 133 | | |
138 | 134 | | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
| 135 | + | |
159 | 136 | | |
160 | 137 | | |
161 | 138 | | |
162 | | - | |
163 | | - | |
164 | | - | |
| 139 | + | |
165 | 140 | | |
166 | 141 | | |
167 | 142 | | |
| |||
0 commit comments