fix(ui): fix issue with box edges (#26148)

This commit is contained in:
Christian Gunderman
2026-05-01 16:46:16 +00:00
committed by GitHub
parent 7213822e84
commit 8943640a71
3 changed files with 56 additions and 2 deletions
@@ -368,6 +368,39 @@ describe('<ToolGroupMessage />', () => {
unmount();
});
it('renders update_topic in the middle of other tools', async () => {
const toolCalls = [
createToolCall({
callId: 'tool-1',
name: 'read_file',
status: CoreToolCallStatus.Success,
}),
createToolCall({
callId: 'topic-tool-middle',
name: UPDATE_TOPIC_TOOL_NAME,
args: {
[TOPIC_PARAM_TITLE]: 'Middle Topic',
},
}),
createToolCall({
callId: 'tool-2',
name: 'write_file',
status: CoreToolCallStatus.Success,
}),
];
const item = createItem(toolCalls);
const { lastFrame, unmount } = await renderWithProviders(
<ToolGroupMessage {...baseProps} item={item} toolCalls={toolCalls} />,
{
config: baseMockConfig,
settings: fullVerbositySettings,
},
);
expect(lastFrame()).toMatchSnapshot('update_topic_middle');
unmount();
});
it('renders with limited terminal height', async () => {
const toolCalls = [
createToolCall({
@@ -192,6 +192,9 @@ export const ToolGroupMessage: React.FC<ToolGroupMessageProps> = ({
!Array.isArray(prevGroup) &&
isCompactTool(prevGroup, isCompactModeEnabled);
const prevIsTopic =
prevGroup && !Array.isArray(prevGroup) && isTopicTool(prevGroup.name);
const nextGroup = !isLast ? groupedTools[i + 1] : null;
const nextIsCompact =
nextGroup &&
@@ -226,7 +229,7 @@ export const ToolGroupMessage: React.FC<ToolGroupMessageProps> = ({
const isFirstProp = !!(isFirst
? (borderTopOverride ?? true)
: prevIsCompact);
: prevIsCompact || prevIsTopic);
const showClosingBorder =
!isCompact &&
@@ -363,6 +366,8 @@ export const ToolGroupMessage: React.FC<ToolGroupMessageProps> = ({
prevGroup &&
!Array.isArray(prevGroup) &&
isCompactTool(prevGroup, isCompactModeEnabled);
const prevIsTopic =
prevGroup && !Array.isArray(prevGroup) && isTopicTool(prevGroup.name);
const nextGroup = !isLast ? groupedTools[index + 1] : null;
const nextIsCompact =
@@ -379,7 +384,7 @@ export const ToolGroupMessage: React.FC<ToolGroupMessageProps> = ({
const isFirstProp = !!(isFirst
? (borderTopOverride ?? true)
: prevIsCompact);
: prevIsCompact || prevIsTopic);
const showClosingBorder =
!isCompact &&
@@ -141,6 +141,22 @@ exports[`<ToolGroupMessage /> > Golden Snapshots > renders two tool groups where
"
`;
exports[`<ToolGroupMessage /> > Golden Snapshots > renders update_topic in the middle of other tools > update_topic_middle 1`] = `
"╭──────────────────────────────────────────────────────────────────────────╮
│ ✓ read_file A tool for testing │
│ │
│ Test result │
╰──────────────────────────────────────────────────────────────────────────╯
Middle Topic
╭──────────────────────────────────────────────────────────────────────────╮
│ ✓ write_file A tool for testing │
│ │
│ Test result │
╰──────────────────────────────────────────────────────────────────────────╯
"
`;
exports[`<ToolGroupMessage /> > Golden Snapshots > renders update_topic tool call using TopicMessage > update_topic_tool 1`] = `
" Testing Topic: This is the description
"