Repository navigation
fix(annotate): place a box with calc() so a host's box-sizing reset can't shift it - #392
Conversation
…an't shift it
A box padded itself 6px out with content-box padding and a -6px margin in the comark layer. An unlayered
'* { box-sizing: border-box }', as Drop's document shell has, beats any layered rule, so the padding folded
back inside the box and the mark sat 6px up and left of its area. The renderer now writes the room into the
mark's left, top, width, and height with calc(), which box-sizing doesn't touch.
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. |
There was a problem hiding this comment.
✅ No new issues found. No P0 or P1 findings remain.
Reviewed changes in the initial review of 2bf37ea, covering the annotate box geometry fix and its regression coverage.
- Reset-resistant box geometry — Box clearance now uses inline
calc()positioning and sizing, so an unlayered hostbox-sizing: border-boxreset cannot fold the clearance inside the marked area. - Aligned placement behavior — The renderer uses the same
boxPaddinginput as stamp placement, while chart annotations retain their zero-padding percentage geometry. - Regression coverage — Unit assertions cover default and chart geometry, and Playwright verifies the rendered rectangle under the overriding host reset.
gpt-5.6-sol | 𝕏
Latest result Pull request merged. Final answersSession Pull request merged. Ready; no repair needed. Pullfrog: no findings; Codex review unavailable due to quota. All supplied checks passed. Package-local `vp test run` passed annotate (72 tests) and charts (42). Focused `vp lint`, the Playwright host-reset regression, dependency builds, and `git diff --check` passed. Initial pnpm setup hooks failed in the sandbox; validation succeeded with automatic reinstall disabled. The checkout remains clean. |
comark-annotate
comark-badge
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-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: |

On a page that sets
* { box-sizing: border-box }outside a layer, everyboxmark sits 6px up and left of its area and doesn't grow past it. Drop's document shell has that reset, so box marks on Drop docs have been off since it moved to comark-ui 0.8.2.Since #230, a box pads itself out with
.ca-mark.ca-box{box-sizing:content-box;padding:6px;margin:-6px}. That rule lives in@layer comark, and any unlayered rule beats a layered one, whatever its specificity. So the host's reset wins, the 12px of padding fold back inside thew%×h%box, and only the-6pxmargin stays.This PR drops that rule and writes the room into the mark's inline geometry instead:
left:calc(x% - 6px),width:calc(w% + 12px), and the same fortopandheight. The box has no padding or border, sobox-sizingno longer changes where it lands. Charts still pass a padding of 0 and get plain percentages.The new e2e test renders a box under that reset and checks its rect is the area plus 6px on each side. It fails on
main(12px off) and passes here. I also rendered the Drop doc where I saw it with this build and the same reset: before/after.