Sort dropdown, spacebar toggle, queue loop, Ctrl+Q, and two playback bugfixes - #32
Merged
Merged
Conversation
- Sort-by control now uses a new reusable Dropdown component (extracted from the equalizer's listbox pattern) instead of a native <select>. - Space toggles play/pause globally, except when a button/input/textarea/ select/contenteditable has focus. - Reaching the end of the queue now loops back to the first track and pauses there instead of clearing "now playing". - Ctrl+Q closes the window (already equivalent to a full quit), granting the core:window:allow-close permission Tauri's ACL denies by default.
Seeking is dispatched fire-and-forget over Tauri IPC, and the backend's position only reaches the frontend via the ~4Hz playback-progress event. Clearing the "seeking" flag immediately on commit raced that event: the bar would flash back to the stale pre-seek position before snapping forward once the real update arrived. Now it holds the optimistic position until an incoming snapshot lands within tolerance of the target, with a fallback timeout in case a seek silently fails.
Seeking near the end of a track nudges the target time back by a small epsilon; when that subtraction underflowed the fractional-second part, the borrow-a-second correction computed 1.0 - frac on an already-negative frac, producing values like 1.00005. That violates symphonia's Time::frac invariant of [0.0, 1.0) and panicked deep in TimeBase::calc_timestamp, which poisoned rodio's sink mutex in the audio callback thread and cascaded into a full process abort. Fixed to 1.0 + frac and added unit tests covering the failing case.
- Guard the spacebar handler against OS auto-repeat: player.snapshot.state only updates from the backend's ~4Hz playback-progress event, so a held key would re-read stale state and spam the same toggle command. - Document why poll_queue_advance's no-queue branch no longer sends an MPRIS Stopped notice: sink and queue are always paired, so it's unreachable today, kept only to keep last_sink_len in sync.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Dropdowncomponent (extracted from the equalizer's listbox pattern) instead of a native<select>.core:window:allow-closepermission Tauri's ACL denies by default.symphoniaTimefractional part from incorrect borrow arithmetic), which cascaded into a full process abort.Test plan
cargo test --lib(110 passed, 1 ignored real-library test)npm run check(0 errors)npm run test(4 passed)