Skip to content

Add canvas inspection report#24

Open
sjquant wants to merge 3 commits into
mainfrom
shannon-claimed-the-last-bagel-nzy
Open

Add canvas inspection report#24
sjquant wants to merge 3 commits into
mainfrom
shannon-claimed-the-last-bagel-nzy

Conversation

@sjquant

@sjquant sjquant commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Why

Expose a deterministic canvas.inspect() report so agents can read measured layout state without rendering output or invoking diagnostics.

Changes

  • Add public inspection report models for canvas, layer, bbox, and text layout metadata.
  • Add canvas.inspect() backed by measure_layers(canvas), including layer IDs, order/z-order, visibility, bboxes, group children, and text wrapped lines/effective font sizes.
  • Keep inspect-only text layout work at the inspection boundary so diagnostics and plain measurement stay lightweight.
  • Add black-box inspection tests for text, rich auto-scaled text, shapes, images, SVGs, groups, custom layers, invisible layers, stable order/IDs, and inspect-only metadata behavior.

Validation: uv run pytest tests/test_inspection.py tests/test_diagnostics.py; uv run ruff check quickthumb tests/test_inspection.py; touched-file formatter check passed.

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