Complete per-viewport image-scan outcome: crawler wiring, query/viewer/MCP exposure - #375
Open
YusukeHirao wants to merge 4 commits into
Open
Complete per-viewport image-scan outcome: crawler wiring, query/viewer/MCP exposure#375YusukeHirao wants to merge 4 commits into
YusukeHirao wants to merge 4 commits into
Conversation
Bumps @d-zero/beholder from 4.2.3 to 5.0.0 (breaking: PageData.imageScan
is a new required field) and wires the scraped per-viewport image-scan
outcome through insertPage's computeMainContentsDenormalized call. The
three synthetic PageData builders (fetch-destination.ts,
link-to-page-data.ts, resource-to-page-data.ts) set imageScan to
{ desktop: null, mobile: null } since none of them run an actual scan.
The database.spec.ts round-trip test now exercises the real write path
end-to-end (PageData.imageScan -> insertPage -> page_meta -> build-page-
query.ts's SELECT) instead of writing page_meta directly.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds page_meta.image_scan_desktop/mobile to the read side: PageDetail and
PageListItem gain imageScanDesktop/imageScanMobile (mapped to the
ImageScanOutcome name), PageMainContents gains a nested imageScan object
alongside scrollHeight, and both listPages (live) and listViewerPages
(read-model fast path) gain an imageScan filter — an OR across the
desktop/mobile columns since a page's two viewports can differ.
VIEWER_READ_MODEL_SCHEMA_VERSION bumps 33 -> 34: viewer_pages gains
image_scan_desktop/mobile as nullable columns (copied from page_meta
verbatim, not defaulted to 0 like the sibling count columns -- 0 ("ok")
is a real, distinct outcome here, not a placeholder for "unmeasured").
sanitizeRedirectSourceRow nulls both columns like every other audit
signal on a redirect-source row.
hasFilterValue is now a type predicate so a caller narrows away
`undefined` without an extra cast when building the desktop/mobile OR.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds the imageScan checklist filter to the Pages view (server-side toImageScanOutcome parses the query param; both the fast-path listViewerPages and live listPages routes wire it through), two new page list columns (imageScanDesktop/Mobile), and an ImageScanBadge component (three severity tiers: ok/scroll-height-exceeded neutral, degraded/ nav-unsettled warn, frame-lost/unknown danger) shown alongside scroll height in the page-detail main-content summary. get-image-scan-label.ts mirrors get-error-kind-label.ts's localised-label- with-raw-fallback pattern; en/ja labels live under views.imageScan. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds an imageScan enum parameter to list_pages' input schema (OR across the desktop/mobile columns, same semantics as the query-layer filter) and documents the new imageScanDesktop/Mobile fields on get_page_detail's description. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #374 (which added the
page_meta.image_scan_desktop/image_scan_mobilecolumns and--retry-failedsupport ahead of the@d-zero/beholderversion bump). This PR completes the feature now that@d-zero/beholder@5.0.0(reportingPageData.imageScan) is published:@d-zero/beholderto5.0.0and wires the scrapedimageScanvalue throughinsertPage→computeMainContentsDenormalized→page_meta. The three syntheticPageDatabuilders (fetch-destination.ts,link-to-page-data.ts,resource-to-page-data.ts) setimageScan: { desktop: null, mobile: null }since none of them run an actual scan.PageDetail/PageListItemgainimageScanDesktop/imageScanMobile(mapped to theImageScanOutcomename),PageMainContentsgains a nestedimageScanobject alongsidescrollHeight, and bothlistPages(live) andlistViewerPages(read-model fast path) gain animageScanfilter — OR across the desktop/mobile columns since a page's two viewports can differ.VIEWER_READ_MODEL_SCHEMA_VERSIONbumps 33 → 34 (viewer_pagesgains the two columns, nullable — not defaulted to0like the sibling count columns, since0("ok") is a real outcome here, not a placeholder).imageScanchecklist filter to the Pages view, two new list columns, and anImageScanBadgecomponent (three severity tiers) shown in the page-detail main-content summary alongside scroll height.imageScanfilter onlist_pagesand documents the new fields onget_page_detail.Test plan
yarn lint/yarn build/yarn testall pass at the repo rootdatabase.spec.tscase exercises the real write path end-to-end (PageData.imageScan→insertPage→page_meta→build-page-query.ts'sSELECT)list-pages.spec.ts/apply-viewer-pages-filters.spec.tscases cover theimageScanfilter (single value, array OR, omitted) on both the live and fast pathsregister-pages-route.spec.tscases cover the/api/pages?imageScan=query param end-to-end, including dropping an invalid value from a repeated parammcp-server.spec.tscase coverslist_pages'simageScanfilter andget_page_detail's new fieldsget-image-scan-label.spec.ts/image-scan-outcome.spec.tscases cover every outcome and the code↔outcome mapping (including theimageScanOutcomeToCodereverse mapping)ImageScanBadge(all 6 outcomes + not-attempted) andMainContentSummary(degraded/frame-lost variants) stories added🤖 Generated with Claude Code