From d16b1bda77cba370bcf211a68634fc843a33a882 Mon Sep 17 00:00:00 2001 From: zzgu Date: Wed, 11 Dec 2024 19:04:17 -0800 Subject: [PATCH] polish --- ee/tabby-ui/app/chat/page.tsx | 3 --- ee/tabby-ui/components/chat/chat.tsx | 19 ++----------------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/ee/tabby-ui/app/chat/page.tsx b/ee/tabby-ui/app/chat/page.tsx index 5c48f7a3666a..44535580864b 100644 --- a/ee/tabby-ui/app/chat/page.tsx +++ b/ee/tabby-ui/app/chat/page.tsx @@ -129,7 +129,6 @@ export default function ChatPage() { setErrorMessage(null) }, addRelevantContext: context => { - console.log('context', context) return addRelevantContext(context) }, updateTheme: (style, themeClass) => { @@ -268,8 +267,6 @@ export default function ChatPage() { const onChatLoaded = () => { pendingRelevantContexts.forEach(addRelevantContext) pendingMessages.forEach(sendMessage) - - console.log('pendingActiveSelection', pendingActiveSelection) chatRef.current?.updateActiveSelection(pendingActiveSelection) diff --git a/ee/tabby-ui/components/chat/chat.tsx b/ee/tabby-ui/components/chat/chat.tsx index 7ae1969555af..cbc2db77da30 100644 --- a/ee/tabby-ui/components/chat/chat.tsx +++ b/ee/tabby-ui/components/chat/chat.tsx @@ -13,7 +13,6 @@ import { CreateMessageInput, InputMaybe, MessageAttachmentCodeInput, - RepositoryListQuery, ThreadRunOptionsInput } from '@/lib/gql/generates/graphql' import { useDebounceCallback } from '@/lib/hooks/use-debounce' @@ -106,10 +105,9 @@ interface ChatProps extends React.ComponentProps<'div'> { supportsOnApplyInEditorV2: boolean } -async function isAvaileableWorkspace(gitUrl: string): Promise< +async function resolveGitUrl(gitUrl: string): Promise< ResolveGitUrlQuery['resolveGitUrl'] > { - // debugger const query = client.createRequestOperation( 'query', createRequest(resolveGitUrlQuery, { gitUrl }) @@ -120,18 +118,6 @@ async function isAvaileableWorkspace(gitUrl: string): Promise< .then(data => console.log('data', data)) as any } -async function fetchAllRepositories(): Promise< - RepositoryListQuery['repositoryList'] -> { - const query = client.createRequestOperation( - 'query', - createRequest(repositoryListQuery, {}) - ) - return client - .executeQuery(query) - .then(data => data?.data?.repositoryList || []) -} - function ChatRenderer( { className, @@ -529,9 +515,8 @@ function ChatRenderer( const debouncedUpdateActiveSelection = useDebounceCallback( (ctx: Context | null) => { console.log('ctx', ctx); - if (ctx?.git_url) isAvaileableWorkspace(ctx.git_url) + // if (ctx?.git_url) resolveGitUrl(ctx.git_url) - fetchAllRepositories().then(res => console.log('fetchres', res)) setActiveSelection(ctx) }, 300