From 9875b5528a3d4164b1556e8b1daf457d8bf21b7a Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Mon, 13 Jul 2026 21:24:33 -0700 Subject: [PATCH 01/38] Improve native chat style (#8654) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Redesign native chat interactive UI to match assistant-turn styling - Restyle approval and question cards as bordered cards docked in the composer region instead of top-border strips, and widen the chat column (max-w-3xl → max-w-4xl) to match the rest of the app - Rework the question card into a numbered pick-list with an always- present free-text row and explicit Next/Skip/Send action, replacing the prior "Other…" toggle flow - Hide the composer while a question card is active since it supplies its own answer input, and hold the card open until the paced answer send settles instead of dismissing on click - Auto-repin the message list to the bottom during in-place streaming growth via a ResizeObserver on the content, not just the viewport - Widen question-answer pacing (800ms→1000ms step, 300ms→500ms buffer) for reliability on slower machines / higher-latency SSH sessions - Restyle tool-run/tool-line disclosure to a right-side hover chevron and add a formatted (pretty-printed) detail view for diff-less calls - Add "Skip" i18n string across all locales * Extend paste bridge and question-card fixes for native chat interactive - Route pane-level Paste to the question card's free-text input when the composer is unmounted, so Cmd/Ctrl+V keeps working while a question prompt is showing. - Fix a stale-timer bug where a new interactive prompt could inherit the previous card's dismiss/submitting state and swallow its first answer. - Only render tool-run detail when there's actually content to show, and mark selected question options with aria-pressed for accessibility. --- .../native-chat/NativeChatApprovalCard.tsx | 58 +++-- .../native-chat/NativeChatComposerField.tsx | 9 +- .../native-chat/NativeChatInteractiveCard.tsx | 53 +++- .../native-chat/NativeChatMessageList.tsx | 37 ++- .../native-chat/NativeChatQuestionCard.tsx | 243 +++++++++++------- .../native-chat/NativeChatToolRun.tsx | 83 ++++-- .../components/native-chat/NativeChatView.tsx | 71 ++--- .../native-chat-runtime-send.test.ts | 8 +- .../native-chat/native-chat-runtime-send.ts | 6 +- .../native-chat/native-chat-tool-summary.ts | 20 ++ .../use-native-chat-context-menu.tsx | 17 ++ .../use-native-chat-interactive-send.ts | 16 +- .../use-native-chat-paste-bridge.ts | 34 ++- src/renderer/src/i18n/locales/en.json | 3 +- src/renderer/src/i18n/locales/es.json | 3 +- src/renderer/src/i18n/locales/ja.json | 3 +- src/renderer/src/i18n/locales/ko.json | 3 +- src/renderer/src/i18n/locales/zh.json | 3 +- 18 files changed, 446 insertions(+), 224 deletions(-) diff --git a/src/renderer/src/components/native-chat/NativeChatApprovalCard.tsx b/src/renderer/src/components/native-chat/NativeChatApprovalCard.tsx index cbf041f62e3..9b394ada907 100644 --- a/src/renderer/src/components/native-chat/NativeChatApprovalCard.tsx +++ b/src/renderer/src/components/native-chat/NativeChatApprovalCard.tsx @@ -19,35 +19,37 @@ export function NativeChatApprovalCard({ onChoose }: NativeChatApprovalCardProps): React.JSX.Element { return ( -
{approval.title}
- {approval.detail ? ( -- {approval.detail} -
- ) : null} +{approval.title}
+ {approval.detail ? ( ++ {approval.detail} +
+ ) : null} +{name}
+
+ {name}
+
{preview ? (
{preview}
) : null}
+ {hasDetail ? (
+ // Chevron sits on the right; hidden until hover when collapsed, always
+ // shown (pointing down) when expanded — mirrors Codex's disclosure affordance.
+
) : null}
- {!diff && !body && preview ? (
-
- {preview}
+ {!diff && !body && detail ? (
+
+ {detail.length > MAX_TOOL_RESULT_CHARS
+ ? `${detail.slice(0, MAX_TOOL_RESULT_CHARS)}…`
+ : detail}
) : null}