Registry Mirror
Skip to content

Conversation

@backnotprop

Copy link
Copy Markdown
Owner

The Inbox's image viewer (beside the thread, full screen, and on phones) now zooms and pans the same way the image lightbox does since #2074. It uses the lightbox's ImageZoomStage.

Gestures:

  • Ctrl/⌘ + wheel and trackpad pinch zoom about the pointer. Safari's pinch works too. The page itself never zooms, including over the size bar.
  • A plain wheel scrolls an image that is larger than the stage, and zooms an image that fits.
  • Mouse drag or one finger pans. Two fingers pinch.
  • Double click (or double tap) toggles Fit and 2× Fit.
  • The range is Fit to 800%. The size bar shows the scale next to Fit / Actual size, and those buttons reset it.
  • ← → and ] [ always step files, zoomed or not. The image no longer claims the arrow keys. When the stage has focus, ↑ ↓, Page Up/Down, Home/End and Space pan it.
  • On a phone, a one-finger horizontal swipe still steps only when the image is at Fit.
  • The pane still remembers Fit / Actual size per file. Zoom from a gesture is not remembered, so a step opens at Fit.
  • A tall screenshot fits its width and starts at the top. A panorama fits its height and starts at the left. You can pinch out to see the whole image.
  • When you select a comment with a drawing, the drawing is drawn over the image with the same transform. It stays aligned at any zoom or pan, and the zoom is kept.

ImageZoomStage gets optional seams: fitAxis, padding, overlay, onImageLoad and onImageError. The lightbox passes none of them and is unchanged. The guides.show manifest did not change.

Tests:

  • New DOM tests for the Inbox view: wheel zoom about the pointer, limits, plain wheel, Fit and Actual size reset, drag, double click, pinch, one-finger pan, the drawing overlay following zoom and pan, tall and wide Fit, swipe only at Fit, and no page zoom over the bar.
  • A stepping DOM test now checks that → and ] step from a zoomed or Actual-size image, and that ↓ pans it.
  • Pure tests for the new zoom math.
  • The Chromium e2e on the compiled binary checks that the pixel under the pointer stays put on Ctrl + wheel, that a drag pans by the pointer's travel, that ← steps while zoomed, that a panorama pans from edge to edge, that the drawing overlay matches the image at full screen, and that a double tap zooms on an iPhone (WebKit).
  • The worst-case panorama check now measures the transformed image.

The Inbox's file viewer now uses ui's ImageZoomStage: Ctrl/Cmd + wheel and
trackpad pinch zoom about the pointer, drag or one finger pans, two fingers
pinch, double click toggles Fit and 2x, Fit to 800%, the scale shown in the
size bar. Arrow keys always step files. A comment's drawing is drawn over
the image in its transform. ImageZoomStage gains optional fitAxis, padding,
overlay, onImageLoad and onImageError seams; the lightbox is unchanged.
… after the annotator loads

The stage padding is read again when the phone breakpoint is crossed, and
ImageZoomStage refits when its padding or fit axis changes. The e2e waited
only for the annotator canvas to be visible, so it drew on the 300x150
default canvas; it now waits for the loaded image, draws around the total,
and checks the drawing's pixels land on that spot on screen at Fit and zoomed.
… against the stage

Leaving full screen brings the list back with a spring; for about 300 ms the
stage moves and resizes. The test read the stage box once and dragged while it
was still moving, so on CI the drag read as -77 px instead of -120. It now
waits until the stage holds still, measures the image relative to the stage,
keeps the drag within the room the image has, and polls for the last move.
@backnotprop
backnotprop merged commit 8a7fc08 into main Oct 22, 2026
29 checks passed
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.

1 participant