Skip to content

Scope typing indicators to the channel or the thread the user is typing in - #6915

Merged
gpunto merged 2 commits into
developfrom
feature/scoped-typing
Oct 30, 2026
Merged

gpunto merged 2 commits into
developfrom
feature/scoped-typing

Conversation

@gpunto

@gpunto gpunto commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Goal

Typing in a thread showed up in the channel, the channel list and the channel header, and a thread had no typing state of its own. The React, React Native and Flutter SDKs already scope typing to where the user types.

Closes AND-1754

Implementation

  • Channel typing ignores typing starts sent from a thread. A typing stop clears the user wherever it was sent, since the composer sends it from whichever mode it is in when typing ends.
  • New ThreadState.typing, fed to the active threads with the same 7s expiry as channel typing.
  • MessageListController.typingUsers and the XML ChannelHeaderViewModel.typingUsers report the thread typers in thread mode and the channel typers otherwise.

Testing

  • Unit tests cover the channel handlers, thread typing (start, stop, other threads, expiry), routing to active threads, and the controller in thread mode.
  • On the compose sample, with a second user typing over REST: thread typing shows only in that thread, channel typing only in the channel list and the channel, and the thread indicator expires on its own.

Summary by CodeRabbit

  • New Features
    • Thread state now exposes typing activity from other users, and message lists and channel headers show typing users for the active thread.
  • Bug Fixes
    • Typing in a thread no longer appears as channel-level typing. Thread typing starts and stops are reflected in the relevant thread, including when a stop event references a different thread.

@gpunto gpunto added the pr:improvement Improvement label Oct 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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, or the PR is bot-authored.
  • An issue is linked (Linear ticket or GitHub issue), or the PR is bot-authored.

🎉 Great job! This PR is ready for review.

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 6.25 MB 6.25 MB 0.00 MB 🟢
stream-chat-android-ui-components 11.57 MB 11.59 MB 0.01 MB 🟢
stream-chat-android-compose 13.25 MB 13.25 MB 0.00 MB 🟢
stream-chat-android-ai-compose 2.20 MB 2.20 MB 0.00 MB 🟢
stream-chat-android-ai-ondevice 1.67 MB 1.67 MB 0.00 MB 🟢

@gpunto
gpunto marked this pull request as ready for review October 29, 2026 16:12
@gpunto
gpunto requested a review from a team as a code owner October 29, 2026 16:12
@gpunto
gpunto enabled auto-merge October 29, 2026 16:12
@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4cf23e59-f937-48fa-9d15-5c2de37bbd70
Commits

Reviewing files that changed from the base of the PR and between 9cd4102 and 89584fd.

Files selected for processing: 19
  • stream-chat-android-client/api/stream-chat-android-client.api
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api/state/ThreadState.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/internal/state/event/handler/internal/EventHandlerSequential.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/internal/state/plugin/logic/channel/internal/ChannelEventHandlerImpl.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/internal/state/plugin/logic/channel/internal/legacy/ChannelEventHandlerLegacyImpl.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/internal/state/plugin/logic/channel/thread/internal/ThreadLogic.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/internal/state/plugin/logic/internal/LogicRegistry.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/internal/state/plugin/state/channel/thread/internal/ThreadMutableState.kt
  • stream-chat-android-client/src/test/java/io/getstream/chat/android/client/internal/state/channel/controller/WhenHandleEvent.kt
  • stream-chat-android-client/src/test/java/io/getstream/chat/android/client/internal/state/event/handler/internal/EventHandlerSequentialThreadTypingTest.kt
  • stream-chat-android-client/src/test/java/io/getstream/chat/android/client/internal/state/plugin/listener/internal/ThreadQueryListenerStateTest.kt
  • stream-chat-android-client/src/test/java/io/getstream/chat/android/client/internal/state/plugin/logic/channel/internal/ChannelEventHandlerImplTest.kt
  • stream-chat-android-client/src/test/java/io/getstream/chat/android/client/internal/state/plugin/logic/channel/internal/legacy/ChannelEventHandlerLegacyImplTest.kt
  • stream-chat-android-client/src/test/java/io/getstream/chat/android/client/internal/state/plugin/logic/channel/thread/internal/ThreadLogicJumpPageTest.kt
  • stream-chat-android-client/src/test/java/io/getstream/chat/android/client/internal/state/plugin/logic/channel/thread/internal/ThreadLogicTest.kt
  • stream-chat-android-client/src/test/java/io/getstream/chat/android/client/internal/state/plugin/logic/channel/thread/internal/ThreadLogicTypingTest.kt
  • stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/feature/messages/list/MessageListController.kt
  • stream-chat-android-ui-common/src/test/kotlin/io/getstream/chat/android/ui/common/feature/messages/list/MessageListControllerTests.kt
  • stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/viewmodel/messages/ChannelHeaderViewModel.kt

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Walkthrough

The client now exposes typing state for each thread. It routes typing events from other users to active threads, applies matching typing starts, and removes users on typing stops. Channel typing handlers exclude thread-scoped starts. The message list and channel header select channel or thread typing users based on their active mode or thread ID. Tests cover event routing, state updates, expiration, and UI selection.

Priority: Normal

Merge Risk: Minimal · up to 89584

This change scopes typing indicators to the channel or the thread where the user is typing. No actionable merge-blocking risk remains after review.

Pre-merge checks: Passed 4 · Failed 1

Failed 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%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title states the main change: typing indicators are scoped to either the channel or the thread where the user types. It matches the raw summary (channel typing ignores thread starts, new ThreadSta…
Description check Passed The description follows the template sections (Goal, Implementation, Testing). The Goal explains the problem and links the issue AND-1754. Implementation lists the channel-handler, ThreadState.typing,…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title states the main change: typing indicators are scoped to either the channel or the thread where the user types. It matches the raw summary (channel typing ignores thread starts, new ThreadState.typing, and mode-based routing of typingUsers) and the PR objectives. It is specific and descriptive, so it is not vague.

Full details: Description check

Explanation

The description follows the template sections (Goal, Implementation, Testing). The Goal explains the problem and links the issue AND-1754. Implementation lists the channel-handler, ThreadState.typing, and typingUsers changes, which match the raw summary. Testing lists unit tests and a manual compose-sample check. The Checklist section from the template is missing, so the checklist items (issue linked, tests/docs updated, Stream CLA signed) are not marked. The description covers the required content, so the check passes. The author should add the checklist section to match the template.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 18 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

A rabbit watches typers hop,
Thread by thread, their names pop.
Starts arrive and stops depart,
State flows onward, neat and smart.
Channel views switch when threads appear,
The rabbit nibbles, pleased and clear.

Comment @coderabbitai help to get the list of available commands.

@andremion andremion left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. One small API note inline.

@sonarqubecloud

Copy link
Copy Markdown

@andremion andremion left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@gpunto
gpunto added this pull request to the merge queue Oct 30, 2026
Merged via the queue into develop with commit 7fdd92c Oct 30, 2026
26 checks passed
@gpunto
gpunto deleted the feature/scoped-typing branch October 30, 2026 11:30
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