Skip to content

Commit 10895fe

Browse files
Redesign sidebar settings popup: cleaner header, icon theme toggle
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 6d952b9 commit 10895fe

1 file changed

Lines changed: 54 additions & 38 deletions

File tree

packages/app/src/App.tsx

Lines changed: 54 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@ import {
88
FolderPlus,
99
LayoutDashboard,
1010
type LucideIcon,
11+
Monitor,
12+
Moon,
1113
PanelBottom,
1214
PanelLeft,
1315
PanelRight,
1416
RefreshCw,
1517
Settings as SettingsIcon,
1618
Sparkles,
1719
SquarePen,
20+
Sun,
1821
} from 'lucide-react';
1922
import { api, execCommand, isMac, type ChatSummary, type ProjectSummary } from './lib/api';
2023
import { LoopEventsProvider, useDaemonConnected } from './lib/events';
@@ -535,28 +538,36 @@ function SidebarSettings({
535538
</button>
536539

537540
{open && (
538-
<div className="absolute bottom-full left-0 right-0 z-50 mb-2 overflow-hidden rounded-lg border border-border bg-panel shadow-xl shadow-black/40">
539-
<div className="flex items-center gap-2 border-b border-border px-3 py-2.5">
540-
<Logo className="h-5 w-5" />
541-
<span className="text-sm font-semibold text-text">CodeRouter</span>
542-
<span className="ml-auto flex items-center gap-1.5 text-xs text-muted">
543-
<span className={cls('h-1.5 w-1.5 rounded-full', connected ? 'bg-ok' : 'bg-bad')} />
544-
{connected ? 'Connected' : 'Offline'}
545-
</span>
546-
</div>
547-
<div className="p-1">
548-
<button
549-
onClick={() => {
550-
setOpen(false);
551-
onOpenSettings();
552-
}}
553-
className="flex w-full items-center gap-2.5 rounded-md px-2.5 py-2 text-left text-sm text-text transition-colors hover:bg-panel2"
554-
>
555-
<SettingsIcon className="h-4 w-4 text-muted" strokeWidth={2} />
556-
Settings
557-
</button>
541+
<div className="absolute bottom-full left-0 z-50 mb-2 w-64 overflow-hidden rounded-xl border border-border bg-panel p-1.5 shadow-2xl shadow-black/40">
542+
<div className="flex items-center gap-2.5 px-1.5 py-1.5">
543+
<div className="flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-panel2">
544+
<Logo className="h-6 w-6" />
545+
</div>
546+
<div className="min-w-0">
547+
<div className="truncate text-sm font-semibold text-text">CodeRouter</div>
548+
<div className="flex items-center gap-1.5 text-xs text-muted">
549+
<span className={cls('h-1.5 w-1.5 shrink-0 rounded-full', connected ? 'bg-ok' : 'bg-bad')} />
550+
{connected ? 'Daemon connected' : 'Daemon offline'}
551+
</div>
552+
</div>
558553
</div>
559-
<div className="border-t border-border px-3 py-2.5">
554+
555+
<div className="my-1 h-px bg-border" />
556+
557+
<button
558+
onClick={() => {
559+
setOpen(false);
560+
onOpenSettings();
561+
}}
562+
className="flex w-full items-center gap-2.5 rounded-lg px-2 py-1.5 text-left text-sm text-text transition-colors hover:bg-panel2"
563+
>
564+
<SettingsIcon className="h-4 w-4 text-muted" strokeWidth={2} />
565+
Open settings
566+
</button>
567+
568+
<div className="my-1 h-px bg-border" />
569+
570+
<div className="px-1.5 pb-0.5 pt-1">
560571
<div className="mb-1.5 text-[11px] font-semibold uppercase tracking-wider text-muted">Appearance</div>
561572
<ThemeToggle />
562573
</div>
@@ -568,25 +579,30 @@ function SidebarSettings({
568579

569580
function ThemeToggle(): React.ReactElement {
570581
const { pref, setPref } = useTheme();
571-
const opts: Array<{ id: ThemePref; label: string }> = [
572-
{ id: 'light', label: 'Light' },
573-
{ id: 'dark', label: 'Dark' },
574-
{ id: 'system', label: 'System' },
582+
const opts: Array<{ id: ThemePref; label: string; icon: LucideIcon }> = [
583+
{ id: 'light', label: 'Light', icon: Sun },
584+
{ id: 'dark', label: 'Dark', icon: Moon },
585+
{ id: 'system', label: 'System', icon: Monitor },
575586
];
576587
return (
577-
<div className="inline-flex w-full overflow-hidden rounded-md border border-border">
578-
{opts.map((o) => (
579-
<button
580-
key={o.id}
581-
onClick={() => setPref(o.id)}
582-
className={cls(
583-
'flex-1 px-2 py-1 text-xs transition-colors',
584-
pref === o.id ? 'bg-accent/20 text-text' : 'text-muted hover:bg-panel2 hover:text-text',
585-
)}
586-
>
587-
{o.label}
588-
</button>
589-
))}
588+
<div className="grid grid-cols-3 gap-1 rounded-lg bg-panel2 p-1">
589+
{opts.map((o) => {
590+
const Icon = o.icon;
591+
const sel = pref === o.id;
592+
return (
593+
<button
594+
key={o.id}
595+
onClick={() => setPref(o.id)}
596+
className={cls(
597+
'flex flex-col items-center gap-1 rounded-md px-1 py-1.5 text-[11px] font-medium transition-colors',
598+
sel ? 'bg-panel text-text shadow-sm ring-1 ring-border' : 'text-muted hover:text-text',
599+
)}
600+
>
601+
<Icon className="h-4 w-4" strokeWidth={2} />
602+
{o.label}
603+
</button>
604+
);
605+
})}
590606
</div>
591607
);
592608
}

0 commit comments

Comments
 (0)