From ea9809f084e2a565577acc2e090e974bb6cf3d45 Mon Sep 17 00:00:00 2001 From: Francisco Arredondo Date: Wed, 12 Aug 2026 15:18:09 -0700 Subject: [PATCH 1/3] test(web): add start-truncated path widget for commit dialog paths --- .../components/StartTruncatedPath.test.tsx | 21 +++++++++++++++++++ .../web/src/components/StartTruncatedPath.tsx | 12 +++++++++++ 2 files changed, 33 insertions(+) create mode 100644 apps/web/src/components/StartTruncatedPath.test.tsx create mode 100644 apps/web/src/components/StartTruncatedPath.tsx diff --git a/apps/web/src/components/StartTruncatedPath.test.tsx b/apps/web/src/components/StartTruncatedPath.test.tsx new file mode 100644 index 00000000000..da6f08ceb3e --- /dev/null +++ b/apps/web/src/components/StartTruncatedPath.test.tsx @@ -0,0 +1,21 @@ +import { renderToStaticMarkup } from "react-dom/server"; +import { describe, expect, it } from "vite-plus/test"; + +import { StartTruncatedPath } from "./StartTruncatedPath"; + +describe("StartTruncatedPath", () => { + it("keeps the filename at the visible end by truncating from the start", () => { + const path = "apps/desktop/src/components/very/long/CommitDialog.tsx"; + + const markup = renderToStaticMarkup(); + + expect(markup).toContain('dir="rtl"'); + expect(markup).toMatch( + /]*>apps\/desktop\/src\/components\/very\/long\/CommitDialog\.tsx<\/bdi>/, + ); + expect(markup).toContain("overflow-hidden"); + expect(markup).toContain("text-ellipsis"); + expect(markup).toContain("whitespace-nowrap"); + expect(markup).toContain("min-w-0"); + }); +}); diff --git a/apps/web/src/components/StartTruncatedPath.tsx b/apps/web/src/components/StartTruncatedPath.tsx new file mode 100644 index 00000000000..ff36037b082 --- /dev/null +++ b/apps/web/src/components/StartTruncatedPath.tsx @@ -0,0 +1,12 @@ +import { cn } from "~/lib/utils"; + +export function StartTruncatedPath({ path, className }: { path: string; className?: string }) { + return ( + + {path} + + ); +} From 083472c86e96986ce6aecb55971f3b948f9828da Mon Sep 17 00:00:00 2001 From: Francisco Arredondo Date: Wed, 12 Aug 2026 15:19:59 -0700 Subject: [PATCH 2/3] feat(web): show full path in tooltip on start-truncated paths --- .../components/StartTruncatedPath.test.tsx | 10 +++++++ .../web/src/components/StartTruncatedPath.tsx | 26 ++++++++++++++----- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/apps/web/src/components/StartTruncatedPath.test.tsx b/apps/web/src/components/StartTruncatedPath.test.tsx index da6f08ceb3e..1f7b158bce3 100644 --- a/apps/web/src/components/StartTruncatedPath.test.tsx +++ b/apps/web/src/components/StartTruncatedPath.test.tsx @@ -18,4 +18,14 @@ describe("StartTruncatedPath", () => { expect(markup).toContain("whitespace-nowrap"); expect(markup).toContain("min-w-0"); }); + + it("shows the full path in a tooltip", () => { + const path = "apps/desktop/src/components/very/long/CommitDialog.tsx"; + + const markup = renderToStaticMarkup(); + + expect(markup).toContain('data-slot="tooltip-trigger"'); + expect(markup).toContain("data-base-ui-tooltip-trigger"); + expect(markup).toContain(path); + }); }); diff --git a/apps/web/src/components/StartTruncatedPath.tsx b/apps/web/src/components/StartTruncatedPath.tsx index ff36037b082..98b1aff0b6c 100644 --- a/apps/web/src/components/StartTruncatedPath.tsx +++ b/apps/web/src/components/StartTruncatedPath.tsx @@ -1,12 +1,26 @@ +import { Tooltip, TooltipPopup, TooltipTrigger } from "~/components/ui/tooltip"; import { cn } from "~/lib/utils"; export function StartTruncatedPath({ path, className }: { path: string; className?: string }) { return ( - - {path} - + + + } + > + {path} + + + {path} + + ); } From 1ff669d1d4fae8fb8d8c30c5484f9b6c788a2221 Mon Sep 17 00:00:00 2001 From: Francisco Arredondo Date: Wed, 12 Aug 2026 15:20:37 -0700 Subject: [PATCH 3/3] fix(web): truncate commit-dialog file paths from the start --- apps/web/src/components/GitActionsControl.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/web/src/components/GitActionsControl.tsx b/apps/web/src/components/GitActionsControl.tsx index 7b824370b39..d448a720ebf 100644 --- a/apps/web/src/components/GitActionsControl.tsx +++ b/apps/web/src/components/GitActionsControl.tsx @@ -51,6 +51,7 @@ import { resolveThreadBranchUpdate, } from "./GitActionsControl.logic"; import { AnimatedHeight } from "./AnimatedHeight"; +import { StartTruncatedPath } from "./StartTruncatedPath"; import { Button } from "~/components/ui/button"; import { Checkbox } from "~/components/ui/checkbox"; import { @@ -1923,14 +1924,13 @@ export default function GitActionsControl({ )}