Skip to content

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

Go

feat(inbox): lead Work panel Inbox rows with the issue status (MUL-9308) (#10647)

Jiayuan Zhangbf25e5a7e7da
diff --git a/packages/views/layout/panels/inbox-section.test.tsx b/packages/views/layout/panels/inbox-section.test.tsx
index f0995c7594..16608b81c7 100644
--- a/packages/views/layout/panels/inbox-section.test.tsx
+++ b/packages/views/layout/panels/inbox-section.test.tsx
@@ -280,6 +280,39 @@ describe("InboxSection", () => {
expect(rows()[0]!.querySelector("[data-mc='unread-dot']")).not.toBeNull();
});
+ it("leads an issue's row with its status, and an issue-less notice with who sent it", () => {
+ const items = [
+ item({ id: "n1", issue_id: "issue-a", title: "Commented", issue_status: "in_review" }),
+ item({ id: "n2", issue_id: null, title: "Autopilot paused", type: "autopilot_paused", issue_status: null, created_at: "2026-11-09T08:00:00Z" }),
+ ];
+ const { unmount } = renderSection(items);
+ const lead = () => rows().map((row) => row.querySelector("[data-mc='nav-item']")!.firstElementChild);
+ expect(lead()[0]).toHaveAttribute("data-inbox-status", "in_review");
+ expect(screen.getByRole("link", { name: /^Commented, In Review/ })).toBeInTheDocument();
+ expect(lead()[1]).not.toHaveAttribute("data-inbox-status");
+ unmount();
+
+ useSidebarTreeStore.setState({ inboxSettings: { ...DEFAULT_SIDEBAR_INBOX_SETTINGS, compact: true } });
+ renderSection(items);
+ expect(lead()[0]).toHaveAttribute("data-inbox-status", "in_review");
+ expect(lead()[1]).toHaveAttribute("title", "Autopilot paused");
+ });
+
+ it("moves the time under the title while an agent holds its place, and keeps the unread dot when compact", () => {
+ const items = [item({ id: "n1", issue_id: "issue-a", title: "Working one" })];
+ const tasks = [{ id: "t1", issue_id: "issue-a", agent_id: "a1", status: "running" as const }];
+ const { unmount } = renderSection(items, null, "/acme/issues", tasks);
+ const [titleLine, actorLine] = Array.from(screen.getByRole("link", { name: /^Working one/ }).children);
+ expect(within(titleLine as HTMLElement).getByTestId("agents")).toBeInTheDocument();
+ expect(actorLine).toHaveTextContent(/\d+d$/);
+ unmount();
+
+ useSidebarTreeStore.setState({ inboxSettings: { ...DEFAULT_SIDEBAR_INBOX_SETTINGS, compact: true } });
+ renderSection(items, null, "/acme/issues", tasks);
+ expect(within(rows()[0]!).getByTestId("agents")).toBeInTheDocument();
+ expect(rows()[0]!.querySelector("[data-mc='unread-dot']")).not.toBeNull();
+ });
+
it("shows the whole notification on hover, with its actions", async () => {
renderSection([item({ id: "n1", issue_id: "issue-a", title: "Commented", body: "Ship it on Friday" })]);
fireEvent.mouseEnter(rows()[0]!.firstElementChild!);
diff --git a/packages/views/layout/panels/inbox-section.tsx b/packages/views/layout/panels/inbox-section.tsx
index 0b07a907d5..fdc5ca9adb 100644
--- a/packages/views/layout/panels/inbox-section.tsx
+++ b/packages/views/layout/panels/inbox-section.tsx
@@ -316,7 +316,7 @@ function InboxRow({
item: InboxItem;
href: string;
active: boolean;
- /** One line (type icon, title, dot or time) instead of the actor line under the title. */
+ /** One line (status, title, agents, dot or time) instead of the actor line under the title. */
compact: boolean;
onArchive: () => void;
}) {
@@ -324,6 +324,9 @@ function InboxRow({
const typeLabels = useTypeLabels();
const timeAgo = useTimeAgo();
const Icon = INBOX_TYPE_ICONS[inboxTypeGroup(item.type)];
+ const { categoryOf, colorOf, iconOf } = useIssueStatuses(item.workspace_id);
+ const statusLabelOf = useStatusLabel(item.workspace_id);
+ const status = item.issue_status;
const title = inboxRowTitle(item, typeLabels);
const writeViewState = useViewStateWriter();
const requestLanding = useInboxSelectionStore((s) => s.requestLanding);
@@ -340,11 +343,8 @@ function InboxRow({
const archiveLabel = t(($) => $.list.archive_tooltip);
// Hidden while the archive button stands in its place.
const yields = "group-hover/inbox:invisible group-focus-within/inbox:invisible";
- const time = (
- <span className={cn("shrink-0 text-caption tabular-nums text-faint-foreground", yields)}>
- {timeAgo(item.created_at)}
- </span>
- );
+ const timeClass = "shrink-0 text-caption tabular-nums text-faint-foreground";
+ const time = <span className={cn(timeClass, yields)}>{timeAgo(item.created_at)}</span>;
// Takes the time's place while an agent runs or waits on the issue.
const agentBadge = agents && (
<span className={cn("flex shrink-0 items-center", yields)}>
@@ -352,6 +352,20 @@ function InboxRow({
</span>
);
const dot = <span data-mc="unread-dot" aria-hidden className="size-1.5 shrink-0 rounded-full bg-brand" />;
+ // Leads the row like a Pinned or tree issue row. Display only: the link
+ // covers the row, and the hover card already names the status.
+ const statusIcon = status && (
+ <span data-inbox-status={status} aria-hidden className={cn("flex shrink-0", !compact && "mt-[3px]")}>
+ <StatusIcon
+ status={status}
+ category={categoryOf(status)}
+ color={colorOf(status)}
+ icon={iconOf(status)}
+ className="size-3.5"
+ />
+ </span>
+ );
+ const statusText = status && <span className="sr-only">, {statusLabelOf(status)}</span>;
const titleText = (
<ShimmerText
active={running}
@@ -376,15 +390,16 @@ function InboxRow({
{...panelRowAnchor(active)}
className={cn(PANEL_ROW_CLASS, panelRowStateClass(active), "relative", !compact && "items-start py-[5px]")}
>
- {compact ? (
- <span title={typeLabels[item.type]} className="flex shrink-0 items-center">
- <Icon aria-hidden className="size-4" />
- </span>
- ) : (
- <span className="mt-0.5 flex shrink-0">
- <InboxActorAvatar item={item} size="xs" />
- </span>
- )}
+ {statusIcon ||
+ (compact ? (
+ <span title={typeLabels[item.type]} className="flex shrink-0 items-center">
+ <Icon aria-hidden className="size-4" />
+ </span>
+ ) : (
+ <span className="mt-0.5 flex shrink-0">
+ <InboxActorAvatar item={item} size="xs" />
+ </span>
+ ))}
<AppLink
href={href}
newTabTitle={title}
@@ -396,19 +411,27 @@ function InboxRow({
{compact ? (
<>
{titleText}
- {agentBadge ||
- (unread ? <span className={cn("flex shrink-0 items-center", yields)}>{dot}</span> : time)}
+ {statusText}
+ {agentBadge}
+ {unread ? <span className={cn("flex shrink-0 items-center", yields)}>{dot}</span> : !agents && time}
</>
) : (
<>
<span className="flex min-w-0 items-center gap-2 leading-5">
{titleText}
+ {statusText}
{agentBadge || time}
</span>
<span className="flex min-w-0 items-center gap-2 text-caption leading-4 text-muted-foreground">
- <span className="min-w-0 flex-1 truncate">
- <InboxActorLine item={item} />
+ <span className="flex min-w-0 flex-1 items-center gap-1.5">
+ {/* The status took the avatar's column; it stays with the name. */}
+ {statusIcon && <InboxActorAvatar item={item} size="xs" />}
+ <span className="min-w-0 flex-1 truncate">
+ <InboxActorLine item={item} />
+ </span>
</span>
+ {/* The agents hold the title line's time slot, so the time moves down. */}
+ {agents && <span className={timeClass}>{timeAgo(item.created_at)}</span>}
{unread && dot}
</span>
</>