feat(player): queue undo/redo with hotkeys and playback-aware restore

Snapshot queue, current track, time, and pause before queue mutations.
Ctrl+Z/Cmd+Z restores prior state; Ctrl+Shift+Z/Cmd+Shift+Z reapplies undone
edits when the redo stack is non-empty; new edits clear redo.

Resync the Rust audio engine only when the current song identity changes
from the pre-apply state so reorder/enqueue-style edits keep live playback.

Register the document capture listener from main.tsx after the window label
is set. Mini player forwards undo/redo via mini:undo-queue and mini:redo-queue.
This commit is contained in:
Maxim Isaev
2026-04-27 00:17:10 +03:00
parent e0c53da94d
commit 39f4d03da5
5 changed files with 408 additions and 7 deletions
+3
View File
@@ -3,6 +3,7 @@ import ReactDOM from 'react-dom/client';
import { invoke } from '@tauri-apps/api/core';
import { getCurrentWindow } from '@tauri-apps/api/window';
import App from './App';
import { installQueueUndoHotkey } from './store/playerStore';
import './i18n';
import './styles/theme.css';
import './styles/layout.css';
@@ -46,6 +47,8 @@ try {
// Ignore parse / non-Tauri.
}
installQueueUndoHotkey();
ReactDOM.createRoot(document.getElementById('root')!).render(
<StrictMode>
<App />