Skip to content

fix(ui): correct Mosaic Item pressed state and color transitions - #9293

Closed
maxyinger wants to merge 1 commit into
mainfrom
max/mosaic-item-press-state
Closed

fix(ui): correct Mosaic Item pressed state and color transitions#9293
maxyinger wants to merge 1 commit into
mainfrom
max/mosaic-item-press-state

Conversation

@maxyinger

Copy link
Copy Markdown
Collaborator

The pressed background on interactive rows never rendered on hover-capable devices. StyleX doubles an atom's class inside an at-rule, so the @media (hover: hover) :hover rule compiled to a higher specificity than the bare :active rule and won for the duration of the press. Excluding :active from the hover selector stops it matching while pressed, matching what button already does.

Rows also had no transition, so the hover background snapped. They now use the same instant-press/soft-settle treatment as button, gated on a bare :active rather than :enabled:active because a row renders as a div or an a and :enabled only matches form controls. Item.Title gets a matching color transition so its hover shift settles in step with the row behind it.

Description

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

The pressed background on interactive rows never rendered on hover-capable
devices. StyleX doubles an atom's class inside an at-rule, so the
`@media (hover: hover)` `:hover` rule compiled to a higher specificity than the
bare `:active` rule and won for the duration of the press. Excluding `:active`
from the hover selector stops it matching while pressed, matching what `button`
already does.

Rows also had no transition, so the hover background snapped. They now use the
same instant-press/soft-settle treatment as `button`, gated on a bare `:active`
rather than `:enabled:active` because a row renders as a `div` or an `a` and
`:enabled` only matches form controls. `Item.Title` gets a matching `color`
transition so its hover shift settles in step with the row behind it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jul 30, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: af96cec

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview Jul 30, 2026 9:28pm
swingset Ready Ready Preview Jul 30, 2026 9:28pm

Request Review

@pkg-pr-new

pkg-pr-new Bot commented Jul 30, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@9293

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@9293

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@9293

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@9293

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@9293

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@9293

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@9293

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@9293

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@9293

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@9293

@clerk/express

npm i https://pkg.pr.new/@clerk/express@9293

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@9293

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@9293

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@9293

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@9293

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@9293

@clerk/react

npm i https://pkg.pr.new/@clerk/react@9293

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@9293

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@9293

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@9293

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@9293

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@9293

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@9293

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@9293

commit: af96cec

@github-actions

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-07-30T21:30:27.179Z

Summary

Metric Count
Packages analyzed 19
Packages with changes 0
🔴 Breaking changes 0
🟡 Non-breaking changes 0
🟢 Additions 0

No API Changes Detected

All packages have stable APIs with no detected changes.


Report generated by Break Check

Last ran on af96cec.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Updated Mosaic item styling so hover backgrounds do not override active states. Added explicit linear transitions for row background and title color using fast and instant duration tokens. Added a changeset entry documenting the press-state update.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main fix to Mosaic item pressed state and color transitions.
Description check ✅ Passed The description directly explains the pressed-state and transition changes made in the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.changeset/mosaic-item-press-state.md:
- Around line 1-2: Populate the changeset front matter with the appropriate
version bump for the affected packages/ui package, then add a concise release
summary describing the mosaic item press-state behavior change. Keep the
standard Changesets delimiter format intact and ensure this is not left as a
delimiter-only changeset.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: db6320ad-d4c5-40d2-9c9d-4940ce10077f

📥 Commits

Reviewing files that changed from the base of the PR and between bc42936 and af96cec.

📒 Files selected for processing (2)
  • .changeset/mosaic-item-press-state.md
  • packages/ui/src/mosaic/components/item/item.styles.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • clerk/clerk_go (manual)
  • clerk/dashboard (manual)
  • clerk/accounts (manual)
  • clerk/backoffice (manual)
  • clerk/clerk (manual)
  • clerk/clerk-docs (manual)
  • clerk/cloudflare-workers (manual)

Comment on lines +1 to +2
---
---

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Populate the changeset for this package change.

Lines 1-2 contain no package bump or release description, so Changesets will not record this packages/ui behavior change for release. Add the appropriate package entry and summary.

Proposed shape
 ---
+'`@clerk/ui`': patch
 ---
+
+Fix Mosaic item pressed-state backgrounds and transitions.

As per coding guidelines, Changesets must manage versioning and changelogs. Based on learnings, delimiter-only changesets are appropriate only for documentation, tooling, or scaffolding changes.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
---
---
---
'`@clerk/ui`': patch
---
Fix Mosaic item pressed-state backgrounds and transitions.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.changeset/mosaic-item-press-state.md around lines 1 - 2, Populate the
changeset front matter with the appropriate version bump for the affected
packages/ui package, then add a concise release summary describing the mosaic
item press-state behavior change. Keep the standard Changesets delimiter format
intact and ensure this is not left as a delimiter-only changeset.

Sources: Coding guidelines, Learnings

@maxyinger maxyinger closed this Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant