Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

fix(inbox): keep status/priority labels from collapsing to an ellipsis (MUL-9407) (#10737)

Bohan Jiangb7e537974c42
diff --git a/packages/views/inbox/components/inbox-detail-label.test.tsx b/packages/views/inbox/components/inbox-detail-label.test.tsx
index c2c7c2cefe..84481eebb6 100644
--- a/packages/views/inbox/components/inbox-detail-label.test.tsx
+++ b/packages/views/inbox/components/inbox-detail-label.test.tsx
@@ -149,3 +149,20 @@ describe("InboxDetailLabel localized values", () => {
expect(container.textContent).not.toContain("Aug");
});
});
+
+describe("InboxDetailLabel in a truncated row", () => {
+ // MUL-9407: an inline-flex wrapper is one atomic box. In a one-line row with
+ // text-overflow: ellipsis the browser hides the whole box once it does not
+ // fit, so the row read "Fy …". The label must stay plain inline text that
+ // truncates character by character.
+ it.each([
+ ["status_changed", "in_progress"],
+ ["priority_changed", "high"],
+ ] as const)("renders %s as plain inline text with spaced words", (type, to) => {
+ const { container } = render(<InboxDetailLabel item={item({ type, details: { to } })} />);
+ const label = container.firstElementChild as HTMLElement;
+
+ expect(label.className).not.toMatch(/\b(inline-)?flex\b/);
+ expect(label.textContent).toMatch(/\S\s+\S/);
+ });
+});
diff --git a/packages/views/inbox/components/inbox-detail-label.tsx b/packages/views/inbox/components/inbox-detail-label.tsx
index 455df68f1a..4a5c9e6b8f 100644
--- a/packages/views/inbox/components/inbox-detail-label.tsx
+++ b/packages/views/inbox/components/inbox-detail-label.tsx
@@ -53,6 +53,12 @@ function shortDate(dateStr: string, locale: string): string {
return formatDateOnly(dateStr, { month: "short", day: "numeric" }, locale);
}
+// The label sits in a one-line, ellipsis-truncated row. Keep it plain inline
+// content with the icon flowing in the text: an `inline-flex` wrapper is a
+// single atomic box, and when it does not fit the browser hides the whole box
+// behind the ellipsis, leaving only "Name …" on the row. (MUL-9407)
+const INLINE_ICON_CLASS = "inline-block h-3 w-3 align-[-0.125em]";
+
export function InboxDetailLabel({ item }: { item: InboxItem }) {
const { t } = useT("inbox");
const { t: tIssues } = useT("issues");
@@ -69,15 +75,15 @@ export function InboxDetailLabel({ item }: { item: InboxItem }) {
case "status_changed": {
if (!details.to) return <span>{typeLabels[item.type]}</span>;
return (
- <span className="inline-flex items-center gap-1">
- {t(($) => $.labels.set_status_to)}
+ <span>
+ {t(($) => $.labels.set_status_to)}{" "}
<StatusIcon
status={details.to as IssueStatus}
category={categoryOf(details.to)}
color={colorOf(details.to)}
icon={iconOf(details.to)}
- className="h-3 w-3"
- />
+ className={INLINE_ICON_CLASS}
+ />{" "}
{statusLabelOf(details.to)}
</span>
);
@@ -86,9 +92,9 @@ export function InboxDetailLabel({ item }: { item: InboxItem }) {
if (!details.to) return <span>{typeLabels[item.type]}</span>;
const label = priorityLabel(details.to, tIssues);
return (
- <span className="inline-flex items-center gap-1">
- {t(($) => $.labels.set_priority_to)}
- <PriorityIcon priority={details.to as IssuePriority} className="h-3 w-3" />
+ <span>
+ {t(($) => $.labels.set_priority_to)}{" "}
+ <PriorityIcon priority={details.to as IssuePriority} className={INLINE_ICON_CLASS} />{" "}
{label}
</span>
);