mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 15:25:46 +00:00
fix(seekbar): commit seek on mouseup + ignore progress ticks while dragging
Ports the WaveformSeek UX changes from PR #219 (original fix by @cucadmuh) onto test/seekable-streaming: - Split previewFraction (during drag) / commitSeek (on mouseup) so audio_seek fires once per gesture instead of on every mousemove. - Subscribe-effect skips external progress updates while isDragging — prevents cursor flicker from streaming/recovery ticks fighting the dragged position. - Clear seekTarget in seek() catch branch so a failed seek doesn't permanently block progress updates. Skips the byte-restart fast-path from #219: would defeat RangedHttpSource's direct seek by restarting the stream after 450ms. Co-Authored-By: cucadmuh <cucadmuh@users.noreply.github.com> Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1427,6 +1427,9 @@ export const usePlayerStore = create<PlayerState>()(
|
||||
seekDebounce = null;
|
||||
seekTarget = time;
|
||||
invoke('audio_seek', { seconds: time }).catch((err: unknown) => {
|
||||
// Release the progress-tick guard so the UI doesn't freeze
|
||||
// waiting for a target the engine will never reach.
|
||||
seekTarget = null;
|
||||
const msg = String(err ?? '');
|
||||
if (!msg.includes('not seekable')) {
|
||||
console.error(err);
|
||||
|
||||
Reference in New Issue
Block a user