diff --git a/apps/web/components/gitlab/my-gitlab/issue-list.tsx b/apps/web/components/gitlab/my-gitlab/issue-list.tsx index bab8ab7c41..472eb4e0a7 100644 --- a/apps/web/components/gitlab/my-gitlab/issue-list.tsx +++ b/apps/web/components/gitlab/my-gitlab/issue-list.tsx @@ -1,7 +1,6 @@ "use client"; -import Link from "@/components/routing/app-link"; -import { IconCircle, IconCircleCheck, IconExternalLink } from "@tabler/icons-react"; +import { IconCircle, IconCircleCheck } from "@tabler/icons-react"; import { Badge } from "@kandev/ui/badge"; import { Spinner } from "@kandev/ui/spinner"; import { cn, formatRelativeTime } from "@/lib/utils"; @@ -9,6 +8,7 @@ import type { Issue } from "@/lib/types/gitlab"; import type { GitLabLaunchPayload, GitLabTaskPreset } from "./quick-task-launcher"; import { StartTaskMenu } from "./start-task-menu"; import { SubscriptionToggle } from "../subscription-toggle"; +import { RowTitleLink } from "./row-title-link"; type IssueListProps = { items: Issue[]; @@ -62,15 +62,7 @@ function IssueRow({ >
- - {issue.title} - - +
{issue.project_path}#{issue.iid} diff --git a/apps/web/components/gitlab/my-gitlab/mr-list.tsx b/apps/web/components/gitlab/my-gitlab/mr-list.tsx index 0c778a285e..4040c18fc8 100644 --- a/apps/web/components/gitlab/my-gitlab/mr-list.tsx +++ b/apps/web/components/gitlab/my-gitlab/mr-list.tsx @@ -1,12 +1,6 @@ "use client"; -import Link from "@/components/routing/app-link"; -import { - IconGitPullRequest, - IconGitPullRequestClosed, - IconGitMerge, - IconExternalLink, -} from "@tabler/icons-react"; +import { IconGitPullRequest, IconGitPullRequestClosed, IconGitMerge } from "@tabler/icons-react"; import type { Icon } from "@tabler/icons-react"; import { Spinner } from "@kandev/ui/spinner"; import { cn, formatRelativeTime } from "@/lib/utils"; @@ -15,6 +9,7 @@ import type { GitLabLaunchPayload, GitLabTaskPreset } from "./quick-task-launche import { gitLabMRKey } from "@/lib/gitlab-identity"; import { MRRowTaskIndicator } from "./mr-row-task-indicator"; import { StartTaskMenu } from "./start-task-menu"; +import { RowTitleLink } from "./row-title-link"; type MRListProps = { items: MR[]; @@ -55,15 +50,7 @@ function MRRow({ >
- - {mr.title} - - +
{mr.project_path}!{mr.iid} diff --git a/apps/web/components/gitlab/my-gitlab/row-title-link.test.tsx b/apps/web/components/gitlab/my-gitlab/row-title-link.test.tsx new file mode 100644 index 0000000000..68d45b2f61 --- /dev/null +++ b/apps/web/components/gitlab/my-gitlab/row-title-link.test.tsx @@ -0,0 +1,29 @@ +import { cleanup, render, screen } from "@testing-library/react"; +import { afterEach, describe, expect, it } from "vitest"; +import { RowTitleLink } from "./row-title-link"; + +const longTitle = + "§7 item 4 (km-product#27) — EntityLocker is not the REQ-011 FR-8 answer lock (no change proposed; recording the distinction)"; + +afterEach(cleanup); + +describe("RowTitleLink", () => { + it("keeps a long title inside its column instead of overlapping row actions", () => { + render(); + + const link = screen.getByRole("link"); + // Block-level flex: an inline-flex link sizes to content and overflows the row. + expect(link.className).toContain("flex"); + expect(link.className).not.toContain("inline-flex"); + expect(link.className).toContain("min-w-0"); + + const text = screen.getByText(longTitle); + expect(text.className).toContain("truncate"); + }); + + it("exposes the full title on hover since the text may be clipped", () => { + render(); + + expect(screen.getByRole("link").getAttribute("title")).toBe(longTitle); + }); +}); diff --git a/apps/web/components/gitlab/my-gitlab/row-title-link.tsx b/apps/web/components/gitlab/my-gitlab/row-title-link.tsx new file mode 100644 index 0000000000..323a24f7bc --- /dev/null +++ b/apps/web/components/gitlab/my-gitlab/row-title-link.tsx @@ -0,0 +1,27 @@ +"use client"; + +import Link from "@/components/routing/app-link"; +import { IconExternalLink } from "@tabler/icons-react"; + +/** + * Title link for GitLab issue/MR rows. + * + * Must stay block-level (`flex`, not `inline-flex`): an inline-flex link sizes + * itself to its content, so a long title escapes the row's `min-w-0 flex-1` + * column and draws over the row actions. Truncation belongs on the text span — + * `overflow-hidden` zeroes its automatic minimum size so it can shrink. + */ +export function RowTitleLink({ href, title }: { href: string; title: string }) { + return ( + + {title} + + + ); +}