Skip to content

Commit 02a537b

Browse files
committed
Fixes for project picker screen
1 parent a085af2 commit 02a537b

File tree

3 files changed

+27
-15
lines changed

3 files changed

+27
-15
lines changed

cli/src/components/project-picker-screen.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ export const ProjectPickerScreen: React.FC<ProjectPickerScreenProps> = ({
8989
id: entry.path,
9090
label: entry.name,
9191
icon: entry.isParent ? '📂' : '📁',
92+
accent: entry.isGitRepo,
9293
})),
9394
[directories],
9495
)
@@ -319,8 +320,7 @@ export const ProjectPickerScreen: React.FC<ProjectPickerScreenProps> = ({
319320
}}
320321
>
321322
<text style={{ fg: theme.muted, wrapMode: 'word' }}>
322-
Navigate to your project folder, or choose Start here to create a
323-
new one.
323+
Navigate to your project folder and press Open.
324324
</text>
325325
</box>
326326
)}
@@ -432,10 +432,12 @@ export const ProjectPickerScreen: React.FC<ProjectPickerScreenProps> = ({
432432
width: contentWidth,
433433
}}
434434
>
435-
{/* Left side: shortcuts */}
436-
<text style={{ fg: theme.muted }}>
437-
{isGitRepo ? '(git) • ' : ''}{isNarrow ? '↑↓ Tab ^C' : '↑↓ Tab complete ^C quit'}
438-
</text>
435+
{/* Current directory path */}
436+
<box style={{ flexGrow: 1, flexShrink: 1, overflow: 'hidden' }}>
437+
<text style={{ fg: theme.muted }}>
438+
{formatCwd(currentPath)}
439+
</text>
440+
</box>
439441

440442
{/* Open button */}
441443
<Button
@@ -451,7 +453,7 @@ export const ProjectPickerScreen: React.FC<ProjectPickerScreenProps> = ({
451453
}}
452454
border={['top', 'bottom', 'left', 'right']}
453455
>
454-
<text style={{ fg: '#ffffff' }}>Open</text>
456+
<text style={{ fg: '#1a1a1a' }}>Open</text>
455457
</Button>
456458
</box>
457459
</box>

cli/src/components/selectable-list.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ export interface SelectableListItem {
2828
label: string
2929
icon?: string
3030
secondary?: string
31+
/** If true, the label will be displayed in an accent color */
32+
accent?: boolean
3133
}
3234

3335
export interface SelectableListProps {
@@ -136,9 +138,9 @@ export const SelectableList = forwardRef<
136138
const isHovered = idx === hoveredIndex
137139
const isHighlighted = isFocused || isHovered
138140

139-
// Use theme.primary background when highlighted, contrast text for readability
140-
const backgroundColor = isHighlighted ? theme.primary : 'transparent'
141-
const textColor = isHighlighted ? theme.background : theme.muted
141+
// Use subtle highlight that works in both light and dark themes
142+
const backgroundColor = isHighlighted ? theme.surfaceHover : 'transparent'
143+
const textColor = isHighlighted ? theme.foreground : theme.muted
142144
const textAttributes = isHighlighted ? TextAttributes.BOLD : undefined
143145

144146
return (
@@ -165,20 +167,20 @@ export const SelectableList = forwardRef<
165167
}}
166168
>
167169
{item.icon && (
168-
<text style={{ fg: isHighlighted ? theme.background : theme.muted }}>
170+
<text style={{ fg: isHighlighted ? theme.foreground : theme.muted }}>
169171
{item.icon}
170172
</text>
171173
)}
172174
<text
173175
style={{
174-
fg: textColor,
175-
attributes: textAttributes,
176+
fg: item.accent && !isHighlighted ? theme.primary : textColor,
177+
attributes: item.accent || isHighlighted ? TextAttributes.BOLD : undefined,
176178
}}
177179
>
178180
{item.label}
179181
</text>
180182
{item.secondary && (
181-
<text style={{ fg: isHighlighted ? theme.surface : theme.muted }}>
183+
<text style={{ fg: theme.muted }}>
182184
{item.secondary}
183185
</text>
184186
)}

cli/src/utils/directory-browser.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export type DirectoryEntry = {
55
name: string
66
path: string
77
isParent: boolean
8+
isGitRepo: boolean
89
}
910

1011
/**
@@ -21,6 +22,7 @@ export function getDirectories(dirPath: string): DirectoryEntry[] {
2122
name: '..',
2223
path: parentDir,
2324
isParent: true,
25+
isGitRepo: false,
2426
})
2527
}
2628

@@ -38,6 +40,7 @@ export function getDirectories(dirPath: string): DirectoryEntry[] {
3840
name: item,
3941
path: fullPath,
4042
isParent: false,
43+
isGitRepo: hasGitDirectory(fullPath),
4144
})
4245
}
4346
} catch {
@@ -48,7 +51,12 @@ export function getDirectories(dirPath: string): DirectoryEntry[] {
4851
// If we can't read the directory, just return parent option
4952
}
5053

51-
return entries
54+
// Sort non-parent entries alphabetically (case-insensitive)
55+
const parentEntry = entries.find((e) => e.isParent)
56+
const childEntries = entries.filter((e) => !e.isParent)
57+
childEntries.sort((a, b) => a.name.toLowerCase().localeCompare(b.name.toLowerCase()))
58+
59+
return parentEntry ? [parentEntry, ...childEntries] : childEntries
5260
}
5361

5462
/**

0 commit comments

Comments
 (0)