Skip to content

Updated design of unsupported attachments#6253

Merged
VelikovPetar merged 1 commit intov7from
redesign/fix-unsupported-attachment
Mar 16, 2026
Merged

Updated design of unsupported attachments#6253
VelikovPetar merged 1 commit intov7from
redesign/fix-unsupported-attachment

Conversation

@gpunto
Copy link
Contributor

@gpunto gpunto commented Mar 16, 2026

Goal

Updated design of unsupported attachments

Implementation

  • Updated implementation of UnsupportedAttachmentContent to the new design
  • Also, display one item per unknown attachment, to avoid losing context
    In any case, integrators are supposed to override CustomAttachmentContent to implement the design for custom attachments.

🎨 UI Changes

Before After
Screenshot_20260316_152625 Screenshot_20260316_152037

Testing

Check how unsupported attachments are displayed in the sample. There are some in the conversation between Padmé & Chewbacca.

Summary by CodeRabbit

  • Refactor
    • Enhanced unsupported attachment rendering to use state-driven approach, enabling display of multiple unsupported attachments with improved styling and layout.
    • Updated attachment display logic to support dynamic, full-size attachment determination.

@gpunto gpunto added the pr:improvement Improvement label Mar 16, 2026
@gpunto
Copy link
Contributor Author

gpunto commented Mar 16, 2026

@coderabbitai review

@github-actions
Copy link
Contributor

github-actions bot commented Mar 16, 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.

@coderabbitai
Copy link

coderabbitai bot commented Mar 16, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions
Copy link
Contributor

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 5.25 MB 5.70 MB 0.45 MB 🟡
stream-chat-android-ui-components 10.60 MB 11.00 MB 0.41 MB 🟡
stream-chat-android-compose 12.81 MB 12.04 MB -0.77 MB 🚀

@coderabbitai
Copy link

coderabbitai bot commented Mar 16, 2026

Walkthrough

The changes refactor UnsupportedAttachmentContent to accept an AttachmentState parameter, enabling state-driven rendering of multiple unsupported attachments. Supporting files are updated to pass the state. A set of supported attachment types is introduced to identify unsupported content.

Changes

Cohort / File(s) Summary
Core Implementation
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/attachments/content/UnsupportedAttachmentContent.kt
Major refactoring from single-attachment UI to multi-attachment state-driven rendering. Function signature updated to accept AttachmentState. Introduces supportedAttachmentTypes set, renders multiple attachments in a Column with conditional styling, and adds preview. Replaces Image/Surface layout with dynamic state-aware Column iteration.
API Surface Update
stream-chat-android-compose/api/stream-chat-android-compose.api
Public method signature updated for UnsupportedAttachmentContent to add AttachmentState as first parameter, reflecting new required dependency.
Dependent Updates
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.kt, stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/util/MessageUtils.kt
Updated CustomAttachmentContent call to pass state parameter. Removed AttachmentType import and fullSizeAttachmentTypes set; simplified shouldBeDisplayedAsFullSizeAttachment logic by dropping type constraint.

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Attachments unsupported, now dance in state,
Multiple friends that render with grace,
State-driven columns, no fixed heights to chase,
Supporting types whisper what's truly fake,
Dynamic rendering makes all hearts elate!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% 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 unsupported attachments, which is the core focus of all file modifications.
Description check ✅ Passed The description includes Goal, Implementation, UI Changes with before/after screenshots, and Testing sections. All critical sections of the template are present and adequately filled.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch redesign/fix-unsupported-attachment
📝 Coding Plan
  • Generate coding plan for human review comments

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.

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.

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.

🧹 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.kt as SUPPORTED_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

📥 Commits

Reviewing files that changed from the base of the PR and between cf203e5 and 9bac9f1.

📒 Files selected for processing (4)
  • stream-chat-android-compose/api/stream-chat-android-compose.api
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/attachments/content/UnsupportedAttachmentContent.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/util/MessageUtils.kt

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarQube Cloud

@gpunto gpunto marked this pull request as ready for review March 16, 2026 15:17
@gpunto gpunto requested a review from a team as a code owner March 16, 2026 15:17
@VelikovPetar VelikovPetar merged commit 82d0ad9 into v7 Mar 16, 2026
15 of 17 checks passed
@VelikovPetar VelikovPetar deleted the redesign/fix-unsupported-attachment branch March 16, 2026 18:04
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