From cea123107cf5a28e5e4702c49f5b07135ed2e886 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Fri, 20 Dec 2024 11:18:40 +0000 Subject: [PATCH] [autofix.ci] apply automated fixes --- clients/vscode/src/chat/fileContext.ts | 5 ++--- clients/vscode/src/chat/utils.ts | 2 +- ee/tabby-ui/components/chat/chat-panel.tsx | 6 +++++- ee/tabby-ui/components/chat/code-references.tsx | 9 +++++---- ee/tabby-ui/lib/utils/chat.ts | 2 +- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/clients/vscode/src/chat/fileContext.ts b/clients/vscode/src/chat/fileContext.ts index acd984be6134..87090df34984 100644 --- a/clients/vscode/src/chat/fileContext.ts +++ b/clients/vscode/src/chat/fileContext.ts @@ -111,10 +111,9 @@ async function showUntitledNotebookCellContext(uri: Uri) { const notebookEditor = await window.showNotebookDocument(notebookDocument); const targetCell = notebookDocument.getCells().find((cell) => cell.document.uri.toString() === uri.toString()); if (notebookEditor && targetCell) { - const cellIndex = targetCell.index + const cellIndex = targetCell.index; // FIXME(@jueliang) set selection - notebookEditor.revealRange(new NotebookRange(cellIndex, cellIndex), NotebookEditorRevealType.InCenter) - + notebookEditor.revealRange(new NotebookRange(cellIndex, cellIndex), NotebookEditorRevealType.InCenter); } else { throw new Error(`Cell not found in notebook: ${uri.toString()}`); } diff --git a/clients/vscode/src/chat/utils.ts b/clients/vscode/src/chat/utils.ts index 7e94d0652bee..22411b678a86 100644 --- a/clients/vscode/src/chat/utils.ts +++ b/clients/vscode/src/chat/utils.ts @@ -128,4 +128,4 @@ export function parseVscodeNotebookCellURI(uri: Uri) { handle, scheme, }; -} \ No newline at end of file +} diff --git a/ee/tabby-ui/components/chat/chat-panel.tsx b/ee/tabby-ui/components/chat/chat-panel.tsx index caffb5bfde4e..72a6f0be786c 100644 --- a/ee/tabby-ui/components/chat/chat-panel.tsx +++ b/ee/tabby-ui/components/chat/chat-panel.tsx @@ -13,7 +13,11 @@ import { updateEnableActiveSelection } from '@/lib/stores/chat-actions' import { useChatStore } from '@/lib/stores/chat-store' import { useMutation } from '@/lib/tabby/gql' import { setThreadPersistedMutation } from '@/lib/tabby/query' -import { cn, getTitleFromMessages, resolveFileNameForDisplay } from '@/lib/utils' +import { + cn, + getTitleFromMessages, + resolveFileNameForDisplay +} from '@/lib/utils' import { Badge } from '@/components/ui/badge' import { Button } from '@/components/ui/button' import { diff --git a/ee/tabby-ui/components/chat/code-references.tsx b/ee/tabby-ui/components/chat/code-references.tsx index 957cca99d90e..57bc5c221532 100644 --- a/ee/tabby-ui/components/chat/code-references.tsx +++ b/ee/tabby-ui/components/chat/code-references.tsx @@ -1,6 +1,7 @@ import React, { forwardRef, useEffect, useState } from 'react' import { isNil } from 'lodash-es' +import { VSCODE_NOTEBOOK_CELL_SCHEME } from '@/lib/constants' import { RelevantCodeContext } from '@/lib/types' import { cn, resolveFileNameForDisplay } from '@/lib/utils' import { @@ -16,7 +17,6 @@ import { AccordionTrigger } from '../ui/accordion' import { IconExternalLink, IconFile, IconFileSearch2 } from '../ui/icons' -import { VSCODE_NOTEBOOK_CELL_SCHEME } from '@/lib/constants' interface ContextReferencesProps { isInEditor?: boolean @@ -86,8 +86,9 @@ export const CodeReferences = forwardRef< - {`Read ${totalContextLength} file${isMultipleReferences ? 's' : '' - }`} + {`Read ${totalContextLength} file${ + isMultipleReferences ? 's' : '' + }`} {clientContexts?.map((item, index) => { @@ -178,7 +179,7 @@ function ContextItem({
- {resolveFileNameForDisplay(context.filepath)} + {resolveFileNameForDisplay(context.filepath)} {context.range?.start && ( :{context.range.start} diff --git a/ee/tabby-ui/lib/utils/chat.ts b/ee/tabby-ui/lib/utils/chat.ts index b325304e0b0b..97ac4a52272a 100644 --- a/ee/tabby-ui/lib/utils/chat.ts +++ b/ee/tabby-ui/lib/utils/chat.ts @@ -7,8 +7,8 @@ import { } from '@/lib/gql/generates/graphql' import { MentionAttributes } from '@/lib/types' -import { MARKDOWN_SOURCE_REGEX } from '../constants/regex' import { VSCODE_NOTEBOOK_CELL_SCHEME } from '../constants' +import { MARKDOWN_SOURCE_REGEX } from '../constants/regex' export const isCodeSourceContext = (kind: ContextSourceKind) => { return [