Skip to content

feat: Show offline indicator for files in conversation (WPB-23968)#4846

Open
ohassine wants to merge 24 commits into
Make-files-available-offlinefrom
show-offline-indicator-for-files-in-conversation
Open

feat: Show offline indicator for files in conversation (WPB-23968)#4846
ohassine wants to merge 24 commits into
Make-files-available-offlinefrom
show-offline-indicator-for-files-in-conversation

Conversation

@ohassine
Copy link
Copy Markdown
Member

@ohassine ohassine commented May 20, 2026

https://wearezeta.atlassian.net/browse/WPB-23968


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Description

Show offline indicator for files available offline in conversation screen

Screenshot_20260518_161250

Needs releases with:

  • GitHub link to other pull request

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

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)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

ohassine added 21 commits May 12, 2026 17:15
…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:
#	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 show-offline-indicator-for-files-in-conversation

# Conflicts:
#	app/src/main/kotlin/com/wire/android/ui/home/conversations/model/messagetypes/multipart/MultipartAttachmentsViewModel.kt
@pull-request-size pull-request-size Bot added size/S and removed size/L labels May 20, 2026
@ohassine ohassine marked this pull request as ready for review May 20, 2026 10:22
@ohassine ohassine requested a review from sbakhtiarov May 20, 2026 10:22
@ohassine ohassine requested a review from yamilmedina May 20, 2026 10:22
@sonarqubecloud
Copy link
Copy Markdown

else -> hiltViewModel<MultipartAttachmentsViewModelImpl>()
}
) {
val offlineAttachmentIds by viewModel.offlineAttachmentIds.collectAsStateWithLifecycle()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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>()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we pass conversationId parameter to observeOfflineFiles(), to limit number of offline files by current conversation.

*/
@Composable
fun MultipartAttachmentsView(
conversationId: ConversationId,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why the conversationId cannot be passed via view parameters anymore?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants