From cc9fe832c224d3dda661d1cd3bb0c5d5b187b3f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98=E9=98=BF=E6=B1=9F=28Relakkes?= =?UTF-8?q?=29?= Date: Mon, 6 Apr 2026 21:30:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20compact=20code=20block=20rendering=20?= =?UTF-8?q?=E2=80=94=20tighter=20line=20height,=20softer=20borders?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 (1M context) --- desktop/src/components/chat/CodeViewer.tsx | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/desktop/src/components/chat/CodeViewer.tsx b/desktop/src/components/chat/CodeViewer.tsx index f8ce60ec..f75721e5 100644 --- a/desktop/src/components/chat/CodeViewer.tsx +++ b/desktop/src/components/chat/CodeViewer.tsx @@ -38,11 +38,10 @@ export function CodeViewer({ code, language, maxLines = 20, showLineNumbers = tr const lineCountLabel = `${lines.length} ${lines.length === 1 ? 'line' : 'lines'}` const showExpandToggle = lines.length > maxLines - const displayLines = visibleLines.length return ( -
-
+
+
{languageLabel} {lineCountLabel} @@ -54,23 +53,21 @@ export function CodeViewer({ code, language, maxLines = 20, showLineNumbers = tr
-
+
{visibleLines.map((line, index) => (
{showLineNumbers ? ( - + {startLine + index} ) : ( )}
@@ -81,7 +78,7 @@ export function CodeViewer({ code, language, maxLines = 20, showLineNumbers = tr {showExpandToggle && (