Skip to content

fix(overlay): WCAG token fixes, semantic palette, health colors, critical button#48

Merged
DevanshuNEU merged 2 commits into
OpenCodeIntel:mainfrom
DevanshuNEU:feat/get-15-overlay-design-tokens
Apr 22, 2026
Merged

fix(overlay): WCAG token fixes, semantic palette, health colors, critical button#48
DevanshuNEU merged 2 commits into
OpenCodeIntel:mainfrom
DevanshuNEU:feat/get-15-overlay-design-tokens

Conversation

@DevanshuNEU

@DevanshuNEU DevanshuNEU commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Six categories of approved design-system fixes for the overlay widget, derived from a full design review session on 2026-04-21. Addresses three confirmed WCAG AA failures, health-state color inaccuracies (neon green / coral instead of warm sage / real red), a brand-ghost blue in nudge info, and adds a filled critical-state button variant.

Type of Change

  • fix — Bug fix

What Was Changed

ui/overlay-styles.ts

  • Dark mode: --lco-bg opacity 0.82 → 0.92 (muted text failed on light page content bleedthrough at 18%); --lco-muted #71717a → #8a8a93 (bumped from WCAG cliff to ~5.8:1); --lco-border 0.06 → 0.12 opacity (was invisible on claude.ai dark panels); bg-hover and border-hover adjusted proportionally.
  • Light mode: --lco-bg opacity 0.85 → 0.92 (parity with dark floor); --lco-muted #a1a1aa → #6b7280 (hard WCAG fail ~3.2:1 on warm cream → ~4.8:1 AA); --lco-border 0.06 → 0.08; border-hover 0.12 → 0.14.
  • Health state colors: healthy #4ade80 → #86efac (warm sage, not neon); degrading #fbbf24 → #f59e0b (one canonical amber matching --lco-warn-fill); critical #f87171 → #ef4444 (real red, not coral). Applied to dot classes, label classes, bar-fill classes, and lco-dot-pulse keyframe.
  • Nudge info: #63b3ed → #6b8cae (desaturated steel derived from terracotta undertones; #63b3ed was a pure blue with no palette origin).
  • Added .lco-start-fresh--critical: filled #c15f3c background, white text, terra cotta glow shadow with deepening hover/active states.

ui/overlay.ts

  • Added elHealthDotMini to the collapsed header DOM — the sole health signal when the widget is minimized. Class mirrors the expanded dot on every render.
  • elCostMini now shows session total cost (state.session.totalCost) instead of last-reply cost. Cost color stays terra cotta regardless of health state per the design spec (documented in comment).
  • render() applies .lco-start-fresh--critical when health.level === 'critical' and removes it otherwise.

