From e77e728cfd1c8754e41523ac0f946dfdb04ee796 Mon Sep 17 00:00:00 2001 From: liuhao1024 Date: Sat, 6 Jun 2026 21:12:05 +0800 Subject: [PATCH] feat(desktop): loosen right-rail preview width caps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Increase the preview pane's intrinsic width cap from 32rem to 64rem and the hard max from 38rem to 72rem. Also remove the max-w-3xl (48rem) constraint on the MarkdownPreview wrapper so rendered content can use the full available width. Wide content — code listings, tables, Mermaid gantt/sequenceDiagrams, and CSV/log previews — currently wraps or scrolls horizontally even on large monitors because the rail caps out at 38rem. The default opening width is unchanged; users still drag the divider to expand. Fixes #40494 --- apps/desktop/src/app/chat/right-rail/preview-file.tsx | 2 +- apps/desktop/src/app/chat/right-rail/preview.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/desktop/src/app/chat/right-rail/preview-file.tsx b/apps/desktop/src/app/chat/right-rail/preview-file.tsx index 86b8acf9c396d..6507daab6228f 100644 --- a/apps/desktop/src/app/chat/right-rail/preview-file.tsx +++ b/apps/desktop/src/app/chat/right-rail/preview-file.tsx @@ -287,7 +287,7 @@ const MARKDOWN_COMPONENTS = { function MarkdownPreview({ text }: { text: string }) { return ( -
+
{text} diff --git a/apps/desktop/src/app/chat/right-rail/preview.tsx b/apps/desktop/src/app/chat/right-rail/preview.tsx index b6825ff6f05c5..b24dfbbd568f4 100644 --- a/apps/desktop/src/app/chat/right-rail/preview.tsx +++ b/apps/desktop/src/app/chat/right-rail/preview.tsx @@ -23,9 +23,9 @@ import { import { PreviewPane } from './preview-pane' export const PREVIEW_RAIL_MIN_WIDTH = '18rem' -export const PREVIEW_RAIL_MAX_WIDTH = '38rem' +export const PREVIEW_RAIL_MAX_WIDTH = '72rem' -const INTRINSIC = `clamp(${PREVIEW_RAIL_MIN_WIDTH}, 36vw, 32rem)` +const INTRINSIC = `clamp(${PREVIEW_RAIL_MIN_WIDTH}, 36vw, 64rem)` // Track for . Folds the intrinsic clamp with a min-floor // against --chat-min-width so the chat surface never gets squeezed below it.