fix(Knowledge): enable text selection in knowledge base search results (#4281)

This commit is contained in:
shiquda 2025-04-01 23:16:34 +08:00 committed by GitHub
parent e572b3801b
commit 91b9a48c48
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -126,7 +126,7 @@ const PopupContainer: React.FC<Props> = ({ base, resolve }) => {
<List.Item> <List.Item>
<ResultItem> <ResultItem>
<ScoreTag>Score: {(item.score * 100).toFixed(1)}%</ScoreTag> <ScoreTag>Score: {(item.score * 100).toFixed(1)}%</ScoreTag>
<Paragraph>{highlightText(item.pageContent)}</Paragraph> <Paragraph style={{ userSelect: 'text' }}>{highlightText(item.pageContent)}</Paragraph>
<MetadataContainer> <MetadataContainer>
<Text type="secondary"> <Text type="secondary">
{t('knowledge.source')}:{' '} {t('knowledge.source')}:{' '}
@ -191,6 +191,7 @@ const MetadataContainer = styled.div`
margin-top: 8px; margin-top: 8px;
padding-top: 8px; padding-top: 8px;
border-top: 1px solid var(--color-border); border-top: 1px solid var(--color-border);
user-select: text;
` `
const TopViewKey = 'KnowledgeSearchPopup' const TopViewKey = 'KnowledgeSearchPopup'