How to Test

  1. Load the unpacked extension from .output/chrome-mv3/ in Chrome.
  2. Open claude.ai and start a conversation.
  3. Verify the widget border is visible against the dark chat panel (previously invisible at 6% opacity).
  4. Let the conversation reach degrading context (>60%): dot and bar should show #f59e0b amber; button should be outline style.
  5. Let the conversation reach critical context (>85%): dot should show #ef4444 red (pulsing); bar fills red; button becomes filled terra cotta.
  6. Toggle a nudge info card: left border should be a desaturated steel (#6b8cae), not a pure bright blue.
  7. Collapse the widget by clicking the header: the pill shows session total cost (not last-reply cost) and a health dot that matches the expanded state.
  8. Check light mode (force via DevTools): muted text should be readable on the warm cream surface.

Checklist

  • Tests pass locally (bun run test) — 1464/1464
  • TypeScript compiles clean (bun run compile)
  • Extension builds without errors (bun run build)
  • No secrets, hardcoded URLs, or sensitive tokens exposed
  • Comments are professional and clear — no emojis, no AI-generated filler
  • Commit messages follow conventional commits (feat:, fix:, refactor:, test:, chore:)

Related Issues

Closes #15

Notes for Reviewer

The MINOR pipeline note: when the widget first appears due to a draft estimate only (before any request completes), collapsing the pill shows no cost in the mini display. This is harmless — the expanded draft row already surfaces the draft cost, and the collapsed state is only meaningful once real requests have completed.

Summary by CodeRabbit

  • New Features

    • Health status indicator now displayed when the overlay is collapsed.
    • Critical state styling added to the start button.
  • Style

    • Updated health status colors for improved visual distinction across healthy, degrading, and critical states.
    • Refined overlay theme colors and contrast for both light and dark modes.
    • Enhanced progress bar colors and notification styling.
    • Improved accessibility by adjusting reduced-motion preferences.

@vercel

vercel Bot commented Apr 22, 2026

Copy link
Copy Markdown

@DevanshuNEU is attempting to deploy a commit to the Dev's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Apr 22, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Updated overlay UI styling and health status visualization: adjusted CSS variable opacity and color values for improved contrast, introduced health dot indicator in the collapsed overlay header, modified collapsed pill to display session total cost and health status, and added critical-state styling for the start button.

Changes

Cohort / File(s) Summary
Theme and styling refinements
ui/overlay-styles.ts
Updated CSS variables for background, border, and muted text opacity across dark/light modes; refreshed health status color palette (green/amber/red) for dots and progress bars; adjusted info nudge desaturation; added .lco-start-fresh--critical variant with hover/active/focus states and updated reduced-motion query.
Collapsed header and health visualization
ui/overlay.ts
Added elHealthDotMini reference and collapsed health dot element during mount; updated render logic to display session total cost instead of last reply cost in collapsed state; applied health-level-based color class to collapsed health dot; added critical CSS class to start button when health level is critical.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 Behold! The health dot now glows in the fold,
Where session costs shine and critical tones turn bold,
Colors refined, opacity just right,
The overlay dances in dark and light! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning This PR applies design-system fixes to the overlay widget but does not address the modularization objectives from issue #15 (state transitions, bridge validation, overlay factory extraction, enable-banner extraction, or content script orchestrator). Ensure the PR fulfills the coding requirements from issue #15: extract lib/overlay-state.ts with state functions, lib/bridge-validation.ts, refactor ui/overlay.ts as a factory, extract ui/enable-banner.ts, and reduce content script to ~150 lines. This PR appears to be a separate design-system fix that should target a different issue or be combined with the modularization work.
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 (3 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly summarizes the main changes: WCAG contrast fixes, semantic palette updates, health color corrections, and a critical button variant—all directly reflected in the code changes.
Description check ✅ Passed Description comprehensively covers all six change categories with detailed technical rationale, testing steps, and checklist completion; it exceeds the template requirements.
Out of Scope Changes check ✅ Passed Changes are narrowly scoped to overlay styling (CSS variables, health colors, button variants) and overlay rendering logic (health dot display, cost display), with no unrelated modifications introduced.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ui/overlay-styles.ts`:
- Around line 251-253: The health label text classes
(.lco-health-label--healthy, .lco-health-label--degrading,
.lco-health-label--critical) use the same bright indicator colors as small
(10px) text and fail contrast in light/dark surfaces; replace those hardcoded
hex values with accessible text color tokens or higher-contrast shades (e.g.,
define --text-color-health-healthy/degrading/critical) and apply them to those
classes, and ensure theme-aware variants (light vs dark) or use
media/query-based overrides so each label meets WCAG contrast for 10px text.
- Around line 296-311: The critical button (.lco-start-fresh--critical)
currently uses color: rgba(255, 255, 255, 0.92) which lacks sufficient contrast
on the `#c15f3c` background; change the color declaration in
.lco-start-fresh--critical to fully opaque white (color: `#ffffff` or color:
white) to meet contrast for the 10px text, and ensure any related states
(.lco-start-fresh--critical:hover and .lco-start-fresh--critical:active) either
inherit that white color or explicitly set the same opaque white so hover/active
text contrast remains consistent.
- Around line 21-25: The CSS comments next to the overlay custom properties
(e.g., --lco-bg, --lco-bg-hover, --lco-text, --lco-muted, --lco-border) use em
dashes; update those comments to remove em dashes and instead use colons,
semicolons, or a rewritten phrase (for example "was .82: prevents muted text
failing on light page content bleedthrough" or split into two sentences) so they
conform to the "No emdashes" style rule; apply the same replacement to the other
occurrences of these comments elsewhere in the file.

In `@ui/overlay.ts`:
- Line 84: Replace the em dash characters in the three new comments in
ui/overlay.ts (the comment text "Health dot shown in collapsed pill — sole
health signal when minimized." and the two additional occurrences) with a colon,
semicolon, or a rewritten sentence that does not use em dashes to satisfy the
project style rule; locate the comments by searching for the phrase "Health dot
shown in collapsed pill" (and its two other occurrences) and update them to
something like "Health dot shown in collapsed pill: sole health signal when
minimized." or an equivalent punctuation rewrite.
- Around line 409-411: The collapsed cost pill (elCostMini) is not cleared when
state.session.requestCount becomes 0, so it still shows the previous session
total; update the logic that currently only sets elCostMini.textContent when
requestCount > 0 (the branch using elCostMini, state.session.requestCount,
fmtCost and state.session.totalCost) to explicitly clear or reset
elCostMini.textContent (e.g., set to empty string or a default) when
requestCount === 0 so the mini pill is blank after a session reset.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4dd2d37a-d509-4b02-b39d-e9aba8507bb2

📥 Commits

Reviewing files that changed from the base of the PR and between da0c299 and c683860.

📒 Files selected for processing (2)
  • ui/overlay-styles.ts
  • ui/overlay.ts

Comment thread ui/overlay-styles.ts
Comment thread ui/overlay-styles.ts
Comment thread ui/overlay-styles.ts
Comment thread ui/overlay.ts
Comment thread ui/overlay.ts
@DevanshuNEU DevanshuNEU merged commit 4b9aed1 into OpenCodeIntel:main Apr 22, 2026
5 of 6 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.

1 participant