fix(ux): have user message display a short path for pasted images (#17613)

This commit is contained in:
Dev Randalpura
2026-01-27 11:59:00 -08:00
committed by GitHub
parent 82687c6dc4
commit 771ece03c9
3 changed files with 42 additions and 1 deletions
@@ -44,4 +44,16 @@ describe('UserMessage', () => {
expect(output).toMatchSnapshot();
});
it('transforms image paths in user message', () => {
const message = 'Check out this image: @/path/to/my-image.png';
const { lastFrame } = renderWithProviders(
<UserMessage text={message} width={80} />,
{ width: 80 },
);
const output = lastFrame();
expect(output).toContain('[Image my-image.png]');
expect(output).toMatchSnapshot();
});
});