mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-13 05:12:55 -07:00
fix: character truncation in raw markdown mode (#18938)
This commit is contained in:
@@ -46,4 +46,21 @@ describe('<GeminiMessage /> - Raw Markdown Display Snapshots', () => {
|
|||||||
expect(lastFrame()).toMatchSnapshot();
|
expect(lastFrame()).toMatchSnapshot();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
it('wraps long lines correctly in raw markdown mode', () => {
|
||||||
|
const terminalWidth = 20;
|
||||||
|
const text =
|
||||||
|
'This is a long line that should wrap correctly without truncation';
|
||||||
|
const { lastFrame } = renderWithProviders(
|
||||||
|
<GeminiMessage
|
||||||
|
text={text}
|
||||||
|
isPending={false}
|
||||||
|
terminalWidth={terminalWidth}
|
||||||
|
/>,
|
||||||
|
{
|
||||||
|
uiState: { renderMarkdown: false, streamingState: StreamingState.Idle },
|
||||||
|
},
|
||||||
|
);
|
||||||
|
expect(lastFrame()).toMatchSnapshot();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ export const GeminiMessage: React.FC<GeminiMessageProps> = ({
|
|||||||
? undefined
|
? undefined
|
||||||
: Math.max(availableTerminalHeight - 1, 1)
|
: Math.max(availableTerminalHeight - 1, 1)
|
||||||
}
|
}
|
||||||
terminalWidth={terminalWidth}
|
terminalWidth={Math.max(terminalWidth - prefixWidth, 0)}
|
||||||
renderMarkdown={renderMarkdown}
|
renderMarkdown={renderMarkdown}
|
||||||
/>
|
/>
|
||||||
<Box
|
<Box
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ export const GeminiMessageContent: React.FC<GeminiMessageContentProps> = ({
|
|||||||
? undefined
|
? undefined
|
||||||
: Math.max(availableTerminalHeight - 1, 1)
|
: Math.max(availableTerminalHeight - 1, 1)
|
||||||
}
|
}
|
||||||
terminalWidth={terminalWidth}
|
terminalWidth={Math.max(terminalWidth - prefixWidth, 0)}
|
||||||
renderMarkdown={renderMarkdown}
|
renderMarkdown={renderMarkdown}
|
||||||
/>
|
/>
|
||||||
<Box
|
<Box
|
||||||
|
|||||||
@@ -31,3 +31,12 @@ exports[`<GeminiMessage /> - Raw Markdown Display Snapshots > renders with rende
|
|||||||
1 const x = 1;
|
1 const x = 1;
|
||||||
"
|
"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
exports[`<GeminiMessage /> - Raw Markdown Display Snapshots > wraps long lines correctly in raw markdown mode 1`] = `
|
||||||
|
"✦ This is a long
|
||||||
|
line that should
|
||||||
|
wrap correctly
|
||||||
|
without
|
||||||
|
truncation
|
||||||
|
"
|
||||||
|
`;
|
||||||
|
|||||||
Reference in New Issue
Block a user