Skip to content

Commit 690f680

Browse files
committed
Makes the intro copy for slash commands only appear when there's no search string
1 parent d0ce642 commit 690f680

File tree

1 file changed

+25
-23
lines changed

1 file changed

+25
-23
lines changed

webview-ui/src/components/chat/ContextMenu.tsx

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -289,30 +289,32 @@ const ContextMenu: React.FC<ContextMenuProps> = ({
289289
overflowX: "hidden",
290290
}}>
291291
{/* Settings button for slash commands */}
292-
{searchQuery.startsWith("/") && (
292+
{searchQuery === "/" && (
293293
<div className="p-2 flex items-start gap-4 justify-between">
294-
<div className="text-sm">
295-
<p className="font-bold text-base text-vscode-foreground mt-1 mb-0.5">Slash Commands</p>
296-
<p className="text-xs mt-0.5 -mb-1">
297-
<Trans
298-
i18nKey="settings:slashCommands.description"
299-
components={{
300-
DocsLink: (
301-
<a
302-
href={buildDocLink(
303-
"features/slash-commands",
304-
"slash_commands_settings",
305-
)}
306-
target="_blank"
307-
rel="noopener noreferrer"
308-
className="text-vscode-textLink-foreground hover:underline">
309-
Docs
310-
</a>
311-
),
312-
}}
313-
/>
314-
</p>
315-
</div>
294+
{searchQuery.length === 1 && (
295+
<div className="text-sm">
296+
<p className="font-bold text-base text-vscode-foreground mt-1 mb-0.5">Slash Commands</p>
297+
<p className="text-xs mt-0.5 -mb-1">
298+
<Trans
299+
i18nKey="settings:slashCommands.description"
300+
components={{
301+
DocsLink: (
302+
<a
303+
href={buildDocLink(
304+
"features/slash-commands",
305+
"slash_commands_settings",
306+
)}
307+
target="_blank"
308+
rel="noopener noreferrer"
309+
className="text-vscode-textLink-foreground hover:underline">
310+
Docs
311+
</a>
312+
),
313+
}}
314+
/>
315+
</p>
316+
</div>
317+
)}
316318
<button
317319
className="mt-1 cursor-pointer"
318320
onClick={handleSettingsClick}

0 commit comments

Comments
 (0)