Skip to content

Selection toolbar reverts to 'Library' after play/pause, while song stays checked (#224 follow-up) #344

Closed

Description

@timusus

Steps

  1. On the Songs tab, long-press a song to enter multi-select (toolbar shows "1 selected").
  2. Without relaunching or touching the selection, start playback and pause it (e.g. via the debug PLAY/PAUSE receivers, or the mini-player controls).

Expected

The "1 selected" toolbar/app-bar persists across the play/pause toggle, matching the still-checked song.

Actual

The song's checkbox remains checked (selection state persists at the data level), but the toolbar/app-bar title reverts to "Library" instead of staying on "1 selected".

Evidence

Screenshot captured during Maestro verification of #224 (song-still-selected flow), showing the checked item with the app-bar back to "Library":
tmp/maestro/2026-09-24_215839/song-still-selected/screenshots/step-003-assertCondition-1_selected.png (local artifact, not attached).

Found while verifying ported PR behaviours; the underlying selection-survives-play/pause feature (#224) works at the data layer but the toolbar state binding doesn't follow it.

Activity

  1. timusus commented on Sep 24, 2026

    @timusus
    OwnerAuthor

    Root cause (from review): library tabs share one contextual toolbar via findToolbarHost(). ViewPager2 keeps off-screen pages at STARTED, and AlbumListFragment/AlbumArtistListFragment call contextualToolbarHelper.hide() on every uiState emission with no selection. Play/pause updates playCount/lastPlayed, which Album carries, so an off-screen Albums tab re-emits and hides the Songs tab's '1 selected' toolbar while the song stays checked. It's a race, and it needs the Albums page to exist. 440a64e3 (single Compose collector) doesn't address this and is being reverted. Fix: tabs only hide on their own selecting→idle transition, and only while they're the current page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions