Skip to content

next(v4): New root navigation idea - #629

Merged
cyanChill merged 27 commits into
devfrom
next/v4/new-home-nav-idea
Oct 23, 2026
Merged

cyanChill merged 27 commits into
devfrom
next/v4/new-home-nav-idea

Conversation

@cyanChill

@cyanChill cyanChill commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Why

This PR switches the root navigation behavior so that it'll work better with our new toolbar idea that we're switching over to (tldr: Move as much of the actions on the top of the screen to the bottom). Essentially, we'll have 2 main root screens, Home & Library, where the Library screen allows you to switch between the Albums, Artists, Folders, Genres, Playlists, and Tracks screen. The Library screen will have its own "history" behavior separate from React Navigation.

In terms of home screen related settings:

  • Removed Tab Order, Home Tab, Visible Tab, and Show Navbar settings.
  • New Default Open Tab & Default Library Tab settings.

Toolbar Design

Note

The "FAB" is currently temporary - we might move the "Search" into the main toolbar and have something else there.

When on the Library screen, its button in the toolbar will open a sheet to switch the screen displayed.

Home Screen Library Screen
Toolbar idea when on Home screen. Toolbar idea when on Library screen.

Other Changes

  • Removed hide-home-tab migration from v2.6.0 as what it was adjusting for no longer exists.
    • We've also needed to update the onboarding-flow migration since we've removed the tabsOrder & tabsVisibility state.
  • Updated useBackHandler to support delaying the registration of the event.
    • This is useful in the situation where we want the back handler in a component's children to be registered after the back handler in the component.
  • Removed additional 16px top padding on the toolbar (basically 16px above the FAB which is "dead" space).
  • Have "Toolbar Actions" container not overflow (via adding shrink to its styling).
  • The header height for the LibraryLayout is now cached.

Checklist

  • New files have the SPDX license identifier at the top of the file.
  • Documentation is up to date to reflect these changes.
  • Ensure dependency licenses are up-to-date by running pnpm sync:licenses.
  • This diff will work correctly for pnpm android:prod.

Summary by CodeRabbit

  • New Features
    • Choose whether the app opens to Home or Library, and select the default section shown in Library.
    • Navigate between Home and Library using the updated toolbar, with library sections available from its selector.
  • Updates
    • Navigation now uses fixed Home and Library tabs instead of customizable tab order and visibility.
    • The mini player appears on supported screens when a track is active.
  • Bug Fixes
    • Folder search results now open in the corresponding Library location.
  • Documentation
    • Updated customization guidance to describe the default tab settings.

