From a6e6f88263dda0e2e977043ac15f7024b8f9a66e Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Wed, 24 Apr 2024 12:40:03 -0700 Subject: [PATCH] fix --- ee/tabby-ui/components/prompt-form.tsx | 21 ++++++++++++++++++--- ee/tabby-ui/lib/types/chat.ts | 1 + 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/ee/tabby-ui/components/prompt-form.tsx b/ee/tabby-ui/components/prompt-form.tsx index cc20f5fa032f..1782eee875e3 100644 --- a/ee/tabby-ui/components/prompt-form.tsx +++ b/ee/tabby-ui/components/prompt-form.tsx @@ -5,7 +5,6 @@ import useSWR from 'swr' import { useEnterSubmit } from '@/lib/hooks/use-enter-submit' import fetcher from '@/lib/tabby/fetcher' -import type { ISearchHit, SearchReponse } from '@/lib/types' import { cn } from '@/lib/utils' import { Button, buttonVariants } from '@/components/ui/button' import { @@ -118,7 +117,6 @@ function PromptFormRenderer( }, []) const handleCompletionSelect = (item: ISearchHit) => { - /* const selectionEnd = prevInputSelectionEnd.current ?? 0 const queryNameMatches = getSearchCompletionQueryName(input, selectionEnd) if (queryNameMatches) { @@ -138,7 +136,6 @@ function PromptFormRenderer( } setOptions([]) setSuggestionOpen(false) - */ } const handlePromptSubmit: React.FormEventHandler< @@ -351,3 +348,21 @@ function IconForCompletionKind({ return } } + +type ISearchHit = { + id: number + score: number + doc: { + body: string + filepath: string + git_url: string + language: string + name: string + kind: string + } +} + +type SearchReponse = { + hits: Array + num_hits: number +} \ No newline at end of file diff --git a/ee/tabby-ui/lib/types/chat.ts b/ee/tabby-ui/lib/types/chat.ts index 83c74cefd86a..c9ce8b7ce3b9 100644 --- a/ee/tabby-ui/lib/types/chat.ts +++ b/ee/tabby-ui/lib/types/chat.ts @@ -21,6 +21,7 @@ export type ISearchHit = { start_line: number } } + export type SearchReponse = { hits: Array num_hits: number