Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@shub39
Copy link
Owner

@shub39 shub39 commented Jul 27, 2025

Summary by CodeRabbit

  • New Features

    • Introduced a new animated dot loading indicator for instrumental breaks in lyrics.
    • Added smoother progress animations and improved centering for active lyrics during playback.
  • Enhancements

    • Refined lyric scrolling to center the current line and provide clearer progress visualization.
    • Improved UI responsiveness based on synchronization state, affecting layout and album art visibility.
    • Ensured card colors in the lyrics page are fully opaque for better visual consistency.
  • Other

    • Updated app version to 4.1.0.

@coderabbitai
Copy link

coderabbitai bot commented Jul 27, 2025

Walkthrough

This 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

File(s) Change Summary
app/build.gradle.kts Updated app version name/code, added .debug applicationIdSuffix to debug build type.
app/src/main/java/com/shub39/rush/lyrics/LyricsPage.kt Modified UI layout/visibility logic to include state.sync in animation and album art display conditions.
app/src/main/java/com/shub39/rush/lyrics/component/DotLoadingProgress.kt Added DotLoadingProgress composable for animated three-dot loading indicator.
app/src/main/java/com/shub39/rush/lyrics/component/SyncedLyrics.kt Enhanced scrolling to center active lyric, improved progress animation, simplified highlight visuals.
app/src/main/java/com/shub39/rush/lyrics/util.kt Added getNextLyricTime function; updated getCardColors to use fully opaque colors.

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~18 minutes

Possibly related PRs

  • 🔧 maintainence #147: Updates the app version and modifies the debug build configuration in app/build.gradle.kts, directly related to changes in this PR.

Poem

Three dots now dance in loading’s light,
Lyrics scroll and center just right.
Colors shine with alpha’s might,
Sync state guides what’s in sight.
A bunny hops with code delight—
Version bumped, the future’s bright!
🐰✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 99c8a42 and 7244bdb.

📒 Files selected for processing (1)
  • app/src/main/java/com/shub39/rush/lyrics/util.kt (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/src/main/java/com/shub39/rush/lyrics/util.kt
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a 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 @Preview composable 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 itemHeights map 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

📥 Commits

Reviewing files that changed from the base of the PR and between f3ce041 and 99c8a42.

📒 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 .debug suffix 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.sync create 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:

  1. Getting the viewport height
  2. Retrieving the current item's height
  3. 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 LinearOutSlowInEasing provides 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 Usage

The @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

@shub39 shub39 merged commit 1f5e4a4 into master Jul 27, 2025
2 checks passed
@shub39 shub39 deleted the dev branch July 27, 2025 11:31
@coderabbitai coderabbitai bot mentioned this pull request Jul 31, 2025
@coderabbitai coderabbitai bot mentioned this pull request Sep 8, 2025
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant