Zoom the document, and grab it to move it

Featurekamo-internal
Shipped
August 14, 2026 at 5:38 PM UTC
Author
kamo
Commit
4ab33fb

A floating capsule in the bottom-right of the document pane: −, the current percentage, +. The READOUT IS THE RESET — a separate reset button would be a third control for something the member only wants once they can already see they are not at 100%, and where they look to check is the number. It is a real button with a label, so keyboard and screen readers reach it. 100% means FIT-TO-PANE, not actual size. `zoom` multiplies the fit-width scale PdfPages already computes, and the view the member started in is what they mean when they press "100%". Steps are multiplicative (x1.25), not ±0.25: a fixed step is a quarter of the page at 100% and a sixteenth of it at 400%, so zooming back out from far in would take a dozen presses. The maths is in app/lib/pdfZoom.ts with tests, including that + then − returns exactly where you were and that a NaN falls back to fit rather than reaching PdfPages as `scale = naturalScale * NaN`, which renders zero pages and looks precisely like the document failing to load. DRAG TO PAN, anywhere that is not something you operate. useDragToPan writes scrollLeft/scrollTop rather than transforming the content, so it inherits the container's bounds, scrollbars and wheel behaviour for free — and the horizontal axis simply does nothing until the page is wider than the pane, with no condition anywhere to say so. It refuses to start on input, textarea, select, button, a[href], label, [role=radiogroup] and the rest: those are the signature boxes, text fields and checkbox groups InteractiveField renders, and the zoom capsule's own buttons. The pointer is captured on the way down so a drag that leaves the pane keeps tracking and still ends cleanly. MOUSE ONLY. Touch already pans natively with momentum and rubber-banding that no handler here can reproduce, and hijacking it would make the document worse on the devices where dragging is the natural gesture. One layout fix comes with this: PdfPages centres pages with `align-items: center`, and a flex item wider than its container overflows EQUALLY on both sides — the left half of which no scroll position can reach. Zooming past the pane width would have put the left margin of every page permanently out of reach. The page wrapper now grows to the widest page (`width: fit-content`, floored at `min-width: 100%`), so the whole sheet stays inside the scrollable area.

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing