Fix/unified player sheet lagging recomposition fix#921
Merged
theovilardo merged 4 commits intomasterfrom Jan 26, 2026
Merged
Conversation
Owner
theovilardo
commented
Jan 26, 2026
- Improved recompositions and optimized UnifiedPlayerSheet
- Added new Slider style for M3E
- **Preferences & Data**:
- Adds `USE_SMOOTH_CORNERS` to `UserPreferencesRepository` to allow users to toggle between smooth (superellipse) and standard rounded corners.
- Implements `useSmoothCornersFlow` and `setUseSmoothCorners` in both `UserPreferencesRepository` and `SettingsViewModel`.
- **UI & Player**:
- **UnifiedPlayerSheet**: Updates the player sheet to dynamically switch between `AbsoluteSmoothCornerShape` and `RoundedCornerShape` based on user preference. Logic ensures smooth shapes are disabled during active dragging or expansion animations to maintain performance.
- **PlayerInternalNavigationBar**: Adjusts top padding for the `FULL_WIDTH` navigation bar style for a more compact layout.
- **Settings**:
- Adds a new "Use Smooth Corners" toggle in the Appearance settings category, including a subtitle explaining the aesthetic benefit versus potential performance impact on low-end devices.
- Integrates the new preference into `PlayerViewModel` for real-time UI updates within the player.
…t` by reducing unnecessary recompositions through granular state observation and state masking.
- **UnifiedPlayerSheet**:
- Introduced `infrequentPlayerState` which masks volatile `currentPosition` updates, preventing the entire sheet from recomposing every second.
- Implemented `positionToDisplayProvider` and other state providers to defer state reading to the specific sub-components that require it.
- Refactored logic to use `infrequentPlayerState` for stable properties like `isPlaying`, `repeatMode`, and `isShuffleEnabled`.
- Improved `showPlayerContentArea` derived state by using explicit keys to minimize recalculations.
- **FullPlayerContent**:
- Replaced direct `stablePlayerState` collection with functional providers (`repeatModeProvider`, `totalDurationProvider`, `lyricsProvider`, etc.) to isolate UI updates.
- Updated `FetchLyricsDialog` and `ExpandedControls` to utilize passed-in state providers instead of observing global state flows.
- Optimized the pre-warming logic to use the new masked state, reducing jank when transitioning between tracks.
- **Internal State Logic**:
- Refined the synchronization between remote and local playback positions using a distinct-until-changed mapping to ensure UI stability.
### Enhance Player UI performance and introduce expressive wavy slider
- **New Components**:
- Introduces `WavySliderExpressive`, a Material 3-styled progress slider with an animated wave effect that flattens during interaction and supports a pill-to-line thumb morph.
- **Player Performance & Optimization**:
- **UnifiedPlayerSheet**: Refactors Z-index and offset logic using `derivedStateOf` to prevent unnecessary recompositions during sheet expansion.
- **FullPlayerContent**: Optimizes progress tracking by replacing `Animatable` with a direct state-derivation strategy and an "optimistic seek" mechanism to eliminate position snap-back.
- **ComposeLoader**: Updates `rememberSmoothProgress` to return `State` objects, allowing UI components to observe progress changes without triggering full-scope recompositions.
- **QueueBottomSheet**: Implements `remember` blocks for all callback lambdas and converts several properties (timer, play count) to `State` parameters to stabilize the UI.
- **Bug Fixes & Stability**:
- Fixes "stepping" lag in the full player progress bar by isolating slider and label updates into dedicated components (`EfficientSlider`, `EfficientTimeLabels`).
- Improves `QueueBottomSheet` visibility logic to ensure the sheet correctly re-measures on configuration changes (e.g., rotation).
- Refines `HomeScreen` shuffle state observation to use `distinctUntilChanged`, reducing redundant UI refreshes.
- **UI/UX**:
- Implements smoother alpha and scaling transitions between the mini-player and full-player views based on expansion fraction.
- **FullPlayerContent**:
- Updates `WavySliderExpressive` integration to use explicit imports and adds horizontal padding for better alignment within the player UI.
- **WavySliderExpressive**:
- Increases default `strokeWidth` to `5.dp` for better visibility.
- Adjusts track geometry by reducing the `gapSize` and setting a fixed `stopSize` of `3.dp` to refine the visual transition between the thumb and the wavy track.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.