From 416813452eafd4b9497fe7f4b36d5000b51c969d Mon Sep 17 00:00:00 2001
From: Miguel Solorio <miguel.solorio07@gmail.com>
Date: Wed, 14 May 2025 16:01:29 -0700
Subject: Improvements to suggestions & slash commands (#344)

Co-authored-by: N. Taylor Mullen <ntaylormullen@google.com>
---
 .../cli/src/ui/components/SuggestionsDisplay.tsx   | 28 +++++++++++++++-------
 1 file changed, 19 insertions(+), 9 deletions(-)

(limited to 'packages/cli/src/ui/components/SuggestionsDisplay.tsx')

diff --git a/packages/cli/src/ui/components/SuggestionsDisplay.tsx b/packages/cli/src/ui/components/SuggestionsDisplay.tsx
index ba25f2b6..3f2094bb 100644
--- a/packages/cli/src/ui/components/SuggestionsDisplay.tsx
+++ b/packages/cli/src/ui/components/SuggestionsDisplay.tsx
@@ -9,6 +9,7 @@ import { Colors } from '../colors.js';
 export interface Suggestion {
   label: string;
   value: string;
+  description?: string;
 }
 interface SuggestionsDisplayProps {
   suggestions: Suggestion[];
@@ -29,7 +30,7 @@ export function SuggestionsDisplay({
 }: SuggestionsDisplayProps) {
   if (isLoading) {
     return (
-      <Box borderStyle="round" paddingX={1} width={width}>
+      <Box paddingX={1} width={width}>
         <Text color="gray">Loading suggestions...</Text>
       </Box>
     );
@@ -48,20 +49,29 @@ export function SuggestionsDisplay({
   const visibleSuggestions = suggestions.slice(startIndex, endIndex);
 
   return (
-    <Box borderStyle="round" flexDirection="column" paddingX={1} width={width}>
+    <Box flexDirection="column" paddingX={1} width={width}>
       {scrollOffset > 0 && <Text color={Colors.Foreground}>▲</Text>}
 
       {visibleSuggestions.map((suggestion, index) => {
         const originalIndex = startIndex + index;
         const isActive = originalIndex === activeIndex;
+        const textColor = isActive ? Colors.AccentPurple : Colors.SubtleComment;
+
         return (
-          <Text
-            key={`${suggestion}-${originalIndex}`}
-            color={isActive ? Colors.Background : Colors.Foreground}
-            backgroundColor={isActive ? Colors.AccentBlue : undefined}
-          >
-            {suggestion.label}
-          </Text>
+          <Box key={`${suggestion}-${originalIndex}`} width={width}>
+            <Box flexDirection="row">
+              <Box width={20} flexShrink={0}>
+                <Text color={textColor}>{suggestion.label}</Text>
+              </Box>
+              {suggestion.description ? (
+                <Box flexGrow={1}>
+                  <Text color={textColor} wrap="wrap">
+                    {suggestion.description}
+                  </Text>
+                </Box>
+              ) : null}
+            </Box>
+          </Box>
         );
       })}
       {endIndex < suggestions.length && <Text color="gray">▼</Text>}
-- 
cgit v1.2.3

