Skip to content

fix(zoom): a deep zoom is sharp to the edges of the view, and first under the pointer (ZOOM-EDGES) - #340

Merged
realrobertdouglas merged 1 commit into
mainfrom
claude/trackpad-zoom-edges-b69a81
Dec 2, 2026
Merged

realrobertdouglas merged 1 commit into
mainfrom
claude/trackpad-zoom-edges-b69a81

Conversation

@realrobertdouglas

Copy link
Copy Markdown
Contributor

The report

An estimator, on a trackpad: "the change when the cursor is in the center of the screen is noticable, but not towards the edges of the screen." The change is DEEP-ZOOM's (zoom past 1200%).

What was wrong

The zoom itself holds the point under the pointer at every position. What lagged was the sharpening after it: past the canvas budget the full-page base is soft and pdf-tile-cache.js lays sharp 512 px cells over the view. Measured on the real app (restaurant sheet, about 3000%, Retina density):

window pointer sharp at the centre sharp at the pointer sharp everywhere
1512 x 982 centre 0.7 s 0.7 s 1.8 s
1512 x 982 a corner 0.7 s 1.6 s 2.0 s
1728 x 1117, no navigator.deviceMemory (Safari, Firefox) a corner 0.7 s 2.9 s never, and the grid rastered for good
  1. The cells filled outward from the view's centre, with a 200 ms settle between each.
  2. The sharp window the zoom commit paints first was dropped the moment the soft base landed.
  3. One screen of cells at density 2 can pass the grid's budget; the corner cell was then evicted, rastered and evicted again.

The fix (pdf-tile-cache.js)

  • The cells fill outward from the pointer (ctx.getFocusPoint, state.mousePos), the view's centre when the pointer is off it.
  • A landed cell asks for the next at once.
  • A cell on screen is never evicted; the budget bounds what is kept off screen.
  • rebaseCropTile: where the new base is clamped soft, the commit's sharp window is kept, its box re-authored in the new base's units, until the grid behind it can replace all of it. A sharp base still retires the tile.

After, same measurement: sharp everywhere about 0.3 s after the zoom on every window tried (1512 x 982 to 2560 x 1300), and no raster once the view is whole.

Tests

  • New zoom-edges.spec.js, two tests; both fail on the code before this change.
  • npm run check: 14 of 14.
  • Full Playwright suite locally: 1041 passed, 18 skipped, 2 failed, neither from this change: render-pixels.spec.js is one pixel off the local macOS baseline with or without it (CI reads the linux baseline), and tag-reader.spec.js:73 timed out once under load and passes alone.

Not measured

The estimator's own machine and browser. PUNCHLIST DEEP-ZOOM-CONFIRM already asks for her Save Status export.

Also in this PR

The docs pass since ec29abc: manage-user's set_flags verb and the roster's two new flags (#339) are written down in CHANGELOG.md and AGENTS.md, and ARCHITECTURE.md's pdf-tile-cache.js row no longer says the tile grid lives in app.js.

🤖 Generated with Claude Code

…nder the pointer (ZOOM-EDGES)

An estimator on a trackpad: the change DEEP-ZOOM made showed with the cursor at
the middle of the screen and not toward its edges. The zoom itself was right;
the sharpening after it lagged. Measured on the restaurant sheet at about 3000%,
Retina density: the centre was sharp 0.7 s after the zoom, a pointer at a corner
1.6 to 2.9 s, and on a 1728 x 1117 window without navigator.deviceMemory one
corner never stayed sharp while the grid rastered for good.

pdf-tile-cache.js:
- the tile grid's cells fill outward from the pointer (ctx.getFocusPoint,
  state.mousePos), the view's centre when the pointer is off it
- a landed cell asks for the next at once, not after the 200 ms settle
- a cell on screen is never evicted; the budget bounds what is kept off screen
- rebaseCropTile: where the new base is clamped soft, the commit's sharp window
  is kept, its box re-authored, until the grid behind it can replace all of it

After: sharp everywhere about 0.3 s after the zoom on every window tried.
New zoom-edges.spec.js (both tests fail on the code before).

Also the docs pass since ec29abc: manage-user's set_flags verb and the roster's
two new flags (#339) are written down, and ARCHITECTURE.md's pdf-tile-cache.js
row no longer says the tile grid lives in app.js.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@realrobertdouglas
realrobertdouglas merged commit 777bca3 into main Dec 2, 2026
1 of 5 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