Skip to content

Conversation

@samcm
Copy link
Member

@samcm samcm commented Jan 19, 2026

Summary

Fixed two issues in the SlotProgressTimeline component:

  1. Mobile hover tooltips: Added hover capability detection to disable tooltips on touch-only devices
  2. Cascading collapse visibility: Fixed visibility filter to hide all descendants of collapsed spans, preventing orphaned child elements

Changes

  • Added useCanHover() hook using window.matchMedia('(hover: hover)') to detect touch devices
  • Updated hover handlers to skip state updates when hover is disabled
  • Fixed visibility filter to walk up the ancestry chain instead of just checking immediate parents
  • Added O(1) span lookup map for efficient parent traversal

@samcm samcm requested a review from Savid as a code owner January 19, 2026 00:26
- Add useCanHover() hook to detect touch-only devices and disable hover tooltips on mobile
- Fix visibility filter to hide all descendants of collapsed spans, not just direct children
- Prevents orphaned child spans from appearing when parent is collapsed
- Tested on desktop and verified cascading collapse behavior works correctly
@samcm samcm force-pushed the samcm/fix-slot-trace-mobile-hover branch from 23a6562 to 5c85a12 Compare January 19, 2026 00:39
Extract the useCanHover hook from SlotProgressTimeline to src/hooks/useCanHover/
for reuse across the app. This hook detects if the device supports hover
interactions using the CSS media query (hover: hover).
@samcm samcm merged commit 23fe522 into master Jan 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants