-
-
Notifications
You must be signed in to change notification settings - Fork 44
dev #155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis update introduces a new animated dot loading indicator, refines the synced lyrics scrolling and highlighting logic, and adjusts the UI to account for synchronization state. The build configuration is updated for a new app version and debug build suffix. Utility functions are added and modified for lyrics timing and color handling. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant LyricsPage
participant SyncedLyrics
participant DotLoadingProgress
participant Util
User->>LyricsPage: Interacts with lyrics UI (scroll, sync)
LyricsPage->>SyncedLyrics: Passes lyrics, scroll, sync state
SyncedLyrics->>Util: getNextLyricTime(index, lyrics)
SyncedLyrics->>DotLoadingProgress: Show loading indicator (if instrumental break)
SyncedLyrics-->>LyricsPage: Renders updated lyrics list with animations
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~18 minutes Possibly related PRs
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (3)
app/src/main/java/com/shub39/rush/lyrics/component/DotLoadingProgress.kt (2)
32-34: Consider documenting the staggered progress calculation.The formula
((clampedProgress - (index * 0.15f)) * 1.4f)creates a wave effect but could benefit from a comment explaining the intended behavior.Add a comment explaining the calculation:
val dotProgresses = List(dotCount) { index -> + // Create staggered progress for wave effect: each dot lags by 0.15 and scales by 1.4 ((clampedProgress - (index * 0.15f)) * 1.4f).coerceIn(0f, 1f) }
21-65: Consider adding a preview function.Adding a
@Previewcomposable would help visualize the loading animation during development.Add a preview function at the end of the file:
@Preview @Composable private fun DotLoadingProgressPreview() { var progress by remember { mutableStateOf(0f) } LaunchedEffect(Unit) { while (true) { progress = (progress + 0.01f) % 1f delay(16) } } DotLoadingProgress( progress = progress, modifier = Modifier.padding(16.dp) ) }app/src/main/java/com/shub39/rush/lyrics/component/SyncedLyrics.kt (1)
61-61: Consider clearing stale height entries.The
itemHeightsmap stores heights for all lyric indices but never clears old entries if the lyrics list changes.Consider clearing the map when lyrics change:
+LaunchedEffect(state.song?.syncedLyrics) { + itemHeights.clear() +}Also applies to: 97-100
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
app/build.gradle.kts(2 hunks)app/src/main/java/com/shub39/rush/lyrics/LyricsPage.kt(3 hunks)app/src/main/java/com/shub39/rush/lyrics/component/DotLoadingProgress.kt(1 hunks)app/src/main/java/com/shub39/rush/lyrics/component/SyncedLyrics.kt(6 hunks)app/src/main/java/com/shub39/rush/lyrics/util.kt(2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
app/src/main/java/com/shub39/rush/lyrics/component/DotLoadingProgress.kt (1)
app/src/main/java/com/shub39/rush/core/presentation/util.kt (1)
lerp(104-111)
app/src/main/java/com/shub39/rush/lyrics/component/SyncedLyrics.kt (2)
app/src/main/java/com/shub39/rush/lyrics/util.kt (2)
getNextLyricTime(67-72)getCurrentLyricIndex(59-65)app/src/main/java/com/shub39/rush/lyrics/component/DotLoadingProgress.kt (1)
DotLoadingProgress(21-65)
🪛 detekt (1.23.8)
app/src/main/java/com/shub39/rush/lyrics/util.kt
[warning] 68-70: This loop contains an unconditional jump expression which essentially renders it useless as it will exit the loop during the first iteration.
(detekt.potential-bugs.UnconditionalJumpStatementInLoop)
🔇 Additional comments (8)
app/src/main/java/com/shub39/rush/lyrics/util.kt (1)
127-127: LGTM! Ensuring full opacity for card colors.The explicit alpha setting ensures consistent opacity across all color configurations, which is a good defensive practice.
app/build.gradle.kts (2)
13-14: Version bump for new release.The version update from 4.0.0 to 4.1.0 aligns with the new features and improvements in this PR.
51-51: Good practice: Adding debug suffix.Adding the
.debugsuffix to the debug build's application ID helps distinguish debug installations from release builds on the same device.app/src/main/java/com/shub39/rush/lyrics/LyricsPage.kt (1)
89-94: Well-structured UI state management based on sync mode.The visibility and height adjustments based on
state.synccreate distinct UI layouts for synced and non-synced modes, improving the user experience by:
- Allocating more space to lyrics when in sync mode
- Showing appropriate album art placement for each mode
Also applies to: 223-223, 248-248
app/src/main/java/com/shub39/rush/lyrics/component/SyncedLyrics.kt (4)
72-81: Excellent implementation of centered scrolling.The calculation properly centers the current lyric by:
- Getting the viewport height
- Retrieving the current item's height
- Calculating the offset to center the item
This provides a much better user experience than simple scroll-to-item.
107-120: Creative progress visualization implementation.The progress animation between lyrics and the clipping effect create a smooth visual transition. The use of
LinearOutSlowInEasingprovides a natural feel to the animation.Also applies to: 185-194
196-200: Good integration of DotLoadingProgress for instrumental sections.Replacing the static icon with an animated progress indicator provides better visual feedback during instrumental breaks.
50-50: Confirm Experimental Material3 Expressive API UsageThe
@OptIn(ExperimentalMaterial3ExpressiveApi::class)annotation is applied across multiple composables. Please ensure this is intentional and that you’re tracking any future deprecations or breaking changes in the expressive-themed APIs.Affected files include (but are not limited to):
- app/src/main/java/com/shub39/rush/search_sheet/SearchSheet.kt
- app/src/main/java/com/shub39/rush/setting/SettingRootPage.kt
- app/src/main/java/com/shub39/rush/lyrics/component/SyncedLyrics.kt
- app/src/main/java/com/shub39/rush/onboarding/Onboarding.kt
- app/src/main/java/com/shub39/rush/core/presentation/RushTheme.kt
Summary by CodeRabbit
New Features
Enhancements
Other