Skip to content

Commit a83c5f0

Browse files
committed
fix: show picker options immediately when slash command is typed
Pickers now open on exact match (/skill, /mcp, /prompt) without requiring trailing space. Typing continues to filter results.
1 parent f7c9611 commit a83c5f0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

components/agent-panel.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,21 +1946,21 @@ export function AgentPanel() {
19461946
return []
19471947
}
19481948

1949-
// Detect picker triggers
1950-
if (input === '/skill ' || input.startsWith('/skill use ')) {
1951-
const query = input.replace('/skill use ', '').replace('/skill ', '')
1949+
// Detect picker triggers — open on exact match OR with trailing space/query
1950+
if (input === '/skill' || input === '/skill ' || input.startsWith('/skill use') || input === '/skill use') {
1951+
const query = input.replace(/^\/skill\s*(use\s*)?/, '')
19521952
setActivePicker('skill')
19531953
setPickerQuery(query)
19541954
return []
19551955
}
1956-
if (input.startsWith('/mcp ')) {
1957-
const query = input.replace('/mcp ', '')
1956+
if (input === '/mcp' || input.startsWith('/mcp ')) {
1957+
const query = input.replace(/^\/mcp\s*/, '')
19581958
setActivePicker('mcp')
19591959
setPickerQuery(query)
19601960
return []
19611961
}
1962-
if (input.startsWith('/prompt ')) {
1963-
const query = input.replace('/prompt ', '')
1962+
if (input === '/prompt' || input.startsWith('/prompt ')) {
1963+
const query = input.replace(/^\/prompt\s*/, '')
19641964
setActivePicker('prompt')
19651965
setPickerQuery(query)
19661966
return []

0 commit comments

Comments
 (0)