Skip to content

Conversation

@alexcarpenter
Copy link
Member

@alexcarpenter alexcarpenter commented Oct 15, 2025

Description

BEFORE

Screen.Recording.2025-10-15.at.3.18.57.PM.mov

AFTER

Screen.Recording.2025-10-15.at.3.18.07.PM.mov

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:

Summary by CodeRabbit

  • Style

    • Updated select dropdown visuals: hover and selection now use a theme-consistent muted background plus a subtle highlight element, improving clarity and focus.
    • Increased touch area and adjusted option layout to remove dead spots and improve navigation/selection on touch devices.
    • Removed redundant hover/focus styling in one member-role list to avoid duplicate highlighting.
  • Tests

    • Made a test interaction more robust by forcing the click when selecting expiration options to reduce flakiness.
  • Chores

    • Added a patch release changeset documenting these fixes.

@changeset-bot
Copy link

changeset-bot bot commented Oct 15, 2025

🦋 Changeset detected

Latest commit: 74a150c

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

This PR includes changesets to release 3 packages
Name Type
@clerk/clerk-js Patch
@clerk/chrome-extension Patch
@clerk/clerk-expo Patch

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
Copy link

vercel bot commented Oct 15, 2025

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

Project Deployment Preview Comments Updated (UTC)
clerk-js-sandbox Ready Ready Preview Comment Oct 16, 2025 1:50pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 15, 2025

Walkthrough

The Select default option renderer signature drops the isFocused parameter; option styling now uses hover and [data-focused] with a ::before pseudo-element and position: relative. RoleSelect hover/focus SX background styling was removed. A changeset was added and a Playwright click was made forced.

Changes

Cohort / File(s) Summary
Select option rendering & styles
packages/clerk-js/src/ui/elements/Select.tsx
defaultRenderOption signature changed to remove isFocused; option container set to position: relative; hover and [data-focused] styling moved to common.mutedBackground(theme) and a ::before pseudo-element; call sites still pass isSelected as third arg though default renderer no longer accepts the third parameter.
RoleSelect option styling removal
packages/clerk-js/src/ui/components/OrganizationProfile/MemberListTable.tsx
Removed hover/focus background sx styles from RolesListItem used in RoleSelect's renderOption; removed common from styledSystem imports.
Playwright test interaction
packages/testing/src/playwright/unstable/page-objects/apiKeys.ts
click() changed to click({ force: true }) in selectExpiration to force the click on the expiration option.
Release notes / changeset
.changeset/forty-experts-battle.md
Added changeset documenting fixes: focus styles for SelectOption and increased touch area between SelectOption items.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant UI as Select UI
  participant Renderer as Option Renderer

  User->>UI: open dropdown / navigate items
  UI->>Renderer: render(option, index, isSelected)
  Note right of Renderer #eef7ff: defaultRenderOption now expects (option, index) — ignores isFocused
  Renderer-->>UI: option element (position:relative with ::before)
  User->>UI: hover or keyboard focus on item
  UI->>UI: apply :hover or [data-focused] state
  Note right of UI #f6fff0: CSS uses hover / [data-focused] + ::before to show background and larger touch area
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

A rabbit nibbles on one-less-arg delight,
Hops past focus, leaves a soft hover light.
A tiny ::before broadens every row,
Clicks coaxed gently, fewer backgrounds show.
Small tweak, snug touch — we hop and glow. 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly specifies that this PR fixes and enhances the SelectOption component within the clerk-js package, which aligns directly with the changes to focus handling, hover styling, and spacing described in the diff. It succinctly identifies the affected module and the nature of the update without extraneous detail. This makes it easy for reviewers to understand the primary intent at a glance.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch alexcarpenter/select-option-improvements

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 3f603a5 and 74a150c.

📒 Files selected for processing (1)
  • packages/testing/src/playwright/unstable/page-objects/apiKeys.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

