Skip to content

Commit

Permalink
chore(ui): optimize display where the question length is excessive
Browse files Browse the repository at this point in the history
  • Loading branch information
liangfung committed Jan 20, 2025
1 parent 72478e5 commit bf1b311
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ee/tabby-ui/app/search/components/user-message-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,17 @@ export function UserMessageSection({
}: QuestionBlockProps) {
const { contextInfo, fetchingContextInfo } = useContext(SearchContext)
const { supportsOnApplyInEditorV2 } = useContext(ChatContext)
const contentLen = message.content?.length
const fontSizeClassname = contentLen > 400 ? 'text-base' : contentLen > 200 ? 'text-lg' : 'text-xl'

return (
<div className={cn('font-semibold', className)} {...props}>
<MessageMarkdown
message={message.content}
contextInfo={contextInfo}
supportsOnApplyInEditorV2={supportsOnApplyInEditorV2}
fetchingContextInfo={fetchingContextInfo}
className="text-xl prose-p:mb-2 prose-p:mt-0"
className={cn('prose-p:mb-2 prose-p:mt-0', fontSizeClassname)}
headline
canWrapLongLines
/>
Expand Down

0 comments on commit bf1b311

Please sign in to comment.