Skip to content

Conversation

@gpunto
Copy link
Contributor

@gpunto gpunto commented Jan 20, 2026

🎯 Goal

Introduce the contextual menu content & item components.

🛠 Implementation details

For the time being, this is just the menu content itself and there is no behavior associated to it, e.g. it's not acting as a popup out of the box, but can be used in one.

🎨 UI Changes

Figma

Screenshot 2026-01-20 at 17 37 48

🧪 Testing

It's not used yet, but you can check the @Preview

☑️Contributor Checklist

General

  • I have signed the Stream CLA (required)
  • Assigned a person / code owner group (required)
  • Thread with the PR link started in a respective Slack channel (#android-chat-core or #android-chat-ui) (required)
  • PR is linked to the GitHub issue it resolves

Code & documentation

  • Changelog is updated with client-facing changes
  • New code is covered by unit tests
  • Comparison screenshots added for visual changes
  • Affected documentation updated (KDocs, docusaurus, tutorial)

☑️Reviewer Checklist

  • UI Components sample runs & works
  • Compose sample runs & works
  • UI Changes correct (before & after images)
  • Bugs validated (bugfixes)
  • New feature tested and works
  • Release notes and docs clearly describe changes
  • All code we touched has new or updated KDocs
  • Check the SDK Size Comparison table in the CI logs

🎉 GIF

Please provide a suitable gif that describes your work on this pull request

Summary by CodeRabbit

  • New Features
    • Added a contextual menu component for Android Compose with support for disabled and destructive item states.
    • Extended color palette with additional colors for improved theming flexibility.
    • Introduced new styling tokens for enhanced design customization.

✏️ Tip: You can customize this high-level summary in your review settings.

@github-actions
Copy link
Contributor

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 5.25 MB 5.25 MB 0.00 MB 🟢
stream-chat-android-offline 5.48 MB 5.48 MB 0.00 MB 🟢
stream-chat-android-ui-components 10.62 MB 10.61 MB -0.01 MB 🚀
stream-chat-android-compose 12.84 MB 11.70 MB -1.14 MB 🚀

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarQube Cloud

@gpunto
Copy link
Contributor Author

gpunto commented Jan 21, 2026

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Jan 21, 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.

@coderabbitai
Copy link

coderabbitai bot commented Jan 21, 2026

Walkthrough

This PR introduces a new contextual menu UI component for Android Compose alongside supporting theme enhancements. A new ContextualMenu.kt file adds three composables: ContextualMenuContent for styling, ContextualMenuItem for individual menu items with state-based styling, and ContextualMenuDivider for dividers. The theme system is extended with two new colors and one new design token.

Changes

Cohort / File(s) Summary
New Contextual Menu Component
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/common/ContextualMenu.kt
New internal UI component providing ContextualMenuContent (styled Surface wrapper), ContextualMenuItem (configurable row with optional leading/trailing icons, enabled/destructive states, and dynamic color computation), and ContextualMenuDivider (horizontal divider with theming). Includes preview composables for development.
Theme Enhancements
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/StreamColors.kt, stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/StreamTokens.kt
Added two public color properties to StreamColors (textSecondary, backgroundElevationElevation2) and two primitive colors (neutral300, slate700). Added new borderStrokeSubtle token (1.2.dp) to StreamTokens for border styling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Menus pop up with contextual grace,
New colors paint the UI space,
Subtle borders, tokens bright,
Compose components take their flight! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% 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 'Introduce contextual menu content & item' directly and specifically summarizes the main change—adding new contextual menu UI components.
Description check ✅ Passed The description includes Goal, Implementation details, and UI Changes sections with a Figma link and screenshot. Testing section explains preview availability. However, the GIF section is incomplete (not provided), and several contributor/reviewer checklist items are unchecked.

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

✨ Finishing touches
  • 📝 Generate docstrings

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.

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.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/StreamColors.kt`:
- Around line 175-179: Add KDoc comments for the new public constructor
properties textSecondary and backgroundElevationElevation2 in the StreamColors
class: document textSecondary as "Used for secondary text color (e.g., captions,
metadata)" and backgroundElevationElevation2 as "Used for elevated surface
backgrounds at elevation level 2"; place the KDoc immediately above the
corresponding public val declarations so they appear in generated docs. Also add
a brief note in the StreamColors class KDoc or PR description that adding these
required constructor parameters is a source/binary-breaking change for consumers
who instantiate StreamColors(...) directly and confirm this is intentional.
🧹 Nitpick comments (1)
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/common/ContextualMenu.kt (1)

129-145: Use StreamPreview helper for Compose previews.

This preview should use the repo’s StreamPreview helper instead of the plain @Preview annotation. As per coding guidelines, Compose previews should use StreamPreview helpers.

♻️ Proposed change
-@Preview(showBackground = true)
+@StreamPreview(showBackground = true)

Comment on lines 175 to +179
public val textPrimary: Color,
public val textSecondary: Color,
public val stateBgDisabled: Color,
public val stateTextDisabled: Color,

public val backgroundElevationElevation2: Color,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# First, find and read the StreamColors.kt file to understand the full structure
fd -n "StreamColors.kt" --type f

Repository: GetStream/stream-chat-android

Length of output: 303


🏁 Script executed:

#!/bin/bash
# Find the StreamColors.kt file
fd "StreamColors.kt" --type f

Repository: GetStream/stream-chat-android

Length of output: 173


🏁 Script executed:

#!/bin/bash
# Read the full StreamColors.kt file to understand the structure and KDoc
cat -n stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/StreamColors.kt

Repository: GetStream/stream-chat-android

Length of output: 28262


🏁 Script executed:

#!/bin/bash
# Find direct StreamColors constructor usage that may require updates
rg -n --type=kt 'StreamColors\s*\(' | head -50

Repository: GetStream/stream-chat-android

Length of output: 99


🏁 Script executed:

#!/bin/bash
# Find direct StreamColors constructor usage
rg -n 'StreamColors\s*\(' --type=kotlin | head -50

Repository: GetStream/stream-chat-android

Length of output: 553


🏁 Script executed:

#!/bin/bash
# More thorough search for any StreamColors instantiation patterns
rg -n 'StreamColors' --type=kotlin -C 2 | grep -E '(StreamColors\(|\.copy\(|= StreamColors)' | head -100

Repository: GetStream/stream-chat-android

Length of output: 712


🏁 Script executed:

#!/bin/bash
# Check if there are any test files that might instantiate StreamColors directly
fd -e ".kt" | xargs rg -l "StreamColors" | xargs rg 'StreamColors\s*\([^)]*='

Repository: GetStream/stream-chat-android

Length of output: 57


🏁 Script executed:

#!/bin/bash
# Search for StreamColors instantiation in test files and other locations
find . -name "*.kt" -type f | xargs grep -l "StreamColors(" | xargs grep -A 5 "StreamColors("

Repository: GetStream/stream-chat-android

Length of output: 1298


Add KDoc for new public parameters.

The textSecondary and backgroundElevationElevation2 parameters are missing KDoc. Per coding guidelines, all public APIs must be documented with KDoc. Add documentation explaining the purpose of each parameter:

  • textSecondary: Brief description of its use case (e.g., "Used for secondary text color")
  • backgroundElevationElevation2: Brief description of its use case (e.g., "Used for elevated surface backgrounds")

Additionally, note that adding required constructor parameters is a source/binary-breaking change for external consumers who instantiate StreamColors(...) directly. Confirm this is intentional.

🤖 Prompt for AI Agents
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/StreamColors.kt`
around lines 175 - 179, Add KDoc comments for the new public constructor
properties textSecondary and backgroundElevationElevation2 in the StreamColors
class: document textSecondary as "Used for secondary text color (e.g., captions,
metadata)" and backgroundElevationElevation2 as "Used for elevated surface
backgrounds at elevation level 2"; place the KDoc immediately above the
corresponding public val declarations so they appear in generated docs. Also add
a brief note in the StreamColors class KDoc or PR description that adding these
required constructor parameters is a source/binary-breaking change for consumers
who instantiate StreamColors(...) directly and confirm this is intentional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants