Repository navigation
feat(annotate): comark-annotate tour turns each compare into a video, with no browser - #428
Conversation
…o, with no browser `tour` zooms to each change in a document's `::compare` blocks, draws its mark with the page's own wobble, writes its note, and cuts from before to after at the same place. It draws with @napi-rs/canvas, an optional peer dependency, and encodes with ffmpeg; `--sheet` writes 12 frames on one image without ffmpeg. `comark-annotate/tour` exports the same as `tour()`. The mark seed moves from the HTML renderer to `marks.ts`, so the tour and the page draw the same marks.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
comark-annotate
comark-badge
comark-bundle
comark-cards
comark-carousel
comark-cast
comark-charts
comark-chat
comark-chips
comark-cjk
comark-code
comark-code-notes
comark-colors
comark-comments
comark-critic
comark-deflist
comark-details
comark-diagrams
comark-diff
comark-embed
comark-fields
comark-figure
comark-file-tree
comark-footnotes
comark-git-graph
comark-github
comark-icon
comark-include
comark-keys
comark-links
comark-linter
comark-magic-move
comark-mark
markdown-it-to-comark
marked-to-comark
comark-mathml
comark-media
comark-metrics
migrate-to-comark
comark-outline
comark-properties
comark-qr
comark-quiz
comark-reading-time
remark-to-comark
comark-sources
comark-steps
comark-table
comark-tabs
comark-tests
comark-time
comark-ui
comark-xref
comark-zoom
commit: |
Latest result Merged 837df5a directly: required checks passed and review threads were resolved. Final answersSession Merged 837df5a directly: required checks passed and review threads were resolved. Ready: verified the expected HEAD, existing repairs, resolved threads, and passing hosted checks. No valid findings remain and no changes were needed. Package builds, publint, and lint passed. Local tests passed 84 cases; two CLI assertions were blocked by sandbox subprocess output restrictions, independently reproduced with a trivial Node subprocess. Session Pull request evidence changed. Session Pull request evidence changed. Session Waiting for review checks before the next pass. Session Waiting for review checks before the next pass. |
There was a problem hiding this comment.
Important
Two supported tour paths lose part of the comparison: brackets can point along the wrong edge, and changes annotated on only one side skip the corresponding view of the other side. Two smaller note-layout defects are also reproduced inline.
Reviewed changes — Reviewed the new browser-free annotation tour, its public API and CLI, shared mark rendering, packaging, documentation, and tests.
- Tour loading and API: Adds compare discovery, screenshot loading, and the public
tour(),frame(),sheet(), andwrite()interfaces. - Planning and drawing: Adds change pairing, camera movement, before/after transitions, animated marks, Caveat notes, and contact sheets.
- Video and packaging: Streams RGBA frames to ffmpeg, adds the optional canvas peer, and exposes the tour through the package and CLI.
- Existing integration: Shares mark seeds with HTML and documents the workflow in the package docs, README, and agent reference.
Validation: package builds and publint passed; focused annotate/tour tests passed 78 tests, with the MP4 integration test skipped because ffmpeg is not installed. Additional public-API frame reproductions confirmed the findings below.
gpt-6.1-sol(xhigh) | 𝕏
There was a problem hiding this comment.
✅ No new issues found; no P0 or P1 findings remain.
Reviewed changes — Re-reviewed 837df5a against the previous Pullfrog review at 2638c9a, focusing on the comparison and note-layout repairs.
- Preserved bracket orientation: Carried the reader’s resolved edge through detail shots and the closing overview.
- Restored counterpart views: Showed Before and After for every change, including changes annotated on only one side.
- Corrected note layout: Wrapped oversized unbroken text and clamped candidate cards before scoring their collisions.
- Added regression coverage: Checked bracket propagation, one-sided screenshot transitions, corner placement, and URL/CJK wrapping.
Validation: package builds and publint passed; focused annotate/tour tests passed 85 tests, with the MP4 integration test skipped because ffmpeg is unavailable. Additional public-API frame checks confirmed the repaired notes fit within the frame.
gpt-6.1-sol(xhigh) | 𝕏

A before/after doc proves a change, but a reviewer skimming a PR rarely studies two half-width screenshots. Agents have started ending PRs with a short video that walks through the same captures (danielroe/my-bad#123 has a good one). Each is built by hand for its PR, takes tens of thousands of tokens, and can drift from the marks on the page.
This adds
comark-annotate tour. It reads the document's::compareblocks with the reader the renderer uses and plays them: the whole before, then for each change a zoom to it, its mark drawn with the page's own wobble, its note written beside it, a cut to the after at the same place, and the whole after to close. Marks that sit within a fifth of the image of each other on both sides share one shot. The agent writes nothing new, so a tour costs only the look at its sheet.It draws with
@napi-rs/canvas, an optional peer dependency with prebuilt Skia binaries, so there's no browser. A 1080p frame takes about 4 ms. ffmpeg encodes the MP4; the sheet doesn't need it.comark-annotate/tourexportstour()withshots,frame(t),sheet()andwrite().seed()moves from the HTML renderer tomarks.ts, so both draw the same marks. Anonemark gets a loop in the tour, since a video has no side-note arrow to point with.Four published docs rendered in 14 to 26 s each, most of it the x264 encode. A Chromium prototype that screenshotted every frame took 54 to 80 s for the same docs. Node 24.21,
@napi-rs/canvas1.1.1, ffmpeg 8.0.1, on a busy 16-core Linux machine.Evidence on Drop: the input compare, its tour, the sheet, and a tour of a doc with two compares.
Not in this PR: the before-after-evidence skill step that tells agents when to make a tour (stacked on this one), and playing a tour live in the HTML renderer.