Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
fix(issues): reveal the clipped header title on hover (#10917)
Jean Woodbb0e5e4e49a2
diff --git a/packages/views/issues/components/issue-detail.test.tsx b/packages/views/issues/components/issue-detail.test.tsxindex d775c53163..ee9ea5f598 100644--- a/packages/views/issues/components/issue-detail.test.tsx+++ b/packages/views/issues/components/issue-detail.test.tsx@@ -140,11 +140,18 @@ vi.mock("../../navigation", async () => ({...(await vi.importActual<typeof import("../../navigation/use-held-until-arrival")>("../../navigation/use-held-until-arrival",)),- AppLink: ({ children, href, ...props }: any) => (- <a href={href} {...props}>- {children}- </a>- ),+ // Forwards ref: the header wraps the link in `TruncatedTooltip`, which+ // measures the anchor it clones, exactly as the real AppLink supports.+ AppLink: forwardRef<HTMLAnchorElement, any>(function MockAppLink(+ { children, href, ...props },+ ref,+ ) {+ return (+ <a ref={ref} href={href} {...props}>+ {children}+ </a>+ );+ }),useNavigation: () => ({push: settingsPush,pathname: "/issues/issue-1",@@ -1572,6 +1579,31 @@ describe("IssueDetail (shared)", () => {expect(screen.getByRole("link", { name: mockIssue.identifier })).toBeInTheDocument();});+ it("reveals the header's clipped identifier and title on hover", async () => {+ renderIssueDetail();+ await screen.findByText("Implement authentication");++ const link = screen.getByRole("link", { name: `${mockIssue.identifier} ${mockIssue.title}` });+ // jsdom never lays out the header: model the clip the actions leave the leaf.+ const leaf = link.firstElementChild as HTMLElement;+ leaf.style.overflowX = "hidden";+ Object.defineProperties(leaf, {+ scrollWidth: { configurable: true, value: 320 },+ clientWidth: { configurable: true, value: 100 },+ });++ vi.useFakeTimers();+ try {+ fireEvent.pointerEnter(link, { pointerType: "mouse" });+ await act(async () => { vi.advanceTimersByTime(550); });+ } finally {+ vi.useRealTimers();+ }++ expect(document.querySelector("[data-slot=tooltip-content]"))+ .toHaveTextContent(`${mockIssue.identifier} ${mockIssue.title}`);+ });+describe("header icon buttons", () => {function renderWithDone() {const queryClient = createTestQueryClient();diff --git a/packages/views/issues/components/issue-detail.tsx b/packages/views/issues/components/issue-detail.tsxindex a930c6f81f..026fb7b7b7 100644--- a/packages/views/issues/components/issue-detail.tsx+++ b/packages/views/issues/components/issue-detail.tsx@@ -3630,6 +3630,10 @@ export function IssueDetail({ issueId, onDelete, onDone, onUnsubscribeArchive, dconst titleSizeClass = isPeek ? "text-title-lg font-semibold" : "text-display-sm font-semibold";+ // What the header names the issue: the identifier only in a peek, where the+ // title is right below it; identifier and title on the page.+ const headerLeafLabel = isPeek ? issue.identifier : `${issue.identifier} ${issue.title}`;+const detailContent = (<CurrentIssueRenderContextProvider value={currentIssueRenderContext}><div@@ -3658,14 +3662,19 @@ export function IssueDetail({ issueId, onDelete, onDone, onUnsubscribeArchive, dleading={leadingAction}segments={breadcrumbSegments}leaf={- <AppLink- href={paths.issueDetail(issue.id)}- className="flex min-w-0 transition-opacity hover:opacity-80"- >- <span className="truncate font-medium text-foreground">- {isPeek ? issue.identifier : `${issue.identifier} ${issue.title}`}- </span>- </AppLink>+ // The header shares its line with the actions, so a long title is+ // cut off; hover (or focus) reveals it for the whole header width.+ // Below the trigger, since the header sits at the top of the page.+ <TruncatedTooltip content={headerLeafLabel} side="bottom">+ <AppLink+ href={paths.issueDetail(issue.id)}+ className="flex min-w-0 transition-opacity hover:opacity-80"+ >+ <span className="truncate font-medium text-foreground">+ {headerLeafLabel}+ </span>+ </AppLink>+ </TruncatedTooltip>}actions={<>