Skip to content

fix(ui): prevent sticky hover styles on touch devices#1799

Open
Oksamies wants to merge 1 commit intomasterfrom
04-02-fix_ui_prevent_sticky_hover_styles_on_touch_devices
Open

fix(ui): prevent sticky hover styles on touch devices#1799
Oksamies wants to merge 1 commit intomasterfrom
04-02-fix_ui_prevent_sticky_hover_styles_on_touch_devices

Conversation

@Oksamies
Copy link
Copy Markdown
Contributor

@Oksamies Oksamies commented Apr 2, 2026

Wrapped hover state CSS rules in @media (hover: hover) and (pointer: fine) for the Link and BreadCrumbs components.

This ensures that hover styling is strictly applied to precise pointing devices (like a mouse) and prevents touch interactions on mobile interfaces from triggering a persistent hover state (e.g., the breadcrumb background remaining actively styled after being tapped).

Wrapped hover state CSS rules in `@media (hover: hover) and (pointer: fine)` for the `Link` and `BreadCrumbs` components.

This ensures that hover styling is strictly applied to precise pointing devices (like a mouse) and prevents touch interactions on mobile interfaces from triggering a persistent hover state (e.g., the breadcrumb background remaining actively styled after being tapped).
Copilot AI review requested due to automatic review settings April 2, 2026 12:58
Copy link
Copy Markdown
Contributor Author

Oksamies commented Apr 2, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates hover styling so it only applies on devices that actually support hover with a fine pointer (e.g., mouse/trackpad), preventing “sticky” hover states after taps on touch devices.

Changes:

  • Wrap Link hover color change in @media (hover: hover) and (pointer: fine).
  • Tighten existing BreadCrumbs hover media queries to also require pointer: fine.
  • Apply the same hover gating to theme-level Link variant hover tokens.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/cyberstorm/src/newComponents/Link/Link.css Restricts .link:hover styling to hover-capable fine pointers to avoid sticky hover on touch.
packages/cyberstorm/src/newComponents/BreadCrumbs/BreadCrumbs.css Updates breadcrumb hover handling to require fine pointer input, reducing touch “hover lock” effects.
packages/cyberstorm-theme/src/components/Link/Link.css Ensures theme variant hover token changes are only applied under fine-pointer hover conditions.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 2, 2026

Walkthrough

This PR updates hover styling across three CSS files to gate :hover states behind a media query requiring both hover: hover and pointer: fine. Changes affect the Link component in both the cyberstorm-theme and cyberstorm packages, as well as the BreadCrumbs component. The modifications ensure that hover-dependent custom properties and related visual behaviors only apply on devices that support hover interactions with a fine pointer, rather than unconditionally.

Possibly related PRs

  • #1766: Modifies Breadcrumbs hover rules to gate styles behind a hover-capable media query, implementing a similar pattern to this PR's approach.
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: wrapping hover styles in media queries to prevent persistent hover states on touch devices.
Description check ✅ Passed The description clearly explains the changes and their purpose: preventing sticky hover styles on touch devices by wrapping hover rules in media queries.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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


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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
packages/cyberstorm/src/newComponents/BreadCrumbs/BreadCrumbs.css (1)

58-62: Optional cleanup: consider a shared media-query token for hover-capable pointers.

@media (hover: hover) and (pointer: fine) is repeated across multiple components in this PR; a shared token/mixin would reduce duplication.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/cyberstorm/src/newComponents/BreadCrumbs/BreadCrumbs.css` around
lines 58 - 62, Extract the repeated media query into a shared token and replace
the inline usage in BreadCrumbs.css; specifically define a shared custom media
like --hover-pointer (e.g. `@custom-media` --hover-pointer (hover: hover) and
(pointer: fine)) in your shared styles/mixins file, then update the rule in
BreadCrumbs.css (the selector block using `@media` (hover: hover) and (pointer:
fine) { &:hover { ... } }) to use `@media` (--hover-pointer) so other components
can reuse the token and remove duplication.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/cyberstorm/src/newComponents/BreadCrumbs/BreadCrumbs.css`:
- Around line 58-62: Extract the repeated media query into a shared token and
replace the inline usage in BreadCrumbs.css; specifically define a shared custom
media like --hover-pointer (e.g. `@custom-media` --hover-pointer (hover: hover)
and (pointer: fine)) in your shared styles/mixins file, then update the rule in
BreadCrumbs.css (the selector block using `@media` (hover: hover) and (pointer:
fine) { &:hover { ... } }) to use `@media` (--hover-pointer) so other components
can reuse the token and remove duplication.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: dc5927ef-2612-41d5-aa51-ca10a4cf6142

📥 Commits

Reviewing files that changed from the base of the PR and between da12e7d and 9a0b346.

📒 Files selected for processing (3)
  • packages/cyberstorm-theme/src/components/Link/Link.css
  • packages/cyberstorm/src/newComponents/BreadCrumbs/BreadCrumbs.css
  • packages/cyberstorm/src/newComponents/Link/Link.css

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 14.57%. Comparing base (da12e7d) to head (9a0b346).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1799   +/-   ##
=======================================
  Coverage   14.57%   14.57%           
=======================================
  Files         338      338           
  Lines       27993    27993           
  Branches      882      882           
=======================================
  Hits         4080     4080           
  Misses      23913    23913           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants