Repository navigation
feat(zoom): data-zoom-aside shows a caption beside the zoomed item, and the events map copies to the page and back - #14
Conversation
The zoomed copy sits in the dialog, so it took the dialog's font and line height and reflowed to another height; the original then took its place on the last frame. The copy now inherits the page's text styles. Annotate screenshots zoom inside a copy of their .ca wrapper, so styles set on it reach the zoomed view.
…igned side notes
- Issues go in `meta.issues`, appended so other plugins can add theirs.
- Every message names its block: a screenshot by its src, or by its position
and alt when the src is missing or shared; a compare by its position and
title; an annotation by its position in its own screenshot, with its stamp
number or side.
- Unknown props are reported with the valid ones and a likely fix, and so is
a `:bound` prop that points at missing frontmatter. Bindings to render-time
`data` or `props` are still left to the renderer.
- `mark="none"` without a `side` is reported, since nothing would point.
- Coordinates must be plain decimals: `10%` and `0x10` are reported, and a
missing one says it is required.
- Hex colors must have 3 or 6 digits, and their stamp gets a dark number
when the color is light.
- Viewports are parsed as WxH (with x or ×, and spaces), so "1440 × 900"
matches "1440x900"; anything else is reported.
- A host's `.ca { --ca-color }` now reaches the marks: the palette and gutters
are declared on `.ca` only, and a zoomed screenshot sits in a copy of it.
- Left and right notes line up with their arrows when the screenshot also has
a note above it.
- `::compare{title}` names the comparison for screen readers.
- The CLI checks several files, prefixing each issue with its file, prints one
line when a file can't be read or written, and knows `::carousel` and
`::zoom`.
BREAKING CHANGE: `meta.annotateIssues` is now `meta.issues`.
BREAKING CHANGE: `::screenshot{label}` is now `title`.
BREAKING CHANGE: `::screenshot{url}` is now `href`, and its link reads as the URL's host instead of "Preview".
…nd the events map copies to the page and back
772dd4e to
cd11f5f
Compare
🚀 Deploying Preview to Cloudflare 🚀Preview Deployments by commit
|
…aside never holds the item
There was a problem hiding this comment.
Important
The annotate integration does not activate the new aside behavior, so screenshot captions and notes still do not appear beside the zoomed item.
Reviewed changes
- Annotate validation and rendering — moves diagnostics to shared
meta.issues, adds clearer prop and coordinate validation, renames screenshot and compare metadata, and updates rendered headings and theming. - Annotate CLI and documentation — adds multi-file checking, mixed zoom/carousel previews, and documents the updated APIs.
- Zoom runtime — adds nested context copies, aside layout, page/copy mapping helpers, and typed bubbling events.
- Tests and browser coverage — updates annotate unit coverage and adds end-to-end checks for theming and side-note alignment.
gpt-5.6-sol | 𝕏
Latest result Pull request merged. Final answersSession Pull request merged. Session Waiting for GitHub merge request 47c3454e-b372-4342-a937-66e750e6e666. Current HEAD has a P1 required-check failure: annotate tests expect outdated href and diagnostic messages at lines 224, 306, and 434, while the implementation emits stricter current messages. No review threads remain actionable; historical Pullfrog findings are resolved. The repair push window is closed until 2026-10-21T09:59:18Z, so the expectation updates require a later repair pass. Session Fixed the required lint/typecheck failures by restoring bundled client CSS defaults, correcting event-map declarations, removing the unused epoch, and cleaning the E2E import. Zoom tests pass 9/9; local E2E could not start because port 4173 is restricted. Pushed commit 492a0e8. Historical Pullfrog P1 findings are already resolved; no new actionable review findings remain. Session Fixed the required lint/typecheck failures by restoring bundled client CSS defaults, correcting event-map declarations, removing the unused epoch, and cleaning the E2E import. Zoom tests pass 9/9; local E2E could not start because port 4173 is restricted. Pushed commit 492a0e8. Historical Pullfrog P1 findings are already resolved; no new actionable review findings remain. Session Fixed the required lint/typecheck failures by restoring bundled client CSS defaults, correcting event-map declarations, removing the unused epoch, and cleaning the E2E import. Zoom tests pass 9/9; local E2E could not start because port 4173 is restricted. Pushed commit 492a0e8. Historical Pullfrog P1 findings are already resolved; no new actionable review findings remain. Fixed the required lint/typecheck failures by restoring bundled client CSS defaults, correcting event-map declarations, removing the unused epoch, and cleaning the E2E import. Zoom tests pass 9/9; local E2E could not start because port 4173 is restricted. Pushed commit 492a0e8. Historical Pullfrog P1 findings are already resolved; no new actionable review findings remain. |
There was a problem hiding this comment.
Important
The new scroll-restoration lifecycle can leave pages in manual mode when a zoom is stopped while a close is still traversing history and the host remounts the zoom during popstate.
Reviewed changes
- Activated annotate asides — Added
data-zoom-aside="figcaption"to generated screenshots so captions and notes are copied beside the zoomed item. - Reworked close navigation — Added scroll-restoration management, interrupted-animation handling, and center-aware travel paths for zoom opening and closing.
- Pinned workflow and packaging dependencies — Pinned the Pullfrog workflow actions and made package
prepackscripts build their workspace runtime dependencies. - Adjusted E2E typing — Added Playwright
LocatorandPagetype imports for the retained helper surface.
The shared restoration slot is overwritten by a new open() before the earlier asynchronous shut() has finished. In a stop/remount sequence, the old popstate listener can then consume the newer value and clear the slot, so the later close has nothing left to restore.
Technical details
# Preserve scroll restoration across overlapping zoom lifecycles
## Affected sites
- `packages/zoom/src/client.ts:85` — stores restoration state in one module-level variable shared by all asynchronous closes.
- `packages/zoom/src/client.ts:434-440` — overwrites that shared state while opening a new zoom and only restores it from the current slot on failure.
- `packages/zoom/src/client.ts:463-471` — the previous close consumes and clears the slot during `history.back()`.
- `packages/zoom/src/client.ts:577-584` — `stop()` starts `shut()` without awaiting it, allowing a remount/open to overlap the old close.
## Required outcome
- Keep each zoom lifecycle's saved `history.scrollRestoration` value associated with that lifecycle until its own history traversal and close cleanup finish.
- Ensure stopping and remounting during the close sequence cannot leave the page in `manual` mode or consume the newer zoom's restoration state.
## Suggested approach
- Avoid a shared mutable restoration slot across overlapping views, or serialize/guard remounts until the prior `shut()` has completed.Note: 1 inline comment(s) dropped because they did not anchor to lines inside the PR diff:
packages/zoom/src/client.ts:85(RIGHT) — line 85 (RIGHT) is not inside a diff hunk
gpt-5.6-sol | 𝕏
|
Fixed the P1 scroll-restoration lifecycle race by storing restoration state on each zoom view, so overlapping stop/remount closes cannot consume a newer view's state. Also resolved the prepared merge conflicts and updated the annotate expectation for data-zoom-aside. Focused tests could not run locally because Corepack could not download pnpm (DNS/network); dependencies were preinstalled successfully by the host. |
There was a problem hiding this comment.
Important
The per-view restoration state fixes the previous slot collision, but an old delayed restoration callback can still overwrite a newly opened zoom's manual setting.
Reviewed changes
- Isolated scroll restoration per view — Moved the saved
history.scrollRestorationvalue from shared module state onto each zoom view and updated close/popstate cleanup to use that view. - Hardened bound-link diagnostics — Resolved bound
srcandhrefvalues independently when checking for unsafe URLs, including when a plain prop is present alongside the binding. - Expanded annotate regression coverage — Added public-interface tests for generated aside attributes, unsafe bound links beside plain links, native attributes, and quoted diagnostic names.
⚠️ Delayed restoration can overwrite a newly opened zoom
restore() schedules a global write to history.scrollRestoration after the browser processes popstate. If an old view queues that callback while its asynchronous close is still unwinding, a remounted host can open a new view and set restoration to manual, then the old callback writes the previous value back and leaves the new zoom without its required scroll lock.
Technical details
# Keep delayed restoration tied to its view lifecycle
## Affected sites
- `packages/zoom/src/client.ts:362-366` — the timeout callback unconditionally assigns the saved value to global `history.scrollRestoration` after `current.restoration` has been cleared.
- `packages/zoom/src/client.ts:434-438` — a newly opened view stores the current global setting and sets it to `manual`.
- `packages/zoom/src/client.ts:568-572` — the `popstate` handler restores the current view before starting its asynchronous close.
## Required outcome
- A delayed restoration from an older view must not overwrite `history.scrollRestoration` after a newer view has opened.
- Preserve the saved setting for the lifecycle that initiated the history traversal while keeping the active view's scroll restoration mode intact.
## Suggested approach
- Guard the delayed assignment with the view's active/closing identity or cancel pending restoration callbacks when a newer view opens.
gpt-5.6-sol | 𝕏
|
Fixed the P1 delayed scroll-restoration race by invalidating callbacks when a new zoom lifecycle opens. Also repaired the required annotate test regressions (P1: native attributes, host validation, and diagnostic quoting). Local Vitest was blocked by unresolved workspace package links; host CI should verify. |
There was a problem hiding this comment.
Important
The incremental restoration guard still permits an old runtime to overwrite a remounted zoom's manual scroll setting.
Reviewed changes
- Guarded delayed restoration — Added an epoch check before restoring
history.scrollRestorationand incremented it when opening a zoom. - Restored annotate diagnostics — Reinstated the stricter URL and viewport validation behavior and corresponding public-interface expectations.
gpt-5.6-sol | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Merged carousel runtime updates — Incorporated the
mainbranch changes for nested carousel scoping, RTL paging, scroll synchronization, and zoom-follow behavior. - Updated carousel normalization and rendering — Added the merged slide normalization, renderer attributes, and nested carousel handling across the HTML, Vue, React, and Svelte surfaces.
- Expanded carousel verification — Added public-interface and browser coverage for nested carousels, quick paging, hidden carousels, reduced motion, multiple columns, RTL behavior, keyboard exclusions, and script-free scrolling.
gpt-5.6-sol | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Shared remount restoration guard — Moved the delayed scroll-restoration epoch to
windowso a callback from a stopped runtime cannot overwrite a newly mounted zoom'smanualsetting. - Added lifecycle regression coverage — Added browser coverage for opening a new zoom while another runtime is still closing, including the expected restoration state through the second close.
- Clarified zoom API documentation — Updated the event, theming, context, and aside documentation to match the current runtime and public entry points.
gpt-5.6-sol | 𝕏
|
Required check failure is a current P1: annotate tests still expect the pre-merge href/diagnostic wording, while packages/annotate/src/read.ts emits the stricter messages now used by the implementation. The three failures are at annotate.test.ts:224, 306, and 434. The repair push window is closed, so this needs a follow-up push updating those expectations before merge. |
#14 was squashed from a branch older than #12 and #21, so it put back annotate's earlier read.ts and tests: an unknown prop named `constructor` or `__proto__` printed Object's own value as its hint, viewports compared as strings ("0900x0360" no longer matched "900x360"), and two tests expected the old href message. Those parts are restored; #17's compare mode stays. The slider e2e test clicked at coordinates measured before focusing the handle, which can scroll the page, so it missed the slider under load. It measures again before that click. zoom's client.ts holds its own copy of the zoom script since #14, so its doctor suppression covers it too.
… too (#25) #14 was squashed from a branch older than #16, so it added data-zoom-aside, copyOf, and originalOf to a copy of the zoom script in client.ts, while the HTML renderer kept inlining script.ts without them. Pages rendered to HTML got no aside and no mapping, and start() lost #16's fixes: keyboard opening of nested items, hidden items left out of a group, and data-zoom-src loading behind the page image. script.ts has the aside and the mapping again, on top of #16, and client.ts is the wrapper around it it was before. An e2e test checks both on a page from the HTML renderer.
…mark lights up its note there The stage, not the figure, is the zoom item now, with `.ca` and `.ca-screenshot` as its contexts and the figcaption as its aside (#14, #25), so the notes sit beside the zoomed image at a size that reads. In the zoom, hovering a mark or a note lights the other, between the zoomed copy and the aside only: the thumbnails are copies too. e2e checks that the aside is to the right of the frame, that a note lights its mark and no thumbnail, and that the zoom's copyOf/originalOf map the image and the note to the page and back.
…mark lights up its note there (#15) The stage, not the figure, is the zoom item now, with `.ca` and `.ca-screenshot` as its contexts and the figcaption as its aside (#14, #25), so the notes sit beside the zoomed image at a size that reads. In the zoom, hovering a mark or a note lights the other, between the zoomed copy and the aside only: the thumbnails are copies too. e2e checks that the aside is to the right of the frame, that a note lights its mark and no thumbnail, and that the zoom's copyOf/originalOf map the image and the note to the page and back.
…ts that #14 dropped (#490) #14 (142b3d0) merged a stale branch over e2e/zoom.e2e.ts and deleted five tests and the lastFrame helper that 26233e9 had. They are back against today's fixtures. The closing test and lastFrame live in e2e/motion-zoom.e2e.ts, since the closing travel has come from comark-motion since #474 and the zoom-only renderer closes at once. The screenshot's zoom item is now .ca-stage, and the tab order steps over each screenshot's Copy button, which #26 added.

Hosts need two things the zoomed view doesn't give them yet. One is room for an item's caption, so it stays readable however far the item zooms. The other is a way to tell which page element a node of the zoomed copy stands for.
data-zoom-aside="<selector>"on an item shows a copy of that element in a column beside the zoomed item, at its own size, or in a band below it on screens narrower than 48rem. It's the first match outside the item, in its innermost context or else its parent. The stage is measured after the column is laid out, so the item fits the space that's left.data-zoom-contextnow copies every ancestor that matches the selector, outermost first, instead of only the closest. An item can carry its colors from one wrapper and its layout from another, for example.ca,.ca-screenshot. A single class behaves as before.openandchangecarryaside, pluscopyOf(element)andoriginalOf(element), which map between the page and both copies by child position and returnnullfor anything the zoom doesn't show. Drop needs these for its comment pins. Without them it rebuilds the mapping itself, from how this package happens to build the copy.DocumentEventMaptoo, since they bubble and hosts listen once on the document.contentis now the copy of the item itself. With a context it used to be the outer context copy, and with several contexts that would be the outermost wrapper, not what was zoomed.Stacked on #12, and it will be rebased onto
mainonce #11, #12, and the zoom review PR land. comark-annotate uses this in the PR stacked on this one.🤖 Generated with Claude Code