Skip to content

fix(agents-ui): keep visualizers and indicators visible in forced colors mode - #1550

Open
bganderson95 wants to merge 1 commit into
livekit:mainfrom
bganderson95:fix/agents-ui-forced-colors
Open

bganderson95 wants to merge 1 commit into
livekit:mainfrom
bganderson95:fix/agents-ui-forced-colors

Conversation

@bganderson95

Copy link
Copy Markdown

Issue

No linked issue. In forced colors mode (Windows High Contrast), the Bar, Grid and Radial visualizers, AgentChatIndicator, and the popup trigger's connecting ring disappear. Every dot is drawn with background-color, which forced colors mode overrides, so someone using a high contrast theme gets no sign of whether the agent is connecting, listening, thinking or speaking.

Overview

Each affected element opts out with forced-color-adjust: none and paints itself in system colors, so it follows the user's theme instead of the app's palette. In the visualizers, highlighted cells are solid CanvasText and the rest are CanvasText outlines. I first tried GrayText for the dim cells, but high contrast themes define it as a saturated color (dark red in the light theme, bright green in the dark one), so lit and dim cells only differed by hue. Solid against hollow differs by shape, which works in any theme.

While testing, I also found the trigger's idle bot icon disappearing in dark high contrast themes. Its color comes from contrast-color() on the brand color, and SVGs keep that color in forced colors mode, so it stayed black on black. It now uses CanvasText there.

Nothing changes outside forced colors mode.

Summary of changes

File Change
agent-audio-visualizer-bar.tsx, agent-audio-visualizer-grid.tsx, agent-audio-visualizer-radial.tsx Under forced-colors, highlighted cells are solid CanvasText and the rest are outlines.
agent-chat-indicator.tsx Under forced-colors, the dot is solid CanvasText.
trigger.tsx (agent-popup-01) Under forced-colors, the connecting ring and the idle bot icon use CanvasText.
.changeset/ patch changeset for @livekit/agents-ui.

Testing

  • pnpm --filter @livekit/agents-ui test: 375 tests pass.
  • Storybook in Chromium with forced colors emulated (DevTools → Rendering → "Emulate CSS media feature forced-colors: active"), in light and dark themes, across connecting / listening / thinking / speaking.

Before (forced colors, current main):

before-high-contrast

After, light and dark high contrast themes:

after-high-contrast-light after-high-contrast-dark

Default rendering, unchanged:

default-unchanged

@vercel

vercel Bot commented Dec 3, 2026

Copy link
Copy Markdown

@bganderson95 is attempting to deploy a commit to the LiveKit Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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.

1 participant