Conversation
This commit introduces the ability for users to reorder the tabs on the Library screen. Key changes: - An "Edit" button has been added to the tab row in `LibraryScreen`. - Tapping the "Edit" button opens a new bottom sheet (`ReorderTabsSheet`). - The bottom sheet allows users to drag and drop tabs to change their order, using the `sh.calvin.reorderable` library. - A "Done" button in the bottom sheet saves the new order. A brief loading indicator is shown for user feedback. - The tab order is persisted across app restarts using `DataStore` in `UserPreferencesRepository`. - `PlayerViewModel` has been updated to manage and persist the tab order state.
This commit addresses two distinct UI issues: 1. **Fixes Reorderable List State:** The `ReorderTabsSheet` is updated to explicitly create a `LazyListState` using `rememberLazyListState()`. This state is then passed to both the `rememberReorderableLazyListState` and the `LazyColumn`. This resolves a bug where the list's scroll position would reset during reordering, ensuring a stable and predictable user experience. 2. **Corrects `AboutScreen` Padding:** The bottom content padding in the `AboutScreen`'s `LazyColumn` has been adjusted. It now correctly accounts for the height of the `MiniPlayer`, preventing the mini-player from overlapping the last few items on the screen.
…nctionality This commit addresses feedback on the reorderable library tabs feature. Key changes: - **Fix `HorizontalPager` Synchronization:** The `HorizontalPager` in `LibraryScreen.kt` now correctly displays its pages in the order defined by the reordered tabs. All UI components that depend on the page index now derive their content from the dynamic `tabTitles` list, ensuring that the content remains synchronized with the tab order. - **Add Reset Functionality:** A "Reset" button has been added to the `ReorderTabsSheet`. This allows the user to restore the default tab order. The underlying logic has been implemented in the `PlayerViewModel` and `UserPreferencesRepository` to remove the custom order from `DataStore`.
This commit refines the UI for the reorderable library tabs feature based on user feedback. Key changes: - **Styled Edit Button:** The 'Edit' button in the `LibraryScreen`'s `ScrollableTabRow` is now wrapped in the `TabAnimation` composable, making its style consistent with the other tabs. The `TabAnimation` composable was also refactored to accept a generic `@Composable` content lambda for greater flexibility. - **Redesigned Bottom Sheet:** The `ReorderTabsSheet` has been redesigned to align with the app's Material 3 expressive style. It now includes a prominent title, updated colors, and reorderable items styled to match the `SongPickerBottomSheet`, providing a more cohesive user experience.
…yListState This commit refactors the `ReorderTabsSheet` to explicitly create and provide a `LazyListState` to `rememberReorderableLazyListState`. Previously, the reorderable state was implicitly creating and managing its own `LazyListState`. While functional, the updated `reorderable` library documentation recommends creating the state explicitly and passing it to both the `ReorderableLazyListState` and the `LazyColumn`. This change aligns with the library's best practices, improving clarity and maintainability without altering functionality.
This commit introduces several refinements to the UI and user experience, primarily focusing on the tab reordering feature.
### Key Changes:
1. **Reorder Tabs UX Improvement:**
* The "Reset" button in the `ReorderTabsSheet` has been replaced with an icon button within a new floating toolbar.
* A confirmation `AlertDialog` is now displayed before resetting the tab order to prevent accidental changes.
* A new `FloatingToolBar` composable has been created to encapsulate the "Reset" and "Done" actions, providing a cleaner and more organized layout.
2. **UI Cleanup:**
* **QueueBottomSheet:** Removed a block of commented-out and redundant code for item clipping and click handling, simplifying the component.
* **LyricsSheet:** Fixed an issue where the tab title was not being displayed by correctly placing the `Text` composable within the `TabAnimation`'s content lambda.
* **LibraryScreen:** Removed a commented-out `aspectRatio` modifier.
There was a problem hiding this comment.
💡 Codex Review
https://github.com/theovilardo/PixelPlay/blob/1c6d00daff7af733515aa0c5ae9763287f1696c0/app/src/main/java/com/theveloper/pixelplay/presentation/viewmodel/PlayerViewModel.kt#L2635-L2639
Load library data based on static indices after tab reorder
The new tab-reordering flow means the first, second, etc. tabs are no longer tied to specific categories. onLibraryTabSelected still switches on the numeric index and triggers loadSongsIfNeeded(), loadAlbumsIfNeeded(), and loadArtistsIfNeeded() for hard-coded indices. If the user moves “Albums” to the first position, selecting that tab will still call loadSongsIfNeeded() and albums never load until they visit whatever index happens to be 1. This leaves reordered tabs showing empty content. Consider branching on the tab identifier (e.g., "ALBUMS") rather than the position.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
@codex adress this feedback |
💡 Codex Reviewhttps://github.com/theovilardo/PixelPlay/blob/659aff8022cdfda6b11780df945d35a1b90e5619/app/src/main/java/com/theveloper/pixelplay/presentation/viewmodel/PlayerViewModel.kt#L2635-L2639
https://github.com/theovilardo/PixelPlay/blob/659aff8022cdfda6b11780df945d35a1b90e5619/app/src/main/java/com/theveloper/pixelplay/presentation/viewmodel/PlayerViewModel.kt#L324-L329
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting |
No description provided.