Repository navigation
feat(zoom): open the zoomed view as a native modal dialog - #457
Conversation
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.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
comark-annotate
comark-badge
comark-bundle
comark-cards
comark-carousel
comark-cast
comark-charts
comark-chat
comark-chips
comark-cjk
comark-code
comark-code-notes
comark-colors
comark-comments
comark-critic
comark-deflist
comark-details
comark-diagrams
comark-diff
comark-embed
comark-fields
comark-figure
comark-file-tree
comark-footnotes
comark-git-graph
comark-github
comark-icon
comark-include
comark-keys
comark-links
comark-linter
comark-magic-move
comark-mark
markdown-it-to-comark
marked-to-comark
comark-mathml
comark-media
comark-metrics
migrate-to-comark
comark-outline
comark-properties
comark-qr
comark-quiz
comark-reading-time
remark-to-comark
comark-sources
comark-steps
comark-table
comark-tabs
comark-tests
comark-time
comark-ui
comark-xref
comark-zoom
commit: |
There was a problem hiding this comment.
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, withZoomDetail.dialogtyped asHTMLDialogElement. - 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.
gpt-6.1-sol(xhigh) | 𝕏
Latest result Pull request merged. Final answersSession 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. 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. |
There was a problem hiding this comment.
✅ 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.
gpt-6.1-sol(xhigh) | 𝕏

The zoomed view is a
<div role="dialog" aria-modal="true">atz-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 callsfocus()on the page behind still moves focus out of the zoom.This PR opens the view as a native
<dialog>withshowModal(). It sits in the top layer above every z-index, and the page behind it is inert. Escape now comes from the dialog'scancelevent, and the Tab trap and the Escape key handling go.ZoomDetail.dialogis now typedHTMLDialogElement.What stays the same:
::backdropnever gets the click;.cz-backdropstill does.cancelit lets us refuse.close()d, sinceclose()would focus the item focused before it opened, and Up and Down may have moved on to another figure.showModal()is in every browser in the support floor.closedbywould 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.tstests 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. Onmain, the inert test fails in all three: the max-z-index widget is still hit. The other tests pass onmaintoo, 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).