Skip to content

[Repo Assist] fix: make code tooltip interactive — allow mouse to enter tooltip to select/copy text#1130

Open
github-actions[bot] wants to merge 5 commits intomainfrom
repo-assist/fix-tooltip-interactive-2026-04-01-b44c688d13d9f923
Open

[Repo Assist] fix: make code tooltip interactive — allow mouse to enter tooltip to select/copy text#1130
github-actions[bot] wants to merge 5 commits intomainfrom
repo-assist/fix-tooltip-interactive-2026-04-01-b44c688d13d9f923

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot commented Apr 1, 2026

🤖 This PR was created by Repo Assist, an automated AI assistant.

Closes #949


Root Cause

The mouseout handler on [data-fsdocs-tip] trigger elements always hid the tooltip as soon as the mouse left the trigger, including when the mouse moved into the tooltip popover. This made it impossible for users to hover over the tooltip to select or copy the type signature text — a common need when working with complex F# types.

Fix

docs/content/fsdocs-tips.js:

  1. In the existing trigger mouseout handler, added a check: if relatedTarget is inside the tooltip element, skip hiding (the user is entering the tooltip).
  2. Added a new mouseout handler on .fsdocs-tip[popover] that hides the tooltip when the mouse leaves the tooltip itself, but not if it returns to the trigger element.

docs/content/fsdocs-default.css:
3. Added cursor: text and user-select: text to div.fsdocs-tip:popover-open so users get a visual cue that tooltip text is selectable.

Behaviour after fix

  • Hovering over a code token shows the tooltip as before.
  • Moving the mouse into the tooltip keeps it open — users can now select and copy the text.
  • Moving the mouse out of both the trigger and the tooltip hides it.
  • Moving from the tooltip back to the trigger keeps it open.

Changes

  • docs/content/fsdocs-tips.js — JS logic for interactive tooltip hover
  • docs/content/fsdocs-default.csscursor: text + user-select: text on open tooltip
  • RELEASE_NOTES.md — changelog entry

Test Status

⚠️ Infrastructure: dotnet build fails with "Creating directory" errors in the CI runner environment — this is a pre-existing sandbox limitation (obj/ directory creation fails), not caused by my changes. The changed files are pure JavaScript and CSS; they contain no compiled .NET code.

Previous CI runs on similar JS/CSS-only changes have passed in the actual GitHub Actions environment. The logic has been manually verified by reading the event flow.

Generated by Repo Assist for issue #949

Generated by 🌈 Repo Assist at {run-started}. Learn more.

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@1f672aef974f4246124860fc532f82fe8a93a57e

…t/copy text

The mouseout handler on [data-fsdocs-tip] trigger elements was hiding
the tooltip whenever the mouse left the trigger, even if it was moving
INTO the tooltip popover. This made it impossible to select or copy
text from the tooltip.

Fixes:
1. Trigger mouseout handler now checks if relatedTarget is inside the
   tooltip element, and skips hiding in that case.
2. New mouseout handler on .fsdocs-tip[popover] hides the tooltip when
   the mouse leaves the tooltip itself (unless it returns to the trigger).
3. CSS adds cursor: text and user-select: text to the open tooltip so
   users have a visual cue that text is selectable.

Closes #949

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dsyme dsyme marked this pull request as ready for review April 1, 2026 16:24
@nojaf
Copy link
Copy Markdown
Collaborator

nojaf commented Apr 7, 2026

/repo-assist this still didn't quite work for me. The tooltip is too far from my cursor on the script.
image
In example, my cursor was on printf and moving towards the tooltip made it disappear.

@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions bot commented Apr 7, 2026

✓ Repo Assist completed successfully, see workflow run.

…tooltip

Previously, the 20px offset between cursor and tooltip created a dead zone.
When the mouse left the trigger into this gap, the tooltip hid immediately
because relatedTarget was not the tooltip element. A short delay gives the
mouse time to reach the tooltip before hiding fires.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions bot commented Apr 7, 2026

Commit pushed: c72e1ec

Generated by 🌈 Repo Assist, see workflow run. Learn more.

@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions bot commented Apr 7, 2026

🤖 Repo Assist here. Thanks for the feedback!

The root cause was a dead zone between the cursor and tooltip. The tooltip is positioned 20px below the cursor, so when the mouse moves downward from the trigger into that gap, mouseout fires but relatedTarget is not the tooltip — causing it to hide immediately.

Fix applied: instead of hiding synchronously on mouseout, I now schedule the hide with a 150ms delay (via setTimeout). If the mouse enters the tooltip (or returns to the trigger) within that window, the hide is cancelled. This is the standard pattern used by most tooltip libraries.

The updated code is now pushed to this PR.

Generated by 🌈 Repo Assist, see workflow run. Learn more.

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@e1ecf341a90b7bc2021e77c58685d7e269e20b99

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve the tooltip system

2 participants