Skip to content

feat(zoom): show an image in a table cell as a thumbnail that zooms - #482

Merged
vite-hub[bot] merged 6 commits into
mainfrom
t3/table-image-zoom
Nov 24, 2026
Merged

vite-hub[bot] merged 6 commits into
mainfrom
t3/table-image-zoom

Conversation

@onmax

@onmax onmax commented Nov 24, 2026

Copy link
Copy Markdown
Owner

A reference table with a screenshot per row was unusable: each image took the full width of its cell, so a row was as tall as its screenshot.

An image in a table cell is now a thumbnail, at most 64px high and 128px wide in the file's ratio. A click, Enter, or Space opens it at the size of its file, in the dialog every other image uses. Nothing new to write:

| Term | Where it shows |
| --- | --- |
| Dashboard | ![Office correlations dashboard](/dashboard.png){link="https://example.com/dashboard"} |

Evidence, with a live page to click through: https://drop.vitehub.dev/d/j8cw1k74my61/table-thumbnails-evidence

  • A thumbnail zooms whatever images says, so a host that turns zoom off for its other images (Drop does) still gets it. thumbnails: false turns it off.
  • link on any image names the page it shows. The zoomed view links to it from its header, and the click on the image still zooms. Only http and https links are kept.
  • Thumbnails load lazily and carry their ratio, so rows keep their height before an image loads. The one delegated listener handles them, so a long table adds none.
  • --comark-thumb-height and --comark-thumb-width set the size.
  • tableLayout counts a cell's images toward its width, and keeps two thumbnails in one cell together.

Checked in Chromium at 1280px and 390px, light and dark. Not checked in Firefox or WebKit beyond what CI's e2e runs.

🤖 Generated with Claude Code

@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-24T10:49:37.363317Z
We couldn’t complete this review. Comment @codex review to try again.
a8a3a9c 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 Waiting 2026-11-24T11:52:34.550Z 3m 49s
View session Cancelled 2026-11-24T11:24:26.636Z 1m 26s

Latest result

Pull request merged.

Final answers

Session

Pull request merged.

View session

PR #482 is ready to merge. All earlier findings are fixed on the assigned head, all review threads are resolved, and current-head checks are green. All 16 local zoom tests passed, and lint passed with warnings. A local pnpm SQLite error prevented building the dependencies needed for the table-layout tests, so I relied on hosted CI for that coverage. No repair commit was needed.

Session

Pass interrupted; current webhook state retained.

Session

Pass interrupted; current webhook state retained.

Session

Pass interrupted; current webhook state retained.

Session

Pass interrupted; current webhook state retained.

Session

Pass interrupted; current webhook state retained.

Session

Pass interrupted; current webhook state retained.

@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@482

comark-badge

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

comark-bundle

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

comark-cards

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

comark-carousel

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

comark-cast

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

comark-charts

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

comark-chat

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

comark-chips

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

comark-cjk

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

comark-code

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

comark-code-notes

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

comark-colors

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

comark-comments

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

comark-critic

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

comark-deflist

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

comark-details

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

comark-diagrams

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

comark-diff

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

comark-embed

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

comark-fields

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

comark-figure

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

comark-file-tree

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

comark-footnotes

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

comark-git-graph

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

comark-github

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

comark-icon

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

comark-include

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

comark-keys

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

comark-links

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

comark-linter

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

comark-magic-move

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

comark-mark

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

markdown-it-to-comark

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

marked-to-comark

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

comark-mathml

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

comark-media

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

comark-metrics

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

migrate-to-comark

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

comark-motion

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

comark-outline

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

comark-properties

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

comark-qr

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

comark-quiz

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

comark-reading-time

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

remark-to-comark

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

comark-sources

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

comark-steps

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

comark-table

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

comark-tabs

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

comark-tests

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

comark-time

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

comark-ui

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

comark-xref

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

comark-zoom

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

commit: 887b556

@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

Fix the failing zoom test and the image sizing regressions before merging. The new thumbnail test passes, but it only covers a landscape image with explicit dimensions.

Approach: Reusing the existing zoom dialog and delegated listener is the right approach; the dialog needs to size the opened image independently of its thumbnail on the page.

Reviewed changes across parsing, table layout, the zoom runtime, and the authoring docs:

  • Thumbnail rendering: Table images become lazy thumbnails with configurable bounds, independently of the images option.
  • Zoom dialog: Image copies can grow past the old 4× cap, and an optional HTTP(S) link appears in the header.
  • Table layout and documentation: Image cells influence column sizing and wrapping; the docs and skills describe sizing and opt-outs.
  • Verification: All 32 zoom and table layout unit tests passed. Chromium zoom E2E: 27 passed, 1 failed. Additional Chromium checks reproduced the sizing issues below.

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

Comment thread e2e/zoom.e2e.ts Resolved
Comment thread packages/zoom/src/script.ts Resolved
Comment thread packages/zoom/src/script.ts Resolved
Comment thread packages/zoom/src/styles.ts Resolved
Comment thread packages/ui/src/table-layout.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 P0 or P1 findings; one input-preservation regression is noted inline. The prior review threads remain open.

Reviewed changes since a8a3a9c:

  • Normalized image attributes. Switched link and style to the shared text() helper before emitting the dialog link and thumbnail ratio.
  • Verified rendering. Ran all 15 zoom unit tests and checked whitespace-sensitive values through the public HTML renderer.

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

Comment thread packages/zoom/src/index.ts Resolved
…ed one whole

A thumbnail's box no longer sets the zoomed size: a tall file scrolls, an icon stays its size, and a copy inside a context shell is measured. An image with no size written keeps a 3:2 box and shows whole. Table layout counts only images that are thumbnails.

@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

Unsized thumbnails lose their visible keyboard focus indicator. The Chromium suite passes, but tabbing to an unsized thumbnail reproduces the regression.

Reviewed changes since ab63b43:

  • Adjusted zoom sizing. Used the actual image clone inside context wrappers and based the scroll threshold on the thumbnail’s file size.
  • Changed thumbnail sizing and layout. Added a height limit for sized images, fitted unsized images without cropping, and counted only marked thumbnails in table layout.
  • Verified the delta. The workspace build, all 33 focused unit tests, and all 29 Chromium zoom end-to-end tests passed. This review is pinned to 86b5ba0; 536e302 landed during the run and is outside its scope.

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

Comment thread packages/zoom/src/styles.ts Resolved
Comment thread packages/zoom/src/styles.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 P0 or P1 findings. Approval is withheld while earlier review threads remain open.

Reviewed changes since 86b5ba0:

  • Preserved authored links. Verified that the HTML renderer keeps a trailing nonbreaking space in a zoom link and that URL parsing encodes it as %C2%A0.
  • Preserved authored styles. Checked that the generated ratio comes before the authored CSS, so a trailing escape cannot consume its separator. All 16 zoom unit tests passed.

CI’s docs step failed because the diagrams-d2 example timed out reaching Kroki; CI skipped the check and E2E jobs.

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

onmax added a commit to vite-hub/drop that referenced this pull request Nov 24, 2026

@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. No P0 or P1 findings remain.

Reviewed changes since 536e302:

  • Restored keyboard focus. Unsized thumbnails now suppress only the resting outline, so tabbing to one shows the 2px focus ring.
  • Respected the width limit. Unsized thumbnails use the same 3:2 ratio for layout and height calculation, so a 2rem limit gives a roughly 32×21px thumbnail even with a host image reset.
  • Verified the fixes. The workspace build, 34 focused unit tests, all 29 Chromium zoom tests, and the focused Firefox regression passed. WebKit could not launch because the runner lacks the required system libraries.

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

@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. No P0 or P1 findings remain.

Reviewed changes since d99e4d1:

  • Preserved the ordinary-image test. Added {zoom=false} to the table image that should still obey the typeset height cap.
  • Covered the default thumbnail. Added a second table image and verified that it renders at 64px. All five typeset E2E tests passed locally in Chromium. GitHub CI skipped E2E after the Docs step got a 504 Gateway Timeout from the fontshare provider.

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

@vite-hub
vite-hub Bot merged commit 1ed2614 into main Nov 24, 2026
10 of 11 checks passed
@vite-hub
vite-hub Bot deleted the t3/table-image-zoom branch November 24, 2026 11:57
@github-actions github-actions Bot mentioned this pull request Nov 24, 2026
vite-hub Bot added a commit to vite-hub/drop that referenced this pull request Nov 24, 2026
#271)

* feat(viewer): an image in a table cell is a small thumbnail that zooms

Pins comark-ui to onmax/comark-ui#482 (536e302f). comark-zoom draws and zooms the thumbnails, so Drop's own lightbox leaves them alone.

* chore: pin comark-ui to d99e4d12 of onmax/comark-ui#482

* fix(viewer): keep thumbnail comment anchors and glossary columns usable

* fix(viewer): save thumbnail edge strokes and handle Marker retries

---------

Co-authored-by: vite-hub[bot] <320448255+vite-hub[bot]@users.noreply.github.com>
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.

2 participants