Skip to content

Commit 292755c

Browse files
authored
🤖 feat: beautify remote directory picker (#1029)
- Add folder icons (Folder, FolderUp) from lucide-react - Increase tree height from h-64 to h-80 - Increase font size from text-xs to text-sm - Add flex layout with proper spacing and truncation _Generated with `mux`_
1 parent 4eb5703 commit 292755c

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/browser/components/DirectoryPickerModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export const DirectoryPickerModal: React.FC<DirectoryPickerModalProps> = ({
111111
</DialogDescription>
112112
</DialogHeader>
113113
{error && <div className="text-error mb-3 text-xs">{error}</div>}
114-
<div className="bg-modal-bg border-border-medium mb-4 h-64 overflow-hidden rounded border">
114+
<div className="bg-modal-bg border-border-medium mb-4 h-80 overflow-hidden rounded border">
115115
<DirectoryTree
116116
currentPath={root ? root.path : null}
117117
entries={entries}

src/browser/components/DirectoryTree.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from "react";
2+
import { Folder, FolderUp } from "lucide-react";
23

34
interface DirectoryTreeEntry {
45
name: string;
@@ -26,36 +27,38 @@ export const DirectoryTree: React.FC<DirectoryTreeProps> = (props) => {
2627
}, [currentPath]);
2728

2829
return (
29-
<div ref={containerRef} className="h-full overflow-y-auto p-2 font-mono text-xs">
30+
<div ref={containerRef} className="h-full overflow-y-auto p-2 text-sm">
3031
{isLoading && !currentPath ? (
3132
<div className="text-muted py-4 text-center">Loading directories...</div>
3233
) : (
3334
<ul className="m-0 list-none p-0">
3435
{currentPath && (
3536
<li
36-
className="text-muted cursor-pointer rounded px-2 py-1 text-xs hover:bg-white/5"
37+
className="text-muted flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 hover:bg-white/5"
3738
onClick={onNavigateParent}
3839
>
39-
...
40+
<FolderUp size={16} className="text-muted shrink-0" />
41+
<span>..</span>
4042
</li>
4143
)}
4244

4345
{!isLoading && !hasEntries ? (
44-
<li className="text-muted px-2 py-1 text-xs">No subdirectories found</li>
46+
<li className="text-muted px-2 py-1.5">No subdirectories found</li>
4547
) : null}
4648

4749
{entries.map((entry) => (
4850
<li
4951
key={entry.path}
50-
className="text-muted cursor-pointer rounded px-2 py-1 text-xs hover:bg-white/5"
52+
className="flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 hover:bg-white/5"
5153
onClick={() => onNavigateTo(entry.path)}
5254
>
53-
{entry.name}
55+
<Folder size={16} className="shrink-0 text-yellow-500/80" />
56+
<span className="truncate">{entry.name}</span>
5457
</li>
5558
))}
5659

5760
{isLoading && currentPath && !hasEntries ? (
58-
<li className="text-muted px-2 py-1 text-xs">Loading directories...</li>
61+
<li className="text-muted px-2 py-1.5">Loading directories...</li>
5962
) : null}
6063
</ul>
6164
)}

0 commit comments

Comments
 (0)