Skip to content

fix(app): restore model picker hover and tooltip contrast#453

Merged
Astro-Han merged 1 commit into
devfrom
codex/i440-model-picker-hotfix
May 5, 2026
Merged

fix(app): restore model picker hover and tooltip contrast#453
Astro-Han merged 1 commit into
devfrom
codex/i440-model-picker-hotfix

Conversation

@Astro-Han

@Astro-Han Astro-Han commented May 5, 2026

Copy link
Copy Markdown
Owner

Summary

Restores visible hover state across the prompt input selectors and fixes model tooltip contrast after the #440 visual-token work.

Covered prompt surfaces:

  • Model picker rows
  • Workspace/directory picker rows
  • Reasoning effort picker rows
  • Shared Select menu item highlight/hover state

Why

#440's token-layer slices remapped several menu/list hover backgrounds to surface-raised, which is also the popover background. Hovered rows therefore had no visible state across multiple prompt controls, not just the model picker.

The model tooltip also forced detail rows to text-fg-on-brand, which can become unreadable when the inverse tooltip background changes across themes.

This is a small hotfix so later #440 slices can continue from a working baseline instead of carrying the regression forward.

Related Issue

Follow-up to #440.

Human Review Status

Pending. A human should make the final merge decision after reviewing the final diff and verification evidence.

Review Focus

Please focus on whether the fix stays scoped to prompt selector hover/tooltip contrast, without pulling forward any deferred #440 visual rewrite work.

Risk Notes

Low. The List and Select hover tokens are shared, so other list/select menu surfaces will now use surface-sunken for active/highlighted rows instead of matching their raised container. That is intentional for visible state contrast.

How To Verify

Dependency install: bun install --frozen-lockfile completed successfully in this fresh worktree
Red test: bun --cwd packages/app test:unit src/components/model-picker-hotfix.test.ts failed on the targeted regressions before the fixes
Focused unit: bun --cwd packages/app test:unit src/components/model-picker-hotfix.test.ts passed, 910 pass / 0 fail
Focused E2E: bun --cwd packages/app test:e2e e2e/models/model-picker-visual.spec.ts --project=chromium passed, 2 passed
Typecheck: bun --cwd packages/app typecheck passed with exit 0
Diff check: git diff --cached --check passed
Browser Use: attempted, but the Codex in-app browser backend was unavailable, so Playwright E2E covered the visible paths instead
Known unrelated check: e2e/models/models-visibility.spec.ts currently failed on pre-existing fixture/navigation assumptions, not on this hotfix path

Screenshots or Recordings

No screenshot attached. The committed Playwright E2E opens the prompt model picker, workspace picker, and reasoning-effort picker; hovers menu rows; asserts hovered row backgrounds differ from popover backgrounds; and checks model tooltip foreground/background contrast is at least 3:1.

Checklist

  • Human review status is stated above as pending, approved, or not required
  • I linked the related issue, or stated why there is no issue
  • This PR has type, scope, and priority labels, or I requested maintainer labeling
  • I described the review focus and any meaningful risks
  • I listed the relevant verification steps and the key result for each
  • I did not introduce unrelated refactors, dependencies, generated files, or file changes beyond the stated scope
  • I manually checked visible UI or copy changes when needed, with screenshots or recordings
  • I considered macOS and Windows impact for desktop, packaging, updater, signing, paths, shell, or permissions changes
  • I called out docs, release notes, dependencies, permissions, credentials, deletion behavior, generated content, or local file changes when relevant
  • I reviewed the final diff for unrelated changes and suspicious dependency changes
  • I am targeting dev, and my PR title and commit messages use Conventional Commits in English

@Astro-Han Astro-Han added bug Something isn't working app Application behavior and product flows ui Design system and user interface P1 High priority labels May 5, 2026
@coderabbitai

coderabbitai Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@Astro-Han has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 12 minutes and 38 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 691d6891-0bf4-421c-a062-ac9f2b661393

📥 Commits

Reviewing files that changed from the base of the PR and between f3c7e8d and 9df9164.

📒 Files selected for processing (8)
  • packages/app/e2e/models/model-picker-visual.spec.ts
  • packages/app/src/components/model-picker-hotfix.test.ts
  • packages/app/src/components/model-tooltip.tsx
  • packages/app/src/components/prompt-input.tsx
  • packages/app/src/components/prompt-input/workspace-chip.tsx
  • packages/ui/src/components/list.css
  • packages/ui/src/components/list.tsx
  • packages/ui/src/components/select.css
📝 Walkthrough

Walkthrough

Model picker visual regression fix removes text-fg-on-brand CSS class from tooltip text lines, adjusts active list item background from raised to sunken surface, and adds E2E and unit tests to validate tooltip contrast accessibility and prevent future visual regressions.

Changes

Model Picker Tooltip & List Styling Accessibility Fix

