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

Rework the presentation of the media browser quick look view to use SwiftUI. #3619

Merged
merged 6 commits into from
Dec 16, 2024

Conversation

pixlwave
Copy link
Member

@pixlwave pixlwave commented Dec 13, 2024

Now that SwiftUI has a navigationTransition(.zoom(…)) option on iOS 18, putting the QuickLook controller inside our own NavigationStack with the right buttons is better, plus we get the matched animation instead of the preview coming from the button. This means the screen now has a Coordinator and is presented using the same system as the rest of the app. A follow-up will be to rename everything to TimelineMediaPreviewScreen or similar.

A few small hitches:

  • The scroll view is flipped 😒, so the transition thumbnail is too 🫤
  • Interactive dismissal works great on iOS 18.1, but on iOS 18.2 dismissal triggers immediately on dragging down.
  • Embedding a QLPreviewController inside a view doesn't work on macOS, so we'll still need to use the old one for that to look correct.
iOS.18.1.mp4

@pixlwave pixlwave requested a review from a team as a code owner December 13, 2024 17:59
@pixlwave pixlwave requested review from Velin92 and removed request for a team December 13, 2024 17:59
@pixlwave pixlwave force-pushed the doug/media-preview-presentation branch from ef78691 to 443d9df Compare December 13, 2024 18:05
@pixlwave pixlwave added the pr-wip for anything that isn't ready to ship and will be enabled at a later date label Dec 13, 2024
@pixlwave pixlwave changed the title Rework the presentation of the quick look view to use SwiftUI. Rework the presentation of the media browser quick look view to use SwiftUI. Dec 13, 2024
@@ -1581,8 +1581,8 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
MXLog.error("Unable to present room timeline for event \(itemID)")
return
}
stateMachine.tryEvent(.dismissMediaEventsTimeline)
stateMachine.tryEvent(.presentRoom(presentationAction: .eventFocus(.init(eventID: eventID, shouldSetPin: false))))
stateMachine.tryEvent(.presentRoom(presentationAction: .eventFocus(.init(eventID: eventID, shouldSetPin: false))),
Copy link
Member

Choose a reason for hiding this comment

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

couldn't we pass the animation directly in presentRoom as a variable?

Copy link
Member

@stefanceriu stefanceriu left a comment

Choose a reason for hiding this comment

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

🙌

Copy link

codecov bot commented Dec 16, 2024

Codecov Report

Attention: Patch coverage is 29.45736% with 273 lines in your changes missing coverage. Please review.

Project coverage is 78.33%. Comparing base (78aa0e3) to head (6a2309a).
Report is 4 commits behind head on develop.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...s/FilePreviewScreen/TimelineMediaPreviewView.swift 0.00% 155 Missing ⚠️
...reviewScreen/TimelineMediaPreviewCoordinator.swift 0.00% 29 Missing ⚠️
...rdinators/MediaEventsTimelineFlowCoordinator.swift 0.00% 25 Missing ⚠️
...ePreviewScreen/TimelineMediaPreviewViewModel.swift 58.97% 16 Missing ⚠️
...ineScreen/MediaEventsTimelineScreenViewModel.swift 7.69% 12 Missing ⚠️
...urces/Other/SwiftUI/Animation/ZoomTransition.swift 35.71% 9 Missing ⚠️
...imelineScreen/View/MediaEventsTimelineScreen.swift 58.82% 7 Missing ⚠️
...X/Sources/Other/SwiftUI/Views/BlurEffectView.swift 0.00% 6 Missing ⚠️
...wScreen/View/TimelineMediaPreviewDetailsView.swift 88.88% 3 Missing ⚠️
...Sources/FlowCoordinators/RoomFlowCoordinator.swift 0.00% 2 Missing ⚠️
... and 5 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3619      +/-   ##
===========================================
- Coverage    78.39%   78.33%   -0.06%     
===========================================
  Files          782      787       +5     
  Lines        65661    66810    +1149     
===========================================
+ Hits         51472    52336     +864     
- Misses       14189    14474     +285     
Flag Coverage Δ
unittests 70.16% <29.45%> (+0.35%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pixlwave pixlwave merged commit 3a82b88 into develop Dec 16, 2024
13 checks passed
@pixlwave pixlwave deleted the doug/media-preview-presentation branch December 16, 2024 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-wip for anything that isn't ready to ship and will be enabled at a later date
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants