Skip to content

fix(frontend): replace hardcoded colors with theme-aware CSS variables - #323

Open
thrawn-sh wants to merge 1 commit into
chriswritescode-dev:mainfrom
thrawn-sh:fix/theme-consistency
Open

fix(frontend): replace hardcoded colors with theme-aware CSS variables#323
thrawn-sh wants to merge 1 commit into
chriswritescode-dev:mainfrom
thrawn-sh:fix/theme-consistency

Conversation

@thrawn-sh

@thrawn-sh thrawn-sh commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Replace hardcoded dark-mode colors (bg-[#141414], text-white, bg-zinc-950, bg-blue-600, etc.) with semantic Tailwind theme tokens (bg-card, text-foreground, bg-primary, etc.) across all affected components. This ensures the UI renders correctly in both light and dark mode.

Components fixed:

  • AddRepoDialog: all hardcoded bg/text/border colors → theme variables
  • ModelQuickSelect: BottomSheet bg-zinc-950/text-white → bg-popover/text-foreground
  • SessionDetail: header button overrides → bg-secondary/text-secondary-foreground
  • RepoDetail: primary buttons bg-blue-600 → bg-primary
  • AssistantRedirect: primary buttons bg-blue-600 → bg-primary
  • Login: added missing bg-input class on inputs (consistent with Register/Setup)

CSS fixes:

  • index.css: fix dead selector :root:not(.dark) html → html:not(.dark)
  • index.css: add light-mode variant for .shine-loading gradient animation

Spotted during extensive weekend use of the UI — switching between light and dark theme revealed that several components were only styled for dark mode, appearing as dark "islands" on a light background. The inconsistencies were particularly noticeable in the AddRepoDialog, model selector bottom sheet, and session header buttons.

Summary

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation

Checklist

  • Code follows project style (no comments, named imports)
  • TypeScript types are properly defined
  • Tests added/updated (80% coverage target)
  • pnpm lint passes locally
  • pnpm typecheck passes locally

Summary by CodeRabbit

  • Style
    • Updated model quick-select menus and provider lists to use theme tokens for consistent hover/selected, text, icon, and chevron colors.
    • Re-themed “New Session” and “Create Workspace” buttons to standard primary styles across assistant and repo/session flows.
    • Adjusted Login email/password input backgrounds and session header action button styling for cleaner borders and hover states.
    • Improved light-mode loading gradient readability and fine-tuned the light-mode html background selector.

@chriswritescode-dev

Copy link
Copy Markdown
Owner

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ef6c62ff-fc15-4b20-9354-4f36d3a63984

📥 Commits

Reviewing files that changed from the base of the PR and between 375fa38 and 1145527.

📒 Files selected for processing (6)
  • frontend/src/components/model/ModelQuickSelect.tsx
  • frontend/src/index.css
  • frontend/src/pages/AssistantRedirect.tsx
  • frontend/src/pages/Login.tsx
  • frontend/src/pages/RepoDetail.tsx
  • frontend/src/pages/SessionDetail.tsx
🚧 Files skipped from review as they are similar to previous changes (6)
  • frontend/src/pages/Login.tsx
  • frontend/src/pages/SessionDetail.tsx
  • frontend/src/pages/AssistantRedirect.tsx
  • frontend/src/index.css
  • frontend/src/pages/RepoDetail.tsx
  • frontend/src/components/model/ModelQuickSelect.tsx

📝 Walkthrough

Walkthrough

This styling update replaces hard-coded colors across model selection, authentication, repository, and session interfaces with theme tokens. It also adds light-mode global background and loading-gradient rules.

Changes

Theme token restyling

Layer / File(s) Summary
Model quick-select token styling
frontend/src/components/model/ModelQuickSelect.tsx
Model and provider rows, controls, sidebars, mobile sections, and footer actions use foreground, muted, border, popover, and accent theme tokens.
Page action and input styling
frontend/src/pages/AssistantRedirect.tsx, frontend/src/pages/Login.tsx, frontend/src/pages/RepoDetail.tsx, frontend/src/pages/SessionDetail.tsx
Page actions use primary tokens, login fields use the input background token, and session header controls use secondary, border, and accent tokens.
Global light-mode styling
frontend/src/index.css
The non-dark HTML background selector is adjusted, and light mode adds dark color stops for the shine-loading gradient.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 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 clearly summarizes the main change: replacing hardcoded colors with theme-aware CSS variables in the frontend.
Description check ✅ Passed The description matches the template with Summary, Type of Change, and Checklist sections filled out and relevant to the PR.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai 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.

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 `@frontend/src/pages/SessionDetail.tsx`:
- Line 465: Update the Header className in SessionDetail so the button styling
selector targets only the intended controls, rather than every descendant
button. Preserve the existing styling for those controls while excluding the
parent-session button and other header actions from the secondary background,
border, text, and hover rules.
🪄 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 UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 057f734c-eb64-4e71-83ea-54a35e845d78

📥 Commits

Reviewing files that changed from the base of the PR and between 8d5102d and 3bb9f74.

📒 Files selected for processing (7)
  • frontend/src/components/model/ModelQuickSelect.tsx
  • frontend/src/components/repo/AddRepoDialog.tsx
  • frontend/src/index.css
  • frontend/src/pages/AssistantRedirect.tsx
  • frontend/src/pages/Login.tsx
  • frontend/src/pages/RepoDetail.tsx
  • frontend/src/pages/SessionDetail.tsx

Comment thread frontend/src/pages/SessionDetail.tsx Outdated
@thrawn-sh
thrawn-sh force-pushed the fix/theme-consistency branch 2 times, most recently from 8b952f1 to 375fa38 Compare July 27, 2026 05:15
Replace hardcoded dark-mode colors (bg-[#141414], text-white, bg-zinc-950,
bg-blue-600, etc.) with semantic Tailwind theme tokens (bg-card, text-foreground,
bg-primary, etc.) across all affected components. This ensures the UI renders
correctly in both light and dark mode.

Components fixed:
- AddRepoDialog: all hardcoded bg/text/border colors → theme variables
- ModelQuickSelect: BottomSheet bg-zinc-950/text-white → bg-popover/text-foreground
- SessionDetail: header button overrides → bg-secondary/text-secondary-foreground
- RepoDetail: primary buttons bg-blue-600 → bg-primary
- AssistantRedirect: primary buttons bg-blue-600 → bg-primary
- Login: added missing bg-input class on inputs (consistent with Register/Setup)

CSS fixes:
- index.css: fix dead selector :root:not(.dark) html → html:not(.dark)
- index.css: add light-mode variant for .shine-loading gradient animation

Spotted during extensive weekend use of the UI — switching between light and
dark theme revealed that several components were only styled for dark mode,
appearing as dark "islands" on a light background. The inconsistencies were
particularly noticeable in the AddRepoDialog, model selector bottom sheet,
and session header buttons.
@thrawn-sh
thrawn-sh force-pushed the fix/theme-consistency branch from 375fa38 to 1145527 Compare July 28, 2026 19:25
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