Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
4034b0b
Introduce Add PollResultsViewController to manage the state and logic…
andremion Dec 12, 2025
3989fd7
Extract a reusable ViewModelStore composable
andremion Dec 12, 2025
54ca195
Refactor PollViewResultDialog to use ViewModel
andremion Dec 12, 2025
7107206
Fix PollViewResultDialog that was cutting the last option items. Usin…
andremion Dec 15, 2025
d7d2250
Refactor PollResultsViewState
andremion Dec 15, 2025
6d2c40e
Handle poll results loading error
andremion Dec 15, 2025
cfec094
Refactor PollResultsViewState
andremion Dec 15, 2025
5328bad
Refactor: Move Sort poll options by vote count and winner calculation…
andremion Dec 15, 2025
0b5a31b
Refactor: Removes unused error previews and simplifies poll sorting l…
andremion Dec 15, 2025
dae1d97
Add XML `PollResultsViewModel`
andremion Dec 15, 2025
d2b4f28
Refactor PollResultsDialogFragment to use ViewModel
andremion Dec 15, 2025
cceeeb1
Refactor PollResultsDialogFragment creation
andremion Dec 15, 2025
b9bb3e7
apiDump
andremion Dec 15, 2025
6011107
Fix poll answer avatar borders
andremion Dec 15, 2025
db8ee58
Refactor poll results screen
andremion Dec 16, 2025
352a01b
Use Crossfade in poll dialogs
andremion Jan 12, 2026
9c6c0cc
Update paparazzi tests
andremion Jan 12, 2026
25db00d
Add poll option results ViewModel
andremion Jan 12, 2026
ae4dba2
Initial poll option results XML UI
andremion Jan 12, 2026
f5d612b
Align the loading more UI
andremion Jan 13, 2026
9cd7396
Update PollResultsViewControllerTest
andremion Jan 13, 2026
490d665
Add PollOptionResultsViewControllerTest
andremion Jan 13, 2026
b33cc12
Rename to PollOptionVotes
andremion Jan 13, 2026
5c7899b
Make PollOptionVotesViewModel internal
andremion Jan 13, 2026
3a2fd98
Fix lint
andremion Jan 13, 2026
87de408
Fix poll memory leak
andremion Jan 13, 2026
b3da083
Rename to PollOptionVotes
andremion Jan 13, 2026
3c16d64
Fix poll vote dialog crash
andremion Jan 13, 2026
660c3e4
Fix NPE in poll dialogs
andremion Jan 14, 2026
04efee7
Fix test case name
andremion Jan 14, 2026
01687f5
Fix recycled-view corruption when vote.user is null.
andremion Jan 14, 2026
a52a788
Refactor PollVoteItem composable
andremion Jan 14, 2026
4d5060d
Remove poll results events
andremion Jan 14, 2026
d21ec5f
Fix poll votes list layout
andremion Jan 14, 2026
c5ceba2
apiDump
andremion Jan 14, 2026
5ed4650
Extract applyEdgeToEdgePadding extension
andremion Jan 14, 2026
6a4bea0
Fix edge-to-edge in poll dialogs
andremion Jan 14, 2026
29036a5
CHANGELOG
andremion Jan 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,29 +51,35 @@
### ⬆️ Improved

### ✅ Added
- Add poll results + poll option votes state/controllers to support pagination and error handling.

### ⚠️ Changed

### ❌ Removed

## stream-chat-android-ui-components
### 🐞 Fixed
- Fix poll results sheet cutting off the last option items.
- Fix poll dialogs layout on edge-to-edge devices by applying system bar insets.

### ⬆️ Improved

### ✅ Added
- Add XML poll option votes dialog with pagination support.

### ⚠️ Changed

### ❌ Removed

## stream-chat-android-compose
### 🐞 Fixed
- Fix poll results sheet cutting off the last option items.

### ⬆️ Improved
- Increase default search debounce period to 300ms. [#6076](https://github.com/GetStream/stream-chat-android/pull/6076)

### ✅ Added
- Add Compose poll option votes dialog with pagination support.

### ⚠️ Changed

Expand Down
28 changes: 26 additions & 2 deletions stream-chat-android-compose/api/stream-chat-android-compose.api
Original file line number Diff line number Diff line change
Expand Up @@ -1945,13 +1945,30 @@ public final class io/getstream/chat/android/compose/ui/components/poll/Composab
public final fun getLambda-3$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
}

