Skip to content

Snapshot page: images at their own size with zoom, a draggable slider, comments in every view - #25

Merged
ndbroadbent merged 2 commits into
mainfrom
snapshot-zoom
Dec 2, 2026
Merged

ndbroadbent merged 2 commits into
mainfrom
snapshot-zoom

Conversation

@ndbroadbent

Copy link
Copy Markdown
Member

Nathan's three asks on the snapshot page. (Was #14, stacked on #7; GitHub closed it when #7 merged and deleted its branch.)

1. Images at their own size, with zoom. Phone screenshots were stretched to half the page's width each, which made the page enormously long.

  • An image is never shown larger than its own size: its pixels divided by the capture scale, read from names like …-2x and @2x, else 1.
  • Fit (the default) also keeps it within the screen's height below the review bar, down to 360px wide so a tall phone page stays readable. Each column is at most as wide as its image and the pair is centred, so two phone shots sit side by side at about phone size.
  • Zoom (Fit, 100%, 200%) is in the review bar, z cycles it, and a click on an image zooms in and keeps the clicked point under the pointer (Fit → 100%, or 200% if it's already at its own size; another click goes back to Fit). Both sides and the diff share it, and an image zoomed past its column scrolls sideways.
  • The same sizing in every mode: side by side, diff, slider, baseline, this build.

2. The slider.

  • Press anywhere on the image and drag: the divider follows, with a grab handle on the line and ew-resize over the image.
  • Touch works: vertical swipes still scroll the page.
  • With focus, the arrow keys move it (Shift for bigger steps, Home and End).
  • The range input at the bottom is gone; Swipe/Fade and the sizes moved to the caption.
  • The PDF compare tool uses the same slider (SliderStage).

3. Comments in every mode.

  • The hint: "Click for a point, drag for an area." is centred in the page's header while comment mode is on, no longer under the Comment button.
  • Diff: comments go on this build's image.
  • Slider: a comment goes on the image where the press starts. Each side's pin layer is clipped at the divider, a drag stays on the side it started on, and a press on the line counts as this build. While comment mode is on, a press on the image comments, and the divider moves by its handle or the arrow keys (the hint says so). In Fade, comments go on this build.
  • Baseline / This build: comments go on the image shown.
  • Pins are always in that image's own pixels. Each side's pin layer is sized to its image's share of the canvas, so pins land in the same place in every mode, and pins of both sides show in Diff and Slider.

Tests:

  • comment-pins.test.tsx: a pin made in each mode lands on the right image at the right pixels; in the slider, the clips follow the divider, a press while commenting doesn't move it, and the handle and arrow keys still do; without comment mode, a press moves it, a drag follows, and there's no range input; the hint shows only in comment mode.
  • zoom.test.ts: capture scale, widths never above the image's own size, and click zoom steps.

Checked on the dev server (headless, 1440×900 light and dark, and 390×844), with the demo's phone pair (dashboard/390-light) and desktop pair:

  • the phone pair shows at its own 195px with the page one screen tall;
  • the desktop pair fits its columns;
  • the slider drags and stops on release;
  • click-zoom works;
  • nothing is wider than 390 on a phone;
  • images load from the agents VM.

Review: the snapshot page screenshots change (the zoom control in the review bar; images at their own size; the slider's handle and caption, with no range input).

From #14's review (build 110):

  • A slider-view screenshot (app/snapshot/slider, after the other snapshot pages, since a ?mode= link is remembered), so the handle and the missing range input are covered. ?mode= now takes every view, Baseline and This build included.
  • A page only one side has (inserted or removed) keeps the pair centred: the empty side takes the other side's width.
  • get_snapshot's images doc breaks between sentences, not mid-sentence.
… from -2x/@2x names), fitted to the screen by default, with Fit/100%/200% zoom (z, or click an image) shared by every view; the slider's divider follows a press anywhere on the image, with a grab handle, touch and arrow keys, and no range input (also in the PDF compare tool); comments in every view (diff: this build; slider: the side where the press starts, the divider by its handle while commenting; baseline and this build: the image shown), with the hint centred in the page header
… takes every view (baseline and this build too); a page only one side has keeps the pair centred (the empty side takes the other's width); get_snapshot's images doc breaks between sentences
@visualci-com

visualci-com Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

VisualCI

docspring/visualci · build #120 · 18 changed, 8 added, 275 unchanged · approved by visualci coordinator agent (MCP) for Nathan Broadbent

24 snapshot-page screenshot changes (pdf, image, new slider), already reviewed; the two tools-list JSON snapshots carry main's matches wording plus the intended line-break move in get_snapshot's images description (PR #7 review).

This PR vs base: 18 changed, 8 added since #119, across 1 build

Snapshot Before After
screenshots/app/snapshot/image/1440-dark (changed)
screenshots/app/snapshot/image/1440-dark-2x (changed)
screenshots/app/snapshot/image/1440-light (changed)
screenshots/app/snapshot/image/1440-light-2x (changed)
screenshots/app/snapshot/image/390-dark (changed)
screenshots/app/snapshot/image/390-dark-2x (changed)
screenshots/app/snapshot/image/390-light (changed)
screenshots/app/snapshot/image/390-light-2x (changed)
and 18 more in the build

Updated as builds change. Agents can review with VisualCI's MCP tools.

@ndbroadbent
ndbroadbent merged commit adb4955 into main Dec 2, 2026
10 checks passed
@ndbroadbent
ndbroadbent deleted the snapshot-zoom branch December 2, 2026 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant