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

View File

@@ -279,8 +279,8 @@ describe('<ToolGroupMessage />', () => {
);
const output = lastFrame();
expect(output).toContain('Testing Topic');
expect(output).toContain('This is the description');
expect(output).toContain('Testing Topic: ');
expect(output).toContain('This is the description');
expect(output).toMatchSnapshot('update_topic_tool');
unmount();
});
@@ -307,8 +307,8 @@ describe('<ToolGroupMessage />', () => {
);
const output = lastFrame();
expect(output).toContain('Testing Topic');
expect(output).toContain('This is the summary');
expect(output).toContain('Testing Topic: ');
expect(output).toContain('This is the summary');
unmount();
});

View File

@@ -31,11 +31,16 @@ export const TopicMessage: React.FC<TopicMessageProps> = ({ args }) => {
const intent = typeof rawIntent === 'string' ? rawIntent : undefined;
return (
<Box flexDirection="row" marginLeft={2}>
<Text color={theme.text.primary} bold>
<Box flexDirection="row" marginLeft={2} flexWrap="wrap">
<Text color={theme.text.primary} bold wrap="truncate-end">
{title || 'Topic'}
{intent && <Text>: </Text>}
</Text>
{intent && <Text color={theme.text.secondary}> {intent}</Text>}
{intent && (
<Text color={theme.text.secondary} wrap="wrap">
{intent}
</Text>
)}
</Box>
);
};

View File

@@ -77,7 +77,7 @@ exports[`<ToolGroupMessage /> > Golden Snapshots > renders header when scrolled
`;
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 │
│ │
@@ -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`] = `
" Testing Topic This is the description
" Testing Topic: This is the description
"
`;