From 7d9af7aa3abf6e857006c9eaa26bcedd6a6b272f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20Andr=C3=A9?= Date: Thu, 6 Aug 2026 19:58:49 +0200 Subject: [PATCH] fix(chat): expand shell output by default (#2492) --- packages/ui/src/components/chat/message/MessageBody.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/ui/src/components/chat/message/MessageBody.tsx b/packages/ui/src/components/chat/message/MessageBody.tsx index ae701111..d2e04411 100644 --- a/packages/ui/src/components/chat/message/MessageBody.tsx +++ b/packages/ui/src/components/chat/message/MessageBody.tsx @@ -284,16 +284,15 @@ const UserSubtaskPart: React.FC<{ part: SubtaskPartLike }> = ({ part }) => { const SHELL_CODE_TAG_STYLE: React.CSSProperties = { background: 'transparent', backgroundColor: 'transparent' }; const UserShellActionPart: React.FC<{ part: ShellActionPartLike }> = ({ part }) => { - const [expanded, setExpanded] = React.useState(false); + const output = typeof part.shellAction?.output === 'string' ? part.shellAction.output : ''; + const [expanded, setExpanded] = React.useState(true); const [copiedOutput, setCopiedOutput] = React.useState(false); const copiedResetTimeoutRef = React.useRef(null); const { t } = useI18n(); const command = typeof part.shellAction?.command === 'string' ? part.shellAction.command.trim() : ''; - const output = typeof part.shellAction?.output === 'string' ? part.shellAction.output : ''; const status = typeof part.shellAction?.status === 'string' ? part.shellAction.status.trim().toLowerCase() : ''; const hasOutput = output.trim().length > 0; - const clearCopiedResetTimeout = React.useCallback(() => { if (copiedResetTimeoutRef.current !== null && typeof window !== 'undefined') { window.clearTimeout(copiedResetTimeoutRef.current);