-
Notifications
You must be signed in to change notification settings - Fork 302
Expose CreatePollScreen
and fix state restoration
#5958
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
base: develop
Are you sure you want to change the base?
Expose CreatePollScreen
and fix state restoration
#5958
Conversation
SDK Size Comparison 📏
|
…l_screen_and_fix_state_restoration
CreatePollScreen
and fix state restoration.CreatePollScreen
and fix state restoration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR exposes the CreatePollScreen
composable as a standalone component and fixes state restoration issues for poll creation across orientation changes.
- Extracts
CreatePollScreen
from the attachment picker factory into a standalone composable - Implements a
CreatePollViewModel
with proper state management for configuration preservation - Adds visual improvements by highlighting selected tab icons for Poll and Location attachments
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
CreatePollScreen.kt | New standalone composable extracted from attachment picker factory |
CreatePollViewModel.kt | New ViewModel handling poll creation state with proper lifecycle management |
CreatePollViewModelTest.kt | Comprehensive test suite for the new ViewModel |
CreatePollViewModelFactory.kt | Factory for creating ViewModel instances with configuration switches |
AttachmentsPickerPollTabFactory.kt | Refactored to use the new CreatePollScreen composable |
AttachmentsPicker.kt | Updated to use ViewModel state instead of local remember state |
LocationPickerTabFactory.kt | Added highlighted icon for selected state |
stream-chat-android-compose.api | API surface addition for the new public CreatePollScreen function |
CHANGELOG.md | Documentation of the new feature and bug fix |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...n/java/io/getstream/chat/android/compose/ui/messages/attachments/poll/CreatePollViewModel.kt
Show resolved
Hide resolved
...n/java/io/getstream/chat/android/compose/ui/messages/attachments/poll/CreatePollViewModel.kt
Show resolved
Hide resolved
...src/main/java/io/getstream/chat/android/compose/ui/messages/attachments/AttachmentsPicker.kt
Show resolved
Hide resolved
…reate_poll_screen_and_fix_state_restoration' into feature/AND-831_AND_832_expose_create_poll_screen_and_fix_state_restoration
…l_screen_and_fix_state_restoration # Conflicts: # CHANGELOG.md
|
🎯 Goal
CreatePollScreen
so that it can used independently from theAttachmentsPickerPollTabFactory
🛠 Implementation details
CreatePollScreen
as a standalone composableCreatePollViewModel
and move all state management fromCreatePollScreen
to theViewModel
AttachmentsPicker
composable: Now reads the selected state from the viewModel instead of usingremember
Poll
andLocation
attachments🎨 UI Changes
before.mp4
after.mp4
🧪 Testing
Poll
tab