Skip to content

feat(zoom): open the zoomed view as a native modal dialog - #457

Merged
vite-hub[bot] merged 2 commits into
mainfrom
feat/zoom-native-dialog
Nov 17, 2026
Merged

vite-hub[bot] merged 2 commits into
mainfrom
feat/zoom-native-dialog

Conversation

@onmax

@onmax onmax commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

The zoomed view is a <div role="dialog" aria-modal="true"> at z-index: 2147483000, so a page widget at a higher z-index, such as a fixed chat bubble or a review toolbar, stays on top of it and takes clicks. Focus is kept in by a hand-written Tab trap, so a script that calls focus() on the page behind still moves focus out of the zoom.

This PR opens the view as a native <dialog> with showModal(). It sits in the top layer above every z-index, and the page behind it is inert. Escape now comes from the dialog's cancel event, and the Tab trap and the Escape key handling go. ZoomDetail.dialog is now typed HTMLDialogElement.

What stays the same:

  • A click around the item closes the view. The dialog fills the window, so its ::backdrop never gets the click; .cz-backdrop still does.
  • The open and close animations run as before. The dialog's styles keep it shown until the close animation ends, even when Chrome closes it without a cancel it lets us refuse.
  • Focus returns to the item, and scroll stays locked. The dialog is removed rather than close()d, since close() would focus the item focused before it opened, and Up and Down may have moved on to another figure.
  • It runs from the inlined script with no polyfill. showModal() is in every browser in the support floor. closedby would handle the outside click, but it needs Safari 27.3, which is still in beta.

A host that draws its own UI over the zoom from outside it, as Drop does with its comment layer, now has to put it inside event.detail.dialog, since the rest of the page is inert.

e2e/zoom-dialog.ts tests opening, Escape (from a click, a key, and an open with no user activation), backdrop clicks, the close button, focus return, and the inert page. It runs in Chromium, Firefox and WebKit, so CI installs WebKit too. On main, the inert test fails in all three: the max-z-index widget is still hit. The other tests pass on main too, since the behavior they check is the same.

Before/after in Chromium, Firefox and WebKit: https://drop.vitehub.dev/d/70413sy686r6/comark-zoom-native-dialog

Drop comment plan: K4 (native-first).

The view is a <dialog> opened with showModal(), so it sits in the top
layer, the page behind it is inert, and Escape comes from the dialog's
cancel event. The hand-written Tab trap and Escape key handling go.
Clicks around the item still close it, and the open and close
animations run as before.

The dialog tests run in Chromium, Firefox and WebKit, so CI installs
WebKit too.
@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-17T16:39:38.421296Z
We couldn’t complete this review. Comment @codex review to try again.
1394fe3 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.

@pkg-pr-new

pkg-pr-new Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

comark-annotate

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

comark-badge

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

comark-bundle

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

comark-cards

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

comark-carousel

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

comark-cast

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

comark-charts

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

comark-chat

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

comark-chips

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

comark-cjk

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

comark-code

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

comark-code-notes

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

comark-colors

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

comark-comments

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

comark-critic

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

comark-deflist

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

comark-details

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

comark-diagrams

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

comark-diff

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

comark-embed

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

comark-fields

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

comark-figure

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

comark-file-tree

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

comark-footnotes

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

comark-git-graph

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

comark-github

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

comark-icon

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

comark-include

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

comark-keys

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

comark-links

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

comark-linter

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

comark-magic-move

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

comark-mark

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

markdown-it-to-comark

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

marked-to-comark

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

comark-mathml

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

comark-media

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

comark-metrics

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

migrate-to-comark

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

comark-outline

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

comark-properties

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

comark-qr

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

comark-quiz

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

comark-reading-time

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

remark-to-comark

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

comark-sources

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

comark-steps

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

comark-table

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

comark-tabs

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

comark-tests

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

comark-time

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

comark-ui

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

comark-xref

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

comark-zoom

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

commit: f6a0310

@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

Native modality breaks two built-in interactions inside zoomed content: citation cards and the manual code-copy fallback.

Reviewed changes — Reviewed the native-dialog migration, its public event contract, styling, and cross-browser tests.

  • Native modality: Zoom now uses showModal() to enter the top layer and make the surrounding page inert, with ZoomDetail.dialog typed as HTMLDialogElement.
  • Dismissal and focus: Native dialog events replace manual Escape handling and the Tab trap, while retaining animated removal, scroll restoration, and focus return.
  • Layout and coverage: Dialog styles preserve the full-window layout, documentation explains the new host-control requirements, and shared tests exercise Chromium, Firefox, and WebKit.
  • Verification: The workspace build, 10 zoom unit tests, and 68 Chromium/Firefox browser tests passed; WebKit could not launch because required system libraries are unavailable and the container forbids privileged installation.

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

Comment thread packages/zoom/src/script.ts Resolved
@vite-hub

vite-hub Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor
Session Status Started Duration
Pending Completed Not started —
View session Completed 2026-11-17T17:02:53.331Z 10m 53s

Latest result

Pull request merged.

Final answers

Session

Pull request merged.

Session

Pushed f6a0310 to fix citation-card interaction and manual-copy selection inside modal zoom, added cross-browser regression coverage, and resolved the review thread. All 40 focused unit tests and lint passed. Local browser tests were blocked by sandbox port restrictions and missing Chromium; awaiting hosted CI and automated review.

View session

Pushed f6a0310 to fix citation-card interaction and manual-copy selection inside modal zoom, added cross-browser regression coverage, and resolved the review thread. All 40 focused unit tests and lint passed. Local browser tests were blocked by sandbox port restrictions and missing Chromium; awaiting hosted CI and automated review.

@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 finding remains.

Reviewed changes — Reviewed f6a0310 since the prior Pullfrog review, focusing on the modal-interaction fixes and their regression coverage.

  • Reparented citation cards: Kept the shared card inside its invoking modal, restored it to the page for subsequent outside citations, and ignored delayed opens for disconnected citations.
  • Restored manual copying: Mounted the clipboard-failure textarea inside the invoking modal so code remains focusable and selected for keyboard copying.
  • Added integration coverage: Exercised citation-card hover, focus, clicks, reuse after zoom closes, and fallback selection and cleanup through the shared cross-browser suite.
  • Validated the fixes: Passed 40 focused unit tests, targeted lint, and 40 Chromium/Firefox browser tests. All eight WebKit cases were blocked before assertions by browserType.launch: Host system is missing dependencies to run browsers.

Pullfrog  | View workflow run | Using gpt-6.1-sol(xhigh) | 𝕏

@vite-hub
vite-hub Bot merged commit 93db5ba into main Nov 17, 2026
7 checks passed
@vite-hub
vite-hub Bot deleted the feat/zoom-native-dialog branch November 17, 2026 17:25
@github-actions github-actions Bot mentioned this pull request Nov 17, 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