Skip to content

Update design of the play button#6138

Merged
gpunto merged 1 commit intov7from
redesign/play-button
Feb 9, 2026
Merged

Update design of the play button#6138
gpunto merged 1 commit intov7from
redesign/play-button

Conversation

@gpunto
Copy link
Contributor

@gpunto gpunto commented Feb 9, 2026

Goal

While addressing this comment, I took the opportunity to update the common play button as per design specs.

Implementation

Updated PlayButton to accept a size enum that maps to the sizes defined in Figma and updated usages accordingly

🎨 UI Changes

Before After
Screenshot_20260209_111204 Screenshot_20260209_115451

Testing

It can be checked in the sample

Summary by CodeRabbit

  • Refactor
    • Consolidated play button implementations across media components into a single standardized component with predefined sizes, reducing code duplication and improving consistency.

@gpunto gpunto added the pr:improvement Improvement label Feb 9, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

PR checklist ✅

All required conditions are satisfied:

  • Title length is OK (or ignored by label).
  • At least one pr: label exists.
  • Sections ### Goal, ### Implementation, and ### Testing are filled.

🎉 Great job! This PR is ready for review.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 5.26 MB 5.26 MB 0.00 MB 🟢
stream-chat-android-offline 5.48 MB 5.48 MB 0.00 MB 🟢
stream-chat-android-ui-components 10.63 MB 10.62 MB -0.01 MB 🚀
stream-chat-android-compose 12.85 MB 11.68 MB -1.17 MB 🚀

@gpunto gpunto force-pushed the redesign/play-button branch from c011c9f to 830cdf5 Compare February 9, 2026 11:41
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 9, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
67.6% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@gpunto gpunto changed the title Update play button design Update design of the play button Feb 9, 2026
@gpunto gpunto marked this pull request as ready for review February 9, 2026 11:56
@gpunto gpunto requested a review from a team as a code owner February 9, 2026 11:56
@coderabbitai
Copy link

coderabbitai bot commented Feb 9, 2026

Walkthrough

A new PlayButton composable component is introduced with three predefined sizes (Large, Medium, Small) that replaces scattered custom play button styling implementations across multiple files in the codebase.

Changes

Cohort / File(s) Summary
New PlayButton Component
src/main/java/io/getstream/chat/android/compose/ui/components/common/PlayButton.kt, api/stream-chat-android-compose.api
Introduces standardized PlayButton composable with three size variants (Large, Medium, Small) and adds corresponding public class to API surface.
Media Attachment Updates
src/main/java/io/getstream/chat/android/compose/ui/attachments/content/MediaAttachmentContent.kt, src/main/java/io/getstream/chat/android/compose/ui/attachments/factory/MediaAttachmentFactory.kt
Removes internal PlayButton implementation and replaces all usages with standardized PlayButton(size = PlayButtonSize.Medium/Small) approach; updates imports accordingly.
Media Gallery & Player Updates
src/main/java/io/getstream/chat/android/compose/ui/attachments/preview/internal/MediaGalleryPhotosMenu.kt, src/main/java/io/getstream/chat/android/compose/ui/attachments/preview/internal/StreamMediaPlayerContent.kt
Replaces custom-styled play buttons (with shadow, background, CircleShape) with PlayButton using PlayButtonSize.Small and PlayButtonSize.Large respectively.
Quoted Message Updates
src/main/java/io/getstream/chat/android/compose/ui/components/messages/QuotedMessage.kt
Removes VideoPlayIndicator and replaces with PlayButton(size = PlayButtonSize.Small); eliminates unused imports (Image, CircleShape, StreamPrimitiveColors).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • VelikovPetar
  • andremion

Poem

🐰 A button new, with sizes three,
Replaces custom flair we see,
No shadow, no background to manage,
PlayButton sizes: small, medium, large!
The code hops cleaner, bright and free! 🎬

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 55.56% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: updating the design of the play button component based on Figma specifications.
Description check ✅ Passed The PR description follows the template structure with Goal, Implementation, UI Changes (with before/after screenshots), and Testing sections provided.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch redesign/play-button

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/common/PlayButton.kt (3)

59-62: Nit: Non-idiomatic Companion references.

Alignment.Companion.Center and Modifier.Companion.size can be simplified to Alignment.Center and Modifier.size.

Proposed simplification
-        contentAlignment = Alignment.Companion.Center,
+        contentAlignment = Alignment.Center,
     ) {
         Icon(
-            modifier = Modifier.Companion.size(size.iconSize),
+            modifier = Modifier.size(size.iconSize),

76-89: Preview doesn't use @StreamPreview helper.

Per project conventions, Compose previews should use @StreamPreview helpers. Based on learnings: "Compose previews should use StreamPreview helpers".


70-74: Consider adding KDoc for PlayButtonSize.

Although internal, a brief KDoc describing the size mapping (component vs icon) would help future maintainers understand the Figma-derived values.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@gpunto gpunto merged commit 09c1e0a into v7 Feb 9, 2026
15 of 17 checks passed
@gpunto gpunto deleted the redesign/play-button branch February 9, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:improvement Improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants