feat(beholder)!: enrich PageData with mainContents and scrollHeight#922
Merged
Merged
Conversation
…Height Collect main-content quantitative data during scrape via page.evaluate, and record desktop/mobile scrollHeight from the image scan path or a light measure path when captureImages is false. Non-HTML responses skip both. BREAKING CHANGE: PageData now requires mainContents and scrollHeight fields. Co-authored-by: Cursor <cursoragent@cursor.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
PageDataにmainContents(メイン領域の定量: wordCount / bodyWordCount / headings / images / tables / buttons / iframes / videos / audios / canvases)とscrollHeight(desktop-compact / mobile-small)を追加page.evaluateで mainContents を収集。scrollHeightはcaptureImages: trueなら既存#fetchImages/beforePageScanから、falseならスクロールなしの軽量計測から取得text/htmlでない場合(大小無視)はコンテンツ・アンカー・スクロール系をスキップし、両フィールドはnullBreaking change
PageDataに必須フィールドmainContents/scrollHeightが増えたため、リテラルを組み立てている呼び出し側は追従が必要です。Test plan
yarn vitest run packages/@d-zero/beholderが通るmainContents/scrollHeightがnullcaptureImages: trueで scrollHeight が desktop/mobile に入るcaptureImages: falseで軽量パスの scrollHeight が入る<main>ありページで wordCount / headings 等が期待どおり