Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
fix(editor): cap issue mention chip at container width, no clickable gap (#4295)
Naiyuan Qing4c7fefd1439a
diff --git a/packages/views/editor/extensions/mention-view.tsx b/packages/views/editor/extensions/mention-view.tsxindex ee9f11c8ef..7d3da435af 100644--- a/packages/views/editor/extensions/mention-view.tsx+++ b/packages/views/editor/extensions/mention-view.tsx@@ -69,7 +69,7 @@ function ProjectMention({};return (- <a href={projectPath} onClick={handleClick} className="project-mention inline-flex">+ <a href={projectPath} onClick={handleClick} className="project-mention"><ProjectChipprojectId={projectId}fallbackLabel={fallbackLabel}@@ -101,7 +101,7 @@ function IssueMention({};return (- <a href={issuePath} onClick={handleClick} className="issue-mention inline-flex">+ <a href={issuePath} onClick={handleClick} className="issue-mention"><IssueChipissueId={issueId}fallbackLabel={fallbackLabel}diff --git a/packages/views/issues/components/issue-chip.test.tsx b/packages/views/issues/components/issue-chip.test.tsxindex ab7e0dccb6..2176f3a611 100644--- a/packages/views/issues/components/issue-chip.test.tsx+++ b/packages/views/issues/components/issue-chip.test.tsx@@ -49,7 +49,7 @@ describe("IssueChip", () => {render(<IssueChip issueId="issue-1" />);const chip = screen.getByText("MUL-3405").closest(".issue-mention");- expect(chip).toHaveClass("min-w-0", "max-w-[min(18rem,100%)]");+ expect(chip).toHaveClass("min-w-0", "max-w-full");expect(screen.getByText("A very long issue title that should stay inside a narrow chat bubble")).toHaveClass("min-w-0", "truncate");});diff --git a/packages/views/issues/components/issue-chip.tsx b/packages/views/issues/components/issue-chip.tsxindex 38019956a1..00bb75abc1 100644--- a/packages/views/issues/components/issue-chip.tsx+++ b/packages/views/issues/components/issue-chip.tsx@@ -7,7 +7,13 @@ import { StatusIcon } from "./status-icon";/*** Compact, presentation-only representation of an issue —- * `<StatusIcon> <identifier> <title>`, bordered, capped at 18rem or parent width.+ * `<StatusIcon> <identifier> <title>`, bordered, capped at the container width+ * (`max-w-full`) with the title truncating to an ellipsis. As an atomic inline+ * box it wraps to the next line as a unit when it doesn't fit at the current+ * position; the ellipsis only kicks in once a whole line can't hold it. The cap+ * lives here (single source of truth) — wrappers must NOT add their own flex+ * container around it, or a percentage cap gets dropped during the wrapper's+ * intrinsic sizing and the clickable box diverges from the truncated chip.** This is the single source of truth for the "issue-mention card" look.* It is intentionally **not** a link or button: callers wrap it in whatever@@ -28,7 +34,7 @@ export interface IssueChipProps {}const BASE_CLASS =- "issue-mention inline-flex min-w-0 max-w-[min(18rem,100%)] items-center gap-1.5 rounded-md border mx-0.5 px-2 py-0.5 text-xs";+ "issue-mention inline-flex min-w-0 max-w-full items-center gap-1.5 rounded-md border mx-0.5 px-2 py-0.5 text-xs";export function IssueChip({ issueId, fallbackLabel, className }: IssueChipProps) {const wsId = useWorkspaceId();diff --git a/packages/views/issues/components/issue-mention-card.tsx b/packages/views/issues/components/issue-mention-card.tsxindex cf439c666b..373a5e3012 100644--- a/packages/views/issues/components/issue-mention-card.tsx+++ b/packages/views/issues/components/issue-mention-card.tsx@@ -18,7 +18,7 @@ interface IssueMentionCardProps {export function IssueMentionCard({ issueId, fallbackLabel }: IssueMentionCardProps) {const p = useWorkspacePaths();return (- <AppLink href={p.issueDetail(issueId)} className="issue-mention not-prose inline-flex max-w-full align-middle">+ <AppLink href={p.issueDetail(issueId)} className="issue-mention not-prose align-middle"><IssueChipissueId={issueId}fallbackLabel={fallbackLabel}