Repository navigation
feat(overlay): draggable annotation popover (#3) - #12
Merged
Merged
Conversation
Let the reviewer drag the popover aside by its title bar to read the surrounding page while composing — complements ANN-10 (composing is no longer dismissed by page interaction). - popover: the title bar (grip icon + label) is a drag handle; Pointer Events + setPointerCapture move the box. preventDefault keeps a focused textarea from blurring and stops text selection; stopPropagation keeps the gesture clear of page selection. The dragged position wins over auto-placement so it survives re-renders, and resets when a different element is selected. Re-clamps on resize via the shared tracker. - geometry: new clampBox() keeps a chosen box fully in the viewport. - styles: .mk-pop-head handle (grip + ellipsised label), touch-action none, .mk-dragging. The popover stays fixed on screen while the page scrolls (so you can read other context) rather than following the element. Adds ANN-11; unit test for clampBox and a Playwright drag spec. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The clamp assertion referenced bare `innerWidth`/`innerHeight` inside a page.evaluate callback — valid in the browser at runtime but flagged as no-undef when eslint lints the spec in a Node context (CI lint failure). Read the box in the browser and compare against page.viewportSize() in Node instead. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3.
Drag the comment/edit popover aside by its title bar (grip icon + label) so you can read the surrounding page while composing — complementing ANN-10 (composing isn't dismissed by page interaction).
Behaviour
Implementation
popover.js: title bar is the.mk-draghandle; Pointer Events +setPointerCapture(touch-aware).preventDefaultkeeps a focused textarea from blurring + stops text selection;stopPropagationkeeps the gesture clear of page selection. AdraggedPoswins overplacePopover(), resets on a new anchor, re-clamps on resize via the shared tracker.geometry.js: newclampBox()keeps a chosen box fully in the viewport (degrades for oversize boxes).styles.js:.mk-pop-headhandle (grip + ellipsised label),touch-action:none,.mk-dragging.Tests
clampBox(test/unit/geometry.test.js).test/browser/drag.spec.js— move, compose→drag→text-preserved, persist-across-rerender, re-anchor-on-new-selection, viewport clamp.🤖 Generated with Claude Code