Skip to content

feat(carousel): ::gallery, and line captions in comark-figure - #521

Merged
vite-hub[bot] merged 6 commits into
mainfrom
feat/gallery-line-captions
Dec 3, 2026
Merged

vite-hub[bot] merged 6 commits into
mainfrom
feat/gallery-line-captions

Conversation

@onmax

@onmax onmax commented Dec 3, 2026 •

Copy link
Copy Markdown
Owner

Two ways to caption images with the line under them, and a grid for several of them.

::gallery (in comark-carousel)

It lives in comark-carousel because that package already owns "several things in one place" and the zoom-gallery wiring (data-zoom-gallery, the shared runtime, print and reduced-motion rules). A gallery is a zoom group, so a click on a photo opens the zoomed view with next/previous.

::gallery{columns=3}
![Wat Arun at dusk](wat-arun.jpg "18 Jul 2022. Wat Arun, Bangkok.")

![A cooking class](class.jpg)
**3 Aug 2022.** Cooking class in [Chiang Mai](/chiang-mai), with `mise en place`.

![Night market](market.jpg)
![Doi Suthep](suthep.jpg)
::
  • Every image is a <figure class="cc-cell">, whether images are separate paragraphs or consecutive lines of one.
  • Caption: the line under the image (rich inline kept), else the image title.
  • When both exist, the line is the caption and the title stays on the image as its tooltip. comark-figure's lineCaptions follows the same rule.
  • The image is the zoom item, not the cell. The zoomed view grows the photo alone and shows the caption as its title (data-zoom-title), so a caption never scales up with the photo. A zoomed image keeps its corner radius at any scale (one line in comark-zoom).
  • columns is 2 to 6, default 3. The grid drops columns in a narrow container, whatever the window. Cells share one aspect ratio (--cc-ratio, default 4/3) and crop with object-fit: cover.
  • Other content and images without alt text go to meta.issues / meta.issueRules, never a throw: gallery-content (COMARK0307), gallery-missing-alt (0308), gallery-empty (0309), gallery-invalid-columns (0310), plus unknown-prop. Doctor pages added.
  • HTML, Vue, React and Svelte renderers; comark-ui's registry and typeset, linter props, docs, READMEs and skills/comark-ui updated.

figure({ lineCaptions: true }) (in comark-figure, off by default)

![The office duck](duck.png)
**On call.** Gerald, [Tuesday](/tue) and `ssh`

becomes <figure><img><figcaption>â€Ķ</figcaption></figure>. A paragraph must be exactly one image (or linked image) followed by inline lines; anything else is left as a paragraph. Title captions, figure numbering and :ref keep working. Also applies inside lists, quotes and components.

Tests

