fix(ui): Display newlines correctly in tool descriptions (#22363)

Add `whiteSpace: 'pre-wrap'` to tool description rendering to preserve newlines.

This fixes #22362.
This commit is contained in:
Luo Peng 2026-03-01 08:00:24 +08:00 committed by GitHub
parent 13e74dd389
commit 0f4771fe19
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -58,7 +58,14 @@ export function FormattedToolView({ tool }: FormattedToolViewProps) {
{/* Description */}
{tool.description && (
<div style={{ marginBottom: 16 }}>
<Text style={{ lineHeight: 1.6 }}>{tool.description}</Text>
<Text
style={{
lineHeight: 1.6,
whiteSpace: 'pre-wrap',
}}
>
{tool.description}
</Text>
</div>
)}