fix(ui): wrap topic and intent fields in TopicMessage (#24386)

This commit is contained in:
Jarrod Whelan
2026-03-31 17:00:48 -07:00
committed by GitHub
parent 782bb4e4bd
commit cdc602edd7
3 changed files with 14 additions and 9 deletions
@@ -279,8 +279,8 @@ describe('<ToolGroupMessage />', () => {
); );
const output = lastFrame(); const output = lastFrame();
expect(output).toContain('Testing Topic'); expect(output).toContain('Testing Topic: ');
expect(output).toContain('This is the description'); expect(output).toContain('This is the description');
expect(output).toMatchSnapshot('update_topic_tool'); expect(output).toMatchSnapshot('update_topic_tool');
unmount(); unmount();
}); });
@@ -307,8 +307,8 @@ describe('<ToolGroupMessage />', () => {
); );
const output = lastFrame(); const output = lastFrame();
expect(output).toContain('Testing Topic'); expect(output).toContain('Testing Topic: ');
expect(output).toContain('This is the summary'); expect(output).toContain('This is the summary');
unmount(); unmount();
}); });
@@ -31,11 +31,16 @@ export const TopicMessage: React.FC<TopicMessageProps> = ({ args }) => {
const intent = typeof rawIntent === 'string' ? rawIntent : undefined; const intent = typeof rawIntent === 'string' ? rawIntent : undefined;
return ( return (
<Box flexDirection="row" marginLeft={2}> <Box flexDirection="row" marginLeft={2} flexWrap="wrap">
<Text color={theme.text.primary} bold> <Text color={theme.text.primary} bold wrap="truncate-end">
{title || 'Topic'} {title || 'Topic'}
{intent && <Text>: </Text>}
</Text> </Text>
{intent && <Text color={theme.text.secondary}> {intent}</Text>} {intent && (
<Text color={theme.text.secondary} wrap="wrap">
{intent}
</Text>
)}
</Box> </Box>
); );
}; };
@@ -77,7 +77,7 @@ exports[`<ToolGroupMessage /> > Golden Snapshots > renders header when scrolled
`; `;
exports[`<ToolGroupMessage /> > Golden Snapshots > renders mixed tool calls including update_topic 1`] = ` exports[`<ToolGroupMessage /> > Golden Snapshots > renders mixed tool calls including update_topic 1`] = `
" Testing Topic This is the description " Testing Topic: This is the description
╭──────────────────────────────────────────────────────────────────────────╮ ╭──────────────────────────────────────────────────────────────────────────╮
│ ✓ read_file Read a file │ │ ✓ read_file Read a file │
│ │ │ │
@@ -141,7 +141,7 @@ exports[`<ToolGroupMessage /> > Golden Snapshots > renders two tool groups where
`; `;
exports[`<ToolGroupMessage /> > Golden Snapshots > renders update_topic tool call using TopicMessage > update_topic_tool 1`] = ` exports[`<ToolGroupMessage /> > Golden Snapshots > renders update_topic tool call using TopicMessage > update_topic_tool 1`] = `
" Testing Topic This is the description " Testing Topic: This is the description
" "
`; `;