Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,23 @@ describe('Seer log embed', () => {
);
});

it('renders an ANSI-colored message without escape codes', async () => {
mockLogDetails([
{
name: OurLogKnownFieldKey.MESSAGE,
type: 'str',
value: '\x1B[31mPayment\x1B[0m provider timed out',
},
...ATTRIBUTES.slice(1),
]);

renderLog();

const colored = await screen.findByText('Payment');
expect(colored.style.color).toContain('color-mix(in srgb,');
expect(colored.parentElement).toHaveTextContent(/^Payment provider timed out$/);
});

it('renders on a page that never initialized page filters', async () => {
// Seer renders from the organization layout, so it appears on plenty of
// pages that mount no PageFiltersContainer -- the stories page among them.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {useQuery} from '@tanstack/react-query';
import {Flex, Stack} from '@sentry/scraps/layout';
import {Text} from '@sentry/scraps/text';

import {AnsiText} from 'sentry/components/ansiText';
import {LoadingIndicator} from 'sentry/components/loadingIndicator';
import {ALL_ACCESS_PROJECTS} from 'sentry/components/pageFilters/constants';
import {LogAttributesView} from 'sentry/components/seer/markdown/embeds/components/log/logAttributesView';
Expand Down Expand Up @@ -336,7 +337,7 @@ export default function LogBlock(props: LogData) {
</Text>
</Flex>
<Text monospace size="sm">
{String(message ?? '')}
<AnsiText>{String(message ?? '')}</AnsiText>
</Text>
</Flex>
<LogBlockContent
Expand Down
Loading