Skip to content

feat: multiple media selection on Drive conversations - WPB-24046#4613

Open
jullianm wants to merge 17 commits intodevelopfrom
feat/drive-multiple-media-selection
Open

feat: multiple media selection on Drive conversations - WPB-24046#4613
jullianm wants to merge 17 commits intodevelopfrom
feat/drive-multiple-media-selection

Conversation

@jullianm
Copy link
Copy Markdown
Contributor

@jullianm jullianm commented Apr 22, 2026

TaskWPB-24046 [iOS] Improve sending multiple images on iOS

Issue

Currently user has to select each image from the gallery (custom and native one) one by one and approve it in full screen view.

This PR introduces changes to allow the user to frictionlessly upload multiple media at once.

Overview

  • On selection of assets from the custom gallery (at the bottom), assets are now directly attached - no full screen confirmation.
  • Multiple assets can be selected and they are easily identifiable from the custom gallery (checkmarked). They can be deselected which automatically removes the related drafts from the preview.
  • Full screen confirmation now only opens on tap of the attached asset (image or video)
  • When the asset (image) is edited on that confirmation screen, it updates the attached asset.
  • The native PHPickerViewController is introduced to allow multiple media selection (previously UIImagePickerController was used)

Testing

Wire drive conversations

  • Hit camera icon button
  • Select multiple media image / video, observe that full screen confirmation screen no longer opens but selected media are directly attached and uploaded.
  • Hit “files” icon button, select multiple files and validate.
  • In the input bar, tap on image attachment, it now opens full screen confirmation, edit the image (draw something), tap “OK”, attachment image will be upated. Tapping “OK” or “Cancel” on an un-edited image will simply dimiss the screen
  • Tap again on that updated attachment to check that asset has been correctly updated.
  • Tap on a video attachment, observe that it opens the same full screen view, “OK” or “Cancel” simply dismisses the screen.
  • Tap on file attachment, observe that it doesn’t open anything..
  • In the media scrollable view, hit the “Gallery” icon button, it should open the native gallery screen allowing multiple media selection
  • Select multiple media (videos/images), validate and observe selected media are correctly attached.
  • Take a picture with the camera, observe that the draft is correctly attached
  • Remove some attachments and attach new media based on the previous use cases to ensure drafts behaviour is preserved.

Non-Wire drive conversations (non regression test)

  • Behaviour should be as before as nothing was changed for these conversations.

Checklist

  • Title contains a reference JIRA issue number like [WPB-XXX].
  • Description is filled and free of optional paragraphs.
  • Adds/updates automated tests.

UI accessibility checklist

If your PR includes UI changes, please utilize this checklist:

  • Make sure you use the API for UI elements that support large fonts.
  • All colors are taken from WireDesign.ColorTheme or constructed using WireDesign.BaseColorPalette.
  • New UI elements have Accessibility strings for VoiceOver.

@jullianm jullianm requested review from a team, David-Henner, WilhelmOks and netbe and removed request for a team April 22, 2026 15:15
@jullianm jullianm requested a review from OlivellaO April 22, 2026 15:16
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 22, 2026

Test Results

4 552 tests   4 525 ✅  7m 40s ⏱️
  601 suites     27 💤
    3 files        0 ❌

Results for commit 35d830e.

♻️ This comment has been updated with latest results.

Summary: workflow run #25305822495
Allure report (download zip): html-report-29641-feat_drive-multiple-media-selection

@jullianm jullianm requested review from johnxnguyen April 27, 2026 09:58
Copy link
Copy Markdown
Collaborator

@johnxnguyen johnxnguyen left a comment

Choose a reason for hiding this comment

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

Looks good, left a couple questions.

Comment on lines +76 to +77
guard error == nil, let url else { return }
self.uploadFiles(at: [url])
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

question: does the temp directory need to be cleanup here too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I extracted the legacy code into a separated reusable function here however you might be right.. I'll check it

Comment thread WireMessaging/Sources/WireMessagingUI/Utilities/Array+SafeIndex.swift Outdated
@jullianm jullianm removed request for David-Henner and netbe May 6, 2026 08:30
}
if useWireDrive(), sourceType != .camera {
// Allows multiple media selection on Wire drive conversations.
// Non-drive conversations use the (legacy) `UIImagePickerController` API.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

question: would it be possible to use PHPicker on other conversations? I know it might be out of scope, but just wonder how big would be the change? maybe on a separate PR?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes it would be possible but only for photos: PHPickerViewController doesn't handle camera.
The UIImagePickerController handles both.

We'll always end up with two different APIs to use however it might make more sense to use the PHPickerViewController for photos (all conversations) and continue to use UIImagePickerController (or another API) only for camera.

I don't think this would be too difficult to change (separated task / PR).


let draft = WireDriveDraft(
nodeID: UUID(),
nodeID: nodeID ?? UUID(),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If we need an UUID to create a WireDriveDraft, why is it not mandatory on the invoke function?
Maybe there is a reason for it but I would prefer to avoid nullability and avoid assigning this UUID in different places (default value on SendableImage & ConversationInputBarViewController if provided by draft object).
We could remove the default value on SendableImage and if draft.nodeId is null just use UUID()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this is optional because sometimes the draft doesn't exist and we create it from scratch, and sometimes it does and we want to update it. I agree the naming is confusing here, I will find something better.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done, the naming is a bit more explicit and gives more context on why it can be optional.

Copy link
Copy Markdown
Collaborator

@OlivellaO OlivellaO left a comment

Choose a reason for hiding this comment

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

Approved with question

…ed drafts uploads (native picker) adjust send button in edition screen
Copy link
Copy Markdown
Collaborator

@WilhelmOks WilhelmOks left a comment

Choose a reason for hiding this comment

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

LGTM. Added a few comments.

…m/wireapp/wire-ios into feat/drive-multiple-media-selection
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Test Results – WireMessagingAll

302 tests   302 ✅  1m 3s ⏱️
 59 suites    0 💤
  1 files      0 ❌

Results for commit 690ac06.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Test Results – Wire-iOS

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
0 files    0 ❌

Results for commit 690ac06.

♻️ This comment has been updated with latest results.

@jullianm
Copy link
Copy Markdown
Contributor Author

jullianm commented May 6, 2026

@netbe @johnxnguyen @WilhelmOks @OlivellaO FYI, I made some improvements / fixes following the PT, these are visible in this single commit: 700d393

  • Handle drafts selection/deselection on the custom picker: making it visible to the user (checkmark icon) and automatically synchronizing it with the draft preview (when asset is deselected, the draft preview is automatically removed)
  • Prevent duplicated drafts uploads from the native picker
  • Adjust send button in edition screen

Feel free to review it if you want.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 6, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Test Results – WireUIAll

161 tests   160 ✅  1m 14s ⏱️
 41 suites    1 💤
  1 files      0 ❌

Results for commit 690ac06.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Test Results – WireDataModel

2 377 tests   2 377 ✅  3m 49s ⏱️
  245 suites      0 💤
    1 files        0 ❌

Results for commit 690ac06.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants