Add tap/click tooltips for cliché highlights on touch devices - #303
Merged
Conversation
The highlight tooltips relied on the title attribute, which only appears on mouse hover and is unreachable on mobile. Tapping a highlight (or its chain badge) now shows the same information in a floating tooltip that dismisses on a second tap, a tap elsewhere, or scroll. The hover title now also includes the chain item count. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018sZga7AZEvoiYGfMYiBqTY
Contributor
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
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.
Claude Code with Fable 5
Summary
This PR adds interactive tooltips for cliché highlights that appear on tap/click, improving the experience on touch devices where hover tooltips are unavailable. The existing title attribute hover tooltips are preserved for mouse users.
Key Changes
.hit-tipCSS class for a floating tooltip element with dark background, positioned intelligently to avoid viewport edgesmatchTipText()helper that combines pattern name with chain item count (badge title) when applicablerole="tooltip"andpointer-events: noneto avoid interfering with interactionscursor: pointerand-webkit-tap-highlight-color: transparentto highlight marks for better touch feedbackmatchTipText()functionImplementation Details
getBoundingClientRect()to calculate placement relative to the highlight, with fallback to bottom placement if insufficient space abovecurrentMatchesarray to map highlight IDs back to match data for tooltip contenttipTargetto enable toggle behaviorhttps://claude.ai/code/session_018sZga7AZEvoiYGfMYiBqTY