Repository navigation
next(v4): New root navigation idea - #629
Conversation
- 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.
…e that it has additional actions
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
- 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.
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 theLibraryscreen allows you to switch between theAlbums,Artists,Folders,Genres,Playlists, andTracksscreen. TheLibraryscreen will have its own "history" behavior separate from React Navigation.In terms of home screen related settings:
Tab Order,Home Tab,Visible Tab, andShow Navbarsettings.Default Open Tab&Default Library Tabsettings.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
Libraryscreen, its button in the toolbar will open a sheet to switch the screen displayed.Other Changes
hide-home-tabmigration fromv2.6.0as what it was adjusting for no longer exists.onboarding-flowmigration since we've removed thetabsOrder&tabsVisibilitystate.useBackHandlerto support delaying the registration of the event.16pxtop padding on the toolbar (basically16pxabove the FAB which is "dead" space).shrinkto its styling).LibraryLayoutis now cached.Checklist
pnpm sync:licenses.pnpm android:prod.Summary by CodeRabbit