perf(ui-chat): contain collapsed reasoning layout

This commit is contained in:
imccyu 2026-09-01 21:00:23 +08:00
parent aad1ce0c68
commit ebe9f50b44
2 changed files with 11 additions and 1 deletions

View file

@ -3,6 +3,11 @@
flex-direction: column;
}
.root:not([data-expanded]) {
contain: size layout;
height: calc(24px + var(--dsh-content-font-delta, 0px));
}
.row {
position: relative;
overflow: hidden;

View file

@ -28,7 +28,12 @@ export function ReasoningRow({ text, running, t }: { text: string; running: bool
const summary = running ? latestLine(text) : firstLine(text)
return (
<div className={css.root} data-variant="think" data-state={running ? 'running' : 'ok'}>
<div
className={css.root}
data-variant="think"
data-state={running ? 'running' : 'ok'}
data-expanded={expanded || undefined}
>
{running && <span className={a11yCss.visuallyHidden}>{t('row.running')}</span>}
<DisclosureRow
rowClassName={css.row}