Skip to content

Commit d773cf9

Browse files
committed
fix: strengthen light mode command palette and diff contrast
- add theme tokens for command palette + sidebar tab text - dark mode values mirror previous appearance; light mode uses darker fg - darken "light" text token and code keywords for diff readability
1 parent 02c4b8d commit d773cf9

File tree

3 files changed

+38
-16
lines changed

3 files changed

+38
-16
lines changed

src/browser/components/CommandPalette.tsx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ export const CommandPalette: React.FC<CommandPaletteProps> = ({ getSlashContext
373373
}}
374374
>
375375
<Command
376-
className="bg-separator border-border text-lighter font-primary w-[min(720px,92vw)] overflow-hidden rounded-lg border shadow-[0_10px_40px_rgba(0,0,0,0.4)]"
376+
className="font-primary w-[min(720px,92vw)] overflow-hidden rounded-lg border border-[var(--color-command-border)] bg-[var(--color-command-surface)] text-[var(--color-command-foreground)] shadow-[0_10px_40px_rgba(0,0,0,0.4)]"
377377
onMouseDown={(e: React.MouseEvent) => e.stopPropagation()}
378378
shouldFilter={shouldUseCmdkFilter}
379379
filter={(value, search) => {
@@ -390,7 +390,7 @@ export const CommandPalette: React.FC<CommandPaletteProps> = ({ getSlashContext
390390
}}
391391
>
392392
<Command.Input
393-
className="bg-darker text-lighter border-hover w-full border-b border-none px-3.5 py-3 text-sm outline-none"
393+
className="w-full border-b border-[var(--color-command-input-border)] bg-[var(--color-command-input)] px-3.5 py-3 text-sm text-[var(--color-command-foreground)] outline-none placeholder:text-[var(--color-command-subdued)]"
394394
value={query}
395395
onValueChange={handleQueryChange}
396396
placeholder={
@@ -423,13 +423,17 @@ export const CommandPalette: React.FC<CommandPaletteProps> = ({ getSlashContext
423423
{groupsWithItems.map((group) => (
424424
<Command.Group
425425
key={group.name}
426-
heading={group.name}
427-
className="[&[cmdk-group-heading]]:text-subdued [&[cmdk-group-heading]]:px-2.5 [&[cmdk-group-heading]]:py-1 [&[cmdk-group-heading]]:text-[11px] [&[cmdk-group-heading]]:tracking-[0.08em] [&[cmdk-group-heading]]:uppercase [&[cmdk-group]]:px-1.5 [&[cmdk-group]]:py-2"
426+
heading={
427+
<div className="px-2.5 py-1 text-[11px] tracking-[0.08em] text-[var(--color-command-subdued)] uppercase">
428+
{group.name}
429+
</div>
430+
}
431+
className="px-1.5 py-2"
428432
>
429433
{group.items.map((item) => (
430434
<Command.Item
431435
key={item.id}
432-
className="hover:bg-hover aria-selected:bg-hover mx-1 my-0.5 grid cursor-pointer grid-cols-[1fr_auto] items-center gap-2 rounded-md px-3 py-2 text-[13px]"
436+
className="hover:bg-hover aria-selected:bg-hover mx-1 my-0.5 grid cursor-pointer grid-cols-[1fr_auto] items-center gap-2 rounded-md px-3 py-2 text-[13px] aria-selected:text-[var(--color-command-foreground)]"
433437
onSelect={() => {
434438
if ("prompt" in item && item.prompt) {
435439
addRecent(item.id);
@@ -454,12 +458,14 @@ export const CommandPalette: React.FC<CommandPaletteProps> = ({ getSlashContext
454458
{"subtitle" in item && item.subtitle && (
455459
<>
456460
<br />
457-
<span className="text-subdued text-xs">{item.subtitle}</span>
461+
<span className="text-xs text-[var(--color-command-subdued)]">
462+
{item.subtitle}
463+
</span>
458464
</>
459465
)}
460466
</div>
461467
{"shortcutHint" in item && item.shortcutHint && (
462-
<span className="text-subdued font-monospace text-[11px]">
468+
<span className="font-monospace text-[11px] text-[var(--color-command-subdued)]">
463469
{item.shortcutHint}
464470
</span>
465471
)}
@@ -468,7 +474,9 @@ export const CommandPalette: React.FC<CommandPaletteProps> = ({ getSlashContext
468474
</Command.Group>
469475
))}
470476
{!hasAnyItems && (
471-
<div className="text-gray p-4 text-[13px]">{emptyText ?? "No results"}</div>
477+
<div className="p-4 text-[13px] text-[var(--color-command-subdued)]">
478+
{emptyText ?? "No results"}
479+
</div>
472480
)}
473481
</Command.List>
474482
</Command>

src/browser/components/RightSidebar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ const RightSidebarComponent: React.FC<RightSidebarProps> = ({
225225
className={cn(
226226
"w-full py-2.5 px-[15px] border-none border-solid cursor-pointer font-primary text-[13px] font-medium transition-all duration-200",
227227
selectedTab === "costs"
228-
? "text-white bg-separator border-b-2 border-b-plan-mode"
228+
? "bg-separator border-b-2 border-b-plan-mode text-[var(--color-sidebar-tab-active)]"
229229
: "bg-transparent text-secondary border-b-2 border-b-transparent hover:bg-background-secondary hover:text-foreground"
230230
)}
231231
onClick={() => setSelectedTab("costs")}
@@ -246,7 +246,7 @@ const RightSidebarComponent: React.FC<RightSidebarProps> = ({
246246
className={cn(
247247
"w-full py-2.5 px-[15px] border-none border-solid cursor-pointer font-primary text-[13px] font-medium transition-all duration-200",
248248
selectedTab === "review"
249-
? "text-white bg-separator border-b-2 border-b-plan-mode"
249+
? "bg-separator border-b-2 border-b-plan-mode text-[var(--color-sidebar-tab-active)]"
250250
: "bg-transparent text-secondary border-b-2 border-b-transparent hover:bg-background-secondary hover:text-foreground"
251251
)}
252252
onClick={() => setSelectedTab("review")}

src/browser/styles/globals.css

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@
9595
--color-line-number-text: rgba(255, 255, 255, 0.4);
9696
--color-line-number-border: rgba(255, 255, 255, 0.1);
9797
--color-assistant-border: hsl(207 45% 40%);
98+
--color-command-surface: hsl(0 0% 15%);
99+
--color-command-border: hsl(240 2% 25%);
100+
--color-command-input: hsl(0 0% 9%);
101+
--color-command-input-border: hsla(0 0% 100% / 0.08);
102+
--color-command-foreground: hsl(0 0% 83%);
103+
--color-command-subdued: hsl(0 0% 63%);
104+
--color-sidebar-tab-active: hsl(0 0% 100%);
98105
--color-assistant-border-hover: hsl(207 45% 50%);
99106
--color-message-header: hsl(0 0% 80%);
100107

@@ -317,6 +324,13 @@
317324
--color-line-number-text: hsl(210 14% 46%);
318325
--color-line-number-border: hsl(210 22% 84%);
319326
--color-assistant-border: hsl(207 65% 50%);
327+
--color-command-surface: hsl(210 32% 97%);
328+
--color-command-border: hsl(210 22% 82%);
329+
--color-command-input: hsl(210 36% 95%);
330+
--color-command-input-border: hsl(210 24% 84%);
331+
--color-command-foreground: hsl(210 18% 18%);
332+
--color-command-subdued: hsl(210 14% 46%);
333+
--color-sidebar-tab-active: hsl(210 18% 18%);
320334
--color-assistant-border-hover: hsl(207 65% 40%);
321335
--color-message-header: hsl(210 18% 20%);
322336

@@ -375,8 +389,8 @@
375389
--color-placeholder: hsl(210 16% 52%);
376390
--color-subtle: hsl(210 20% 64%);
377391
--color-dim: hsl(210 16% 50%);
378-
--color-light: hsl(210 22% 72%);
379-
--color-lighter: hsl(210 32% 86%);
392+
--color-light: hsl(210 22% 40%);
393+
--color-lighter: hsl(210 24% 52%);
380394
--color-bright: hsl(210 60% 48%);
381395
--color-subdued: hsl(210 18% 60%);
382396
--color-label: hsl(210 18% 46%);
@@ -418,8 +432,8 @@
418432
--color-warning: hsl(45 100% 50%);
419433
--color-warning-light: hsl(38 100% 70%);
420434

421-
--color-code-type: hsl(210 70% 34%);
422-
--color-code-keyword: hsl(210 78% 32%);
435+
--color-code-type: hsl(200 84% 28%);
436+
--color-code-keyword: hsl(210 88% 24%);
423437

424438
--color-toast-success-bg: hsl(207 90% 46% / 0.18);
425439
--color-toast-success-text: hsl(207 90% 34%);
@@ -436,8 +450,8 @@
436450
--color-white-overlay: hsl(210 14% 12% / 0.08);
437451
--color-selection: hsl(204 100% 45% / 0.3);
438452
--color-vim-status: hsl(210 18% 32% / 0.6);
439-
--color-code-keyword-overlay-light: hsl(210 80% 45% / 0.12);
440-
--color-code-keyword-overlay: hsl(210 80% 45% / 0.24);
453+
--color-code-keyword-overlay-light: hsl(210 88% 28% / 0.16);
454+
--color-code-keyword-overlay: hsl(210 88% 28% / 0.32);
441455

442456
--color-info-light: hsl(5 90% 70%);
443457
--color-info-yellow: hsl(38 100% 60%);

0 commit comments

Comments
 (0)