Layer / File(s) Summary
CSS Styling
packages/ui/src/components/list.css
Active list item background changes from var(--surface-raised) to var(--surface-sunken), and :active state now uses var(--surface-base-active) instead of var(--surface-base).
Component Implementation
packages/app/src/components/model-tooltip.tsx
Removes text-fg-on-brand CSS class from "allows" message, reasoning, and context lines, leaving only text-13-regular for text styling.
Unit Test / Regression Guard
packages/app/src/components/model-picker-hotfix.test.ts
Bun test suite validates that model-tooltip.tsx does not use text-fg-on-brand and that list.css active-row styling uses the sunken surface background correctly.
E2E Test / Accessibility Validation
packages/app/e2e/models/model-picker-visual.spec.ts
Playwright test opens model picker, hovers and activates the first row, verifies tooltip visibility, and asserts computed foreground/background color contrast ratio meets WCAG standard (≥3) using helper functions for RGB parsing and luminance calculation.

Sequence Diagram

sequenceDiagram
    actor User
    participant Picker as Model Picker Dialog
    participant Tooltip as Model Tooltip
    participant List as List Component
    participant CSS as CSS Styles

    User->>Picker: Open slash command
    Picker->>List: Render list with items
    List->>CSS: Apply list item styling
    User->>List: Hover and click first row
    List->>List: Mark item data-active="true"
    CSS-->>List: Apply sunken background (not raised)
    List->>Tooltip: Show tooltip for hovered item
    Tooltip->>CSS: Apply text-13-regular (no text-fg-on-brand)
    CSS-->>Tooltip: Render with inherited foreground color
    Tooltip-->>User: Display with accessible contrast ratio ≥3
Loading

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested Labels

bug, P2, app, ui

Poem

🐰 A picker once styled in raised delight,
Now sunken and soft—much better sight!
No brand-colored text to clash and confuse,
With contrast so sharp, accessibility wins the muse! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: restoring model picker hover visibility and tooltip contrast, matching the primary objectives.
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.
Description check ✅ Passed The pull request description comprehensively addresses all required template sections with clear explanations of changes, rationale, scope, risks, and verification steps.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/i440-model-picker-hotfix

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.

@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: 2

🤖 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 `@packages/app/e2e/models/model-picker-visual.spec.ts`:
- Line 38: The test uses a fragile selector row =
picker.locator('[data-slot="list-item"]').first() — replace the data-slot
selector with a stable semantic or component hook: update the picker.locator
call to use a role-based locator (e.g., getByRole / locator('role', { name: ...
})) or a data-component/data-action attribute (e.g.,
'[data-component="model-list-item"]') so tests target the visible semantic
element; modify the locator in the same statement (picker.locator(...).first())
and any related assertions to use the new selector.

In `@packages/app/src/components/model-picker-hotfix.test.ts`:
- Around line 16-18: The assertion that checks for "background:
var(--surface-sunken)" is too broad and can pass if that token appears outside
the active-row block; replace the loose expect(source).toContain("background:
var(--surface-sunken)") with a scoped regex assertion that ensures the
background declaration appears inside the &\[data-active="true"\] block (similar
to the existing negative regex). In other words, use expect(source).toMatch(...)
with a pattern like
&\[data-active="true"\]\s*\{[\s\S]*?background:\s*var\(--surface-sunken\) to
tightly scope the check to the active block.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e3af72ed-a441-48b8-a3cd-0c3037cf3d9c

📥 Commits

Reviewing files that changed from the base of the PR and between b1656c3 and f3c7e8d.

📒 Files selected for processing (4)
  • packages/app/e2e/models/model-picker-visual.spec.ts
  • packages/app/src/components/model-picker-hotfix.test.ts
  • packages/app/src/components/model-tooltip.tsx
  • packages/ui/src/components/list.css

Comment thread packages/app/e2e/models/model-picker-visual.spec.ts Outdated
Comment thread packages/app/src/components/model-picker-hotfix.test.ts

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces visual regression tests for the model picker and updates UI components, specifically adjusting background colors for active list items and removing text color classes in tooltips. The review feedback recommends using contrast calculations for hover state visibility checks and increasing the tooltip contrast threshold to 4.5 to align with WCAG AA accessibility standards.

Comment thread packages/app/e2e/models/model-picker-visual.spec.ts Outdated
Comment thread packages/app/e2e/models/model-picker-visual.spec.ts Outdated
@Astro-Han Astro-Han force-pushed the codex/i440-model-picker-hotfix branch 3 times, most recently from 5fa6fd3 to eab8cfc Compare May 5, 2026 14:11
@Astro-Han Astro-Han force-pushed the codex/i440-model-picker-hotfix branch from eab8cfc to 9df9164 Compare May 5, 2026 14:31
@Astro-Han Astro-Han merged commit 21514d4 into dev May 5, 2026
20 checks passed
@Astro-Han Astro-Han deleted the codex/i440-model-picker-hotfix branch May 5, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app Application behavior and product flows bug Something isn't working P1 High priority ui Design system and user interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant