Skip to content

fix: a tall image in a doc fits on the screen - #268

Merged
vite-hub[bot] merged 6 commits into
mainfrom
fix/image-fit
Nov 21, 2026
Merged

vite-hub[bot] merged 6 commits into
mainfrom
fix/image-fit

Conversation

@onmax

@onmax onmax commented Nov 21, 2026

Copy link
Copy Markdown
Member

A tall picture in a doc filled the screen: a portrait image took the whole 768px column, so it ran past the bottom of the window as you scrolled. The fix is in comark-ui's typeset (onmax/comark-ui#478), and this moves Drop's comark-ui pins to that PR's build.

  • A Markdown image is now at most 70% of the window's height (40rem at most) and sits centered over its caption. A click still zooms it whole. In a 1280×800 window, the three images in the reported doc go from 768×620, 768×955 and 768×1038 to 694×560, 450×560 and 414×560.
  • Screenshots in ::screenshot keep their size, so their marks don't move.
  • The new comark-ui also ships ViteHub UI's motion layer, which needs one more inline script. Drop turns it off (motion: false), so the CSP stays the same and blocks stay still until we decide to adopt it.
  • One test now looks for the zoomed header's .ca-zoom-tools (comark-ui#472 moved Copy there, beside Hide marks), and comark-motion joins the packages the Markdown references skip.

Before/after: https://drop.vitehub.dev/d/8b6pvn5aspvd/comark-ui-image-fits-screen

Once #478 merges, the pins should move to its merge commit.

🤖 Generated with Claude Code

…ocks stay still until Drop adopts comark-ui's motion layer
@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-21T16:49:23.513967Z
We couldn’t complete this review. Comment @codex review to try again.
92d8efb 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 21, 2026 •

Copy link
Copy Markdown
Contributor
Session Status Started Duration
Pending Completed Not started —
View session Completed 2026-11-21T18:38:20.373Z 2m 59s
View session Starting Not started —
View session Cancelled 2026-11-21T18:07:46.163Z 41s
View session Cancelled 2026-11-21T18:03:42.811Z 40s

Latest result

Pull request merged.

Final answers

Session

Pull request merged.

Session

Updated the branch with main because main changed package.json, pnpm-lock.yaml after its checks ran; waiting for checks on the new head.

Session

Updated the branch with main because main changed package.json, pnpm-lock.yaml after its checks ran; waiting for checks on the new head.

Session

Updated the branch with main because main changed package.json, pnpm-lock.yaml after its checks ran; waiting for checks on the new head.

Session

Updated the branch with main because main changed package.json, pnpm-lock.yaml after its checks ran; waiting for checks on the new head.

View session

Hosted checks passed, and 18 focused Markdown tests passed locally. Local Chromium was unavailable, but a delayed-response harness reproduced the P2 Highlight test race. I resolved the thread without a test-only push. The remaining step is to verify the upstream merge and repin Comark UI.

Session

Pushed 9931278 and resolved the review thread. Markdown images now honor authored width caps and shrink proportionally without typed CSS attr(), while screenshots and chip icons keep their sizing. The Highlight test now waits for submission to finish before checking that strokes clear. Lint, formatting, doctor, and 19 focused tests passed. Playwright’s browser download failed locally, so hosted CI will verify the browser tests.

@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 pinned Comark UI build leaves some ordinary Markdown images taller than the viewport and introduces distortion when zooming images with explicit dimensions on direct Markdown pages.

Approach: Fixing image sizing in the shared Comark UI stylesheet is the right scope, but Drop needs the upstream follow-up as well as the first build.

Reviewed changes — I checked the dependency pins, Drop’s rendered Markdown, and the screenshot controls. All 107 focused tests passed with the PR lockfile.

  • Image sizing: The new stylesheet caps and centers plain captioned images without resizing annotated screenshots.
  • Renderer configuration: motion: false keeps the new script out of rendered documents, and the Markdown reference audit skips comark-motion.
  • Screenshot zoom: The browser test follows the new toolbar wrapper and still verifies copy and gallery navigation.

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

Comment thread package.json 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 portrait rule fixes the reported zoom distortion, but it also enlarges ordinary link icons and images that authors explicitly sized smaller.

Approach: A local workaround can bridge the upstream pin, but it needs to preserve component sizing and authored widths below the cap.

Reviewed changes — I reviewed the changes in a2b7f05. All 20 targeted tests passed against the PR lockfile; the sizing regression below was verified separately in Chromium.

  • Added a local portrait cap. The rule fits nested and explicitly dimensioned portraits while excluding annotated screenshots.
  • Added direct-page browser coverage. The test checks emphasis, tables, explicit dimensions, and the zoomed aspect ratio.
  • Reformatted the Markdown reference test. The audit still excludes comark-motion, which remains disabled in the renderer.

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

Comment thread shared/typeset.css 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 thumbnail regression test fails in CI and locally: both thumbnails still render at 224×560 instead of 80×200.

Approach: The local width override does not reliably win the cascade, and the proportional sizing it replaces has no fallback on supported Safari. Use one sizing contract: keep authored widths when they fit, and shrink images proportionally when they do not.

Reviewed changes — I reviewed a2b7f05 → 20af92a and ran 20 focused tests against the PR lockfile; 19 passed.

  • Moved portrait sizing into Comark’s typeset layer, excluded chip icons, and added a typed attr() width cap.
  • Extended browser coverage to include both thumbnail syntaxes and Drop’s fallback favicon. The favicon stayed 14×14 in Chromium.

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

Comment thread shared/typeset.css 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 P0 or P1 findings remain; the only finding is a test race.

Approach: Passing the authored width from the renderer to CSS fixes both the cascade tie and the dependency on typed attr().

Reviewed changes — I reviewed 20af92a → 9931278. All 43 focused tests passed against the PR lockfile, and the image sizing and zoom checks passed separately in Firefox. WebKit could not launch on this runner.

  • Preserved authored widths by rendering a CSS custom property and making the local width cap win over Comark’s default. Both thumbnail forms stayed 80×200, and the larger portrait kept its aspect ratio in zoom.
  • Invalidated cached Markdown HTML so existing documents pick up the new width property, and added a test for when the property is emitted.
  • Added a composer wait before the highlight test checks that sending clears the strokes.

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

Comment thread test/review/highlight-browser.test.mjs Resolved
@vite-hub
vite-hub Bot merged commit 20ab09c into main Nov 21, 2026
6 checks passed
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