Skip to content

EvoResolver - Fix hybrid touch devices by using any-hover/any-pointer for hover and text selection#1811

Merged
prxt6529 merged 2 commits intomainfrom
evolvecoder-auto/1-IA-user-cannot-select-text-or-reply-in-20260123-063328
Jan 23, 2026
Merged

EvoResolver - Fix hybrid touch devices by using any-hover/any-pointer for hover and text selection#1811
prxt6529 merged 2 commits intomainfrom
evolvecoder-auto/1-IA-user-cannot-select-text-or-reply-in-20260123-063328

Conversation

@punk6529
Copy link
Copy Markdown
Contributor

@punk6529 punk6529 commented Jan 23, 2026

Automated change generated by evoticketresolver.

  • Execution ID: 7246326a-aee0-457c-abeb-365eedadccc7
  • Provider: openai
  • Model: gpt-5.2-pro
  • Target branch: main

Prompt

1/ IA user cannot select text or reply in the waves

2/ our working hypothesis is that because they have a touchscreen laptop with a trackpad (no external mouse) - Microsoft Surface Laptop Studio, running Brave and the code is detecting it as a mobile device

Specifically we are suspicious of the IsTouchDevice hook but that may or may not be correct, you have to analyze yourself

3/ characteristics as follows
{maxTouchPoints: 10, ontouchstart: false, pointerCoarse: true, pointerFine: false}

This must be a general issue and have general solutions implemented elsewhere.  Can you identify the issue and solution and you push a fix

Engine output (last message)

Root cause is hybrid “touchscreen laptop + trackpad” devices getting treated as **touch-only** because the code/CSS keys off **primary** pointer media queries like `(pointer: coarse)` / `(hover: none)`. On a Surface Laptop Studio this commonly disables hover-driven UI (reply/actions) and also applies `user-select: none` in drops, so you can’t select text.

Fixes pushed:

- `styles/globals.scss:97` changes `.touch-select-none` to only apply on **true touch-only** devices via `@media (any-hover: none) and (any-pointer: coarse)` (so hybrids keep text selection).
- `styles/globals.scss:727` changes `.touch-visible` to the same `any-*` logic (so hybrids don’t get forced “touch-only” visibility rules).
- `tailwind.config.ts:179` updates the `desktop-hover` variant to `@media (any-hover: hover)` (so trackpads/mice on hybrid devices get hover styles even if the primary pointer is coarse).
- `components/waves/drops/WaveDropActions.tsx:44` switches the reveal behavior to `desktop-hover:group-hover:tw-opacity-100` and adds `focus-within:tw-opacity-100` (so reply/actions show on hover-capable devices; keyboard focus also reveals).
- `hooks/useIsTouchDevice.ts:18` no longer relies on a “first touchstart” to decide touch-only; it now treats devices as touch-only only when there’s **no fine pointer and no hover**, and uses `navigator.maxTouchPoints` to avoid the “first touch can’t long-press” trap.
- Updated tests in `__tests__/hooks/useIsTouchDevice.test.ts`.

Note: I couldn’t run Jest here because `node_modules` isn’t present in this environment (`jest: not found`), but the changes are small and localized to the detection/hover/selection paths above.

Generated at 2026-01-23 07:20:38Z.

Summary by CodeRabbit

  • Improvements
    • Enhanced detection of device touch and pointer capabilities to better identify hybrid devices supporting both input types
    • Improved focus and hover state behavior for interactive elements across different device types
    • Refined responsive styling for hybrid devices to more accurately apply touch-specific styles based on actual input capabilities

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 23, 2026

📝 Walkthrough

Walkthrough

This PR refines touch device detection by incorporating maxTouchPoints and multiple media queries (any-pointer, any-hover, pointer, hover) to better distinguish touch and pointer devices, including hybrid devices. Updates propagate across the detection hook, tests, global styles, and Tailwind configuration.

Changes

Cohort / File(s) Summary
Touch Device Detection Tests
__tests__/hooks/useIsTouchDevice.test.ts
Adds test setup to preserve/restore navigator.maxTouchPoints across tests. Introduces two new test cases validating detection when maxTouchPoints > 0 with and without fine pointer support, ensuring proper cleanup between test runs.
Core Touch Detection Logic
hooks/useIsTouchDevice.ts
Reworks detection to check maxTouchPoints, then evaluate multiple media queries: (any-pointer: fine), (pointer: fine), (any-hover: hover), (hover: hover). Treats device as touch only if no fine pointer/hover capability exists but maxTouchPoints > 0.
Touch-Related Styles
styles/globals.scss
Replaces (pointer: coarse) + (hover: none) queries with combined (any-hover: none) and (any-pointer: coarse) for both touch-select-none and touch-visible rules to better handle hybrid devices.
Tailwind Desktop-Hover Variant
tailwind.config.ts
Updates desktop-hover variant from (hover: hover) and (pointer: fine) to (any-hover: hover) with explanatory comments, broadening hover style application on hybrid devices.
Wave Drop Actions Component
components/waves/drops/WaveDropActions.tsx
Replaces group-hover opacity trigger with combined desktop-hover:group-hover and explicit focus-within rules, making action UI visible on desktop hover or element focus.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • prxt6529
  • simo6529
  • ragnep

Poem

🐰 Hop, hop, media queries refine,
maxTouchPoints and hover align,
Hybrid devices now shine,
Touch or pointer? Both work fine!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing hybrid touch device detection by replacing pointer/hover media queries with any-hover/any-pointer equivalents across multiple files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@prxt6529 prxt6529 self-assigned this Jan 23, 2026
…t-or-reply-in-20260123-063328

Signed-off-by: prxt6529 <prxt@6529.io>
@sonarqubecloud
Copy link
Copy Markdown

@prxt6529 prxt6529 merged commit 46e3ed8 into main Jan 23, 2026
7 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