Skip to content

Only show undo toasts for queue-replacing actions - #3

Merged
ingoau merged 1 commit into
mainfrom
claude/kind-sagan-389uxc
Sep 24, 2026
Merged

ingoau merged 1 commit into
mainfrom
claude/kind-sagan-389uxc

Conversation

@ingoau

@ingoau ingoau commented Sep 24, 2026

Copy link
Copy Markdown
Owner

Summary

This change refines the undo/redo toast behavior to only announce actions that replace or clear the queue (like playing an album or clearing the queue), while keeping other mutations (like rating a track or toggling shuffle) quietly undoable via the undo button and keyboard shortcuts.

Key Changes

  • Added replacesQueue field to undo entries: The core now tracks which undo actions replace or empty the queue via a new replaces_queue boolean in UndoEntry, determined by the action kind ("playContext", "playTracks", "clearQueue", "restoreSavedQueue").

  • Filtered toast announcements: The renderer only shows toast notifications for undo entries where replacesQueue is true, reducing notification noise while preserving full undo functionality.

  • Added undoEntryId to toast data: Toast messages now include a reference to their associated undo entry, allowing the renderer to filter "Undid…" / "Redid…" toasts to only show for queue-replacing actions.

  • Updated undo state tracking: The reducer now maintains a queueReplacingUndo list to identify which undo entries should have their action toasts displayed.

  • Simplified toast API: Removed the undoable parameter from the fake core's toast() method since only queue-replacing actions get undo toasts now.

  • Updated tests and e2e specs: Test expectations now reflect that only queue-replacing actions (like playing an album) show toasts, while other mutations (like shuffle or rating) remain silent but still undoable.

Implementation Details

  • The replaces_queue determination happens in the core's undo module based on action kind, ensuring consistency across platforms.
  • Toast filtering in the renderer checks both the undoEntryId field and the queueReplacingUndo list to suppress non-queue-replacing undo toasts.
  • The undo button and keyboard shortcuts (Ctrl+Z / Ctrl+Shift+Z) continue to work for all mutations regardless of toast visibility.

https://claude.ai/code/session_01CMp2CmvGbYrTBopB2qgTsY

Undo entries now carry replacesQueue (play album/tracks, clear queue,
restore saved queue) and the core's Undid/Redid toasts carry the entry
id they report on. The desktop reducer announces only queue-replacing
mutations and their undo/redo, and drops its own success toasts
(diagnostics copied, config exported, filter exported). Error toasts
and the deep-link prompt still show; every change stays undoable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CMp2CmvGbYrTBopB2qgTsY
@ingoau
ingoau merged commit 6f43541 into main Sep 24, 2026
2 of 4 checks passed
@ingoau
ingoau deleted the claude/kind-sagan-389uxc branch September 24, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants