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

feat: multiple image preview [WPB-8801] #3004

Merged
merged 20 commits into from
May 27, 2024
Merged

Conversation

Garzas
Copy link
Contributor

@Garzas Garzas commented May 15, 2024

TaskWPB-8801 [Android] preview images and files when sending them through files button


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?

  • asset file preview to show generic file description in asset preview screen
  • asset tile preview for images, generic files and only extension preview
  • support for multiple images/files selection
  • support for legal hold for multiple messages in preview and import media
  • support for sending already handled AttachmentPickedBundle and not handled UriPickedBundle
  • removed unnecessary imported media models
  • divided imported and remote asset composables for better readability
  • fixed mock image for previews (without borders)

TODO

  • better handling screen navigation after messages sent errors
  • show dialog when one of messages are too big (models are already prepared)
  • removing asset functionality in import media screen
  • show too large file indicator in import media previews

Attachments (Optional)


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.

Copy link

Ups 🫰🟨

This PR is too big. Please try to break it up into smaller PRs.

Copy link
Contributor

github-actions bot commented May 15, 2024

Test Results

931 tests  ±0   931 ✅ ±0   12m 21s ⏱️ +26s
124 suites ±0     0 💤 ±0 
124 files   ±0     0 ❌ ±0 

Results for commit 2ad8796. ± Comparison against base commit c4d8002.

♻️ This comment has been updated with latest results.

@AndroidBob
Copy link
Collaborator

Build 4745 failed.

@codecov-commenter
Copy link

codecov-commenter commented May 15, 2024

Codecov Report

Attention: Patch coverage is 34.75177% with 92 lines in your changes are missing coverage. Please review.

Project coverage is 44.36%. Comparing base (c4d8002) to head (2ad8796).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3004      +/-   ##
===========================================
+ Coverage    44.29%   44.36%   +0.07%     
===========================================
  Files          448      450       +2     
  Lines        14519    14517       -2     
  Branches      2493     2497       +4     
===========================================
+ Hits          6431     6441      +10     
+ Misses        7385     7366      -19     
- Partials       703      710       +7     
Files Coverage Δ
.../ui/home/conversations/MessageComposerViewState.kt 84.84% <100.00%> (+4.84%) ⬆️
...conversations/messages/item/MessageTypesPreview.kt 0.00% <ø> (ø)
.../conversations/messages/item/RegularMessageItem.kt 0.00% <ø> (ø)
...ndroid/ui/home/conversations/model/MessageTypes.kt 85.00% <ø> (ø)
...droid/ui/home/messagecomposer/AttachmentOptions.kt 0.00% <ø> (ø)
...ions/model/messagetypes/asset/AssetMessageTypes.kt 0.00% <0.00%> (ø)
...com/wire/android/util/ui/WireSessionImageLoader.kt 19.23% <0.00%> (ø)
...onversations/media/preview/ImagesPreviewNavArgs.kt 0.00% <0.00%> (ø)
...e/android/util/permission/UseStorageRequestFlow.kt 0.00% <0.00%> (ø)
...oid/ui/home/messagecomposer/model/MessageBundle.kt 77.77% <0.00%> (-9.73%) ⬇️
... and 10 more

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c4d8002...2ad8796. Read the comment docs.

Copy link
Contributor

APKs built during tests are available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator

Build 4747 succeeded.

The build produced the following APK's:

VerticalSpace.x16()
Text(
assetName,
style = MaterialTheme.wireTypography.title02.copy(color = MaterialTheme.colorScheme.onBackground),
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: do not apply color to the style, apply it directly to the Text

Comment on lines 71 to 74
style = MaterialTheme.wireTypography.title01.copy(
fontWeight = FontWeight.W900,
color = MaterialTheme.colorScheme.onPrimary
)
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: it would be better to create a dedicated one in WireTypography as for instance designs may want to make the font size different than title01 on other screen sizes, especially when this custom typography is already used twice (also in AssetExtensionPreviewTile)

Copy link
Contributor

@alexandreferris alexandreferris left a comment

Choose a reason for hiding this comment

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

Amazing work 👏🏻

I just have some either question comments or nitpick comments

}
}
}

private suspend fun sendMessages(messageBundleList: List<MessageBundle>) {
val jobs: MutableCollection<Job> = mutableListOf()
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we need to somehow cancel this jobs?

A possible test to run:

  • send max number of images possible (try with big 4k images, so it takes time)
  • while they are being sent, log out and login again to same account
  • double check if you have any can't access DB issue

Multiple times we had this issue was because of logout and login again but keeping some old jobs

app/src/main/res/values/strings.xml Outdated Show resolved Hide resolved
@AndroidBob
Copy link
Collaborator

Build 4777 failed.

@AndroidBob
Copy link
Collaborator

Build 4778 failed.

Copy link
Contributor

@alexandreferris alexandreferris left a comment

Choose a reason for hiding this comment

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

Nice improvements!

Just one small change and good to go from my side 💪🏻

Copy link
Contributor

APKs built during tests are available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator

Build 4780 succeeded.

The build produced the following APK's:

@AndroidBob
Copy link
Collaborator

Build 4996 failed.

Copy link

sonarcloud bot commented May 27, 2024

Quality Gate Passed Quality Gate passed

Issues
6 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@Garzas Garzas enabled auto-merge May 27, 2024 11:54
@Garzas Garzas added this pull request to the merge queue May 27, 2024
Copy link
Contributor

APKs built during tests are available here. Scroll down to Artifacts!

Merged via the queue into develop with commit 7f02ec4 May 27, 2024
13 of 14 checks passed
@Garzas Garzas deleted the feat/multiple-image-preview branch May 27, 2024 12:17
@AndroidBob
Copy link
Collaborator

Build 4998 succeeded.

The build produced the following APK's:

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.

5 participants