Skip to content

Structure tab: sharp full-page screenshot; page width ignores clipped overflow - #66

Merged
woutervanwijk merged 1 commit into
mainfrom
claude/structure-sharp-tiles
Nov 25, 2026
Merged

woutervanwijk merged 1 commit into
mainfrom
claude/structure-sharp-tiles

Conversation

@woutervanwijk

Copy link
Copy Markdown
Owner

Follow-up to #65. This commit was pushed after #65 had already been merged, so it was left out.

Problems

  • The full-page screenshot looked blurry and low quality on long pages.
  • On some sites (edition.cnn.com) the wireframe and screenshot were drawn at about half the tab width.

Causes and fixes

  • Blur: one stitched image of a long page has to shrink to fit GPU size limits. CNN is 22,277 px tall, so its image came out at 144×8192 px, about 0.4 image px per CSS px. The Structure tab now draws each scroll-through shot as a separate tile at its own page offset. The tiles are decoded within a pixel budget shared across all of them, so long pages stay sharp without unbounded memory. The stitched image is still made for the Size tab thumbnail.
  • Half width: the layout script took scrollWidth as the page width. CNN reports 760 in a 375 px window, but <html> has overflow-x: hidden, so the extra width can't be scrolled to. When <html> or <body> has overflow-x hidden or clip, the page is now as wide as the window.

Testing

  • Layout script tests for overflow-x hidden on html, clip on body, and a page that really scrolls sideways. Painter tests for tile placement.
  • Ran CNN in the real app in a phone-sized macOS window: page width went from 760 to 392, and the rendered wireframe is full width with sharp tiles.

🤖 Generated with Claude Code

… overflow

Draw the scroll-through shots as separate tiles at their page offsets
instead of one stitched image. A stitched image of a long page has to
shrink to fit GPU limits (CNN: 22000 px tall -> 144x8192 px, ~0.4 px
per CSS px), which looked blurry. Tiles are decoded within a pixel
budget across all of them, so a long page stays sharp without using
unbounded memory. The stitched image is still made for the Size tab
thumbnail.

The layout script took scrollWidth as the page width, but content that
sticks out to the right is cut off when <html> or <body> has
overflow-x hidden/clip (CNN: scrollWidth 760 in a 375 px window), so
the wireframe and screenshot were drawn at half width. The page is then
as wide as the window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@woutervanwijk
woutervanwijk merged commit a6c98d4 into main Nov 25, 2026
1 check 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