feat: Show offline indicator for files in conversation (WPB-23968)#4846
feat: Show offline indicator for files in conversation (WPB-23968)#4846ohassine wants to merge 24 commits into
Conversation
…to display-offline-files # Conflicts: # features/cells/src/main/java/com/wire/android/feature/cells/ui/CellFileActionsMenu.kt # features/cells/src/main/java/com/wire/android/feature/cells/ui/OfflineFileDownloadController.kt # features/cells/src/main/java/com/wire/android/feature/cells/ui/model/NodeBottomSheetAction.kt # features/cells/src/main/res/drawable/ic_cross_in_circle.xml
# Conflicts: # kalium
# Conflicts: # features/cells/src/main/java/com/wire/android/feature/cells/ui/CellScreenContent.kt
…to display-offline-files # Conflicts: # features/cells/src/main/java/com/wire/android/feature/cells/ui/model/CellNodeUi.kt # kalium
…to display-offline-files
…to show-offline-indicator-for-files-in-conversation # Conflicts: # app/src/main/kotlin/com/wire/android/ui/home/conversations/model/messagetypes/multipart/MultipartAttachmentsViewModel.kt
|
| else -> hiltViewModel<MultipartAttachmentsViewModelImpl>() | ||
| } | ||
| ) { | ||
| val offlineAttachmentIds by viewModel.offlineAttachmentIds.collectAsStateWithLifecycle() |
There was a problem hiding this comment.
Suggestion: do not expose offlineAttachmentIds outside of viewmodel just for mapping.
Add mapAttachment(attachment) method for mapping one attachment and then both mapAttachment/mapAttachments can do the mapping using private offlineAttachmentIds in viewmodel.
| viewModel: MultipartAttachmentsViewModel = when { | ||
| LocalInspectionMode.current -> MultipartAttachmentsViewModelPreview | ||
| else -> hiltViewModel<MultipartAttachmentsViewModelImpl>(key = conversationId.value) | ||
| else -> hiltViewModel<MultipartAttachmentsViewModelImpl>() |
There was a problem hiding this comment.
This change will create one view model per multipart view. Is this intended? This ViewModel was designed as single instance per conversation.
| private val conversationId = savedStateHandle.navArgs<ConversationNavArgs>().conversationId.value | ||
|
|
||
| private val uploadProgress = mutableStateMapOf<String, Float>() | ||
| override val offlineAttachmentIds: StateFlow<Set<String>> = observeOfflineFiles() |
There was a problem hiding this comment.
Should we pass conversationId parameter to observeOfflineFiles(), to limit number of offline files by current conversation.
| */ | ||
| @Composable | ||
| fun MultipartAttachmentsView( | ||
| conversationId: ConversationId, |
There was a problem hiding this comment.
Why the conversationId cannot be passed via view parameters anymore?



https://wearezeta.atlassian.net/browse/WPB-23968
PR Submission Checklist for internal contributors
The PR Title
SQPIT-764The PR Description
What's new in this PR?
Description
Show offline indicator for files available offline in conversation screen
Needs releases with:
Testing
Test Coverage (Optional)
How to Test
Briefly describe how this change was tested and if applicable the exact steps taken to verify that it works as expected.
Notes (Optional)
Specify here any other facts that you think are important for this issue.
Attachments (Optional)
Attachments like images, videos, etc. (drag and drop in the text box)
PR Post Submission Checklist for internal contributors (Optional)
PR Post Merge Checklist for internal contributors
References
feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.