From 82b63b9a7a646ffa126a766577a3d0ba8afc52c4 Mon Sep 17 00:00:00 2001 From: Thomas Petersen Date: Wed, 12 Aug 2026 11:02:45 -0400 Subject: [PATCH] desktop: keep PR metadata readable in Inbox Wrap pull request metadata between complete phrases and truncate long channel names so the Inbox detail rail cannot compress copy into word-wide columns. Signed-off-by: Thomas Petersen --- .../projects/ui/ProjectOriginReference.tsx | 29 +++++++++++---- .../projects/ui/ProjectPullRequestsPanel.tsx | 18 +++++++-- desktop/tests/e2e/project-inbox.spec.ts | 37 +++++++++++++++++++ 3 files changed, 73 insertions(+), 11 deletions(-) diff --git a/desktop/src/features/projects/ui/ProjectOriginReference.tsx b/desktop/src/features/projects/ui/ProjectOriginReference.tsx index 6cd9915615..d5f3d1d8b4 100644 --- a/desktop/src/features/projects/ui/ProjectOriginReference.tsx +++ b/desktop/src/features/projects/ui/ProjectOriginReference.tsx @@ -17,7 +17,7 @@ export function ProjectOriginReference({ if (channelId) { return ( - started from + + started from + {channel ? ( ) : ( - a private channel + a private channel )} - (author-claimed) + + (author-claimed) + ); } @@ -48,10 +58,15 @@ export function ProjectOriginReference({ if (agentName) { return ( - started privately with + + started privately with + {agentName} diff --git a/desktop/src/features/projects/ui/ProjectPullRequestsPanel.tsx b/desktop/src/features/projects/ui/ProjectPullRequestsPanel.tsx index d4804ef6fe..3544c42c49 100644 --- a/desktop/src/features/projects/ui/ProjectPullRequestsPanel.tsx +++ b/desktop/src/features/projects/ui/ProjectPullRequestsPanel.tsx @@ -359,9 +359,15 @@ export function PullRequestDetailHeader({ testId="project-pull-request-copy-link" /> -

- - +

+ + - + created {relativeTime(pullRequest.createdAt)} + layout.evaluate( + (element) => + getComputedStyle(element) + .gridTemplateColumns.split(" ") + .filter(Boolean).length, + ), + ) + .toBe(2); + await expect( + detail.getByRole("button", { + name: "Open author-claimed origin channel #general", + }), + ).toBeVisible(); + const metadataPhrases = detail.locator("[data-project-metadata-phrase]"); + await expect(metadataPhrases).not.toHaveCount(0); + const phraseLayouts = await metadataPhrases.evaluateAll((phrases) => + phrases.map((phrase) => { + const style = getComputedStyle(phrase); + return { + height: phrase.getBoundingClientRect().height, + lineHeight: Number.parseFloat(style.lineHeight), + }; + }), + ); + for (const phrase of phraseLayouts) { + expect(phrase.height).toBeLessThanOrEqual(phrase.lineHeight * 1.5); + } + await waitForAnimations(page); + await detail.screenshot({ + path: "test-results/project-inbox/02-pull-request-detail-wide.png", + }); });