Skip to content

fix: include comment bubbles in blocks screenshot export#320

Merged
takaokouji merged 1 commit intodevelopfrom
fix/screenshot-include-comments
Mar 16, 2026
Merged

fix: include comment bubbles in blocks screenshot export#320
takaokouji merged 1 commit intodevelopfrom
fix/screenshot-include-comments

Conversation

@takaokouji
Copy link

@takaokouji takaokouji commented Mar 16, 2026

Summary

  • ブロックスクリーンショット(PNG エクスポート)にコメントバブルが含まれない問題を修正
  • buildExportSVGworkspace.svgBubbleCanvas_ もクローンして SVG に追加
  • mergeWithBubbleBBox を追加し、バウンディングボックスをコメント位置まで拡張

Changes

  • packages/scratch-gui/src/lib/blocks-screenshot.js:
    • mergeWithBubbleBBox() 関数を追加(ブロック bbox + バブル bbox の合成)
    • buildExportSVG() でバブルキャンバスもクローン・追加
    • downloadBlocksAsImage() で merged bbox を使用
  • packages/scratch-gui/test/unit/lib/blocks-screenshot.test.js:
    • mergeWithBubbleBBox のテスト 3 件追加
    • buildExportSVG のバブルキャンバス含有テスト 2 件追加
    • makeMockWorkspacesvgBubbleCanvas_ サポート追加

Implementation Steps

  • Phase 1: バブルキャンバスのクローンとバウンディングボックス拡張
  • Phase Final: ブラウザ確認

Definition of Done

  • ユニットテスト pass
  • lint pass
  • CI green (build-and-deploy pending)
  • ブラウザ確認(Playwright MCP):
    • @ruby:* コメント付きブロックのスクリーンショットにコメントバブルが表示される(hasBubbleContent: true 確認済み)
    • コメントなしのブロックのスクリーンショットは従来通り動作する(bubbleChildren: 0 確認済み)

Fixes #319

🤖 Generated with Claude Code

The screenshot export was only cloning workspace.svgBlockCanvas_ which
contains only blocks. Comment bubbles are rendered in a separate SVG
group (workspace.svgBubbleCanvas_) and were excluded from the exported
PNG. This adds bubble canvas cloning and bounding box merging so that
@ruby:* comments and other comment bubbles appear in screenshots.

Fixes #319

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link

@takaokouji takaokouji merged commit fb081e0 into develop Mar 16, 2026
9 checks passed
@takaokouji takaokouji deleted the fix/screenshot-include-comments branch March 16, 2026 03:32
github-actions bot pushed a commit that referenced this pull request Mar 16, 2026
…t-include-comments

fix: include comment bubbles in blocks screenshot export
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.

fix: コメントバブルがブロックスクリーンショットに含まれない

1 participant