Skip to content

Structure tab: page-width wireframe on full-page screenshot, reveal element in DOM tree and source - #62

Merged
woutervanwijk merged 1 commit into
mainfrom
claude/webpage-explorer-structure-63cfb8
Nov 18, 2026
Merged

woutervanwijk merged 1 commit into
mainfrom
claude/webpage-explorer-structure-63cfb8

Conversation

@woutervanwijk

Copy link
Copy Markdown
Owner

What

Structure tab improvements on top of #61:

  • Wireframe at page width (max 1000 px) — drawn 1:1 with the page, centred in the tab, horizontally scrollable when wider (was shrunk to fit the tab plus a 6000 px height cap).
  • Full-page screenshot as background — takeScreenshot only captures the viewport, so at page-settle the live browser is scrolled viewport-by-viewport (max 50 shots) and the shots are stitched into one tall image (lib/services/screenshot_stitch.dart); scroll position is restored. Drawn fully opaque behind the wireframe; the structure overlay is 75% transparent so the page shows through. Falls back to the viewport thumbnail over the first screen (e.g. Linux, where screenshots are unsupported).
  • Element reveal from the block sheet — "Open in DOM tree" and "Open in source" now work for elements without an id: matched by tag/id/classes plus occurrence in document order (DomReveal, findNodeBySignature, lineOfSignature). Source scrolls to the element's line; DOM tree expands ancestors, opens the node one level, scrolls exactly to it (large finite cacheExtent during the reveal so the lazy sliver builds the row) and highlights the row like a selected line in the Source view.
  • Pull-to-refresh removed from all tab pages (the RefreshIndicator wrappers in HomeScreen).

Verification

  • flutter analyze clean.
  • flutter test: 1678 tests pass, incl. new coverage for occurrenceOfBlock/lineOfSignature, findNodeBySignature, stitchScreenshots, the sheet buttons, and the DOM reveal (scroll-into-view + one-level open + highlight on a tall document).

Caveats

  • Full-page stitching is best-effort: position: fixed elements repeat at seams; very tall pages are capped at 50 viewport shots.
  • Signature matching assumes the displayed source closely matches the rendered DOM; with diverged server HTML the reveal can land on the nearest similar element.

…lement in DOM tree and source

- Wireframe drawn at page width (max 1000 px), centred, horizontally
  scrollable when wider than the tab (was shrunk to fit + 6000 px cap).
- Full-page screenshot of the live browser as the wireframe background:
  captured at settle by scrolling viewport-by-viewport and stitching the
  shots (screenshot_stitch.dart); drawn opaque, structure overlay 75%
  transparent. Falls back to the viewport thumbnail over the first screen.
- Block details sheet: "Open in DOM tree" and "Open in source" buttons that
  work for elements without an id too (matched by tag/id/classes plus
  occurrence in document order); source scrolls to the element's line.
- DOM tree reveal: expands ancestors, opens the node one level, scrolls
  exactly to it (large finite cacheExtent during the reveal) and highlights
  the row like a selected line in the Source view.
- Pull-to-refresh removed from all tab pages.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
@woutervanwijk
woutervanwijk merged commit 5d1e181 into main Nov 18, 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