Skip to content

fix(touch): show hover-only controls on devices without hover. - #1137

Open
KarunyaChavan wants to merge 1 commit into
WordPress:trunkfrom
KarunyaChavan:fix/touch-hover-only-controls
Open

KarunyaChavan wants to merge 1 commit into
WordPress:trunkfrom
KarunyaChavan:fix/touch-hover-only-controls

Conversation

@KarunyaChavan

@KarunyaChavan KarunyaChavan commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

What it does

Buttons that used to appear only when you hover with a mouse now stay visible on touch devices, so tablet users can find and use them:

  • the delete button on uploaded themes in OpenStation Preferences → Themes
  • the edit and close buttons on desktop tiles in Overview
  • the settings gear on the Pulse Monitor widget
  • the delete button on conversations in Agent chat

Fixes #1136

Before (touch) After (touch)
Uploaded theme before-theme after-theme
Overview before-overview after-overview
Pulse Monitor before-pulse after-pulse

With a mouse nothing changes: these buttons still fade in on hover.

Rationale

These buttons start fully transparent and only show on :hover or :focus-visible. A touch screen has no hover, and a tap doesn't trigger :focus-visible, so on a tablet they never appear. You couldn't delete an uploaded theme, edit or close a desktop from Overview, open the Pulse Monitor settings, or delete a chat.

We already fixed this for widgets: the widget close button and the "add widget" button stay visible under @media ( hover: none ) in assets/css/desktop.css. These buttons were missed.

Implementation

  • Each button gets an @media ( hover: none ) rule that keeps it visible, the same approach the widget close button uses. Hover behaviour on desktop is untouched.
  • The theme delete, Overview edit/close and Pulse Monitor gear rest at 0.7 opacity, matching the widget close button. They're small buttons in the corner of a card, and dimming them means a card you're only reading doesn't carry a hard × in its corner.
  • The Agent chat delete button rests at full opacity instead. It's a grey glyph on the dark sidebar with no background behind it. At 0.7 its contrast drops to about 2.5:1, below the 3:1 a control needs to be found easily.
  • The Overview close button shares its rule with the edit button, so it's fixed in the same change.

Testing instructions

Use a touch device. A real tablet works, or Chrome DevTools.

  1. Theme delete: on a regular desktop browser, upload any desktop theme ZIP in OpenStation Preferences > Themes. Switch to touch, reload, and open the same page. The uploaded theme's card shows a × in its corner. Tap it: the "Delete this theme?" dialog opens.
  2. Overview: tap the Workspaces tile in the dock. Each desktop tile shows a pencil (edit) and a × (close).
  3. Pulse Monitor: long-press the desktop, choose Add widget and add Pulse Monitor. A settings gear sits in the widget's top-right corner. Tap it to open the settings.
  4. Agent chat: open an agent's chat from WP Explorer > Agents with at least one past conversation. Each conversation in the sidebar shows a ×.
  5. No regression on desktop: in a normal desktop browser, all of these still stay hidden until you hover, then fade in.
Open WordPress Playground Preview

- Keep the uploaded theme's delete button visible on touch in Preferences > Themes.
- Keep the Overview tile's edit and close buttons visible on touch.
- Keep the Pulse Monitor widget's settings gear visible on touch.
- Keep the Agent chat conversation delete button visible on touch.
- Rest corner controls at 0.7 opacity, matching the existing widget close button.
- Show the Agent chat delete at full opacity; its grey glyph drops below 3:1 contrast at 0.7.
@KarunyaChavan
KarunyaChavan marked this pull request as ready for review November 27, 2026 12:09

This branch has not been deployed

No deployments
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.

Some controls only show up on hover, so they're missing on touch devices

1 participant