From 8665a4d0bb413766c6e5d3247f50d968472d2b81 Mon Sep 17 00:00:00 2001 From: Chris Scott Date: Sun, 30 Nov 2025 23:17:56 -0500 Subject: [PATCH] Fix command and file suggestions rendering position on mobile and desktop --- .../components/command/CommandSuggestions.tsx | 19 +++++--------- .../components/message/FileSuggestions.tsx | 14 +++-------- .../src/components/message/PromptInput.tsx | 25 +------------------ 3 files changed, 10 insertions(+), 48 deletions(-) diff --git a/frontend/src/components/command/CommandSuggestions.tsx b/frontend/src/components/command/CommandSuggestions.tsx index 3244429e..eaabd7fd 100644 --- a/frontend/src/components/command/CommandSuggestions.tsx +++ b/frontend/src/components/command/CommandSuggestions.tsx @@ -10,7 +10,6 @@ interface CommandSuggestionsProps { commands: CommandType[] onSelect: (command: CommandType) => void onClose: () => void - position: { bottom: number; left: number; width: number } selectedIndex?: number } @@ -19,7 +18,6 @@ export function CommandSuggestions({ query, commands, onSelect, - position, selectedIndex = 0 }: CommandSuggestionsProps) { const containerRef = useRef(null) @@ -50,12 +48,7 @@ export function CommandSuggestions({ return (
{filteredCommands.map((command, index) => { @@ -68,17 +61,17 @@ export function CommandSuggestions({ data-selected={isSelected} className={`px-3 py-2 cursor-pointer rounded-md transition-colors flex items-center gap-2 ${ isSelected - ? 'bg-blue-600/20 text-white' - : 'hover:bg-[#2a2a2a] text-zinc-300' + ? 'bg-primary/20 text-foreground' + : 'hover:bg-muted text-muted-foreground' }`} onClick={() => onSelect(command)} > - +
{displayName}
{command.description && ( -
{command.description}
+
{command.description}
)}
@@ -86,7 +79,7 @@ export function CommandSuggestions({ })}
-
+
↑↓ Navigate ↵ Select diff --git a/frontend/src/components/message/FileSuggestions.tsx b/frontend/src/components/message/FileSuggestions.tsx index 404060b4..24cf2688 100644 --- a/frontend/src/components/message/FileSuggestions.tsx +++ b/frontend/src/components/message/FileSuggestions.tsx @@ -2,11 +2,9 @@ import { useEffect, useRef } from 'react' interface FileSuggestionsProps { isOpen: boolean - query: string files: string[] onSelect: (file: string) => void onClose: () => void - position: { bottom: number, left: number, width: number } selectedIndex?: number } @@ -15,7 +13,6 @@ export function FileSuggestions({ files, onSelect, onClose, - position, selectedIndex = 0 }: FileSuggestionsProps) { const listRef = useRef(null) @@ -53,12 +50,7 @@ export function FileSuggestions({ return (
{files.map((file, idx) => (