Skip to content

Add multi-select and batch actions to the album/playlist screen - #1686

Open
wenpeishao wants to merge 1 commit into
finamp-app:redesignfrom
wenpeishao:feature/multiselect-redesign
Open

Add multi-select and batch actions to the album/playlist screen#1686
wenpeishao wants to merge 1 commit into
finamp-app:redesignfrom
wenpeishao:feature/multiselect-redesign

Conversation

@wenpeishao

Copy link
Copy Markdown

What

Adds QQ Music-style multi-select to the album and playlist detail screen. Long-press a track to enter selection mode; tap to toggle. A contextual app bar shows the selected count with select-all, and a bottom action bar performs the batch equivalents of the per-track actions:

  • Play, add to queue, play next, add to next up
  • Add to playlist (and remove from playlist inside playlists)
  • Add / remove favourite

How

  • Selection state is a screen-scoped Riverpod NotifierProvider.family (trackSelectionProvider, keyed by the album/playlist id). It's a plain manual provider, so no code generation is required.
  • TrackListTile gains an opt-in selectionScope param. When set, tapping toggles selection and long-pressing enters selection mode (instead of opening the track menu), a selection indicator is drawn, and swipe is disabled. When null — every other use of the tile, e.g. playback history — the tile is unchanged.
  • Batch queue actions build a PlayableSlice.simple(selectedTracks, source) and go through QueueService. Favourites reuse isFavoriteProvider(...).updateFavorite(...). Add / remove to playlist reuses showPlaylistActionsMenu(items:, parentPlaylist:).
  • New English strings (selectAll, deselectAll, itemsSelected) are added to app_en.arb; everything else reuses existing keys.

Notes

  • Scoped to the album/playlist detail screen for a focused first PR. The shared TrackListTile change makes extending this to the Songs tab a small follow-up.
  • Download / delete batch actions are intentionally left for a follow-up.
  • Passes flutter analyze with no new errors.

Long-press a track on an album or playlist to enter selection mode; tap
to toggle. A contextual app bar shows the selected count with
select-all, and a bottom action bar performs the batch equivalents of
the per-track actions: play, add to queue, play next, add to next up,
add to playlist (and remove from playlist inside playlists), and
add/remove favourite.

Selection state is a screen-scoped Riverpod NotifierProvider.family
(no code generation needed). TrackListTile only participates when given
a selectionScope, so every other use of the tile is unaffected. Batch
queue actions use PlayableSlice.simple over the selected tracks.
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.

1 participant