Skip to content

feat: add and remove song from playlist#99

Merged
LargeModGames merged 3 commits intoLargeModGames:mainfrom
nthpaul:nthpaul/add-and-remove-song-from-playlist
Feb 15, 2026
Merged

feat: add and remove song from playlist#99
LargeModGames merged 3 commits intoLargeModGames:mainfrom
nthpaul:nthpaul/add-and-remove-song-from-playlist

Conversation

@nthpaul
Copy link
Copy Markdown
Contributor

@nthpaul nthpaul commented Feb 14, 2026

Summary

  • adds playlist track management flows in TUI: add track to playlist and remove track from playlist from playlist contexts.
  • adds shortcut support for quick add from the currently playing song and existing add/remove actions from track table contexts.
  • adds dedicated dialogs for playlist picking (add) and confirmation (remove), including vim-style h/l navigation for confirmation buttons.
  • wires new handler/network events through app state and updates help text/UI affordances for discoverability.
  • updates playlist mutation behavior to avoid broad duplicate deletion by applying deterministic single-item removal semantics tied to the selected playlist position.

Testing

  • /Users/ple/.cargo/bin/cargo fmt --all
  • /Users/ple/.cargo/bin/cargo test -q network::tests -- --nocapture
  • /Users/ple/.cargo/bin/cargo test -q

Additional notes

  • playlist add uses the playlist items API path with uris payload.
  • playlist remove validates selected row/position against current server data before mutation and then applies ordered playlist replacement in API-sized chunks.
  • remove now preserves other duplicate occurrences of the same song by removing only the selected occurrence.
  • if a playlist includes local or unavailable items that cannot be represented in mutation payloads, remove reports an actionable status error instead of silently mutating the wrong rows.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cebf870143

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/network.rs Outdated
Comment thread src/network.rs Outdated
Comment thread src/network.rs Outdated
Comment thread src/network.rs Outdated
Comment thread src/network.rs Outdated
Comment thread src/network.rs Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive playlist track management functionality to the TUI, enabling users to add tracks to playlists and remove tracks from playlists with position-aware semantics.

Changes:

  • Adds 'w' key binding to add selected/playing tracks to a playlist via an interactive picker dialog
  • Adds 'W' global shortcut for quick-add of currently playing track
  • Adds 'x' key binding to remove selected track from current playlist with confirmation dialog
  • Implements position-based removal that preserves duplicate tracks by removing only the selected occurrence
  • Adds error handling for local/unavailable tracks and playlist sync validation

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/app.rs Adds state structures (PendingPlaylistTrackAdd, PendingPlaylistTrackRemoval), playlist_track_positions field, and begin_add_track_to_playlist_flow method
src/network.rs Implements AddTrackToPlaylist and RemoveTrackFromPlaylistAtPosition IoEvents with full playlist fetching, position validation, and chunked replacement logic; adds position tracking in set_playlist_tracks_to_table and sorting
src/handlers/track_table.rs Adds 'w' and 'x' handlers with playlist context validation and position resolution
src/handlers/playbar.rs Adds 'w' handler and add_currently_playing_track_to_playlist function with episode filtering
src/handlers/dialog.rs Refactors dialog handler to support AddTrackToPlaylistPicker and RemoveTrackFromPlaylistConfirm contexts with vim-style navigation
src/handlers/mod.rs Adds global 'W' shortcut with input/dialog mode exclusion
src/handlers/empty.rs Delegates 'w' to playbar handler when hovering over PlayBar
src/ui/mod.rs Refactors draw_dialog to support multiple dialog contexts with dedicated picker and confirmation rendering functions
src/ui/help.rs Adds help text entries for new keybindings

@LargeModGames
Copy link
Copy Markdown
Owner

This is amazing tysm!

@LargeModGames LargeModGames merged commit 96eeb7f into LargeModGames:main Feb 15, 2026
10 of 11 checks passed
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.

3 participants