Updated design of unsupported attachments#6253
Conversation
|
@coderabbitai review |
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
✅ Actions performedReview triggered.
|
SDK Size Comparison 📏
|
WalkthroughThe changes refactor Changes
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
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 Tip CodeRabbit can use TruffleHog to scan for secrets in your code with verification capabilities.Add a TruffleHog config file (e.g. trufflehog-config.yml, trufflehog.yml) to your project to customize detectors and scanning behavior. The tool runs only when a config file is present. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/attachments/content/UnsupportedAttachmentContent.kt (1)
93-100: This duplicate set of supported attachment types should be consolidated.The same attachment type list (IMAGE, GIPHY, VIDEO, AUDIO, FILE, AUDIO_RECORDING) is already defined in
stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/adapter/viewholder/attachment/UnsupportedAttachmentFactory.ktasSUPPORTED_ATTACHMENT_TYPES. Extracting to a shared constant would prevent maintenance issues when new attachment types are added to the SDK.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/attachments/content/UnsupportedAttachmentContent.kt` around lines 93 - 100, Replace the duplicated supportedAttachmentTypes set with a single shared constant and use it from both places: extract the set (IMAGE, GIPHY, VIDEO, AUDIO, FILE, AUDIO_RECORDING) into a public constant (e.g., SUPPORTED_ATTACHMENT_TYPES) in a common module or package accessible to both UnsupportedAttachmentContent and UnsupportedAttachmentFactory, then remove the local supportedAttachmentTypes declaration and reference the shared SUPPORTED_ATTACHMENT_TYPES in UnsupportedAttachmentContent (and update UnsupportedAttachmentFactory if needed) so all code uses the same central definition.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/attachments/content/UnsupportedAttachmentContent.kt`:
- Around line 93-100: Replace the duplicated supportedAttachmentTypes set with a
single shared constant and use it from both places: extract the set (IMAGE,
GIPHY, VIDEO, AUDIO, FILE, AUDIO_RECORDING) into a public constant (e.g.,
SUPPORTED_ATTACHMENT_TYPES) in a common module or package accessible to both
UnsupportedAttachmentContent and UnsupportedAttachmentFactory, then remove the
local supportedAttachmentTypes declaration and reference the shared
SUPPORTED_ATTACHMENT_TYPES in UnsupportedAttachmentContent (and update
UnsupportedAttachmentFactory if needed) so all code uses the same central
definition.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: e0b7495b-d6a7-43f0-8bbd-f5aaebf1d161
📒 Files selected for processing (4)
stream-chat-android-compose/api/stream-chat-android-compose.apistream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/attachments/content/UnsupportedAttachmentContent.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/util/MessageUtils.kt
|


Goal
Updated design of unsupported attachments
Implementation
UnsupportedAttachmentContentto the new designIn any case, integrators are supposed to override
CustomAttachmentContentto implement the design for custom attachments.🎨 UI Changes
Testing
Check how unsupported attachments are displayed in the sample. There are some in the conversation between Padmé & Chewbacca.
Summary by CodeRabbit