Skip to content

Feature/playback queue improvements#108

Merged
theovilardo merged 8 commits intomasterfrom
feature/playback-queue-improvements
Sep 2, 2025
Merged

Feature/playback queue improvements#108
theovilardo merged 8 commits intomasterfrom
feature/playback-queue-improvements

Conversation

@theovilardo
Copy link
Copy Markdown
Owner

No description provided.

google-labs-jules bot and others added 8 commits September 2, 2025 01:31
The playback queue in the UI now correctly updates to reflect the shuffled (or unshuffled) order when the user toggles shuffle mode.

This was fixed by calling the existing `updateCurrentPlaybackQueueFromPlayer` function from the `onShuffleModeEnabledChanged` player listener. This ensures the queue is rebuilt from the MediaController, which correctly reports the timeline in the active playback order.
The playback queue in the UI now correctly updates to reflect the shuffled (or unshuffled) order when the user toggles shuffle mode.

This is fixed by:
1. Updating `updateCurrentPlaybackQueueFromPlayer` to correctly build the shuffled queue by iterating through the timeline's window indices in shuffled order.
2. Calling this function from the `onShuffleModeEnabledChanged` player listener to ensure the UI is refreshed at the correct time.
This commit introduces two main improvements to the playback queue:

1.  **Auto-Dequeue:** Songs are now automatically removed from the queue after they finish playing, provided that repeat mode is turned off. This gives the queue a more traditional "play next" behavior.

2.  **UI Enhancements:** The `QueueBottomSheet` has been updated to always display the currently playing song at the top of the list. This item is now static and cannot be reordered, while the rest of the "up next" songs remain reorderable. This provides a clearer and more intuitive user experience.
This commit introduces several improvements to the playback queue to create a more intuitive and standard user experience.

1.  **Queue Creation Logic:** The queue is now created starting from the selected song, and only includes subsequent songs from the original context (e.g., album or playlist). Songs before the selected item are discarded from the queue.

2.  **Auto-Dequeue:** Songs are automatically removed from the queue after they finish playing (when repeat mode is off).

3.  **UI Enhancements:** The `QueueBottomSheet` has been updated to always display the currently playing song at the top of the list. This item is static and cannot be reordered, while the rest of the "up next" songs remain reorderable.
This commit completely revamps the playback queue's behavior to be more intuitive and align with standard music player conventions.

Key changes include:

- **True Queue Behavior**: When playback is initiated from a list (e.g., an album), the queue is now correctly formed starting from the selected song. All preceding songs in the list are discarded, and only the selected song and those following it constitute the "Up Next" queue.

- **Visual Queue Display**: The `QueueBottomSheet` has been updated to only display the currently playing song and the upcoming songs in the queue. Previously played songs are no longer visible in the list, providing a clean and accurate view of what's next.

- **Auto-Dequeue on Completion**: Songs are automatically removed from the queue after they finish playing (when repeat mode is off), reinforcing the progression through the queue.

- **UI/UX Enhancements**:
    - The currently playing song is now always fixed at the top of the `QueueBottomSheet` for easy reference.
    - This current song item is not reorderable, while the rest of the upcoming songs can be freely reordered by the user via drag-and-drop.
    - The reordering logic has been carefully updated to handle the new visual display, ensuring that changes are correctly reflected in the underlying media player's queue.
This commit removes the restriction that prevented users from dragging items to the very beginning of the queue (index 0).

The `canDragOver` condition in the `rememberReorderableLazyListState` within `QueueBottomSheet.kt` has been commented out, enabling items to be moved to any position in the queue, including the first one.
This commit improves the user interface for selecting songs to add to a playlist.

The following changes have been made in `PlaylistDetailScreen.kt`:
- Album art is now displayed next to each song in the "Add Songs to Playlist" modal bottom sheet. The `SmartImage` composable is used for this, with a circular shape and a size of 36dp.
- Padding around the checkbox and song details has been adjusted for better visual alignment.
- A smooth corner shape (`albumShape`) is now defined for album art display, although it's currently applied as a `CircleShape` in this specific implementation.
The right padding of the search bar's `FilledIconButton` in `LibraryScreen.kt` has been increased from `6.dp` to `14.dp`. This provides more spacing between the button and the edge of the screen or adjacent elements.
@theovilardo theovilardo merged commit 2519b93 into master Sep 2, 2025
@theovilardo theovilardo deleted the feature/playback-queue-improvements branch September 2, 2025 03:26
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