feat: add floating (drag-to-move) position for tooltip icons#74
Merged
mountaindude merged 5 commits intomainfrom Mar 19, 2026
Merged
feat: add floating (drag-to-move) position for tooltip icons#74mountaindude merged 5 commits intomainfrom
mountaindude merged 5 commits intomainfrom
Conversation
Co-authored-by: mountaindude <1029262+mountaindude@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add movable option for tooltip icons
feat: add floating (drag-to-move) position for tooltip icons
Mar 18, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new tooltip icon position option (floating) to let users reposition tooltip trigger icons via click-drag within the target element, while preserving click-to-open dialog behavior.
Changes:
- Implemented pointer-based drag-to-move behavior for tooltip icons when
iconPosition === 'floating'. - Added CSS modifier classes for floating/dragging cursor + interaction styling.
- Exposed the new option in the property panel and documented the behavior in both developer guides.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| extension/src/ui/tooltip-injector.js | Adds floating positioning support and enableDrag() pointer-event drag logic with click suppression after drag. |
| extension/src/style.css | Adds .hbqs-tooltip-trigger--floating and .hbqs-tooltip-trigger--dragging styles (cursor/touch-action/transition/opacity). |
| extension/src/property-panel/tooltips-section.js | Adds "Floating (drag to move)" to the icon position dropdown. |
| extension/docs/tooltips-developer.md | Documents mount lifecycle updates and the new drag behavior + modifier classes. |
| extension/docs/tooltips-app-developer.md | Documents the new floating position option for app developers. |
Comment on lines
+299
to
+307
| const parentRect = parentEl.getBoundingClientRect(); | ||
| const iconSize = iconEl.offsetWidth; | ||
|
|
||
| let newLeft = origLeft + dx; | ||
| let newTop = origTop + dy; | ||
|
|
||
| // Constrain within parent bounds | ||
| newLeft = Math.max(0, Math.min(newLeft, parentRect.width - iconSize)); | ||
| newTop = Math.max(0, Math.min(newTop, parentRect.height - iconSize)); |
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.
Adds a new
floatingicon position that lets users reposition tooltip icons via click-drag, constrained within the target element. Click-to-open-dialog still works — a 5px dead-zone distinguishes clicks from drags.Property panel
"Floating (drag to move)"in the icon position selectorDrag behavior (
tooltip-injector.js)enableDrag()uses Pointer Events withsetPointerCapturefor reliable cross-browser dragpointerdown, converts anyright/bottomCSS positioning to explicitleft/topso deltas are trivialgetBoundingClientRect()clicklistener suppresses dialog open after a drag gestureCSS (
style.css).hbqs-tooltip-trigger--floating—cursor: grab; touch-action: none.hbqs-tooltip-trigger--dragging—cursor: grabbing; transition: none; opacity: 0.85Docs
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.