From 7fedab6815533f65c13d5a8ce4db70865476f344 Mon Sep 17 00:00:00 2001 From: Chris Scott <99081550+chriswritescode-dev@users.noreply.github.com> Date: Thu, 8 Oct 2026 16:20:38 -0400 Subject: [PATCH] fix(prompt): drop the command icon from the slash menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The slash menu prefixed every command with the Command (⌘) glyph, which the leading "/" already conveys and which only consumed horizontal space. Render the kind icon only for kinds that have one, so command rows start at the label while agent, skill and file rows keep theirs. --- .../message/PromptSuggestions.test.tsx | 12 ++++++++++++ .../components/message/PromptSuggestions.tsx | 19 ++++++++++--------- 2 files changed, 22 insertions(+), 9 deletions(-) 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)}