Skip to content

Commit

Permalink
feat(ui): omit source details in Answer Engine title (#3051)
Browse files Browse the repository at this point in the history
* feat(ui): omit source details from Answer Engine title

* update
  • Loading branch information
liangfung authored Sep 3, 2024
1 parent 072f571 commit 3a2165d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ee/tabby-ui/app/search/components/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1350,7 +1350,8 @@ function ThreadMessagesErrorView() {
function getTitleFromMessages(messages: ConversationMessage[] | undefined) {
if (!messages?.length) return ''

const firstLine = messages?.[0]?.content.split('\n')[0]
const title = firstLine.slice(0, 48)
const firstLine = messages[0]?.content.split('\n')[0] ?? ''
const cleanedLine = firstLine.replace(/\[\[source:(\S+)\]\]/g, '').trim()
const title = cleanedLine.slice(0, 48)
return title
}

0 comments on commit 3a2165d

Please sign in to comment.