fix(tui): auto-expand Activity on error

The Activity accordion in ToolTrail tints red (via metaTone) when an error
item is present, but stays collapsed — the error is invisible until the
user clicks. Track the latest error id and force-open openMeta whenever
it advances. Users can still manually collapse; a new error re-opens.
This commit is contained in:
Brooklyn Nicholson 2026-04-20 15:25:29 -05:00
parent 4a424f1fbb
commit 93b47d962a

View file

@ -596,6 +596,17 @@ export const ToolTrail = memo(function ToolTrail({
}
}, [detailsMode])
const latestErrorId = useMemo(
() => activity.reduce((max, i) => (i.tone === 'error' && i.id > max ? i.id : max), -1),
[activity]
)
useEffect(() => {
if (latestErrorId >= 0) {
setOpenMeta(true)
}
}, [latestErrorId])
const cot = useMemo(() => thinkingPreview(reasoning, 'full', THINKING_COT_MAX), [reasoning])
if (