Skip to content

feat(annotate): draw a screenshot a table cell names as a thumbnail - #485

Merged
vite-hub[bot] merged 4 commits into
mainfrom
t3/annotated-thumbnails
Nov 24, 2026
Merged

vite-hub[bot] merged 4 commits into
mainfrom
t3/annotated-thumbnails

Conversation

@onmax

@onmax onmax commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

A table cell holds one line, so it can't hold a ::screenshot and its annotations. #482 gave tables image thumbnails, but an annotated screenshot still had to sit outside the table.

A cell now names a screenshot written anywhere in the document:

| Screen | Finding | Where |
| --- | --- | --- |
| Filters | The toolbar wraps onto a second row | :screenshot{of="filters-before"} |

::screenshot{#filters-before src="/before.png" alt="Filter toolbar wrapping" viewport="1280x500"}
:::annotation{x=3.6 y=20.6 w=92.9 h=31.4 color="red"}
Two filters don't fit, so the toolbar wraps.
:::
::

The block moves into the cell as a thumbnail the size of comark-zoom's, with a dot where each mark sits. A click opens the whole figure: marks, side notes, and numbered notes. Nothing is drawn where the block was written.

Evidence: https://drop.vitehub.dev/d/wt9qe6jsb2xp/annotated-screenshots-as-table-thumbnails

Changes

  • comark-annotate: thumbnails() in src/read.ts moves each named screenshot into its cell and marks it data-thumbnail. A second cell naming the same screenshot gets a copy without the id. The thumbnail styles apply only outside the zoom dialog, so the opened copy is the ordinary figure.
  • comark-zoom: data-zoom-width sets the width the zoomed copy is laid out at, capped at 92% of the stage, since a thumbnail's own width is too small to lay a figure out in.
  • comark-ui: table layout counts a named screenshot as one thumbnail and ignores its notes' text when measuring the column.
  • comark-linter: comark/annotate/unknown-screenshot (COMARK0127) for an of that names no screenshot, and comark/annotate/thumbnail-outside-table (COMARK0128) for :screenshot{of} outside a cell, each with a doctor page.
  • Docs: "In a table" on the Screenshot page, the data-zoom-width row on the Zoom page, and the skill's annotate reference.

Checked

  • pnpm check and pnpm run doctor pass.
  • Unit tests for annotate, table-layout, info, doctor, motion, inline-scripts, workspace, zoom, and lint pass.
  • e2e for annotate, zoom, and typeset pass in Chromium, Firefox, and WebKit, including a new test that opens a thumbnail and closes it with Escape.
  • Not run: the full pnpm test and the full e2e suite. Copy and Hide marks from an opened thumbnail are present but not exercised by a test.

Open choice

The thumbnail shows dots, not the drawn marks: a box drawn at 128px is a smudge. If the drawn marks are preferred, it is a CSS change in packages/annotate/src/styles.ts.

🤖 Generated with Claude Code

A cell holds one line, so it names a ::screenshot written elsewhere with :screenshot{of="id"}. The block moves into the cell as a thumbnail with a dot per mark and opens as the whole figure, laid out at data-zoom-width.
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-24T12:35:56.309059Z
We couldn’t complete this review. Comment @codex review to try again.
5b065f0 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@vite-hub

vite-hub Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor
Session Status Started Duration
Pending Completed Not started —
View session Last seen running 2026-11-24T13:34:12.538Z 1s
View session Cancelled 2026-11-24T13:21:13.735Z 5m 36s

Latest result

Pull request merged.

Final answers

Session

Pull request merged.

Session

Merged f62cb89 directly: required checks passed and review threads were resolved.

Session

Pull request evidence changed.

Session

Pull request evidence changed.

Session

Pull request evidence changed.

Session

Pull request evidence changed.

Session

Pull request evidence changed.

Session

GitHub is still calculating mergeability for this PR head.

@pkg-pr-new

pkg-pr-new Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

comark-annotate

pnpm add https://pkg.pr.new/comark-annotate@485

comark-badge

pnpm add https://pkg.pr.new/comark-badge@485

comark-bundle

pnpm add https://pkg.pr.new/comark-bundle@485

comark-cards

pnpm add https://pkg.pr.new/comark-cards@485

comark-carousel

pnpm add https://pkg.pr.new/comark-carousel@485

comark-cast

pnpm add https://pkg.pr.new/comark-cast@485

comark-charts

pnpm add https://pkg.pr.new/comark-charts@485

comark-chat

pnpm add https://pkg.pr.new/comark-chat@485

comark-chips

pnpm add https://pkg.pr.new/comark-chips@485

comark-cjk

pnpm add https://pkg.pr.new/comark-cjk@485

comark-code

pnpm add https://pkg.pr.new/comark-code@485

comark-code-notes

pnpm add https://pkg.pr.new/comark-code-notes@485

comark-colors

pnpm add https://pkg.pr.new/comark-colors@485

comark-comments

pnpm add https://pkg.pr.new/comark-comments@485

comark-critic

pnpm add https://pkg.pr.new/comark-critic@485

comark-deflist

pnpm add https://pkg.pr.new/comark-deflist@485

comark-details

pnpm add https://pkg.pr.new/comark-details@485

comark-diagrams

pnpm add https://pkg.pr.new/comark-diagrams@485

comark-diff

pnpm add https://pkg.pr.new/comark-diff@485

comark-embed

pnpm add https://pkg.pr.new/comark-embed@485

comark-fields

pnpm add https://pkg.pr.new/comark-fields@485

comark-figure

pnpm add https://pkg.pr.new/comark-figure@485

comark-file-tree

pnpm add https://pkg.pr.new/comark-file-tree@485

comark-footnotes

pnpm add https://pkg.pr.new/comark-footnotes@485

comark-git-graph

pnpm add https://pkg.pr.new/comark-git-graph@485

comark-github

pnpm add https://pkg.pr.new/comark-github@485

comark-icon

pnpm add https://pkg.pr.new/comark-icon@485

comark-include

pnpm add https://pkg.pr.new/comark-include@485

comark-keys

pnpm add https://pkg.pr.new/comark-keys@485

comark-links

pnpm add https://pkg.pr.new/comark-links@485

comark-linter

pnpm add https://pkg.pr.new/comark-linter@485

comark-magic-move

pnpm add https://pkg.pr.new/comark-magic-move@485

comark-mark

pnpm add https://pkg.pr.new/comark-mark@485

markdown-it-to-comark

pnpm add https://pkg.pr.new/markdown-it-to-comark@485

marked-to-comark

pnpm add https://pkg.pr.new/marked-to-comark@485

comark-mathml

pnpm add https://pkg.pr.new/comark-mathml@485

comark-media

pnpm add https://pkg.pr.new/comark-media@485

comark-metrics

pnpm add https://pkg.pr.new/comark-metrics@485

migrate-to-comark

pnpm add https://pkg.pr.new/migrate-to-comark@485

comark-motion

pnpm add https://pkg.pr.new/comark-motion@485

comark-outline

pnpm add https://pkg.pr.new/comark-outline@485

comark-properties

pnpm add https://pkg.pr.new/comark-properties@485

comark-qr

pnpm add https://pkg.pr.new/comark-qr@485

comark-quiz

pnpm add https://pkg.pr.new/comark-quiz@485

comark-reading-time

pnpm add https://pkg.pr.new/comark-reading-time@485

remark-to-comark

pnpm add https://pkg.pr.new/remark-to-comark@485

comark-sources

pnpm add https://pkg.pr.new/comark-sources@485

comark-steps

pnpm add https://pkg.pr.new/comark-steps@485

comark-table

pnpm add https://pkg.pr.new/comark-table@485

comark-tabs

pnpm add https://pkg.pr.new/comark-tabs@485

comark-tests

pnpm add https://pkg.pr.new/comark-tests@485

comark-time

pnpm add https://pkg.pr.new/comark-time@485

comark-ui

pnpm add https://pkg.pr.new/comark-ui@485

comark-xref

pnpm add https://pkg.pr.new/comark-xref@485

comark-zoom

pnpm add https://pkg.pr.new/comark-zoom@485

commit: f62cb89

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The thumbnail opens with its annotations, but Copy with marks exports an unannotated PNG. When scripts are blocked, readers also lose access to the notes and caption.

Approach: Resolving screenshot references during parsing and reusing the existing zoom renderer makes sense, but the collapsed preview cannot serve as the source for copying or as the only script-free presentation.

Reviewed changes across the parser, renderer, zoom runtime, table layout, and linter:

  • References: Table cells resolve named screenshots, repeated references render copies, and invalid references get Doctor diagnostics.
  • Rendering and zoom: The cell shows a thumbnail with dots; data-zoom-width gives the opened figure a wider layout.
  • Table layout: Annotated thumbnails contribute to column sizing without counting their notes as text.
  • Verification: The workspace build and focused annotate, zoom, table-layout, linter, and Doctor tests passed. Targeted Chromium checks reproduced the copy, script-free, link, and sizing issues below.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.2-sol(high) | 𝕏

Comment thread packages/annotate/src/styles.ts Resolved
Comment thread packages/annotate/src/styles.ts Resolved
Comment thread packages/annotate/src/html.ts Resolved
Comment thread packages/annotate/src/read.ts Resolved
Comment thread packages/annotate/src/html.ts Resolved
Comment thread packages/ui/src/table-layout.ts Resolved
Comment thread packages/annotate/src/read.ts Resolved

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The new regression tests fail CI for two separate reasons: the clipboard test does not typecheck, and the delayed-image fixture never starts zoom. A UTF‑8 Chromium fixture confirmed that the thumbnail itself holds its 96 × 64 size while the image loads.

Reviewed changes in 0b880e8:

  • Restored the full figure when scripts are blocked and the captured-page link when zoom opens.
  • Exported clipboard PNGs from a full-size copy and reserved a 3:2 stage for unsized thumbnails.
  • Clarified which screenshots can be referenced, excluded hidden note chips from table sizing, and changed how lint locates thumbnail references.

The package build and 156 focused unit tests passed. Chromium passed the clipboard, link, and script-free checks; the delayed-image test failed both locally and in CI.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.2-sol(high) | 𝕏

Comment thread e2e/annotate.e2e.ts Resolved
Comment thread e2e/annotate.e2e.ts Resolved

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found in f62cb89; no P0 or P1 findings remain.

Reviewed changes in the latest commit. All four thumbnail regressions passed in Chromium, and e2e/annotate.e2e.ts passed a focused strict typecheck.

  • Declared UTF‑8 in both raw HTML fixtures so the delayed-image test runs the zoom script and the script-blocking test exercises CSP.
  • Narrowed the clipboard test’s figure to HTMLElement before passing it to capture().

Pullfrog  | Fix it ➔ | View workflow run | Using gpt-6.2-sol(high) | 𝕏

@vite-hub
vite-hub Bot merged commit b31954f into main Nov 24, 2026
7 checks passed
@vite-hub
vite-hub Bot deleted the t3/annotated-thumbnails branch November 24, 2026 13:36
@github-actions github-actions Bot mentioned this pull request Nov 24, 2026
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