From 5b662f107575ab404c77e12820be332aca329185 Mon Sep 17 00:00:00 2001
From: "sentry-junior[bot]"
<264270552+sentry-junior[bot]@users.noreply.github.com>
Date: Wed, 2 Dec 2026 23:52:20 +0000
Subject: [PATCH] feat(notifications): Render markdown sections in the debug
previewer
The notification platform is getting a markdown section type for
comment notifications. Render it with MarkedText so /debug/notifications
shows the comment instead of skipping it.
Co-Authored-By: Grant Patterson <82265+hobzcalvin@users.noreply.github.com>
---
.../notificationBodyRenderer.spec.tsx | 29 +++++++++++++++++++
.../components/notificationBodyRenderer.tsx | 16 ++++++++--
2 files changed, 43 insertions(+), 2 deletions(-)
create mode 100644 static/app/debug/notifications/components/notificationBodyRenderer.spec.tsx
diff --git a/static/app/debug/notifications/components/notificationBodyRenderer.spec.tsx b/static/app/debug/notifications/components/notificationBodyRenderer.spec.tsx
new file mode 100644
index 000000000000..49b7ff2ac79e
--- /dev/null
+++ b/static/app/debug/notifications/components/notificationBodyRenderer.spec.tsx
@@ -0,0 +1,29 @@
+import {render, screen} from 'sentry-test/reactTestingLibrary';
+
+import {
+ NotificationBodyFormattingBlockType,
+ NotificationBodyRenderer,
+ NotificationBodyTextBlockType,
+} from './notificationBodyRenderer';
+
+describe('NotificationBodyRenderer', () => {
+ it('renders markdown sections as markdown', async () => {
+ const body = [
+ {
+ type: NotificationBodyFormattingBlockType.MARKDOWN,
+ blocks: [
+ {
+ type: NotificationBodyTextBlockType.PLAIN_TEXT,
+ text: '**@Jane Doe** take a look',
+ },
+ ],
+ },
+ ];
+
+ render();
+
+ expect(await screen.findByText('@Jane Doe')).toBeInTheDocument();
+ expect(screen.getByText('@Jane Doe').tagName).toBe('STRONG');
+ expect(screen.queryByText(/\*\*/)).not.toBeInTheDocument();
+ });
+});
diff --git a/static/app/debug/notifications/components/notificationBodyRenderer.tsx b/static/app/debug/notifications/components/notificationBodyRenderer.tsx
index 848b2fe277e9..e6b29a80e1c6 100644
--- a/static/app/debug/notifications/components/notificationBodyRenderer.tsx
+++ b/static/app/debug/notifications/components/notificationBodyRenderer.tsx
@@ -1,13 +1,16 @@
import {Fragment} from 'react';
import styled from '@emotion/styled';
+import {MarkedText} from 'sentry/utils/marked/markedText';
+
// Match the Python types from notifications/platform/types.py
-enum NotificationBodyFormattingBlockType {
+export enum NotificationBodyFormattingBlockType {
PARAGRAPH = 'paragraph',
CODE_BLOCK = 'code_block',
+ MARKDOWN = 'markdown',
}
-enum NotificationBodyTextBlockType {
+export enum NotificationBodyTextBlockType {
PLAIN_TEXT = 'plain_text',
BOLD_TEXT = 'bold_text',
CODE = 'code',
@@ -70,6 +73,15 @@ function renderFormattingBlock(
);
}
+ if (block.type === NotificationBodyFormattingBlockType.MARKDOWN) {
+ return (
+ textBlock.text).join('\n')}
+ style={{marginBottom: '8px'}}
+ />
+ );
+ }
return null;
}