feat(ui): draggable comment popover and annotation toolbar#442
Merged
backnotprop merged 2 commits intomainfrom Mar 31, 2026
Merged
feat(ui): draggable comment popover and annotation toolbar#442backnotprop merged 2 commits intomainfrom
backnotprop merged 2 commits intomainfrom
Conversation
Users reported awkward positioning of popovers near viewport edges. Instead of perfecting auto-positioning heuristics, this lets users drag the popover header to reposition it wherever they want. - Add shared useDraggable hook (packages/ui/hooks/useDraggable.ts) that reads the element's rendered position via getBoundingClientRect on drag start, sidestepping all transform complexity - Integrate into AnnotationToolbar (code review line comments) - Integrate into CommentPopover (plan review + file-level comments) - 3px movement threshold prevents interfering with header button clicks - Drag position resets when a new annotation opens - Scroll/resize tracking pauses once user has dragged For provenance purposes, this commit was AI assisted.
Owner
Author
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
The drag handle was only applied to the comment mode header, leaving the Ask AI variant immovable and potentially covering the diff. For provenance purposes, this commit was AI assisted.
stk-code
pushed a commit
to stk-code/plannotator
that referenced
this pull request
Mar 31, 2026
…op#442) Makes the CommentPopover and AnnotationToolbar draggable by their headers via a shared `useDraggable` hook. Users can reposition popovers that land awkwardly near viewport edges. - New `useDraggable` hook reads rendered position via getBoundingClientRect on drag start - 3px movement threshold prevents interfering with button clicks - CommentPopover: suppresses scroll/resize tracking after drag, resets on anchor change - AnnotationToolbar: both comment and Ask AI modes are draggable - Clamps position to keep at least 50px visible on screen For provenance purposes, this commit was AI assisted.
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.
Summary
useDraggablehook that makes fixed-position elements movable by their headerHow it works
Test plan
bun run dev:review— select diff lines, drag toolbar header, verify repositioning