这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@balanceiskey
Copy link
Contributor

@balanceiskey balanceiskey commented Oct 13, 2025

What problem(s) was I solving?

Text selection colors in the WUI were using generic accent colors (selection:bg-accent and selection:text-background) that didn't match the design language of each theme. This resulted in low contrast and poor readability when selecting text, especially across the 16 different themes we support. The selection colors were not cohesive with the rest of the theme's color palette.

Related to ENG-2222: Selection colors in app are off/low contrast.

What user-facing changes did I ship?

  • Text selection now uses theme-specific colors that complement each theme's design language
  • Improved contrast and readability when selecting text across all 16 themes
  • Consistent selection behavior across all UI components (inputs, textareas, code blocks, etc.)
  • Each theme now has a carefully chosen selection color, some with alpha transparency for better blending with underlying content

How I implemented it

  1. Added --terminal-selection CSS variable to all 16 themes (humanlayer-wui/src/App.css):

    • Solarized Dark: #2aa19899 (teal with transparency)
    • Solarized Light: #eee8d5 (base2 from Solarized palette)
    • Coffee: #f4a2614d (warm orange with transparency)
    • Catppuccin: #9399b240 (lavender with transparency)
    • High Contrast: #ffffff (pure white for maximum contrast)
    • Figma: #fd579933 (coral with transparency)
    • Minimalist: #0066cc26 (blue with subtle transparency)
    • Gruvbox Dark: #504945 (neutral gray from Gruvbox palette)
    • Gruvbox Light: #d5c4a1 (light gray from Gruvbox palette)
    • Monokai: #49483e (dark gray from Monokai palette)
    • Hacker News: #ff66001a (orange with transparency)
    • Rosé Pine: #6e6a8633 (iris with transparency)
    • Rosé Pine Dawn: #6e6a8614 (iris with lighter transparency)
    • Rosé Pine Moon: #817c9c26 (iris with transparency)
    • Tokyo Night: #515c7e4d (dark blue-gray with transparency)
    • Tokyo Night Storm: #6f7bb640 (blue-gray with transparency)
    • And more...
  2. Created global ::selection rule that applies the theme-specific selection color:

    ::selection {
      background-color: var(--terminal-selection);
      color: var(--terminal-fg);
    }
  3. Updated input component (humanlayer-wui/src/components/ui/input.tsx):

    • Changed from hardcoded selection:bg-accent selection:text-background
    • To CSS variable-based selection:bg-[var(--terminal-selection)] selection:text-foreground
    • This ensures inputs respect the global selection styling

How to verify it

Automated Checks

  • Linting passes: bun run lint (only pre-existing warnings, no new issues)
  • Type checking passes: bun run typecheck

Manual Testing

Test selection colors across themes:

  1. Launch the WUI in development mode
  2. Navigate to Settings and switch between different themes (all 16 available)
  3. For each theme:
    • Select text in various components (session titles, approval content, input fields, code blocks)
    • Verify that the selection color has good contrast with the text
    • Verify that the selection color complements the theme's overall aesthetic
    • Check that selected text is still readable
  4. Pay special attention to these themes which had the most noticeable issues:
    • Solarized Light/Dark (were using accent colors that didn't fit the palette)
    • High Contrast (needs maximum contrast selection)
    • Gruvbox variants (selection should match Gruvbox's earthy tones)
    • Tokyo Night variants (selection should match the dark blue aesthetic)

Specific test cases:

  • Select text in the session list
  • Select text in approval requests
  • Select text in input fields and text areas
  • Select code blocks in the terminal output
  • Select text across line breaks
  • Test with both light and dark themes

Description for the changelog

Fixed text selection colors across all themes. Selection now uses theme-specific colors with proper contrast instead of generic accent colors, improving readability and visual consistency throughout the UI.

@balanceiskey balanceiskey changed the title Sundeep/eng 2222 selection colors in app are offlow contrast 1 [ENG-2222] Update selection colors Oct 13, 2025
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed everything up to b7a6878 in 2 minutes and 20 seconds. Click for details.
  • Reviewed 182 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. humanlayer-wui/src/App.css:62
  • Draft comment:
    Added --terminal-selection variables with alpha values. Ensure these colors meet contrast/accessibility guidelines across themes.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
2. humanlayer-wui/src/App.css:755
  • Draft comment:
    Global ::selection styling using var(--terminal-selection) creates consistency. Consider if it should be placed within an @layer for maintainability.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
3. humanlayer-wui/src/components/ui/input.tsx:11
  • Draft comment:
    Updated input selection classes now reference var(--terminal-selection) and text-foreground; this aligns well with the global theme styling.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
4. humanlayer-wui/src/App.css:134
  • Draft comment:
    Typographical note: The hex color code for --terminal-selection is #f4a2614d, which contains 8 hexadecimal digits. All other color codes in this file are 6-digit hex codes (e.g., #7b9171). Please verify if the extra digits (i.e., alpha transparency) are intended or if this is a typographical error.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 0% vs. threshold = 50% The comment suggests there might be a typographical error because the hex code has 8 digits instead of 6. However, 8-digit hex codes are valid CSS - the last 2 digits represent alpha transparency. Looking at the full file, many other themes intentionally use 8-digit hex codes for their selection colors to create semi-transparent selections. This appears to be an intentional pattern, not an error. I could be wrong if there was a specific requirement for this codebase to only use 6-digit hex codes. Maybe there's a technical limitation I'm not aware of. The consistent use of 8-digit hex codes across multiple themes strongly suggests this is intentional design. Text selection typically needs transparency, so using alpha values makes sense. The comment should be deleted. The 8-digit hex code is not a typographical error but an intentional use of alpha transparency that matches the pattern used in other themes.

Workflow ID: wflow_FR4FPTd57uOSMWpR

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link
Contributor

@K-Mistele K-Mistele left a comment

Choose a reason for hiding this comment

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

LGTM

balanceiskey and others added 3 commits October 13, 2025 14:17
Restores the use of the --terminal-selection CSS variable for text
selection styling:
- Add global ::selection rule in App.css using --terminal-selection
- Update input component to use --terminal-selection variable

This prepares for adding proper selection colors to theme definitions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Adds theme-accurate selection colors for all 19 themes based on official VS Code theme specifications:

- Rose Pine variants: Official VS Code theme colors with appropriate opacity
- Tokyo Night variants: Official terminal selection colors from theme
- Solarized: VS Code cyan selection (#2AA19899) with transparency
- Catppuccin: Overlay2 color (#9399b240) matching editor selection
- Gruvbox: bg2 colors for both light and dark variants
- Monokai: Original Sublime Text selection color (#49483E)
- High Contrast: White (#FFFFFF) for maximum visibility
- Custom themes: Research-based colors with appropriate opacity (10-40%)

All selection colors follow best practices:
- Dark themes: 20-40% opacity for visibility
- Light themes: 10-20% opacity to maintain readability
- Colors harmonize with each theme's existing palette

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@balanceiskey balanceiskey force-pushed the sundeep/eng-2222-selection-colors-in-app-are-offlow-contrast-1 branch from b7a6878 to 6ded4a1 Compare October 13, 2025 19:17
@balanceiskey balanceiskey merged commit 91ee775 into humanlayer:main Oct 13, 2025
3 checks passed
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