Save queue as playlist and improve queue edit mode#300
Open
cacuscacus wants to merge 6 commits into
Open
Conversation
- Introduced a new button to save the current queue as a private playlist. - Implemented dialog for playlist name input and success/error alerts. - Updated AccessibilityIdentifiers to include the new button identifier. - Enhanced SongActionsHelper with a method to create a playlist from the queue.
- Added functionality to check for duplicate entries in the queue. - Implemented methods to remove entries from the queue by index and to remove later duplicates while keeping the first occurrence. - Updated QueueSidePanelView to include a button for removing duplicate songs. - Adjusted accessibility identifiers to accommodate the new button. - Modified tests to validate the new queue management features, including removal of duplicates and checking for duplicate entries.
…lView - Introduced a new reusable QueueFooterIconButton component to streamline button creation for queue actions. - Updated QueueFooterActions to utilize QueueFooterIconButton for Undo, Redo, Shuffle, Save to Playlist, and Clear Queue functionalities. - Enhanced accessibility and help text for each button to improve user experience.
…mproved UI responsiveness - Added `normalizeVisibleRowFrames` method to `DraggableTableView` to reset row views after drag operations, ensuring consistent visual alignment. - Updated `QueueListControllerRepresentable` to call `normalizeVisibleRowFrames` during data reload and drag session end. - Refactored `QueueTableCellView` layout to improve view hierarchy and added static constants for layout dimensions, enhancing maintainability and readability. - Improved handling of row view frames to prevent misalignment during interactions.
- Simplified the process of saving the current queue as a private playlist by moving the logic from SongActionsHelper to PlayerService. - Updated QueueFooterActions to streamline the save playlist action, removing unnecessary parameters. - Enhanced the queue duplicate check by using a more concise syntax. - Removed the outdated saveQueueAsPlaylist method from SongActionsHelper to improve code clarity and maintainability.
- Added a private method `waitForSuggestionFetch` to streamline the waiting process for search suggestion queries during tests. - Updated the `editingAfterSubmittedSuggestionReenablesAutocomplete` test to utilize the new method, improving readability and reliability of the test execution.
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.
Pull Request: Save Queue as Playlist & Queue Edit Improvements
Summary
Adds the ability to save the current playback queue as a new private playlist, plus several queue edit-mode fixes and UI polish: per-row removal for duplicate songs, a remove-duplicates action, icon-only footer controls with tooltips, and a layout fix for misaligned queue rows with long titles.
Type of Change
Features
Save Queue to Playlist
text.badge.plus)NSAlertsheet to name the playlistplaylist/createAPI, seeding all queuevideoIdsin orderLibraryMutationBroadcaster(same pattern as song context menu “Create Playlist…”)queueView.saveToPlaylistButtonRemove Duplicates
arrow.triangle.merge)queueHasDuplicateEntriesis true; faded when inactive but still hoverable for the tooltipvideoId; realignscurrentIndexif the playing entry was a later duplicatequeueView.removeDuplicatesButtonQueue Footer UI (Edit Mode)
Bug Fixes
Remove only the selected queue row (duplicates)
Problem: Deleting one instance of a duplicated song could remove every copy in the queue.
Fix:
removeFromQueue(at:)— removes by index, notvideoIdor shared entry IDremoveFromQueue(entryIDs:)removes by index (highest first) for batch safetyMisaligned queue rows (long titles)
Problem: Rows with long titles (e.g. featured artist lists) could shift left, overlapping the index number and thumbnail.
Fix:
NSStackViewcell layout with pinned Auto Layout (fixed leading index + thumbnail, fixed trailing duration/like/badge, truncating middle text)makeView(withIdentifier:)clipsToBoundson cell to prevent visual bleedAPI / Service Changes
SongActionsHelpersaveQueueAsPlaylist(songs:title:client:)PlayerService+QueuequeueHasDuplicateEntries,removeFromQueue(at:),removeDuplicateQueueEntries()YTMusicClientplaylist/createFiles Changed
Testing
Automated
swift test --filter PlayerServiceQueueTestsNew/updated tests:
removeFromQueueAtIndexRemovesSingleDuplicateremoveDuplicateQueueEntriesKeepsFirstOccurrencequeueHasDuplicateEntriesManual
Build
Install to
/Applications(useditto, notcp -r, because of Sparkle symlinks):Checklist
playlist/createAPI (no guessed endpoints)swiftlint --strict && swiftformat .run before submitswift test --skip KasetUITestsrun before submitBranch
feature/save-queue-as-playlistSuggested PR Title
Save queue as playlist and improve queue edit mode (dedupe, alignment, icon footer)
Prompt Request (for reviewers)