Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/cli/ui/components/CommandInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,12 @@ export const CommandInput: React.FC<Props> = ({
</Box>

{isIntercepting && (
<Box flexDirection="column" borderStyle="round" borderColor={COLORS.semantic.yellow} paddingX={1}>
<Box
flexDirection="column"
borderStyle="round"
borderColor={COLORS.semantic.yellow}
paddingX={1}
>
<Text color={COLORS.semantic.yellow} bold>
{isSelecting
? pendingSelection?.title
Expand Down Expand Up @@ -296,7 +301,11 @@ export const CommandInput: React.FC<Props> = ({
<Text key={item.id} color={isSelected ? COLORS.semantic.cyan : COLORS.text.muted}>
{isSelected ? '❯ ' : ' '}
{isMultiSelecting && (
<Text color={selectedItems.includes(item.id) ? COLORS.semantic.cyan : COLORS.text.muted}>
<Text
color={
selectedItems.includes(item.id) ? COLORS.semantic.cyan : COLORS.text.muted
}
>
{selectedItems.includes(item.id) ? '[x] ' : '[ ] '}
</Text>
)}
Expand All @@ -315,6 +324,7 @@ export const CommandInput: React.FC<Props> = ({
suggestions={visibleSuggestions}
selectedIndex={selectedIndex - startIndex}
parentCommand={activeCommand}
totalCount={suggestions.length}
/>
)}
</Box>
Expand Down
16 changes: 16 additions & 0 deletions src/cli/ui/components/CommandSuggestionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ interface CommandSuggestionListProps {
selectedIndex: number;
parentCommand?: Command;
filterText?: string;
totalCount?: number;
}

export const CommandSuggestionList: React.FC<CommandSuggestionListProps> = ({
suggestions,
selectedIndex,
parentCommand,
totalCount = 0,
}) => {
if (suggestions.length === 0) return null;

Expand Down Expand Up @@ -76,6 +78,20 @@ export const CommandSuggestionList: React.FC<CommandSuggestionListProps> = ({
})}
</Box>

{totalCount > suggestions.length && (
<Box flexDirection="row" paddingX={1} paddingTop={0} paddingBottom={0}>
<Box width={6}>
<Text> </Text>
</Box>
<Box flexGrow={1}>
<Text color={COLORS.text.muted} dimColor>
... and {totalCount - suggestions.length} more command
{totalCount - suggestions.length === 1 ? '' : 's'}
</Text>
</Box>
</Box>
)}

{/* FOOTER: Contextual Hints */}
{suggestions[selectedIndex]?.command?.usage && (
<Box
Expand Down
Loading