- We've also marked settings that we want to remove.
- The `MaterialTopTabs` will render 2 screens: `Home` & `Library`.
- `Library` will then programmatically determine the screen that'll get rendered without using a separate navigator.
- This does mean that the "Back" gesture on the "Library" screen will work a bit differently as it'll either dimiss the app or navigate back to the "Home" screen.
- We're going to replace it with our toolbar design.
- Removed the `hide-home-tab` migration & revised the `onboarding-flow` migration.
- Temporarily have "navbar" render nothing.
- ❗ We still need to pre-build the app to fix the bunlded icon font.
- ❗ The navigation history is a bit broken, with the back gesutre on the "Library" tab (when it's the default tab) goes back to the "Home" screen.
  - We might need some sort of custom history handling like we did before.
- When we fully went back, then swiped right to go back to the "Folders" screen, the params were restored.
- We need to disable the type error due to it being confused as this "screen" technically isn't rendered as a screen.
- The default value is `firstRoute`, which means the screen before the back gesture brings us to the Android home screen will be the "Home" tab.
- We internally track the screens rendered on the "Library" screen and handle the back gesture, stacking, and popping behavior ourselves.
- When navigating to the "Library" screen, we require specifying the `category`, but internally, we clear it to have our history behavior work.
- Back gesture behavior on the "Folder" screen can break (ie: navigate to specific folder, then navigate to "Home", then go back to "Library" and do back gesture).
- No conflicts should occur since this should be in the `params` option and not the root navigation config object.
- Basically in the following situation:
  1. Navigate to specific "Folders" screen.
  2. Swipe to "Home" screen.
  3. Swipe back to "Library" screen.
- Using the back gesture will pop the "Library" history stack instead of popping a folder path.
- This is due to the back handler in `LibraryView` being registered **after** the one in `Folders`.
- `useBottomActionsOffset` is a lot simpler now since we plan on using the toolbar on every screen, so the miniplayer will appear in a "fixed" spot.
- One additional change is that we now have the linear gradient end at the top of the toolbar instead of going beyond by `16px`.
- We add the ability to swap the rendered screen by clicking the library tab again while on it.
  - ❗ We maybe need to make it easier to understand that there's an extra press action.
- We now set a max-width for the toolbar.
@cyanChill cyanChill added the enhancement New feature or request label Oct 23, 2026
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ada103f1-776c-484b-8709-633e47996599
📥 Commits

Reviewing files that changed from the base of the PR and between 0753493 and cf8cf7e.

⛔ Files ignored due to path filters: 7
  • mobile/android/app/src/main/assets/fonts/app-icons-85d12634.ttf is excluded by !**/*.ttf
  • mobile/assets/icons/app-icons/bottom-navigation.svg is excluded by !**/*.svg
  • mobile/assets/icons/app-icons/library-music-filled.svg is excluded by !**/*.svg
  • mobile/assets/icons/app-icons/library-music.svg is excluded by !**/*.svg
  • mobile/assets/icons/app-icons/tab-move.svg is excluded by !**/*.svg
  • mobile/assets/icons/app-icons/unfold-more.svg is excluded by !**/*.svg
  • mobile/src/resources/icons/app-icons.ttf is excluded by !**/*.ttf
📒 Files selected for processing: 37
  • docs/customizations.md
  • mobile/src/components/next/composed/toolbar.tsx
  • mobile/src/data/album/types.ts
  • mobile/src/data/track/types.ts
  • mobile/src/hooks/useBackHandler.ts
  • mobile/src/modules/i18n/translations/en.json
  • mobile/src/modules/search/screens/View.tsx
  • mobile/src/modules/startup/audioBrowser/registerEvents.ts
  • mobile/src/modules/startup/migrations/constants.ts
  • mobile/src/modules/startup/migrations/index.ts
  • mobile/src/navigation/components/BottomActions/Miniplayer.tsx
  • mobile/src/navigation/components/BottomActions/NavActions.tsx
  • mobile/src/navigation/components/BottomActions/RootToolbar.tsx
  • mobile/src/navigation/components/BottomActions/index.tsx
  • mobile/src/navigation/components/BottomActions/useBottomActions.ts
  • mobile/src/navigation/layouts/LibraryLayout.tsx
  • mobile/src/navigation/routes.tsx
  • mobile/src/navigation/screens/HomeView.tsx
  • mobile/src/navigation/screens/LibraryView.tsx
  • mobile/src/navigation/screens/albums/View.tsx
  • mobile/src/navigation/screens/artists/View.tsx
  • mobile/src/navigation/screens/folders/View.tsx
  • mobile/src/navigation/screens/genres/View.tsx
  • mobile/src/navigation/screens/playlists/View.tsx
  • mobile/src/navigation/screens/settings/AppearanceSettingsView.tsx
  • mobile/src/navigation/screens/settings/sheets/TabOrderSheet.tsx
  • mobile/src/navigation/screens/settings/sheets/TabSelectionSheets.tsx
  • mobile/src/navigation/screens/tracks/View.tsx
  • mobile/src/navigation/utils/router.ts
  • mobile/src/resources/icons/app-icons.glyphmap.json
  • mobile/src/stores/Preference/actions/index.ts
  • mobile/src/stores/Preference/actions/preferenceTogglers.ts
  • mobile/src/stores/Preference/actions/tabs.ts
  • mobile/src/stores/Preference/constants.ts
  • mobile/src/stores/Preference/hooks.ts
  • mobile/src/stores/Preference/store.ts
  • mobile/src/stores/Preference/types.ts
💤 Files with no reviewable changes: 7
  • mobile/src/stores/Preference/hooks.ts
  • mobile/src/stores/Preference/actions/preferenceTogglers.ts
  • mobile/src/navigation/components/BottomActions/NavActions.tsx
  • mobile/src/stores/Preference/actions/tabs.ts
  • mobile/src/stores/Preference/actions/index.ts
  • mobile/src/navigation/screens/settings/sheets/TabOrderSheet.tsx
  • mobile/src/navigation/components/BottomActions/index.tsx

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

The app replaces configurable home tabs with fixed Home and Library routes. It adds preferences for the default opening tab and default library tab, and updates library navigation, layout rendering, and bottom controls.

Changes: Library navigation and default tabs

Layer / File(s) Summary
Default-tab preferences and settings
mobile/src/stores/Preference/*, mobile/src/navigation/screens/settings/AppearanceSettingsView.tsx, mobile/src/navigation/screens/settings/sheets/*, mobile/src/modules/startup/migrations/*, mobile/src/modules/i18n/translations/en.json, docs/customizations.md
Preference types and defaults now define the default opening tab and default library tab. Settings provide selection sheets for both. The tab-order sheet, visibility preferences, and related migration updates are removed. Translations and documentation describe the new options.
Root routes and library navigation
mobile/src/navigation/routes.tsx, mobile/src/navigation/screens/LibraryView.tsx, mobile/src/navigation/screens/HomeView.tsx, mobile/src/navigation/screens/folders/View.tsx, mobile/src/navigation/utils/router.ts, mobile/src/modules/search/screens/View.tsx, mobile/src/hooks/useBackHandler.ts, mobile/src/modules/startup/audioBrowser/registerEvents.ts
Root navigation uses fixed Home and Library routes. Library tab history handles tab selection and back actions. Home links, folder search results, and media links pass nested Library screen parameters and folder paths. Back-handler registration can be delayed.
Library layout and header caching
mobile/src/navigation/layouts/LibraryLayout.tsx, mobile/src/navigation/screens/{albums,artists,folders,genres,playlists,tracks}/View.tsx, mobile/src/data/{album,track}/types.ts
Library layouts cache measured header heights by screen key and use current or cached heights for rendering. Each library screen supplies a cache key. Sorting comments now refer to the library screen.
Root toolbar and miniplayer
mobile/src/navigation/components/BottomActions/*, mobile/src/components/next/composed/toolbar.tsx, mobile/src/navigation/screens/HomeView.tsx, mobile/src/navigation/routes.tsx, mobile/src/resources/icons/app-icons.glyphmap.json
A root toolbar provides Home, Library, and Search controls. The bottom-actions layout and navbar are removed, and a route-aware miniplayer provider replaces them. Toolbar sizing, miniplayer offsets, and icon glyphs are updated.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to cf8cf

The reviewed navigation and miniplayer changes have no established issue that needs resolution before merge. Normal checks can proceed.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 26.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 30 functions across 27 files. (3 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the main change as a new root navigation design. Although “idea” is broad, the title is specific enough to distinguish the navigation restructuring.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 26.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 30 functions across 27 files. (3 skipped: 3 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

- We don't want to use the `usePreferenceStore` hook as the screen will re-render unnecssarily when we change the setting.
- Export the container rendering the miniplayer in the `Miniplayer.tsx` file.
- Also fixed uses of the work "miniplayer".
- I think this was here for positioning the original "bottom actions" that rendered on the home screen (so search, navbar, & settings row) as they weren't absolute positioned.
…n going back

- The cause is the clause that renders `ListEmptyComponent` when `headerHeight = 0`.
- We fixed the issue by caching previously found header heights & falling back to that value while we re-render one of the `Library` screens.
@cyanChill
cyanChill marked this pull request as ready for review October 23, 2026 19:52
@cyanChill
cyanChill merged commit 1c4be07 into dev Oct 23, 2026
1 check passed
@cyanChill
cyanChill deleted the next/v4/new-home-nav-idea branch October 23, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant