Skip to content

Add ability to pin DM channels#6313

Merged
VelikovPetar merged 3 commits intov7from
pin-channel-fix
Mar 30, 2026
Merged

Add ability to pin DM channels#6313
VelikovPetar merged 3 commits intov7from
pin-channel-fix

Conversation

@gpunto
Copy link
Copy Markdown
Contributor

@gpunto gpunto commented Mar 30, 2026

Goal

The pin action is not visible for 1:1 channels

Implementation

  • Add the action in buildDmChannelActions
  • Update pin-related strings to be consistent with the other ones, e.g. use Pin Chat/Group instead of Pin Channel

🎨 UI Changes

None

Testing

Check that 1:1 chats can be pinned and unpinned

Summary by CodeRabbit

  • Improvements
    • Refined pin/unpin channel actions with improved contextual clarity. Direct message and group conversations now display distinct pin/unpin labels tailored to their conversation type, enhancing clarity when managing pinned channels.

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

github-actions bot commented Mar 30, 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
Copy Markdown
Contributor

github-actions bot commented Mar 30, 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.99 MB 0.39 MB 🟡
stream-chat-android-compose 12.81 MB 12.11 MB -0.70 MB 🚀

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

coderabbitai bot commented Mar 30, 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: 82a0d7ee-efed-415b-a074-cd7ae20f5342

📥 Commits

Reviewing files that changed from the base of the PR and between 18dbf19 and 8d84d92.

📒 Files selected for processing (2)
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/channels/ChannelOptions.kt
  • stream-chat-android-compose/src/main/res/values/strings.xml

Walkthrough

The changes introduce channel type-specific pin/unpin actions in the channel options menu. A new DM-specific action builder was added, the existing pin action builder was refactored to group-specific, and string resources were updated to distinguish between DM ("Chat") and group terminology.

Changes

Cohort / File(s) Summary
Channel Options UI Actions
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/channels/ChannelOptions.kt
Added buildDmPinAction for DM-specific pin/unpin behavior; renamed buildPinAction to buildGroupPinAction for group-specific handling. Both builders use the same visibility logic (isPinned().takeIf { canPinChannel }) but invoke appropriate viewModel methods and display channel-type-specific labels.
String Resources
stream-chat-android-compose/src/main/res/values/strings.xml
Renamed generic pin/unpin channel strings to chat-scoped labels (..._pin_chat, ..._unpin_chat); added new group-scoped labels (..._pin_group, ..._unpin_group) to support distinct terminology for DM and group channels.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 DMs and groups, now talking their own way,
Pin actions dancing in the channel's display!
One path for chats, another for the crew,
Labels that clarify what's old and what's new.
Stream hops forward with precision and grace! 🌿

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.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 clearly and concisely summarizes the main change: adding pin capability to DM channels, which aligns with the code changes introducing DM-specific pin/unpin actions.
Description check ✅ Passed The description covers the Goal and Implementation sections well. However, it lacks required checklist items and testing details, though the minimal UI changes and testing instructions are appropriately noted.

✏️ 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 pin-channel-fix

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
Copy Markdown

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarQube Cloud

@VelikovPetar VelikovPetar enabled auto-merge (squash) March 30, 2026 20:42
@VelikovPetar VelikovPetar merged commit fcb183b into v7 Mar 30, 2026
18 of 20 checks passed
@VelikovPetar VelikovPetar deleted the pin-channel-fix branch March 30, 2026 21:14
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.

2 participants