feat: Add hover and long press tooltips to quicktools items - #2456
Conversation
Greptile SummaryThis PR adds hover and long-press tooltip support to the editor quick-tools toolbar, introducing a reusable singleton
Confidence Score: 5/5Safe to merge — the tooltip feature is additive, touch interaction logic is preserved, and all previously flagged regressions have been corrected. The core logic changes are straightforward: a new singleton tooltip element, RAF-guarded positioning, and a
Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant User
participant RowItem
participant quickToolsInit
participant Tooltip
Note over User,Tooltip: Mouse hover flow
User->>RowItem: mouseenter
RowItem->>Tooltip: showTooltip($item, description(id))
Tooltip->>Tooltip: cancelAnimationFrame(rafId)
Tooltip->>Tooltip: RAF → position + animate(opacity:1)
User->>RowItem: mouseleave
RowItem->>Tooltip: hideTooltip()
Tooltip->>Tooltip: animate(opacity:0)
Note over User,Tooltip: Touch long-press flow
User->>quickToolsInit: touchstart
quickToolsInit->>quickToolsInit: setTimeout(500ms)
quickToolsInit->>Tooltip: showTooltip($el, description($el.dataset.id))
alt repeat button
quickToolsInit->>quickToolsInit: "contextmenu=true, oncontextmenu()"
end
User->>quickToolsInit: touchend / touchcancel
quickToolsInit->>Tooltip: hideTooltip()
Note over User,Tooltip: Click (any mode)
User->>quickToolsInit: click / onclick
quickToolsInit->>Tooltip: hideTooltip()
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant User
participant RowItem
participant quickToolsInit
participant Tooltip
Note over User,Tooltip: Mouse hover flow
User->>RowItem: mouseenter
RowItem->>Tooltip: showTooltip($item, description(id))
Tooltip->>Tooltip: cancelAnimationFrame(rafId)
Tooltip->>Tooltip: RAF → position + animate(opacity:1)
User->>RowItem: mouseleave
RowItem->>Tooltip: hideTooltip()
Tooltip->>Tooltip: animate(opacity:0)
Note over User,Tooltip: Touch long-press flow
User->>quickToolsInit: touchstart
quickToolsInit->>quickToolsInit: setTimeout(500ms)
quickToolsInit->>Tooltip: showTooltip($el, description($el.dataset.id))
alt repeat button
quickToolsInit->>quickToolsInit: "contextmenu=true, oncontextmenu()"
end
User->>quickToolsInit: touchend / touchcancel
quickToolsInit->>Tooltip: hideTooltip()
Note over User,Tooltip: Click (any mode)
User->>quickToolsInit: click / onclick
quickToolsInit->>Tooltip: hideTooltip()
Reviews (4): Last reviewed commit: "fix: replaced title attribute" | Re-trigger Greptile |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
…undation#2456) Co-authored-by: Raunak Raj <71929976+bajrangCoder@users.noreply.github.com>
Summary of this PR
This PR adds tooltips for the editor quick tools.
Changes
Testing
Closes #2268