diff --git a/frontend/src/components/message/PromptSuggestions.test.tsx b/frontend/src/components/message/PromptSuggestions.test.tsx index c1b585bd..3ec65e14 100644 --- a/frontend/src/components/message/PromptSuggestions.test.tsx +++ b/frontend/src/components/message/PromptSuggestions.test.tsx @@ -70,6 +70,18 @@ describe('PromptSuggestions', () => { expect(handlers.onSelect).not.toHaveBeenCalled() }) + it('omits the icon for commands but keeps it for other kinds', () => { + renderList({ + items: [ + { key: 'review', value: 'review', kind: 'command', label: '/review', ranges: [] }, + { key: 'build', value: 'build', kind: 'agent', label: '@build', ranges: [] }, + ], + }) + + expect(rowButton('/review').querySelector('svg')).toBeNull() + expect(rowButton('@build').querySelector('svg')).not.toBeNull() + }) + it('renders nothing without items', () => { renderList({ items: [] }) diff --git a/frontend/src/components/message/PromptSuggestions.tsx b/frontend/src/components/message/PromptSuggestions.tsx index 6a05a4f1..1f91747c 100644 --- a/frontend/src/components/message/PromptSuggestions.tsx +++ b/frontend/src/components/message/PromptSuggestions.tsx @@ -1,5 +1,5 @@ import { useCallback, useEffect, useLayoutEffect, useRef, useState, type ReactNode, type RefObject } from 'react' -import { Bot, Command, FileText, Sparkles, Play } from 'lucide-react' +import { Bot, FileText, Sparkles, Play, type LucideIcon } from 'lucide-react' import { SWIPE_COMMIT_DISTANCE, useTouchTapSelect } from '@/hooks/useTouchTapSelect' import type { MatchRange } from '@/lib/fuzzyMatch' @@ -28,8 +28,7 @@ interface PromptSuggestionsProps { const TAKEOVER_TOP_GAP_PX = 8 const TAKEOVER_MIN_HEIGHT_PX = 160 -const KIND_ICONS: Record = { - command: Command, +const KIND_ICONS: Partial> = { agent: Bot, skill: Sparkles, file: FileText, @@ -111,12 +110,14 @@ export function PromptSuggestions({ : takeover ? 'bg-background border-transparent hover:bg-muted text-foreground' : 'hover:bg-muted text-foreground' }`} > - - - + {Icon && ( + + + + )} {renderHighlighted(item.label, item.ranges)}