Add playlist view toggle to library folders#289
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ 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 address that feedback".
| viewModelScope.launch { | ||
| userPreferencesRepository.isFoldersPlaylistViewFlow.collect { isPlaylistView -> | ||
| setFoldersPlaylistViewState(isPlaylistView) | ||
| } |
There was a problem hiding this comment.
Reset folders view on unrelated preference updates
The new collector for userPreferencesRepository.isFoldersPlaylistViewFlow triggers setFoldersPlaylistViewState on every DataStore emission. Because the flow maps directly from dataStore.data without distinctUntilChanged, it re-emits the same boolean whenever any preference (sorting, theme, etc.) is written. setFoldersPlaylistViewState always clears currentFolder and currentFolderPath, so browsing the folder hierarchy will unexpectedly jump back to the root whenever an unrelated preference is saved even though the playlist-view toggle itself didn’t change. Consider ignoring repeated values before resetting the navigation state so it only happens when the preference actually flips.
Useful? React with 👍 / 👎.
This commit refactors the "Playlist View" toggle within the `LibrarySortBottomSheet` to introduce animations and improve its visual styling. Key changes include: - The `Surface` containing the view toggle has been replaced with a `Box`. - The background color and corner radius of the view toggle container are now animated based on the toggle's checked state. - A custom `AbsoluteSmoothCornerShape` is used to create a "squircle" effect for the container. - The `Switch` component has been restyled with custom colors and a check icon in the thumb when enabled. - Typography styles and padding have been updated for better visual alignment and hierarchy.
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_68fa3921f150832f8971dc4cc00c765a