Skip to content

Remove UserPresence and default to showing online status#6251

Merged
gpunto merged 1 commit intov7from
rm-userpresence
Mar 16, 2026
Merged

Remove UserPresence and default to showing online status#6251
gpunto merged 1 commit intov7from
rm-userpresence

Conversation

@gpunto
Copy link
Contributor

@gpunto gpunto commented Mar 16, 2026

Goal

Remove UserPresence and default to showing online status. Integrators that want to hide the online status can override the relevant components, e.g. they would override UserAvatar and call super.UserAvatar passing showIndicator = false.

Implementation

Basically what the title says: removed UserPresence and defaulted usages to showing online status.

🎨 UI Changes

No changes

Testing

No changes in the sample

Summary by CodeRabbit

  • Breaking Changes

    • Removed UserPresence configuration model from the public API.
  • Changes

    • Online status indicators in user avatars now consistently display across all screens, removing previous conditional visibility.
    • Simplified member status text display by removing user presence customization options.

@gpunto gpunto added the pr:breaking-change Breaking change label Mar 16, 2026
@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.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 16, 2026

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.03 MB -0.78 MB 🚀

@gpunto
Copy link
Contributor Author

gpunto commented Mar 16, 2026

@coderabbitai 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.

@coderabbitai
Copy link

coderabbitai bot commented Mar 16, 2026

Walkthrough

This pull request removes the UserPresence class and its related online indicator logic, simplifying the codebase by eliminating customizable presence configuration and hardcoding avatar online indicators to always display across UI components.

Changes

Cohort / File(s) Summary
Core Model & API Removal
stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/model/UserPresence.kt, stream-chat-android-ui-common/api/stream-chat-android-ui-common.api
Deleted UserPresence data class and nested DisplayOptions class entirely, removing all public API surface for online presence configuration.
Utility Extensions
stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/utils/extensions/User.kt, stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/util/ChannelUtils.kt
Removed shouldShowOnlineIndicator() extension function and userPresence parameter from getMembersStatusText(), eliminating dynamic presence-based logic.
Theme Configuration
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatTheme.kt, stream-chat-android-compose/api/stream-chat-android-compose.api
Removed userPresence parameter from ChatTheme() public API, deleted LocalUserPresence composition local, and removed public userPresence accessor.
UI Components
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/channel/info/ChannelInfoMemberInfoModalSheet.kt, stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/channel/info/DirectChannelInfoScreen.kt, stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/channel/info/GroupChannelInfoScreen.kt, stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/channels/list/SearchResultItem.kt, stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/channels/ChannelMembersItem.kt, stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/preview/internal/MessagePreviewItem.kt, stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/threads/ThreadItem.kt
Replaced dynamic shouldShowOnlineIndicator() logic with hardcoded showIndicator = true for avatar components; removed related imports across multiple screens and UI items.
Header & Menu Components
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/header/MessageListHeader.kt, stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/channels/info/SelectedChannelMenu.kt
Removed userPresence argument from getMembersStatusText() calls in header subtitle and menu content generation.
Test Cleanup
stream-chat-android-ui-common/src/test/kotlin/io/getstream/chat/android/ui/common/utils/UserPresenceTest.kt
Deleted test file that covered shouldShowOnlineIndicator() functionality with parameterized test cases and helper methods.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 No more presence to track, just indicators bright,
The UserPresence is gone, simplified the sight,
Always show them online with a hardcoded true,
The rabbit hops forward, the code starts anew! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% 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 clearly and concisely summarizes the main change: removing UserPresence and defaulting to showing online status. It is specific, descriptive, and directly reflects the primary objective of the changeset.
Description check ✅ Passed The description covers the goal, implementation, and testing sections but lacks comprehensive details. UI Changes section only states 'No changes', and Testing only mentions 'No changes in the sample'. Several required checklist items are unchecked.

✏️ 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 rm-userpresence
📝 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 generate a title for your PR based on the changes.

Add @coderabbitai placeholder anywhere in the title of your PR and CodeRabbit will replace it with a title based on the changes in the PR. You can change the placeholder by changing the reviews.auto_title_placeholder setting.

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/api/stream-chat-android-compose.api`:
- Line 3125: ChatTheme's signature has removed the UserPresence parameter
(breaking change); update the repository docs by adding an entry under the
stream-chat-android-compose section in CHANGELOG.md in the ❌ Removed subsection
describing that ChatTheme no longer accepts UserPresence and that callers should
use UserAvatar with the showIndicator parameter instead, and add a new
MIGRATION_TO_V7.md that gives concrete migration steps showing how to replace
code paths that passed UserPresence to ChatTheme with equivalent UserAvatar
configuration (reference symbol ChatTheme, previously-present UserPresence, and
replacement UserAvatar::showIndicator) so users upgrading know exactly how to
adapt their code.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 3bc22ca0-e9d1-4e59-b97f-19bc3471a373

📥 Commits

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

📒 Files selected for processing (16)
  • stream-chat-android-compose/api/stream-chat-android-compose.api
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/channel/info/ChannelInfoMemberInfoModalSheet.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/channel/info/DirectChannelInfoScreen.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/channel/info/GroupChannelInfoScreen.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/channels/info/SelectedChannelMenu.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/channels/list/SearchResultItem.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/channels/ChannelMembersItem.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/header/MessageListHeader.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/preview/internal/MessagePreviewItem.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatTheme.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/threads/ThreadItem.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/util/ChannelUtils.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/model/UserPresence.kt
  • stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/utils/extensions/User.kt
  • stream-chat-android-ui-common/src/test/kotlin/io/getstream/chat/android/ui/common/utils/UserPresenceTest.kt
💤 Files with no reviewable changes (8)
  • stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/model/UserPresence.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/util/ChannelUtils.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/channels/info/SelectedChannelMenu.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/header/MessageListHeader.kt
  • stream-chat-android-ui-common/src/test/kotlin/io/getstream/chat/android/ui/common/utils/UserPresenceTest.kt
  • stream-chat-android-ui-common/api/stream-chat-android-ui-common.api
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatTheme.kt
  • stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/utils/extensions/User.kt

@gpunto gpunto marked this pull request as ready for review March 16, 2026 12:25
@gpunto gpunto requested a review from a team as a code owner March 16, 2026 12:25
@sonarqubecloud
Copy link

@gpunto gpunto enabled auto-merge (squash) March 16, 2026 16:12
@gpunto gpunto merged commit 8660d8d into v7 Mar 16, 2026
15 checks passed
@gpunto gpunto deleted the rm-userpresence branch March 16, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:breaking-change Breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants