summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAdam <[email protected]>2025-12-15 05:41:37 -0600
committerAdam <[email protected]>2025-12-15 10:20:17 -0600
commit88c06751487291416eb473831cda70455f67412a (patch)
tree91530cb20b7ca0d9a9b3a357c669c37ebb3c657a
parent82c4755fb01f3ae821569af80d1b8670fe69fe56 (diff)
downloadopencode-88c06751487291416eb473831cda70455f67412a.tar.gz
opencode-88c06751487291416eb473831cda70455f67412a.zip
wip(desktop): progress
-rw-r--r--packages/desktop/src/components/prompt-input.tsx21
-rw-r--r--packages/desktop/src/pages/layout.tsx3
2 files changed, 6 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)
diff --git a/packages/desktop/src/pages/layout.tsx b/packages/desktop/src/pages/layout.tsx
index 965ade9f8..08d24dc6f 100644
--- a/packages/desktop/src/pages/layout.tsx
+++ b/packages/desktop/src/pages/layout.tsx
@@ -299,6 +299,9 @@ export default function Layout(props: ParentProps) {
if (match.found) draft.session.splice(match.index, 1)
}),
)
+ if (session.id === params.id) {
+ navigate(`/${params.dir}/session`)
+ }
}
return (
<div