The best way to control Claude Code, Codex and more from any computer or phone
fix(web): short branch names no longer get clipped in thread details (#25328)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Theo Browne committed
Oct 25, 2026 at 22:15 UTC
70b0abceda6e500e3f33612b9b6227fbd72dacd3
2 files changed
+30
-1
apps/web/src/components/ui/middle-truncate.browser.test.tsx
new
+26
@@ -0,0 +1,26 @@
1
+import { describe, expect, it } from "vite-plus/test";
2
+
3
+import { render } from "../../../test/render";
4
+import { MiddleTruncate } from "./middle-truncate";
5
+
6
+import "~/index.css";
7
+
8
+const narrow = (value: string) => (
9
+ <div style={{ width: 80 }}>
10
+ <MiddleTruncate value={value} className="w-full" />
11
+ </div>
12
+);
13
+
14
+describe("MiddleTruncate", () => {
15
+ it("does not clip a short value that replaces a truncated one", async () => {
16
+ await using screen = await render(narrow("t3/investigate-release-build-times"));
17
+ const label = () => screen.container.querySelector("[title] > span");
18
+ await expect.poll(() => label()?.hasAttribute("data-overflow")).toBe(true);
19
+
20
+ await screen.rerender(narrow("main"));
21
+
22
+ expect(label()).toHaveTextContent("main");
23
+ expect(label()).not.toHaveAttribute("data-overflow");
24
+ expect(label()).toHaveStyle({ clipPath: "none" });
25
+ });
26
+});
apps/web/src/components/ui/middle-truncate.tsx
+4
-1
@@ -47,7 +47,10 @@ export function MiddleTruncate({
47
<span className="shrink-0 peer-data-overflow:before:content-['…']">{split.tail}</span>
48
</>
49
) : (
50
- <span className="min-w-0 truncate">{value}</span>
50
+ // Keyed so React does not reuse the head node and its imperative clip.
51
+ <span key="whole" className="min-w-0 truncate">
52
+ {value}
53
+ </span>
54
)}
55
</span>
56
);