Conversation
SDK Size Comparison 📏
|
22a35ac to
d62445b
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
WalkthroughThis PR consolidates file type icon handling by introducing a Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/attachments/content/FileAttachmentContent.kt`:
- Line 51: The current FileAttachmentContent rendering always shows
StreamAsyncImage when imagePreviewData exists, ignoring
ChatTheme.videoThumbnailsEnabled; update the rendering logic in
FileAttachmentContent so StreamAsyncImage is used only if the attachment is an
image OR it's a video and ChatTheme.videoThumbnailsEnabled is true, otherwise
render FileTypeIcon; apply the same conditional fix to the other occurrence
around the 274-297 block to ensure video thumbnails are toggled off correctly
(refer to StreamAsyncImage, FileTypeIcon, ChatTheme.videoThumbnailsEnabled, and
the attachment's imagePreviewData/isVideo/isImage properties).
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/util/MimeTypeIconProvider.kt`:
- Around line 28-32: Update the KDoc for the getIcon function in
MimeTypeIconProvider to reflect that it returns a FileIconData instance instead
of a drawable resource: change wording like "Returns a drawable resource for the
given MIME type" and the `@return` description to say it returns FileIconData
(include what fields/meaning are returned if relevant), and update the `@param`
description if needed to reference the MIME type format; ensure references to
drawable resource are removed or replaced with FileIconData throughout the KDoc.
In
`@stream-chat-android-compose/src/main/res/drawable/stream_compose_ic_file_code.xml`:
- Around line 22-25: Replace the hardcoded fill color in
stream_compose_ic_file_code.xml (the <path> element with android:pathData
"M0,4C0,1.791 1.791,0 4,0H28L40,12V44C40,46.209 38.209,48 36,48H4C1.791,48
0,46.209 0,44V4Z") with a neutral placeholder color (e.g., black/#000000 or
`@android`:color/black) so runtime tinting in composables works correctly; locate
the android:fillColor attribute on that path and swap the hex `#00ACA1` to the
placeholder color, ensuring the drawable relies on the runtime tint rather than
a hardcoded brand color.
.../main/java/io/getstream/chat/android/compose/ui/attachments/content/FileAttachmentContent.kt
Show resolved
Hide resolved
...roid-compose/src/main/java/io/getstream/chat/android/compose/ui/util/MimeTypeIconProvider.kt
Outdated
Show resolved
Hide resolved
| <path | ||
| android:pathData="M0,4C0,1.791 1.791,0 4,0H28L40,12V44C40,46.209 38.209,48 36,48H4C1.791,48 0,46.209 0,44V4Z" | ||
| android:fillColor="#00ACA1"/> | ||
| <path |
There was a problem hiding this comment.
Use placeholder fill color to preserve runtime tinting.
These stream_compose_ic_* icons are tinted at runtime, so hardcoding #00ACA1 can break theme-aware coloring. Consider switching to a placeholder (e.g., black) and rely on the tint in composables. Based on learnings, use placeholder colors in drawable XMLs for this module.
♻️ Proposed change
- <path
- android:pathData="M0,4C0,1.791 1.791,0 4,0H28L40,12V44C40,46.209 38.209,48 36,48H4C1.791,48 0,46.209 0,44V4Z"
- android:fillColor="#00ACA1"/>
+ <path
+ android:pathData="M0,4C0,1.791 1.791,0 4,0H28L40,12V44C40,46.209 38.209,48 36,48H4C1.791,48 0,46.209 0,44V4Z"
+ android:fillColor="#000000"/>📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| <path | |
| android:pathData="M0,4C0,1.791 1.791,0 4,0H28L40,12V44C40,46.209 38.209,48 36,48H4C1.791,48 0,46.209 0,44V4Z" | |
| android:fillColor="#00ACA1"/> | |
| <path | |
| <path | |
| android:pathData="M0,4C0,1.791 1.791,0 4,0H28L40,12V44C40,46.209 38.209,48 36,48H4C1.791,48 0,46.209 0,44V4Z" | |
| android:fillColor="#000000"/> | |
| <path |
🤖 Prompt for AI Agents
In
`@stream-chat-android-compose/src/main/res/drawable/stream_compose_ic_file_code.xml`
around lines 22 - 25, Replace the hardcoded fill color in
stream_compose_ic_file_code.xml (the <path> element with android:pathData
"M0,4C0,1.791 1.791,0 4,0H28L40,12V44C40,46.209 38.209,48 36,48H4C1.791,48
0,46.209 0,44V4Z") with a neutral placeholder color (e.g., black/#000000 or
`@android`:color/black) so runtime tinting in composables works correctly; locate
the android:fillColor attribute on that path and swap the hex `#00ACA1` to the
placeholder color, ensuring the drawable relies on the runtime tint rather than
a hardcoded brand color.
There was a problem hiding this comment.
The color of these specific file type icons is theme independent
There was a problem hiding this comment.
@gpunto, thank you for the clarification! I understand now that these file type icons (stream_compose_ic_file_*) are designed with specific, intentional colors that remain consistent regardless of theme, unlike other icons in the module that rely on runtime tinting. This makes sense for maintaining visual consistency and recognition of different file types.
/)_/)
(^.^)
(> <) Got it!
✏️ Learnings added
Learnt from: gpunto
Repo: GetStream/stream-chat-android PR: 6092
File: stream-chat-android-compose/src/main/res/drawable/stream_compose_ic_file_code.xml:22-25
Timestamp: 2026-01-21T11:30:52.069Z
Learning: In stream-chat-android-compose, file type icon drawables (stream_compose_ic_file_*.xml) use intentional, theme-independent colors specific to each file type (e.g., PDF is red, spreadsheet is green, code is teal) and do not rely on runtime tinting like other icons in the module.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
🧠 Learnings used
Learnt from: gpunto
Repo: GetStream/stream-chat-android PR: 6084
File: stream-chat-android-compose/src/main/res/drawable/stream_compose_ic_camera.xml:27-28
Timestamp: 2026-01-15T13:09:56.922Z
Learning: In stream-chat-android-compose, drawable XML icon files (e.g., stream_compose_ic_*.xml) use hardcoded placeholder colors because tint is applied programmatically when the icons are used in composables, ensuring theme-aware coloring at runtime.
Learnt from: CR
Repo: GetStream/stream-chat-android PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T15:00:07.506Z
Learning: Applies to **/stream-chat-android-compose/**/*.kt : Compose previews should use `StreamPreview` helpers
Learnt from: CR
Repo: GetStream/stream-chat-android PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T15:00:07.506Z
Learning: Applies to **/stream-chat-android-compose/**/*Test.kt : Add Paparazzi snapshots for Compose UI regressions and run `verifyPaparazziDebug`
Learnt from: CR
Repo: GetStream/stream-chat-android PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T15:00:07.506Z
Learning: Applies to **/stream-chat-android-ui-components/**/*Test.kt : Record Shot baselines when behaviour changes in XML kit UI tests
d62445b to
a53eb30
Compare
a53eb30 to
34ccaa8
Compare
34ccaa8 to
e2eb2d4
Compare
...roid-compose/src/main/java/io/getstream/chat/android/compose/ui/util/MimeTypeIconProvider.kt
Outdated
Show resolved
Hide resolved
6d6a06c to
6220090
Compare
|


🎯 Goal
AND-1020: Update filetype icon/component
The filetype icon label is now dynamic, i.e. we overlay the text in code instead of having N variant where the only thing that changes is the text.
🛠 Implementation details
🎨 UI Changes
Add relevant screenshots
🧪 Testing
You can run the sample and check how the file icons look, e.g. in the message list, attachment picker.
☑️Contributor Checklist
General
Code & documentation
☑️Reviewer Checklist
🎉 GIF
Please provide a suitable gif that describes your work on this pull request
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.