Only show undo toasts for queue-replacing actions - #3
Merged
Merged
Conversation
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
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
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
replacesQueuefield to undo entries: The core now tracks which undo actions replace or empty the queue via a newreplaces_queueboolean inUndoEntry, determined by the action kind ("playContext", "playTracks", "clearQueue", "restoreSavedQueue").Filtered toast announcements: The renderer only shows toast notifications for undo entries where
replacesQueueis true, reducing notification noise while preserving full undo functionality.Added
undoEntryIdto 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
queueReplacingUndolist to identify which undo entries should have their action toasts displayed.Simplified toast API: Removed the
undoableparameter from the fake core'stoast()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
replaces_queuedetermination happens in the core's undo module based on action kind, ensuring consistency across platforms.undoEntryIdfield and thequeueReplacingUndolist to suppress non-queue-replacing undo toasts.https://claude.ai/code/session_01CMp2CmvGbYrTBopB2qgTsY