From 085682665bb12ee16fd224bcb6fc17667c47dd4a Mon Sep 17 00:00:00 2001 From: liuxiaocs7 Date: Sat, 29 Aug 2026 17:55:33 +0800 Subject: [PATCH] fix(desktop): truncate long file paths in the changes panel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Collapsible trigger wraps each review row in a flex that keeps the browser default min-width:auto, so a long file path cannot shrink and overflows the narrow panel — clipping the change counts and chevron off the right edge instead of ellipsizing the path. Constrain that label span so the path truncates and the stats stay in view. Adds a deep-path fixture to the Changes story to exercise the case. Generated-by: Claude Code (Opus 4.8) --- .../src/renderer/styles/workbar/review.css | 11 +++++++++++ .../desktop/stories/session-workbar.stories.tsx | 17 +++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/apps/desktop/src/renderer/styles/workbar/review.css b/apps/desktop/src/renderer/styles/workbar/review.css index f8b0c8096b..f6d2f5787b 100644 --- a/apps/desktop/src/renderer/styles/workbar/review.css +++ b/apps/desktop/src/renderer/styles/workbar/review.css @@ -47,6 +47,17 @@ flex: 1; } +/* Collapsible wraps the trigger row in its own flex , which keeps the + browser default `min-width: auto` and so refuses to shrink below the full + file path — the row overflows the narrow panel and clips the change counts + and chevron instead of truncating the path. Let that label track the trigger + width so the path ellipsizes and the stats stay in view. */ +.maka-session-review-file .astryx-collapsible-trigger > span:first-child { + min-width: 0; + flex: 1 1 auto; + overflow: hidden; +} + .maka-session-review-file-path { min-width: 0; flex: 1; diff --git a/apps/desktop/stories/session-workbar.stories.tsx b/apps/desktop/stories/session-workbar.stories.tsx index a46d591ace..434a36b017 100644 --- a/apps/desktop/stories/session-workbar.stories.tsx +++ b/apps/desktop/stories/session-workbar.stories.tsx @@ -207,6 +207,23 @@ const artifactText: Record = { }; const gitReviewFiles: GitReviewSnapshot['files'] = [ + { + // The deep path is deliberate: it is what proves a long file path + // ellipsizes inside the narrow panel instead of pushing the change counts + // and chevron off the row (issue: 变更 rows clipped when the path is long). + path: '.scratch/pyclient/gen/client/Comparator_pb2.py', + status: 'added', + additions: 129, + deletions: 0, + diff: [ + 'diff --git a/.scratch/pyclient/gen/client/Comparator_pb2.py b/.scratch/pyclient/gen/client/Comparator_pb2.py', + '--- /dev/null', + '+++ b/.scratch/pyclient/gen/client/Comparator_pb2.py', + '@@ -0,0 +1,2 @@', + '+# Generated by the protocol buffer compiler. DO NOT EDIT!', + '+from google.protobuf import descriptor as _descriptor', + ].join('\n'), + }, { path: 'apps/desktop/src/renderer/session-review-panel.tsx', status: 'modified',