Parse/render tests for both, framework tests, lint and doctor, and e2e/gallery.e2e.ts (columns, narrow container, zoom paging with the keyboard, caption in the zoomed view's title and not in its stage, no-script, print).

pnpm ready passed before the last one-line radius change in packages/zoom/src/script.ts. After it I ran the zoom and carousel unit tests, the gallery e2e, and the zoom e2e.

Screenshots: https://drop.vitehub.dev/d/v7gf018vaahe/comark-ui-pr-521-gallery

ðŸĪ– Generated with Claude Code

@vite-hub

vite-hub Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor
Session Status Started Duration
Pending Completed Not started —

Latest result

Pull request merged.

Final answers

Session

Pull request merged.

Session

GitHub has reported no check for e808cbf yet; waiting until 2026-12-03T11:33:52.760Z for its first check.

Session

GitHub has reported no check for e808cbf yet; waiting until 2026-12-03T11:33:52.760Z for its first check.

Session

GitHub has reported no check for e808cbf yet; waiting until 2026-12-03T11:33:52.760Z for its first check.

Session

GitHub has reported no check for e808cbf yet; waiting until 2026-12-03T11:33:52.760Z for its first check.

Session

GitHub has reported no check for e808cbf yet; waiting until 2026-12-03T11:33:52.760Z for its first check.

Session

GitHub has reported no check for e808cbf yet; waiting until 2026-12-03T11:33:52.760Z for its first check.

Session

GitHub has reported no check for e808cbf yet; waiting until 2026-12-03T11:33:52.760Z for its first check.

Session

GitHub has reported no check for e808cbf yet; waiting until 2026-12-03T11:33:52.760Z for its first check.

Session

GitHub has reported no check for e808cbf yet; waiting until 2026-12-03T11:33:52.760Z for its first check.

@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-12-03T10:23:07.211420Z
We couldn’t complete this review. Comment @codex review to try again.
0e0d350 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.

@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

Captions can lose spaces or entire text fragments, and line-captioned figures do not resolve :ref as documented.

Approach: Sharing the caption parser and reusing the existing zoom gallery are the right boundaries, but the parser needs to preserve inline content and cooperate with cross-references.

Reviewed changes — I reviewed the parser and renderer changes, preset and lint integration, and the accompanying docs and tests. The 40 focused unit tests passed after building carousel and zoom; I reproduced the findings through the public parse and render APIs.

  • Gallery: Normalizes images into captioned grid cells and uses the existing zoom runtime across all four renderers.
  • Line captions: Adds opt-in captioning to comark-figure through the same parser used by galleries.
  • Integration: Registers the new block in the preset, adds Doctor rules, and documents the syntax and supported behavior.

Non-blocking

  • P2 — Class: nonnumeric column values are coerced. A bound :columns='[4]' silently sets four columns, while :columns='{"toString":null,"valueOf":null}' throws instead of reporting gallery-invalid-columns and falling back to three. Validate the type before conversion and reuse the result for both rendering and diagnostics (column parser, diagnostic check).
  • P2 — Class: nested images bypass the caption guard. With lineCaptions: true, a line like A *[![Goose](/goose.png)](/goose)*. still becomes a caption for the image above it. The docs say an image in a caption leaves the paragraph alone; check descendants as well as direct children (caption guard).

PullfrogÂ Â ï―œ Fix all ➔ ï―œ Fix 👍s ➔ ï―œ View workflow run ï―œ Using pullfrog(medium) ï―œ 𝕏

Comment thread shared/picture.ts Resolved
Comment thread packages/carousel/src/gallery.ts Resolved
Comment thread packages/figure/src/index.ts Resolved
@pkg-pr-new

pkg-pr-new Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

comark-annotate

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

comark-badge

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

comark-bundle

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

comark-cards

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

comark-carousel

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

comark-cast

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

comark-charts

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

comark-chat

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

comark-chips

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

comark-cjk

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

comark-code

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

comark-code-notes

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

comark-colors

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

comark-comments

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

comark-critic

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

comark-deflist

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

comark-details

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

comark-diagrams

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

comark-diff

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

comark-embed

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

comark-fields

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

comark-figure

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

comark-file-tree

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

comark-footnotes

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

comark-git-graph

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

comark-github

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

comark-icon

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

comark-include

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

comark-keys

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

comark-links

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

comark-linter

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

comark-magic-move

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

comark-mark

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

markdown-it-to-comark

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

marked-to-comark

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

comark-mathml

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

comark-media

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

comark-metrics

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

migrate-to-comark

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

comark-motion

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

comark-outline

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

comark-properties

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

comark-qr

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

comark-quiz

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

comark-reading-time

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

remark-to-comark

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

comark-social

pnpm add https://pkg.pr.new/comark-social@521

comark-sources

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

comark-steps

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

comark-table

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

comark-tabs

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

comark-tests

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

comark-time

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

comark-ui

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

comark-xref

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

comark-zoom

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

commit: e808cbf

â€Ķes the zoomed view instead

The whole cell was the zoom item, so the caption grew with the photo. The image is the item now, with the
caption's text as its title. A zoomed image keeps the size of its corners however far it grows. The doctor
pages' example pictures use full addresses, so the docs link check finds no missing file.
@onmax

onmax commented Dec 3, 2026

Copy link
Copy Markdown
Owner Author

Screenshots on Drop

a6d7f16 changes what zooms: the image, not the whole cell. The caption grew with the photo before; now it is the zoomed view's title. That also removes the known limit in the description about tiny captions in the strip.

@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 zoom view clips longer gallery captions on phones and overrides host styling on ordinary zoomed images.

Reviewed changes — I reviewed a6d7f16 and verified both regressions in Chromium. The 39 focused gallery, carousel framework, and zoom unit tests and all five gallery browser tests passed.

  • Gallery zoom: Moved the zoom trigger and focus target to the image and used the caption text as the dialog title.
  • Zoom styling: Applied inverse corner scaling to all direct image copies, not just thumbnails.
  • Doctor examples: Replaced relative image paths with absolute example URLs. The root Doctor suite did not run in the focused check: Failed to load tsconfig 'docs/.nuxt/tsconfig.app.json': Tsconfig not found.

PullfrogÂ Â ï―œ Fix all ➔ ï―œ Fix 👍s ➔ ï―œ View workflow run ï―œ Using pullfrog(medium) ï―œ 𝕏

Comment thread packages/carousel/src/gallery.ts Resolved
Comment thread packages/zoom/src/script.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

A gallery can render empty when comark-figure unwraps its images before comark-carousel runs.

Reviewed changes — I reviewed 5fe85b79 since the previous review. All 103 focused unit tests and seven Chromium gallery tests passed; I reproduced the plugin-order regression separately through the public parse and render APIs.

  • Preserved rich captions. Kept gallery paragraphs intact through parsing, retained spaces between inline elements, and rejected nested images in figure captions.
  • Fixed figure references and column validation. Numbered captioned figures in the documented plugin order and rejected nonnumeric column values before conversion.
  • Updated the zoom dialog. Made long captions wrap and scroll, and moved default radius scaling into CSS so host overrides still work.

PullfrogÂ Â ï―œ Fix all ➔ ï―œ Fix 👍s ➔ ï―œ View workflow run ï―œ Using pullfrog(medium) ï―œ 𝕏

Comment thread packages/carousel/src/gallery.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.

Reviewed changes — I reviewed bd07de17 since the previous review. All 104 focused unit tests and the targeted typecheck passed. No blocking findings remain.

  • Preserved unwrapped gallery images. Galleries now keep standalone images and image-only links when comark-figure unwraps them first. The regression test checks rendered output and the absence of diagnostics in both plugin orders.
  • Aligned figure test types. The renderer helper now uses ParserOptions["plugins"] for mixed plugin lists.

PullfrogÂ Â ï―œ View workflow run ï―œ Using pullfrog(medium) ï―œ 𝕏

@vite-hub
vite-hub Bot merged commit 82410e5 into main Dec 3, 2026
7 checks passed
@vite-hub
vite-hub Bot deleted the feat/gallery-line-captions branch December 3, 2026 11:42
@github-actions github-actions Bot mentioned this pull request Dec 3, 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