Skip to content

Commit

Permalink
polish
Browse files Browse the repository at this point in the history
  • Loading branch information
antimonyGu committed Dec 12, 2024
1 parent d8dc027 commit d16b1bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
3 changes: 0 additions & 3 deletions ee/tabby-ui/app/chat/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ export default function ChatPage() {
setErrorMessage(null)
},
addRelevantContext: context => {
console.log('context', context)
return addRelevantContext(context)
},
updateTheme: (style, themeClass) => {
Expand Down Expand Up @@ -268,8 +267,6 @@ export default function ChatPage() {
const onChatLoaded = () => {
pendingRelevantContexts.forEach(addRelevantContext)
pendingMessages.forEach(sendMessage)

console.log('pendingActiveSelection', pendingActiveSelection)

chatRef.current?.updateActiveSelection(pendingActiveSelection)

Expand Down
19 changes: 2 additions & 17 deletions ee/tabby-ui/components/chat/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
CreateMessageInput,
InputMaybe,
MessageAttachmentCodeInput,
RepositoryListQuery,
ThreadRunOptionsInput
} from '@/lib/gql/generates/graphql'
import { useDebounceCallback } from '@/lib/hooks/use-debounce'
Expand Down Expand Up @@ -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 })
Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d16b1bd

Please sign in to comment.