Skip to content

fix(chat): keep a zoomed photo on screen when the finger lifts - #1751

Merged
bmc08gt merged 1 commit into
code/cashfrom
fix/chat-photo-zoom-blackout
Oct 10, 2026
Merged

bmc08gt merged 1 commit into
code/cashfrom
fix/chat-photo-zoom-blackout

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

The chat photo viewer goes black after a pinch, or after any drag while zoomed.

The event that lifts the last finger has no pointer still down, so calculateCentroid() returns Offset.Unspecified (NaN, NaN). The zoomed branch of the viewer's gesture loop passed it to ChatMediaZoomState.transform, which made the offset NaN. clampOffset keeps NaN, so the graphicsLayer translation moved the photo out of view. A double tap brought it back because zooming out resets the offset to zero.

transform now ignores an unspecified focus. ChatMediaZoomTest.transformIgnoresTheLiftEventsMissingCentroid covers the lift event and failed with a NaN offset before the change.

A single tap on the photo now hides or shows the close and share buttons. They fade over 200ms (instantly with reduced motion) and stop taking taps as soon as they are hidden; ChatPhotoMediaUiTest.singleTapTogglesTheButtons covers the toggle. Because the same tap detector handles double-tap zoom, a single tap waits out the double-tap timeout before the buttons change.

The viewer goes black after a pinch, or after any drag while zoomed.
The event that lifts the last finger has no pointer still down, so
calculateCentroid() returns Offset.Unspecified (NaN, NaN). The zoomed
branch passed it to ChatMediaZoomState.transform, which made the offset
NaN; clampOffset keeps NaN, and the graphicsLayer translation moved the
photo out of view. A double tap brought it back because zooming out
resets the offset to zero.

transform now ignores an unspecified focus. ChatMediaZoomTest covers the
lift event: it failed with a NaN offset before the change.

A single tap on the photo now hides or shows the close and share
buttons. They fade over 200ms (instantly with reduced motion) and stop
taking taps as soon as they are hidden. Because the tap detector also
handles double taps, a single tap waits out the double-tap timeout
before toggling.
@bmc08gt bmc08gt self-assigned this Oct 10, 2026
@github-actions github-actions Bot added the type: fix Bug fix label Oct 10, 2026
@bmc08gt
bmc08gt merged commit 141e59c into code/cash Oct 10, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant