diff options
| author | Adam <[email protected]> | 2025-12-15 05:41:37 -0600 |
|---|---|---|
| committer | Adam <[email protected]> | 2025-12-15 10:20:17 -0600 |
| commit | 88c06751487291416eb473831cda70455f67412a (patch) | |
| tree | 91530cb20b7ca0d9a9b3a357c669c37ebb3c657a /packages/desktop/src/components | |
| parent | 82c4755fb01f3ae821569af80d1b8670fe69fe56 (diff) | |
| download | opencode-88c06751487291416eb473831cda70455f67412a.tar.gz opencode-88c06751487291416eb473831cda70455f67412a.zip | |
wip(desktop): progress
Diffstat (limited to 'packages/desktop/src/components')
| -rw-r--r-- | packages/desktop/src/components/prompt-input.tsx | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/packages/desktop/src/components/prompt-input.tsx b/packages/desktop/src/components/prompt-input.tsx index a498593bd..fd5574990 100644 --- a/packages/desktop/src/components/prompt-input.tsx +++ b/packages/desktop/src/components/prompt-input.tsx @@ -93,13 +93,11 @@ export const PromptInput: Component<PromptInputProps> = (props) => { historyIndex: number savedPrompt: Prompt | null placeholder: number - slashFilter: string }>({ popover: null, historyIndex: -1, savedPrompt: null, placeholder: Math.floor(Math.random() * PLACEHOLDERS.length), - slashFilter: "", }) const MAX_HISTORY = 100 @@ -237,25 +235,12 @@ export const PromptInput: Component<PromptInputProps> = (props) => { onInput: slashOnInput, onKeyDown: slashOnKeyDown, } = useFilteredList<SlashCommand>({ - items: () => { - const filter = store.slashFilter.toLowerCase() - return slashCommands().filter( - (cmd) => - cmd.trigger.toLowerCase().includes(filter) || - cmd.title.toLowerCase().includes(filter) || - cmd.description?.toLowerCase().includes(filter) || - false, - ) - }, + items: slashCommands, key: (x) => x?.id, + filterKeys: ["trigger", "title", "description"], onSelect: handleSlashSelect, }) - // Update slash filter when store changes - createEffect(() => { - slashOnInput(store.slashFilter) - }) - createEffect( on( () => prompt.current(), @@ -337,7 +322,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => { onInput(atMatch[1]) setStore("popover", "file") } else if (slashMatch) { - setStore("slashFilter", slashMatch[1]) + slashOnInput(slashMatch[1]) setStore("popover", "slash") } else { setStore("popover", null) |