**/*.{js,jsx,ts,tsx}: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels

Files:

  • packages/testing/src/playwright/unstable/page-objects/apiKeys.ts
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use Prettier for consistent code formatting

Files:

  • packages/testing/src/playwright/unstable/page-objects/apiKeys.ts
packages/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

TypeScript is required for all packages

Files:

  • packages/testing/src/playwright/unstable/page-objects/apiKeys.ts
packages/**/*.{ts,tsx,d.ts}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Packages should export TypeScript types alongside runtime code

Files:

  • packages/testing/src/playwright/unstable/page-objects/apiKeys.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use proper TypeScript error types

**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoid any type - prefer unknown when type is uncertain, then narrow with type guards
Use interface for object shapes that might be extended
Use type for unions, primitives, and computed types
Prefer readonly properties for immutable data structures
Use private for internal implementation details
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Prefer readonly for properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Use const assertions for literal types: as const
Use satisfies operator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports: import type { ... } from ...
No any types without justification
Proper error handling with typed errors
Consistent use of readonly for immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)

Files:

  • packages/testing/src/playwright/unstable/page-objects/apiKeys.ts
**/*.{js,ts,tsx,jsx}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Support multiple Clerk environment variables (CLERK_, NEXT_PUBLIC_CLERK_, etc.) for configuration.

Files:

  • packages/testing/src/playwright/unstable/page-objects/apiKeys.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: Build Packages
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (1)
packages/testing/src/playwright/unstable/page-objects/apiKeys.ts (1)

46-46: Verify the forced click is necessary and doesn't mask a usability issue.

The force: true option bypasses Playwright's actionability checks, which ensure elements are visible, stable, and can receive events. While this may address test flakiness caused by the new SelectOption styling (hover/focus with ::before pseudo-elements), it could also hide real accessibility or usability problems.

Before merging, confirm:

  • The SelectOption is still keyboard navigable and can be activated without hover
  • The element is properly visible and clickable for users (not just obscured by the pseudo-element)
  • This change addresses test timing/animation issues rather than masking an actual interaction problem introduced by the styling changes

If you'd like, I can help generate a script to verify keyboard accessibility and proper ARIA attributes on the Select component.


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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 15, 2025

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@6999

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@6999

@clerk/elements

npm i https://pkg.pr.new/@clerk/elements@6999

@clerk/clerk-expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/clerk-react

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

@clerk/react-router

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

@clerk/remix

npm i https://pkg.pr.new/@clerk/remix@6999

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/themes

npm i https://pkg.pr.new/@clerk/themes@6999

@clerk/types

npm i https://pkg.pr.new/@clerk/types@6999

@clerk/upgrade

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

@clerk/vue

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

commit: 74a150c

Copy link
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.

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b59def4 and b1aa117.

📒 Files selected for processing (1)
  • .changeset/forty-experts-battle.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
.changeset/**

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Automated releases must use Changesets.

Files:

  • .changeset/forty-experts-battle.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (28)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 14)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (expo-web, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (handshake, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Integration Tests (elements, chrome)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Unit Tests (18, --filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@c...
  • GitHub Check: Unit Tests (22, **)
  • GitHub Check: Publish with pkg-pr-new
  • GitHub Check: Static analysis
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan

Copy link
Member

@tmilewski tmilewski left a comment

Choose a reason for hiding this comment

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

🚀 LGTM, just update the one CodeRabbit comment.

@alexcarpenter alexcarpenter changed the title fix(clerk-js): SelectOptions improvements fix(clerk-js): SelectOption improvements Oct 15, 2025
Copy link
Member

@bratsos bratsos left a comment

Choose a reason for hiding this comment

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

👏

@alexcarpenter alexcarpenter merged commit 64d3135 into main Oct 20, 2025
41 checks passed
@alexcarpenter alexcarpenter deleted the alexcarpenter/select-option-improvements branch October 20, 2025 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants