Skip to content

Commit 852b6b1

Browse files
🤖 fix: use Radix UI Select for project dropdown on Linux (#1088)
Replace native `<select>` with Radix UI Select component in ProjectSettingsSection. Native `<select>` options don't respect CSS styling on Linux (GTK themes override), causing invisible text in dark mode. The Radix Select has full CSS control via `bg-dark text-foreground`. **Before:** Non-hovered dropdown items had white background with invisible text **After:** Proper dark theme styling with visible text _Generated with `mux`_
1 parent 533b363 commit 852b6b1

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

src/browser/components/Settings/sections/ProjectSettingsSection.tsx

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,19 @@ import {
88
CheckCircle,
99
XCircle,
1010
Plus,
11-
ChevronDown,
1211
Server,
1312
Pencil,
1413
Check,
1514
X,
1615
} from "lucide-react";
1716
import { Button } from "@/browser/components/ui/button";
17+
import {
18+
Select,
19+
SelectContent,
20+
SelectItem,
21+
SelectTrigger,
22+
SelectValue,
23+
} from "@/browser/components/ui/select";
1824
import { createEditKeyHandler } from "@/browser/utils/ui/keybinds";
1925
import { formatRelativeTime } from "@/browser/utils/ui/dateTime";
2026
import type { CachedMCPTestResult } from "@/common/types/mcp";
@@ -269,24 +275,19 @@ export const ProjectSettingsSection: React.FC = () => {
269275
<div className="space-y-6">
270276
{/* Project selector */}
271277
<div className="space-y-1.5">
272-
<label htmlFor="project-select" className="text-sm font-medium">
273-
Project
274-
</label>
275-
<div className="relative">
276-
<select
277-
id="project-select"
278-
value={selectedProject}
279-
onChange={(e) => setSelectedProject(e.target.value)}
280-
className="border-border-medium bg-secondary/30 text-foreground focus:ring-accent w-full appearance-none rounded-md border py-2 pr-8 pl-3 text-sm focus:ring-1 focus:outline-none"
281-
>
278+
<label className="text-sm font-medium">Project</label>
279+
<Select value={selectedProject} onValueChange={setSelectedProject}>
280+
<SelectTrigger className="w-full">
281+
<SelectValue placeholder="Select project" />
282+
</SelectTrigger>
283+
<SelectContent>
282284
{projectList.map((path) => (
283-
<option key={path} value={path}>
285+
<SelectItem key={path} value={path}>
284286
{projectName(path)}
285-
</option>
287+
</SelectItem>
286288
))}
287-
</select>
288-
<ChevronDown className="text-muted-foreground pointer-events-none absolute top-1/2 right-2.5 h-4 w-4 -translate-y-1/2" />
289-
</div>
289+
</SelectContent>
290+
</Select>
290291
<p className="text-muted-foreground truncate text-xs" title={selectedProject}>
291292
{selectedProject}
292293
</p>

0 commit comments

Comments
 (0)