Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AND-17] Add Channel Pinning and Channel Archive options #5513

Merged
merged 11 commits into from
Dec 12, 2024

Conversation

JcMinarro
Copy link
Member

@JcMinarro JcMinarro commented Dec 10, 2024

🎯 Goal

Add new options over channels to allow pinning and archiving action over them.

🎨 UI Changes

Before After
image image

🧪 Testing

After apply the patch, the channels list will be sort showing on the first position pinned channels, following by unread channels and then the rest of them

Patch
Subject: [PATCH] crash investigation
---
Index: stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/ui/ChannelsActivity.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/ui/ChannelsActivity.kt b/stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/ui/ChannelsActivity.kt
--- a/stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/ui/ChannelsActivity.kt	(revision 1486f30abfebfaef0ccc97baefb6e13e0b5e71c5)
+++ b/stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/ui/ChannelsActivity.kt	(date 1733914998573)
@@ -62,6 +62,8 @@
 import io.getstream.chat.android.compose.ui.channels.list.ChannelItem
 import io.getstream.chat.android.compose.ui.channels.list.ChannelList
 import io.getstream.chat.android.compose.ui.components.SearchInput
+import io.getstream.chat.android.compose.ui.components.channels.ChannelOptionItemVisibility
+import io.getstream.chat.android.compose.ui.theme.ChannelOptionsTheme
 import io.getstream.chat.android.compose.ui.theme.ChatTheme
 import io.getstream.chat.android.compose.ui.threads.ThreadList
 import io.getstream.chat.android.compose.viewmodel.channels.ChannelListViewModel
@@ -81,7 +83,9 @@
     private val listViewModelFactory by lazy {
         ChannelViewModelFactory(
             ChatClient.instance(),
-            QuerySortByField.descByName("last_updated"),
+            QuerySortByField
+                .descByName<Channel>("pinned_at")
+                .desc("last_updated"),
             null,
         )
     }
@@ -109,6 +113,11 @@
             ChatTheme(
                 dateFormatter = ChatApp.dateFormatter,
                 autoTranslationEnabled = ChatApp.autoTranslationEnabled,
+                channelOptionsTheme = ChannelOptionsTheme(
+                    ChannelOptionItemVisibility(
+                        isPinChannelVisible = true,
+                    ),
+                ),
                 allowUIAutomationTest = true,
             ) {
                 Scaffold(

@JcMinarro JcMinarro force-pushed the and-17-channel-pinning-archiving branch from a51de57 to 1486f30 Compare December 11, 2024 11:03
@JcMinarro JcMinarro changed the title And 17 channel pinning archiving [AND-17] Add Channel Pinning and Channel Archive options Dec 11, 2024
@JcMinarro JcMinarro marked this pull request as ready for review December 11, 2024 12:32
@JcMinarro JcMinarro requested a review from a team as a code owner December 11, 2024 12:32
@JcMinarro JcMinarro force-pushed the and-17-channel-pinning-archiving branch from b8c7d46 to f7f67d9 Compare December 11, 2024 12:47
Copy link
Contributor

@VelikovPetar VelikovPetar left a comment

Choose a reason for hiding this comment

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

Left a minor comment concerning some logs, but otherwise looks good to me!

@JcMinarro JcMinarro enabled auto-merge (squash) December 12, 2024 00:24
@JcMinarro JcMinarro force-pushed the and-17-channel-pinning-archiving branch from f7f67d9 to e62d9c2 Compare December 12, 2024 00:24
@JcMinarro JcMinarro merged commit 9cf8391 into develop Dec 12, 2024
9 checks passed
@JcMinarro JcMinarro deleted the and-17-channel-pinning-archiving branch December 12, 2024 00:30
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