Skip to content

4181 swiping down any amount closes image preview even when zoomed in - #4184

Merged
marinofaggiana merged 3 commits into
masterfrom
4181-swiping-down-any-amount-closes-image-preview-even-when-zoomed-in
Jul 16, 2026
Merged

4181 swiping down any amount closes image preview even when zoomed in#4184
marinofaggiana merged 3 commits into
masterfrom
4181-swiping-down-any-amount-closes-image-preview-even-when-zoomed-in

Conversation

@marinofaggiana

@marinofaggiana marinofaggiana commented Jul 15, 2026

Copy link
Copy Markdown
Member

Summary

Fixes an issue where swiping down would dismiss the image viewer even when the image was zoomed in.

Changes

  • Added zoom state tracking to the image viewer.
  • Prevented the swipe-to-dismiss gesture from starting while the current image is zoomed.
  • Propagated zoom state changes from NCImageZoomView to the media viewer presenter.
  • Introduced a dedicated callback (onZoomChanged) to synchronize zoom state across the viewer hierarchy.

Additional Improvements

  • Refactored NCMediaViewerPageModel into an observable object to allow page state updates without recreating the SwiftUI view hierarchy.
  • Updated page rendering to observe state changes directly instead of rebuilding the hosting view.
  • Preserved SwiftUI view state (including image loading and zoom state) during page updates.
  • Eliminated the visible white flash that could occur while transitioning from placeholder/loading states to the final image, especially with large images and Live Photos.

Result

  • Swiping down no longer dismisses the viewer while the image is zoomed.
  • Image dismissal behaves correctly once the zoom returns to its default scale.
  • Page updates are smoother and no longer recreate the entire view hierarchy.
  • Improved visual stability during image and Live Photo loading.

Signed-off-by: Marino Faggiana <[email protected]>
Signed-off-by: Marino Faggiana <[email protected]>
Signed-off-by: Marino Faggiana <[email protected]>
@marinofaggiana
marinofaggiana merged commit aaae403 into master Jul 16, 2026
5 checks passed
@marinofaggiana
marinofaggiana deleted the 4181-swiping-down-any-amount-closes-image-preview-even-when-zoomed-in branch July 16, 2026 05:12
@marinofaggiana marinofaggiana self-assigned this Aug 3, 2026
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.

Swiping down ANY amount closes image preview, even when zoomed in.

1 participant