Repository navigation
feat(ui): zoom an enlarged picture on its own, closing it only on purpose - #510
Merged
Merged
Conversation
…pose An enlarged card picture had no zoom of its own, so a pinch zoomed the whole page, and the picture often closed under it: moving about the zoomed page counted as a scroll, and the end of a pinch could count as a tap. A reader pinching back out to see the whole picture found it back in the card instead. The enlarged copy now takes every touch on its layer and zooms itself. A pinch zooms it about the fingers, up to four times its fit, and a pinch out past the fit springs back to it. A double tap zooms in on the spot tapped and another goes back to the fit; a drag moves it while zoomed in, settling where it covers the most of the viewport. A single tap, Escape, or a throw up or down, far or fast enough, puts it back, and a pinch or a drag never does. A single tap waits a moment for a second one, held while a finger is down so a slow double tap still zooms in. Reduced motion keeps every change instant, as the stylesheet already stops the transitions. Closes: #508
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
An enlarged card picture had no zoom of its own. A pinch zoomed the whole page, and the picture often closed in the middle of it. Moving around the zoomed page counted as a scroll, which closed it, and the end of a pinch could count as a tap on the dimmed layer. Someone who pinched back out to see the whole picture found it back in the card instead.
The enlarged picture now takes every touch on its layer and zooms by itself:
The gestures are covered in
ZoomableImage.test.tsx, including regression tests for the gesture bugs found while building it.docs/user-guide.mdanddocs/data-model.mddescribe the new behavior.Not yet tried on a real iOS device; the gestures are tested with simulated touch events. Zooming with the mouse wheel on desktop is left as a possible follow-up.
Closes: #508