From 93f85830331efa6bbd4a13a7a5a88ebceb5b2c90 Mon Sep 17 00:00:00 2001
From: Jinjing <6427696+AmethystLiang@users.noreply.github.com>
Date: Fri, 30 Oct 2026 23:25:25 -0700
Subject: [PATCH] Render CodeRabbit review icons in git comments (#36198)
* Render CodeRabbit review icons locally in git comments
- Replace trusted external SVGs with themed Lucide icons
- Suppress picture sources to prevent remote image fetches
* Fix code review icon rendering in git comments
---
.../checks-panel/comment-row.tsx | 7 +-
.../review-comment-markdown.fixture.tsx | 44 ++++++
.../review-comment-markdown.test.tsx | 102 +++++++++++++
.../checks-panel/review-comment-markdown.tsx | 137 ++++++++++++++++++
.../right-sidebar/pr-comment-presentation.ts | 6 +-
.../comment-markdown-element-renderers.tsx | 2 +-
6 files changed, 293 insertions(+), 5 deletions(-)
create mode 100644 src/renderer/src/components/right-sidebar/checks-panel/review-comment-markdown.fixture.tsx
create mode 100644 src/renderer/src/components/right-sidebar/checks-panel/review-comment-markdown.test.tsx
create mode 100644 src/renderer/src/components/right-sidebar/checks-panel/review-comment-markdown.tsx
diff --git a/src/renderer/src/components/right-sidebar/checks-panel/comment-row.tsx b/src/renderer/src/components/right-sidebar/checks-panel/comment-row.tsx
index c9cd3dfe477..f0a9ec75971 100644
--- a/src/renderer/src/components/right-sidebar/checks-panel/comment-row.tsx
+++ b/src/renderer/src/components/right-sidebar/checks-panel/comment-row.tsx
@@ -2,6 +2,7 @@ import React, { useCallback, useEffect, useState } from 'react'
import { Button } from '@/components/ui/button'
import { cn } from '@/lib/utils'
import CommentMarkdown from '@/components/sidebar/CommentMarkdown'
+import { reviewCommentMarkdown } from './review-comment-markdown'
import { CommentReactions } from '@/components/github/CommentReactions'
import { isBotPRComment } from '../../../../../shared/pr-comment-audience'
import type { GitHubReactionContent, PRComment } from '../../../../../shared/github/comment-types'
@@ -322,7 +323,11 @@ export function CommentRow({
) : (
-
+
Minor** · **Functional Correctness** · **Quick win**
+
+
Supported by static analysis
+
+The callback then discards the result from \`openChromeWebStore()\`.
+
+
+
+**Handle rejected Web Store tab creation before completing the tour.**
+
+\`performContextualTourStepAction\` calls \`finishTour()\` before it schedules \`openChromeWebStore()\`.
+
+**
Major** · **Security & Privacy**
+
+**
Critical** · **Functional Correctness**`
+
+export const narrow = defineFixture({
+ width: 360,
+ render: () => (
+
+ )
+})
+
+export const expanded = defineFixture({
+ ...narrow,
+ width: 540,
+ interact: (frame) => {
+ frame.querySelector('summary')?.click()
+ }
+})
diff --git a/src/renderer/src/components/right-sidebar/checks-panel/review-comment-markdown.test.tsx b/src/renderer/src/components/right-sidebar/checks-panel/review-comment-markdown.test.tsx
new file mode 100644
index 00000000000..b3c73c2a35d
--- /dev/null
+++ b/src/renderer/src/components/right-sidebar/checks-panel/review-comment-markdown.test.tsx
@@ -0,0 +1,102 @@
+import { renderToStaticMarkup } from 'react-dom/server'
+import { describe, expect, it } from 'vitest'
+import CommentMarkdown from '@/components/sidebar/CommentMarkdown'
+import { reviewCommentMarkdown } from './review-comment-markdown'
+
+const iconBase = 'https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/'
+
+describe('review comment icons', () => {
+ it('renders CodeRabbit picture icons locally without loading images or source sets', () => {
+ const markup = renderToStaticMarkup(
+
Minor** · **Functional Correctness** · **Quick win**
+
+
Supported by static analysis
+
+Handle rejected Web Store tab creation before completing the tour.
+
+ `}
+ />
+ )
+
+ expect(markup.match(/
)
- }
+ } satisfies Components
}
export function createDocumentCommentMarkdownComponents(