Skip to content

feat(import): use element boxes of the imported site in the layout shift model - #569

Merged
fogrew merged 3 commits into
developfrom
feature/173-import-element-boxes
Nov 10, 2026
Merged

fogrew merged 3 commits into
developfrom
feature/173-import-element-boxes

Conversation

@fogrew

@fogrew fogrew commented Nov 10, 2026

Copy link
Copy Markdown
Owner

Closes #173

The bookmarklet and the extension now collect the boxes of visible headings, paragraphs, list items, quotes and buttons (tag, up to 400 characters of text, font size, box width, indent, margins, padding, line height, plus the capture viewport width). They are sanitized field by field, kept in memory after the user accepts the import, and used as the document blocks of the layout shift prediction, the automatic fit, the support matrix and the on-device check. A fixed-width column caps the block width; a box that filled the capture viewport stays fluid. The panel shows where the layout comes from and offers to switch back to the sample article.

Privacy and security (see docs/security.md): boxes are left out of the clipboard fallback, share links and exports; navigation chrome is skipped; spacing values are clamped and counts, text length and numbers are bounded; styles reach the sandboxed measuring frame through CSSOM only. Three independent reviews (code, security, requirements) and a re-check of the fixes are clean.

Not done here (tracked in a follow-up issue): per-OS ranking still uses the sample article, direct URL import has no DOM and carries no boxes, and the import confirmation does not mention the boxes. Nothing in this PR needs the owner.

Verified: pnpm verify and pnpm test:e2e (E2E_PORT=4873) pass.

🤖 Generated with Claude Code

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://feature-173-import-element-boxes.fontstay.dev (commit cf2f47e)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://f36fafb1.fontstay.dev cf2f47e 2026-11-10T05:11:17.311Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://11d42460.fontstay.dev 9c2a170 2026-11-10T04:57:33.266Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://8e999e74.fontstay.dev 1dac022 2026-11-10T04:46:29.307Z Visit the dashboard ↗

@fogrew
fogrew force-pushed the feature/173-import-element-boxes branch from 1dac022 to 9c2a170 Compare November 10, 2026 04:53
fogrew and others added 3 commits November 10, 2026 07:07
…ift model (#173)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…h boxes (#173)

Skip navigation chrome in the collector, clamp spacing, send the capture viewport width.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…es (#173)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@fogrew
fogrew force-pushed the feature/173-import-element-boxes branch from 9c2a170 to cf2f47e Compare November 10, 2026 05:07
@fogrew
fogrew merged commit fd50152 into develop Nov 10, 2026
7 checks passed
@fogrew
fogrew deleted the feature/173-import-element-boxes branch November 10, 2026 05:19
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.

feat(import): Element boxes and structure from the imported site for the layout shift preview

1 participant