Skip to content

Fix missing click handler on thread root#6229

Open
gpunto wants to merge 1 commit intov7from
fix/thred-root-click
Open

Fix missing click handler on thread root#6229
gpunto wants to merge 1 commit intov7from
fix/thred-root-click

Conversation

@gpunto
Copy link
Contributor

@gpunto gpunto commented Mar 9, 2026

Goal

In #6218 I moved the click handling for threads from the message to the annotation. However, that only applies for thread replies. Thread roots should still handle the click.

Implementation

Call onThreadClick when the message is a thread root.

🎨 UI Changes

None

Testing

Try opening a thread by clicking on the root

Summary by CodeRabbit

  • Bug Fixes
    • Enabled clicking on thread start messages in the message list to navigate to the corresponding thread conversation. Long-click behavior remains unchanged.

@gpunto gpunto added the pr:bug Bug fix label Mar 9, 2026
@github-actions
Copy link
Contributor

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

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 5.25 MB 5.69 MB 0.44 MB 🟡
stream-chat-android-ui-components 10.60 MB 11.00 MB 0.40 MB 🟡
stream-chat-android-compose 12.81 MB 12.03 MB -0.78 MB 🚀

@gpunto gpunto marked this pull request as ready for review March 9, 2026 14:40
@gpunto gpunto requested a review from a team as a code owner March 9, 2026 14:40
@gpunto gpunto marked this pull request as draft March 9, 2026 14:40
@coderabbitai
Copy link

coderabbitai bot commented Mar 9, 2026

Walkthrough

A file modification that introduces thread-click functionality to MessageContainer by adding conditional logic to its onClick handler, calling onThreadClick(message) for thread-start messages while preserving existing long-click behavior.

Changes

Cohort / File(s) Summary
Thread Click Handler
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/list/MessageContainer.kt
Added isThreadStart import and modified onClick handler to conditionally invoke onThreadClick(message) for thread-start messages, replacing previous no-op behavior.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A click upon a thread so fine,
Now flow and logic intertwine,
One small condition makes it right,
MessageContainer sees the light! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.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: fixing the missing click handler on thread root messages in the MessageContainer component.
Description check ✅ Passed The description covers the Goal, Implementation, and Testing sections adequately, though it lacks UI Changes details and the full Contributor Checklist items.

✏️ 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 fix/thred-root-click

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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/list/MessageContainer.kt`:
- Line 169: The current onClick in MessageContainer calls onThreadClick whenever
message.isThreadStart(), causing taps inside the thread screen to trigger
leaveThread; change MessageContainer to only invoke onThreadClick for thread
roots when it is rendered in the channel-list context by adding a boolean prop
(e.g., isInThreadScreen or isChannelList) and gate the call: onClick = { if
(message.isThreadStart() && !isInThreadScreen) onThreadClick(message) }. Update
callers (including MessageList) to pass the appropriate flag and adjust the
default onThreadClick/leaveThread wiring so tapping a root inside the thread
screen no longer fires leaveThread.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: fc5c816f-2ef3-4918-aa6b-60dbae70482d

📥 Commits

Reviewing files that changed from the base of the PR and between dd111d5 and f5dabbc.

📒 Files selected for processing (1)
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/list/MessageContainer.kt

@gpunto gpunto force-pushed the fix/thred-root-click branch from f5dabbc to 6e82ed4 Compare March 9, 2026 15:35
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 9, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
C Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@gpunto gpunto marked this pull request as ready for review March 9, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:bug Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant