From f875e09a4268a7c086f3db45cc7c71cd527bbbfe Mon Sep 17 00:00:00 2001
From: liangfung <1098486429@qq.com>
Date: Fri, 18 Oct 2024 17:06:00 +0800
Subject: [PATCH] update
---
ee/tabby-ui/components/chat/chat.tsx | 8 ++++++-
.../components/chat/question-answer.tsx | 22 +++++++++----------
2 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/ee/tabby-ui/components/chat/chat.tsx b/ee/tabby-ui/components/chat/chat.tsx
index 54ce77589f3a..a960d85b2422 100644
--- a/ee/tabby-ui/components/chat/chat.tsx
+++ b/ee/tabby-ui/components/chat/chat.tsx
@@ -198,6 +198,11 @@ function ChatRenderer(
const nextQaPairs = qaPairs.filter(o => o.user.id !== userMessageId)
setQaPairs(nextQaPairs)
setInput(userMessage.message)
+ if (userMessage.activeContext) {
+ onNavigateToContext(userMessage.activeContext, {
+ openInEditor: true
+ })
+ }
deleteThreadMessagePair(threadId, qaPair?.user.id, qaPair?.assistant?.id)
}
@@ -385,10 +390,11 @@ function ChatRenderer(
message: userMessage.message + selectCodeSnippet,
// If no id is provided, set a fallback id.
id: userMessage.id ?? nanoid(),
- // If a temporary user message draft exists, use its selectContext and activeContext
+ // FIXME: perhaps should use the current active selection
selectContext: userMessageForEditTemp.current
? userMessageForEditTemp.current.selectContext
: userMessage.selectContext,
+ // todo: use current active selection
activeContext: userMessageForEditTemp.current
? userMessageForEditTemp.current.activeContext
: userMessage.activeContext
diff --git a/ee/tabby-ui/components/chat/question-answer.tsx b/ee/tabby-ui/components/chat/question-answer.tsx
index d9ffb13d5664..cc1644e1fa54 100644
--- a/ee/tabby-ui/components/chat/question-answer.tsx
+++ b/ee/tabby-ui/components/chat/question-answer.tsx
@@ -208,7 +208,17 @@ function UserMessageCardActions(props: { message: UserMessage }) {
+ )}
+ {!isLoading && (
+
)}
- {!isGenerating && (
-
- )}
)