The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 25, 07:30 UTC
fix(web): Fix duplicate highlight in composer slash command menu (#1445)
Abdulelah Hajjar committed
Mar 30, 2026 at 04:14 UTC
63584449002d93aab65599ec34d2352663d5caf7
1 file changed
+8
-2
apps/web/src/components/chat/ComposerCommandMenu.tsx
+8
-2
@@ -43,6 +43,7 @@ export const ComposerCommandMenu = memo(function ComposerCommandMenu(props: {
43
}) {
44
return (
45
<Command
46
+ autoHighlight={false}
47
mode="none"
48
onItemHighlighted={(highlightedValue) => {
49
props.onHighlightedItemChange(
@@ -58,6 +59,7 @@ export const ComposerCommandMenu = memo(function ComposerCommandMenu(props: {
59
item={item}
60
resolvedTheme={props.resolvedTheme}
61
isActive={props.activeItemId === item.id}
62
+ onHighlight={props.onHighlightedItemChange}
63
onSelect={props.onSelect}
64
/>
65
))}
@@ -80,15 +82,19 @@ const ComposerCommandMenuItem = memo(function ComposerCommandMenuItem(props: {
82
item: ComposerCommandItem;
83
resolvedTheme: "light" | "dark";
84
isActive: boolean;
85
+ onHighlight: (itemId: string | null) => void;
86
onSelect: (item: ComposerCommandItem) => void;
87
}) {
88
return (
89
<CommandItem
90
value={props.item.id}
91
className={cn(
89
- "cursor-pointer select-none gap-2",
90
- props.isActive && "bg-accent text-accent-foreground",
92
+ "cursor-pointer select-none gap-2 data-highlighted:bg-transparent data-highlighted:text-inherit",
93
+ props.isActive && "bg-accent! text-accent-foreground!",
94
)}
95
+ onMouseMove={() => {
96
+ if (!props.isActive) props.onHighlight(props.item.id);
97
+ }}
98
onMouseDown={(event) => {
99
event.preventDefault();
100
}}