Skip to content

feat(beholder)!: enrich PageData with mainContents and scrollHeight#922

Merged
YusukeHirao merged 1 commit into
devfrom
feat/beholder-main-contents-scroll-height
Jul 16, 2026
Merged

feat(beholder)!: enrich PageData with mainContents and scrollHeight#922
YusukeHirao merged 1 commit into
devfrom
feat/beholder-main-contents-scroll-height

Conversation

@YusukeHirao

Copy link
Copy Markdown
Member

Summary

  • PageDatamainContents(メイン領域の定量: wordCount / bodyWordCount / headings / images / tables / buttons / iframes / videos / audios / canvases)と scrollHeight(desktop-compact / mobile-small)を追加
  • HTML 取得後に page.evaluate で mainContents を収集。scrollHeightcaptureImages: true なら既存 #fetchImages / beforePageScan から、false ならスクロールなしの軽量計測から取得
  • Content-Type が text/html でない場合(大小無視)はコンテンツ・アンカー・スクロール系をスキップし、両フィールドは null
  • README に取得フロー(mermaid)と返却データの簡易説明を追加

Breaking change

PageData に必須フィールド mainContents / scrollHeight が増えたため、リテラルを組み立てている呼び出し側は追従が必要です。

Test plan

  • yarn vitest run packages/@d-zero/beholder が通る
  • 非 HTML(例: PDF)で mainContents / scrollHeightnull
  • HTML + captureImages: true で scrollHeight が desktop/mobile に入る
  • HTML + captureImages: false で軽量パスの scrollHeight が入る
  • <main> ありページで wordCount / headings 等が期待どおり

…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>
@YusukeHirao
YusukeHirao requested a review from yusasa16 as a code owner July 16, 2026 06:36
@YusukeHirao
YusukeHirao merged commit 5bd7b0e into dev Jul 16, 2026
6 checks passed
@YusukeHirao
YusukeHirao deleted the feat/beholder-main-contents-scroll-height branch July 16, 2026 07:14
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