Skip to content

fix(bottom-bar): sync selected tab with current destination - #2906

Open
jpcmpc123 wants to merge 1 commit into
maxrave-dev:devfrom
jpcmpc123:fix/2714-home-tab-selected
Open

jpcmpc123 wants to merge 1 commit into
maxrave-dev:devfrom
jpcmpc123:fix/2714-home-tab-selected

Conversation

@jpcmpc123

Copy link
Copy Markdown

What & why

The bottom navigation bar tracked the selected tab only from taps (selectTab()). When the destination changed through Back navigation, the highlighted tab stayed on the previous one — e.g. pressing Back from Mix, Library or Search back to Home left Home unselected.

This syncs the selected index with the current destination inside the existing LaunchedEffect on the back stack entry, in both bottom bar variants (the Android liquid-glass bar and the common one).

Linked issue

Closes #2714

Checklist

  • This PR addresses an accepted issue (linked above)
  • I wrote or personally reviewed every line of this change
  • I tested it on Android and/or Desktop (say which, and how)

Tested on Android (Galaxy M32, build from this branch): open Mix, Library and Search, press Back each time — Home is highlighted again in all three cases.

The bottom bars only updated selectedIndex on tap, so pressing Back from
Library, Mix or Search landed on Home with the previous tab still
highlighted. Sync the highlight from the destination whenever it changes.

Refs maxrave-dev#2714
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.

[UI Bug] Home navigation button not selected after pressing Back from Mix, Library, or Search

1 participant