Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
liangfung committed Oct 21, 2024
1 parent 889bc5e commit 02dd3aa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
5 changes: 5 additions & 0 deletions ee/tabby-ui/components/chat/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,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)
}
Expand Down
22 changes: 11 additions & 11 deletions ee/tabby-ui/components/chat/question-answer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,17 @@ function UserMessageCardActions(props: { message: UserMessage }) {
<Button
variant="ghost"
size="icon"
onClick={e => handleMessageAction?.(message.id, 'delete')}
onClick={e => handleMessageAction(message.id, 'edit')}
>
<IconEdit />
<span className="sr-only">Edit message</span>
</Button>
)}
{!isLoading && (
<Button
variant="ghost"
size="icon"
onClick={e => handleMessageAction(message.id, 'delete')}
>
<IconTrash />
<span className="sr-only">Delete message</span>
Expand Down Expand Up @@ -444,16 +454,6 @@ function AssistantMessageCardActions(props: AssistantMessageActionProps) {
<span className="sr-only">Regenerate message</span>
</Button>
)}
{!isGenerating && (
<Button
variant="ghost"
size="icon"
onClick={e => handleMessageAction(userMessageId, 'edit')}
>
<IconEdit />
<span className="sr-only">Edit message</span>
</Button>
)}
<CopyButton value={copyContent} onCopyContent={onCopyContent} />
</ChatMessageActionsWrapper>
)
Expand Down

0 comments on commit 02dd3aa

Please sign in to comment.