Repository navigation
feat(sources,ui): place the citation card and the props panel with CSS anchor positioning - #456
Conversation
…S anchor positioning The citation card and the editor's props panel are popovers placed by CSS anchor positioning under @supports (anchor-name: --a), with the script's place() kept for browsers without it. The props panel's height stays under half the viewport, so it always fits on one side of its button instead of running off the bottom.
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
The capability gate disables working placement on older Chromium, and citation cards lose their position during dismissal.
Reviewed changes — Reviewed the CSS anchor-positioning migration for citation cards and editor props panels, including fallback behavior and regression coverage.
- Citation cards: CSS places the shared popover above or below its active citation, while JavaScript retains dismissal and transform-origin handling.
- Editor props panels: Per-button anchor names replace JavaScript placement where supported, with directional fallbacks and a smaller viewport-relative height cap.
- Coverage and documentation: Shared Chromium/Firefox tests exercise placement, flipping, viewport clearance, and scrolling; sources documentation describes the new positioning.
Validation: all 27 focused Playwright tests and 24 focused parser, renderer, and editor tests passed. Full pnpm build ended with [timed out after 120000ms] near the final package; the sources and linter packages built successfully independently, including publint.
gpt-6.1-sol(xhigh) | 𝕏
Latest result Pull request merged. Final answersSession Pull request merged. Session Pull request evidence changed. Pushed 126e4d3 fixing both findings and adding regression coverage. Six focused tests and lint passed; browser tests were blocked by sandbox EPERM on server startup. The exit-position thread was resolved; resolving the capability-gate thread failed twice with transport errors. Awaiting hosted checks and review. |
There was a problem hiding this comment.
Important
No P0 or P1 findings remain, but the two new Firefox regression tests fail consistently and need correction before merging.
Reviewed changes — Reviewed 126e4d3, the fix commit since the previous Pullfrog review.
- Tightened capability detection in both JavaScript and CSS so partial anchor-positioning implementations retain measured placement.
- Retained citation anchors during dismissal, transferring the anchor on the next opening and removing it on teardown.
- Added fallback and exit regressions to the shared Chromium/Firefox suite; both new cases currently fail in Firefox for test-specific reasons.
Validation: pnpm build and all 24 focused sources/editor tests passed. The focused browser suite passed 29 of 31 tests; both Firefox failures reproduced twice in isolation and also appear in the CI e2e job.
gpt-6.1-sol(xhigh) | 𝕏
There was a problem hiding this comment.
✅ No new issues found. No P0 or P1 findings remain.
Reviewed changes — Reviewed a410d81, the Firefox regression-test fixes since the previous Pullfrog review.
- Added standards-mode setup to the partial-support fixture so Firefox measures the full viewport when testing JavaScript placement.
- Gated exit-transition geometry on overlay support while retaining anchor-preservation and anchor-transfer assertions in both browsers.
Validation: pnpm build passed; all 31 focused Playwright tests and 24 sources/editor tests passed. Repeating the two repaired cases three times in each browser also passed all 12 executions.
gpt-6.1-sol(xhigh) | 𝕏

The citation card and the editor's props panel are popovers that a script places:
place()reads the anchor's rect, measures the popover, and writestopandleft, then does it again on every scroll and resize. The browsers comark-ui supports can now do this in CSS (anchor positioning shipped in Chrome 125, Firefox 147 and Safari 26), so the measuring can go where anchor positioning exists.This PR moves both to CSS anchor positioning under
@supports (anchor-name: --a)and keepsplace()as the fallback:data-cso-open) is the anchor. The card takesposition-area: top,position-try-fallbacks: flip-blockandjustify-self: anchor-center, with margins that keep it 8px inside the viewport. Hover and focus still open it from the script, sinceinterestforis Chrome-only. The script only sets the transform origin now, so the card still grows from its citation.anchor-name: --cev-N) and its panel takes it. The panel opens below its button from its start, then flips above or to the button's end. With anchor positioning there are no scroll or resize listeners.min(24rem, 80vh)tomin(24rem, 50vh - 3.5rem). With the old cap, a block near the middle of a short window had no room for the panel on either side, soplace()put it below and the bottom ran off the screen. Under half the viewport it always fits on one side.Nothing is added to the inline scripts and there's no polyfill. A browser without anchor positioning runs the same
place()as before.e2e/anchor.tschecks the placement (above and centered, flipped at the top edge, 8px from either side, follows a scroll, panel flips, panel never covers its button) and runs in Chromium (anchor.e2e.ts) and Firefox 157 (anchor-firefox.e2e.ts). Onmainthe CSS-only panel checks and the "placed by the browser" check fail. I also ran the same file in Playwright WebKit locally and it passes, but CI doesn't install WebKit, so it isn't committed.Before/after in Chromium, Firefox and WebKit: on Drop