public final class io/getstream/chat/android/compose/ui/components/poll/ComposableSingletons$PollOptionVotesDialogKt {
public static final field INSTANCE Lio/getstream/chat/android/compose/ui/components/poll/ComposableSingletons$PollOptionVotesDialogKt;
public static field lambda-1 Lkotlin/jvm/functions/Function2;
public static field lambda-2 Lkotlin/jvm/functions/Function3;
public static field lambda-3 Lkotlin/jvm/functions/Function3;
public static field lambda-4 Lkotlin/jvm/functions/Function2;
public static field lambda-5 Lkotlin/jvm/functions/Function2;
public static field lambda-6 Lkotlin/jvm/functions/Function2;
public fun <init> ()V
public final fun getLambda-1$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda-2$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function3;
public final fun getLambda-3$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function3;
public final fun getLambda-4$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda-5$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda-6$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
}

public final class io/getstream/chat/android/compose/ui/components/poll/ComposableSingletons$PollViewResultDialogKt {
public static final field INSTANCE Lio/getstream/chat/android/compose/ui/components/poll/ComposableSingletons$PollViewResultDialogKt;
public static field lambda-1 Lkotlin/jvm/functions/Function3;
public static field lambda-1 Lkotlin/jvm/functions/Function2;
public static field lambda-2 Lkotlin/jvm/functions/Function3;
public static field lambda-3 Lkotlin/jvm/functions/Function2;
public fun <init> ()V
public final fun getLambda-1$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function3;
public final fun getLambda-1$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda-2$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function3;
public final fun getLambda-3$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
}
Expand Down Expand Up @@ -5120,6 +5137,13 @@ public final class io/getstream/chat/android/compose/viewmodel/messages/Messages
public fun create (Ljava/lang/Class;)Landroidx/lifecycle/ViewModel;
}

public final class io/getstream/chat/android/compose/viewmodel/messages/PollResultsViewModel : androidx/lifecycle/ViewModel {
public static final field $stable I
public fun <init> (Lio/getstream/chat/android/models/Poll;Lkotlin/jvm/functions/Function1;)V
public synthetic fun <init> (Lio/getstream/chat/android/models/Poll;Lkotlin/jvm/functions/Function1;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun getState ()Lkotlinx/coroutines/flow/StateFlow;
}

public final class io/getstream/chat/android/compose/viewmodel/pinned/PinnedMessageListViewModel : androidx/lifecycle/ViewModel {
public static final field $stable I
public fun <init> (Lio/getstream/chat/android/ui/common/feature/pinned/PinnedMessageListController;)V
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,11 @@ import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Scaffold
import androidx.compose.material3.VerticalDivider
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.key
import androidx.compose.runtime.movableContentOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
Expand All @@ -48,9 +46,6 @@ import androidx.compose.ui.layout.onSizeChanged
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.unit.IntOffset
import androidx.compose.ui.unit.IntSize
import androidx.lifecycle.ViewModelStore
import androidx.lifecycle.ViewModelStoreOwner
import androidx.lifecycle.viewmodel.compose.LocalViewModelStoreOwner
import androidx.lifecycle.viewmodel.compose.viewModel
import io.getstream.chat.android.client.api.models.QueryThreadsRequest
import io.getstream.chat.android.compose.state.channels.list.ItemState
Expand All @@ -66,6 +61,7 @@ import io.getstream.chat.android.compose.ui.theme.ChatComponentFactory
import io.getstream.chat.android.compose.ui.theme.ChatTheme
import io.getstream.chat.android.compose.ui.theme.CompoundComponentFactory
import io.getstream.chat.android.compose.ui.threads.ThreadList
import io.getstream.chat.android.compose.ui.util.ViewModelStore
import io.getstream.chat.android.compose.ui.util.adaptivelayout.AdaptiveLayoutConstraints
import io.getstream.chat.android.compose.ui.util.adaptivelayout.AdaptiveLayoutInfo
import io.getstream.chat.android.compose.ui.util.adaptivelayout.ThreePaneDestination
Expand Down Expand Up @@ -771,37 +767,6 @@ private fun InfoPane(
}
}

/**
* Creates a new [ViewModelStore] whenever the provided keys change.
*/
@Composable
private inline fun ViewModelStore(
vararg keys: Any?,
crossinline content: @Composable () -> Unit,
) {
// Restart composition on every new combination of values
key(keys) {
// Create a fresh ViewModelStore on each new composition
val viewModelStore = remember { ViewModelStore() }
val viewModelStoreOwner = remember(viewModelStore) {
object : ViewModelStoreOwner {
override val viewModelStore: ViewModelStore get() = viewModelStore
}
}

// Ensure the store is cleared when the composition is disposed
DisposableEffect(Unit) {
onDispose {
viewModelStore.clear()
}
}

CompositionLocalProvider(LocalViewModelStoreOwner provides viewModelStoreOwner) {
content()
}
}
}

private class DefaultMessagesViewModelFactoryProvider : MessagesViewModelFactoryProvider {
override fun invoke(context: Context, selection: ChatMessageSelection): MessagesViewModelFactory? =
if (selection.channelId == null) {
Expand Down
Loading
Loading