Skip to content

Improve message preview in message menu#6278

Open
gpunto wants to merge 5 commits intov7from
redesign/improve-message-preview-in-message-menu
Open

Improve message preview in message menu#6278
gpunto wants to merge 5 commits intov7from
redesign/improve-message-preview-in-message-menu

Conversation

@gpunto
Copy link
Contributor

@gpunto gpunto commented Mar 20, 2026

Goal

Improve message preview in message menu

Implementation

Add isPreviewMode to change the message appearance when in preview mode (i.e. in the message menu)

🎨 UI Changes

Add relevant screenshots

Before After
Screenshot_20260320_132326 Screenshot_20260320_132253

Testing

Check the message menu for message with annotations and pinned ones (pinned messages already have an annotation)

Summary by CodeRabbit

  • New Features

    • Added preview mode support for messages, providing customized visual presentation and enhanced styling when messages are displayed in message selection menus and other preview contexts.
  • Style

    • Message backgrounds now render with transparency when in preview mode for improved visual hierarchy and clarity.
    • Message annotation colors automatically adjust when in preview mode to enhance text contrast and overall readability.

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

github-actions bot commented Mar 20, 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 Mar 20, 2026

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 5.25 MB 5.68 MB 0.43 MB 🟡
stream-chat-android-ui-components 10.60 MB 10.98 MB 0.38 MB 🟡
stream-chat-android-compose 12.81 MB 12.08 MB -0.73 MB 🚀

@gpunto gpunto marked this pull request as ready for review March 20, 2026 13:11
@gpunto gpunto requested a review from a team as a code owner March 20, 2026 13:11
@coderabbitai
Copy link

coderabbitai bot commented Mar 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 0ff77958-e65a-4f64-8d46-67976856fa01

📥 Commits

Reviewing files that changed from the base of the PR and between d41c055 and 3e77e06.

📒 Files selected for processing (4)
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/selectedmessage/SelectedMessageMenu.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/list/MessageContainer.kt
  • stream-chat-android-ui-common/api/stream-chat-android-ui-common.api
  • stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/state/messages/list/MessageListItemState.kt

Walkthrough

A isPreviewMode boolean property is added to MessageItemState to support preview-mode message rendering. The selected message menu initializes messages with this flag set to true, and the message container adjusts highlight colors and annotation text colors based on this preview state.

Changes

Cohort / File(s) Summary
Core State Model
stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/state/messages/list/MessageListItemState.kt
Added isPreviewMode: Boolean = false property to MessageItemState data class to indicate preview-mode rendering context.
API Definitions
stream-chat-android-ui-common/api/stream-chat-android-ui-common.api
Updated MessageItemState constructor, copy, and synthetic method signatures to include new isPreviewMode parameter; added component15() and isPreviewMode() accessors.
UI Rendering
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/selectedmessage/SelectedMessageMenu.kt, stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/list/MessageContainer.kt
SelectedMessageMenu initializes MessageItemState with isPreviewMode = true; MessageContainer adjusts background color transparency and annotation text colors (annotationContentColor() helper) based on preview mode.

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 A preview mode hops into view,
Messages dressed in their best debut,
Colors shift soft in the menu's embrace,
Annotations glow with newfound grace!
The UI composes a preview array,
Making messages shine in a special way! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% 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 summarizes the main change: improving message preview appearance in the message menu through the addition of isPreviewMode.
Description check ✅ Passed The description covers Goal and Implementation well, includes before/after screenshots, and provides testing guidance, but lacks several required sections like detailed Testing explanation, Contributor Checklist, and complete UI change context.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch redesign/improve-message-preview-in-message-menu
📝 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.

@sonarqubecloud
Copy link

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.

1 participant