Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
feat(inbox): keep the issue's actions in a settled Inbox bar and name what archived it (MUL-9806) (#11151)
Jiayuan Zhang7fa034feb39c
diff --git a/apps/docs/components/demos/inbox-demo.tsx b/apps/docs/components/demos/inbox-demo.tsxindex ffad7f9f5b..76ab9bfc05 100644--- a/apps/docs/components/demos/inbox-demo.tsx+++ b/apps/docs/components/demos/inbox-demo.tsx@@ -2,10 +2,10 @@import { useState, type ReactNode } from "react";import {+ AlarmClock,Archive,ArchiveRestore,Bot,- Check,ChevronRight,Circle,CircleCheck,@@ -46,8 +46,11 @@ type Copy = {/** Newest first, as the section lists them. */notices: Notice[];selectPrompt: string;- markRead: string;- markUnread: string;+ /** The Inbox bar under the issue's header. */+ snooze: string;+ /** The assignee of the issues that aren't an agent's. */+ you: string;+ statuses: Record<Status, string>;archive: string;archivedToast: string;runFailed: string;@@ -110,8 +113,9 @@ const copy: { en: Copy } & Partial<Record<Lang, Copy>> = {},],selectPrompt: "Open a notification from the Inbox",- markRead: "Mark as read",- markUnread: "Mark as unread",+ snooze: "Snooze",+ you: "You",+ statuses: { todo: "Todo", in_progress: "In Progress", in_review: "In Review" },archive: "Archive",archivedToast: "Notification archived",runFailed: "Run failed",@@ -181,8 +185,9 @@ const copy: { en: Copy } & Partial<Record<Lang, Copy>> = {},],selectPrompt: "从收件箱打开一条通知",- markRead: "标为已读",- markUnread: "标为未读",+ snooze: "延后",+ you: "你",+ statuses: { todo: "待办", in_progress: "进行中", in_review: "审核中" },archive: "归档",archivedToast: "已归档通知",runFailed: "运行失败",@@ -248,8 +253,9 @@ const copy: { en: Copy } & Partial<Record<Lang, Copy>> = {},],selectPrompt: "從收件箱開啟一條通知",- markRead: "標為已讀",- markUnread: "標為未讀",+ snooze: "延後",+ you: "你",+ statuses: { todo: "待辦", in_progress: "進行中", in_review: "審查中" },archive: "歸檔",archivedToast: "已歸檔通知",runFailed: "執行失敗",@@ -315,8 +321,9 @@ const copy: { en: Copy } & Partial<Record<Lang, Copy>> = {},],selectPrompt: "インボックスから通知を開いてください",- markRead: "既読にする",- markUnread: "未読にする",+ snooze: "スヌーズ",+ you: "あなた",+ statuses: { todo: "未着手", in_progress: "進行中", in_review: "レビュー中" },archive: "アーカイブ",archivedToast: "通知をアーカイブしました",runFailed: "実行失敗",@@ -391,8 +398,9 @@ const copy: { en: Copy } & Partial<Record<Lang, Copy>> = {},],selectPrompt: "인박스에서 알림을 여세요",- markRead: "읽음으로 표시",- markUnread: "읽지 않음으로 표시",+ snooze: "다시 알림",+ you: "나",+ statuses: { todo: "할 일", in_progress: "진행 중", in_review: "리뷰 중" },archive: "보관",archivedToast: "알림을 보관했습니다",runFailed: "실행 실패함",@@ -461,8 +469,9 @@ const copy: { en: Copy } & Partial<Record<Lang, Copy>> = {},],selectPrompt: "Ouvrez une notification depuis la boîte de réception",- markRead: "Marquer comme lu",- markUnread: "Marquer comme non lu",+ snooze: "Reporter",+ you: "Vous",+ statuses: { todo: "À faire", in_progress: "En cours", in_review: "En relecture" },archive: "Archiver",archivedToast: "Notification archivée",runFailed: "Exécution en échec",@@ -553,32 +562,78 @@ function RowAvatar({ name, agent }: { name: string; agent: boolean }) {);}-function HeaderAction({+/** A control in the Inbox bar; unless `pinned`, its label gives way when the bar is narrow. */+function BarButton({+ icon,label,- coach,+ shortcut,+ muted = true,+ pinned = false,onClick,- children,}: {+ icon: ReactNode;label: string;- coach: boolean;+ shortcut?: string;+ muted?: boolean;+ pinned?: boolean;onClick?: () => void;- children: ReactNode;}) {return (- <CoachMark active={coach} side="bottom" align="end" ringClassName="rounded-md">- <Button- type="button"- variant="ghost"- size="icon-xs"- aria-label={label}- title={label}- disabled={!coach}- onClick={onClick}- className="text-muted-foreground disabled:opacity-100"- >- {children}- </Button>- </CoachMark>+ <Button+ type="button"+ variant="ghost"+ size="xs"+ aria-label={label}+ title={label}+ disabled={!onClick}+ onClick={onClick}+ className={cn("shrink-0 gap-1 px-1.5 disabled:opacity-100 [&_svg]:size-3.5", muted && "text-muted-foreground")}+ >+ {icon}+ <span className={cn(!pinned && "@max-[30rem]/bar:hidden")}>{label}</span>+ {shortcut && (+ <kbd className="rounded border bg-muted px-1 font-mono text-[0.625rem] leading-4 text-muted-foreground @max-[24rem]/bar:hidden">+ {shortcut}+ </kbd>+ )}+ </Button>+ );+}++/**+ * The bar under an issue opened from the Inbox: who did what and when, the+ * issue's status and assignee, then the notification's Snooze and Archive.+ */+function InboxBar({+ notice,+ copy,+ coach,+ onArchive,+}: {+ notice: Notice;+ copy: Copy;+ coach: boolean;+ onArchive: () => void;+}) {+ const status = statusOf(notice.id);+ const assignee = notice.agent ? notice.actor : copy.you;+ return (+ <div className="@container/bar flex h-9 items-center gap-0.5 border-b px-3">+ <span className="mr-1 flex min-w-0 flex-1 items-center gap-1.5 text-caption text-muted-foreground">+ <RowAvatar name={notice.actor} agent={notice.agent} />+ <span className="min-w-0 truncate">+ <span className="font-medium text-foreground">{notice.actor}</span> {notice.detail}+ </span>+ <span className="shrink-0 tabular-nums text-faint-foreground @max-[30rem]/bar:hidden">· {notice.time}</span>+ </span>+ <BarButton icon={<DemoStatus status={status} />} label={copy.statuses[status]} muted={false} />+ <BarButton icon={<RowAvatar name={assignee} agent={notice.agent} />} label={assignee} muted={false} />+ <span aria-hidden className="mx-1 h-4 w-px shrink-0 bg-border" />+ <BarButton icon={<AlarmClock />} label={copy.snooze} shortcut="H" />+ <CoachMark active={coach} side="bottom" align="end" ringClassName="rounded-md">+ <BarButton icon={<Archive />} label={copy.archive} shortcut="E" pinned onClick={coach ? onArchive : undefined} />+ </CoachMark>+ </div>);}@@ -707,19 +762,13 @@ export function InboxDemo() {<div className="flex h-10 items-center gap-2 border-b px-3"><span className="shrink-0 text-caption text-muted-foreground">{selected.issue}</span><span className="min-w-0 flex-1 truncate text-label font-medium">{selected.title}</span>- <span className="flex shrink-0 items-center gap-0.5">- <HeaderAction label={isRead(selected.id) ? t.markUnread : t.markRead} coach={false}>- {isRead(selected.id) ? <CircleDot /> : <Check />}- </HeaderAction>- <HeaderAction- label={`${t.archive} (E)`}- coach={phase === "opened" || phase === "archived"}- onClick={() => setPhase(phase === "opened" ? "archived" : "archivedAgain")}- >- <Archive />- </HeaderAction>- </span></div>+ <InboxBar+ notice={selected}+ copy={t}+ coach={phase === "opened" || phase === "archived"}+ onArchive={() => setPhase(phase === "opened" ? "archived" : "archivedAgain")}+ /><div className="flex flex-col gap-2 p-3">{selected.id === "failed" ? (<>diff --git a/apps/docs/content/docs/inbox.fr.mdx b/apps/docs/content/docs/inbox.fr.mdxindex a8c3492c27..0722bc6207 100644--- a/apps/docs/content/docs/inbox.fr.mdx+++ b/apps/docs/content/docs/inbox.fr.mdx@@ -137,7 +137,7 @@ Lire une notification ne la retire pas. Une ligne quitte la boîte de réception- quand c'est une notification **Exécution en échec** et que sa tâche passe à un statut qui la rend à une personne : `in_review`, un statut personnalisé de la catégorie `started`, ou n'importe quel statut des catégories `done` ou `closed`. Les notifications Exécution en échec de tout le monde sur cette tâche sont alors archivées, quelle que soit la personne qui a changé le statut, et indépendamment du réglage ci-dessus. `blocked` fait exception : il rend aussi la tâche, mais le travail reste bloqué, donc les échecs précédents méritent encore d'être lus.- quand votre boîte de réception dans l'espace de travail dépasse 2 000 notifications. Elle garde les 2 000 plus récentes et archive peu après les plus anciennes, lues ou non. Une notification revenue d'un report ou restaurée depuis l'archive compte à partir de son retour. Les notifications d'une tâche reportée ne comptent pas et restent en place.-Les fenêtres ouvertes retirent aussitôt une ligne archivée, sauf celle que vous avez ouverte. Quand sa notification quitte la boîte de réception autrement (vous passez la tâche à `done` depuis son statut, une autre fenêtre l'archive, ou une modification la sort des filtres de la section), la ligne reste en surbrillance à sa place et la barre de la boîte de réception indique ce qui s'est passé. **Annuler** fait revenir la notification, et **Suivante** (ou `E`) ouvre la ligne suivante. La ligne disparaît dès que vous passez à autre chose.+Les fenêtres ouvertes retirent aussitôt une ligne archivée, sauf celle que vous avez ouverte. Quand sa notification quitte la boîte de réception autrement (vous passez la tâche à `done` depuis son statut, une autre fenêtre l'archive, ou une modification la sort des filtres de la section), la ligne reste en surbrillance à sa place et la barre de la boîte de réception indique ce qui s'est passé. Quand un changement fait depuis la barre archive la notification, la barre le nomme, par exemple *Statut passé à En cours · Notification archivée*, et garde **Statut**, **Assigné à** et **Actions rapides** pour la suite. **Annuler** fait revenir la notification, et **Suivante** (ou `E`) ouvre la ligne suivante. La ligne disparaît dès que vous passez à autre chose.Quand vous retirez vous-même la ligne ouverte, depuis la barre de la boîte de réception, sa ligne, la carte de survol ou une action groupée qui l'inclut, c'est la ligne suivante qui s'ouvre. S'il n'en reste aucune, la tâche reste ouverte. L'archivage et les actions groupées proposent **Annuler**, qui fait revenir les notifications sans changer le statut de la tâche.diff --git a/apps/docs/content/docs/inbox.ja.mdx b/apps/docs/content/docs/inbox.ja.mdxindex 582574df4d..bb617e96bc 100644--- a/apps/docs/content/docs/inbox.ja.mdx+++ b/apps/docs/content/docs/inbox.ja.mdx@@ -137,7 +137,7 @@ multica inbox snooze <id>... --until tomorrow # RFC 3339、30m、3h、1d、1w- 「実行失敗」の通知で、タスクが人に引き継がれるステータスになったとき。対象は `in_review`、`started` カテゴリのカスタムステータス、`done`・`closed` カテゴリのすべてのステータスです。誰がステータスを変えたかにかかわらず、そのタスクの全員分の「実行失敗」の通知がアーカイブされ、上の設定には左右されません。`blocked` は例外です。人に引き継がれはしますが作業は止まったままなので、それまでの失敗の記録はまだ確認する必要があります。- そのワークスペースのインボックスが 2,000 件を超えたとき。新しい 2,000 件を残し、それより古い通知は既読かどうかにかかわらず、少し後に自動でアーカイブされます。スヌーズから戻った通知やアーカイブから戻した通知は、戻った時点の新しさで数えます。スヌーズ中のタスクの通知は数えず、そのまま残ります。-アーカイブされた行は、開いているウィンドウからもすぐに消えます。ただし、いま開いている行は別です。その通知がほかの理由でインボックスから外れたとき(ステータスからタスクを `done` にした、別のウィンドウでアーカイブされた、編集でセクションのフィルターに合わなくなった)、行は元の位置でハイライトされたまま残り、インボックスバーに何が起きたかが表示されます。**元に戻す** で通知が戻り、**次へ**(または `E`)で次の行が開きます。行が消えるのは、ほかへ移ったときです。+アーカイブされた行は、開いているウィンドウからもすぐに消えます。ただし、いま開いている行は別です。その通知がほかの理由でインボックスから外れたとき(ステータスからタスクを `done` にした、別のウィンドウでアーカイブされた、編集でセクションのフィルターに合わなくなった)、行は元の位置でハイライトされたまま残り、インボックスバーに何が起きたかが表示されます。バーの **ステータス**、**担当者**、**クイックアクション** で変更して通知がアーカイブされたときは、「進行中 に変更 · 通知をアーカイブしました」のようにその操作が示され、これらの操作はバーに残るので続けて変更できます。**元に戻す** で通知が戻り、**次へ**(または `E`)で次の行が開きます。行が消えるのは、ほかへ移ったときです。開いている行を自分で処理したとき(インボックスバー、その行、ホバーカード、その行を含む一括操作)は、代わりに次の行が開きます。残りがなければ、タスクは開いたままです。アーカイブと一括操作の確認には **元に戻す** があり、通知は戻りますが、タスクのステータスはそのままです。diff --git a/apps/docs/content/docs/inbox.ko.mdx b/apps/docs/content/docs/inbox.ko.mdxindex cf124ea567..dda8e8339b 100644--- a/apps/docs/content/docs/inbox.ko.mdx+++ b/apps/docs/content/docs/inbox.ko.mdx@@ -137,7 +137,7 @@ multica inbox snooze <id>... --until tomorrow # RFC 3339, 30m, 3h, 1d, 1w; uns- "실행 실패함" 알림이고, 태스크가 사람에게 넘어가는 상태가 될 때. 해당 상태는 `in_review`, `started` 카테고리의 사용자 지정 상태, `done`·`closed` 카테고리의 모든 상태입니다. 누가 상태를 바꿨는지와 관계없이 그 태스크의 모든 사람의 "실행 실패함" 알림이 보관되며, 위 설정의 영향을 받지 않습니다. `blocked`는 예외입니다. 사람에게 넘어가기는 하지만 작업이 여전히 막혀 있으므로 지난 실패 기록을 계속 확인해야 합니다.- 그 워크스페이스의 인박스가 알림 2,000개를 넘을 때. 최신 2,000개를 남기고, 그보다 오래된 알림은 읽음 여부와 관계없이 잠시 후 자동으로 보관됩니다. 미루기에서 돌아온 알림과 보관함에서 복원한 알림은 돌아온 시점을 기준으로 셉니다. 미룬 태스크의 알림은 개수에 포함되지 않으며 그대로 남습니다.-보관된 행은 열려 있는 창에서도 바로 사라집니다. 단, 지금 열어 둔 행은 예외입니다. 그 알림이 다른 이유로 인박스에서 빠지면(상태에서 태스크를 `done`으로 바꿨거나, 다른 창에서 보관했거나, 편집으로 섹션 필터에 더 이상 맞지 않게 된 경우) 행은 제자리에서 강조된 채 남고, 인박스 바에 무슨 일이 있었는지 표시됩니다. **실행 취소**로 알림을 되돌리고, **다음**(또는 `E`)으로 다음 행을 엽니다. 행은 다른 곳으로 이동할 때 사라집니다.+보관된 행은 열려 있는 창에서도 바로 사라집니다. 단, 지금 열어 둔 행은 예외입니다. 그 알림이 다른 이유로 인박스에서 빠지면(상태에서 태스크를 `done`으로 바꿨거나, 다른 창에서 보관했거나, 편집으로 섹션 필터에 더 이상 맞지 않게 된 경우) 행은 제자리에서 강조된 채 남고, 인박스 바에 무슨 일이 있었는지 표시됩니다. 바의 **상태**, **담당자**, **퀵 액션**으로 바꿔서 알림이 보관되면 '상태 변경됨: 진행 중 · 알림이 보관됨'처럼 그 동작이 표시되고, 이 동작들은 바에 그대로 남아 이어서 바꿀 수 있습니다. **실행 취소**로 알림을 되돌리고, **다음**(또는 `E`)으로 다음 행을 엽니다. 행은 다른 곳으로 이동할 때 사라집니다.열어 둔 행을 직접 처리하면(인박스 바, 그 행, 호버 카드, 그 행을 포함한 일괄 작업) 대신 다음 행이 열립니다. 남은 행이 없으면 태스크는 열린 채로 있습니다. 보관과 일괄 작업의 확인에는 **실행 취소**가 있으며, 알림은 돌아오고 태스크 상태는 그대로 유지됩니다.diff --git a/apps/docs/content/docs/inbox.mdx b/apps/docs/content/docs/inbox.mdxindex 5dab3ee3e2..0856f837ff 100644--- a/apps/docs/content/docs/inbox.mdx+++ b/apps/docs/content/docs/inbox.mdx@@ -137,7 +137,7 @@ Reading a notification doesn't remove it. A row leaves the inbox only when:- it's a **Run failed** notification and its issue moves to a status that hands it back to a person: `in_review`, a custom status in the `started` category, or any status in the `done` or `closed` category. This archives everyone's Run failed notifications on the issue, whoever moved it, and doesn't depend on the setting above. `blocked` is the exception: it hands the issue over too, but the work is still stuck, so the earlier failures are still worth reading.- your inbox in the workspace goes past 2,000 notifications. It keeps the newest 2,000 and shortly afterwards archives the older ones, read or not. A notification that comes back from a snooze or that you restore from the archive counts from when it came back. Notifications on a snoozed issue don't count and are left alone.-Open windows drop an archived row right away, except the one you have open. When its notification leaves the inbox some other way (you set the issue to `done` from its status, another window archived it, or an edit took it out of the section's filters), the row stays lit where it was and the inbox bar says what happened. **Undo** brings the notification back, and **Next** (or `E`) opens the next row. The row leaves once you move on.+Open windows drop an archived row right away, except the one you have open. When its notification leaves the inbox some other way (you set the issue to `done` from its status, another window archived it, or an edit took it out of the section's filters), the row stays lit where it was and the inbox bar says what happened. When a change you make from the bar archives the notification, the bar names it, as in *Changed to In Progress · Notification archived*, and keeps **Status**, **Assignee** and **Quick actions** for the next change. **Undo** brings the notification back, and **Next** (or `E`) opens the next row. The row leaves once you move on.When you take the open row out yourself, from the inbox bar, its row, the hover card, or a bulk action that includes it, the next row opens instead. With nothing left to open, the issue stays open. Archiving and the bulk actions confirm with **Undo**, which brings the notifications back and leaves the issue's status as it is.diff --git a/apps/docs/content/docs/inbox.zh-Hant.mdx b/apps/docs/content/docs/inbox.zh-Hant.mdxindex 05464c29d2..22ded18ae6 100644--- a/apps/docs/content/docs/inbox.zh-Hant.mdx+++ b/apps/docs/content/docs/inbox.zh-Hant.mdx@@ -137,7 +137,7 @@ multica inbox snooze <id>... --until tomorrow # RFC 3339、30m、3h、1d、1w- 它是"執行失敗"通知,且任務進入交回給人的狀態:`in_review`、`started` 分類下的自定義狀態,或 `done`、`closed` 分類下的任一狀態。這會歸檔所有人在該任務上的"執行失敗"通知,不論是誰改的狀態,也不受上面的開關影響。`blocked` 例外:它同樣交回給人,但工作還卡著,之前的失敗記錄還要看。- 你在該工作區的收件箱超過 2,000 條通知。收件箱保留最新的 2,000 條,隨後自動歸檔更早的通知,無論是否已讀。從延後中回來或從歸檔中還原的通知,按回來的時間算作新通知。已延後任務上的通知不計入,也不會被歸檔。-開著的視窗會立即移除已歸檔的列,但你正開著的那一列除外。它的通知因為其他原因離開收件箱時(你在狀態裡把任務改為 `done`、別的視窗歸檔了它,或修改後不再符合分區的篩選),這一列會在原位保持高亮,收件箱列會說明發生了什麼:**復原**讓通知回來,**下一條**(或按 `E`)開啟下一列。你離開之後,這一列才會移出。+開著的視窗會立即移除已歸檔的列,但你正開著的那一列除外。它的通知因為其他原因離開收件箱時(你在狀態裡把任務改為 `done`、別的視窗歸檔了它,或修改後不再符合分區的篩選),這一列會在原位保持高亮,收件箱列會說明發生了什麼。在列裡改**狀態**、**負責人**或執行**快捷操作**後通知被歸檔時,列會寫明是哪一項,例如「已改為進行中 · 通知已歸檔」,這幾個操作也留在列裡,可以接著改。**復原**讓通知回來,**下一條**(或按 `E`)開啟下一列。你離開之後,這一列才會移出。如果是你自己把正開著的這一列處理掉(在收件箱列、它所在的列、懸停卡片,或包含它的批次操作裡),會直接開啟下一列;沒有剩下的列時,任務保持開啟。歸檔和批次操作的提示裡都可以**復原**:通知會回來,任務的狀態保持不變。diff --git a/apps/docs/content/docs/inbox.zh.mdx b/apps/docs/content/docs/inbox.zh.mdxindex 745605379f..828d22d507 100644--- a/apps/docs/content/docs/inbox.zh.mdx+++ b/apps/docs/content/docs/inbox.zh.mdx@@ -137,7 +137,7 @@ multica inbox snooze <id>... --until tomorrow # RFC 3339、30m、3h、1d、1w- 它是"运行失败"通知,且任务进入交回给人的状态:`in_review`、`started` 分类下的自定义状态,或 `done`、`closed` 分类下的任一状态。这会归档所有人在该任务上的"运行失败"通知,不论是谁改的状态,也不受上面的开关影响。`blocked` 例外:它同样交回给人,但工作还卡着,之前的失败记录还要看。- 你在该工作区的收件箱超过 2,000 条通知。收件箱保留最新的 2,000 条,随后自动归档更早的通知,无论是否已读。从延后中回来或从归档中还原的通知,按回来的时间算作新通知。已延后任务上的通知不计入,也不会被归档。-打开着的窗口会立即移除已归档的行,但你正打开的那一行除外。它的通知因为其他原因离开收件箱时(你在状态里把任务改为 `done`、别的窗口归档了它,或修改后不再符合分区的筛选),这一行会在原位保持高亮,收件箱栏会说明发生了什么:**撤销**让通知回来,**下一条**(或按 `E`)打开下一行。你离开之后,这一行才会移出。+打开着的窗口会立即移除已归档的行,但你正打开的那一行除外。它的通知因为其他原因离开收件箱时(你在状态里把任务改为 `done`、别的窗口归档了它,或修改后不再符合分区的筛选),这一行会在原位保持高亮,收件箱栏会说明发生了什么。在栏里改**状态**、**负责人**或运行**快捷操作**后通知被归档时,栏会写明是哪一项,比如“已改为进行中 · 通知已归档”,这几个操作也留在栏里,可以接着改。**撤销**让通知回来,**下一条**(或按 `E`)打开下一行。你离开之后,这一行才会移出。如果是你自己把正打开的这一行处理掉(在收件箱栏、它所在的行、悬停卡片,或包含它的批量操作里),会直接打开下一行;没有剩下的行时,任务保持打开。归档和批量操作的提示里都可以**撤销**:通知会回来,任务的状态保持不变。diff --git a/packages/core/inbox/auto-archive.test.ts b/packages/core/inbox/auto-archive.test.tsindex dd471c462c..d01a4ec9a5 100644--- a/packages/core/inbox/auto-archive.test.ts+++ b/packages/core/inbox/auto-archive.test.ts@@ -1,5 +1,5 @@import { describe, expect, it } from "vitest";-import { noteInboxAutoArchive, takeInboxAutoArchive } from "./auto-archive";+import { noteInboxAutoArchive, noteInboxBarAction, takeInboxAutoArchive, takeInboxBarAction } from "./auto-archive";describe("inbox auto-archive records", () => {it.each(["issue_status_terminal", "actor_acted"])("records an archive the user caused: %s", (reason) => {@@ -21,3 +21,17 @@ describe("inbox auto-archive records", () => {expect(takeInboxAutoArchive("issue-c", 1_000 + 30_001)).toBe(false);});});++describe("inbox bar actions", () => {+ it("keeps the latest action on an issue until it is taken", () => {+ noteInboxBarAction("issue-a", { type: "status", status: "in_progress" }, 1_000);+ noteInboxBarAction("issue-a", { type: "quick_action", name: "Code Review" }, 1_500);+ expect(takeInboxBarAction("issue-a", 2_000)).toEqual({ type: "quick_action", name: "Code Review" });+ expect(takeInboxBarAction("issue-a", 2_000)).toBeNull();+ });++ it("forgets an action once it is stale", () => {+ noteInboxBarAction("issue-b", { type: "assignee", assignee: null }, 1_000);+ expect(takeInboxBarAction("issue-b", 1_000 + 30_001)).toBeNull();+ });+});diff --git a/packages/core/inbox/auto-archive.ts b/packages/core/inbox/auto-archive.tsindex 4d4c66344b..5e1c91accd 100644--- a/packages/core/inbox/auto-archive.ts+++ b/packages/core/inbox/auto-archive.ts@@ -1,3 +1,5 @@+import type { IssueAssigneeType } from "../types";+/*** Issues whose notifications the server just archived because the user* handled them: completed the issue, commented on it, changed its status or reassigned it@@ -30,3 +32,31 @@ export function takeInboxAutoArchive(issueId: string, now = Date.now()): booleanarchivedAt.delete(issueId);return at !== undefined && now - at <= AUTO_ARCHIVE_TTL_MS;}++/**+ * What the user did to an issue from its Inbox bar in this window. These+ * actions archive the notification on the server, so once the archive comes+ * back as the user's own (`takeInboxAutoArchive`), the bar can name the+ * action instead of a bare "Notification archived".+ */+export type InboxBarAction =+ | { type: "status"; status: string }+ | { type: "assignee"; assignee: { type: IssueAssigneeType; id: string } | null }+ | { type: "quick_action"; name: string };++const barActions = new Map<string, { action: InboxBarAction; at: number }>();++/** Record an action taken from `issueId`'s Inbox bar; a later one replaces it. */+export function noteInboxBarAction(issueId: string, action: InboxBarAction, now = Date.now()): void {+ for (const [id, entry] of barActions) {+ if (now - entry.at > AUTO_ARCHIVE_TTL_MS) barActions.delete(id);+ }+ barActions.set(issueId, { action, at: now });+}++/** The action just taken from `issueId`'s Inbox bar, if any. Consumes the record. */+export function takeInboxBarAction(issueId: string, now = Date.now()): InboxBarAction | null {+ const entry = barActions.get(issueId);+ barActions.delete(issueId);+ return entry && now - entry.at <= AUTO_ARCHIVE_TTL_MS ? entry.action : null;+}diff --git a/packages/views/inbox/components/inbox-kept-actions.tsx b/packages/views/inbox/components/inbox-kept-actions.tsxindex 2d7149e249..4fd36dbba3 100644--- a/packages/views/inbox/components/inbox-kept-actions.tsx+++ b/packages/views/inbox/components/inbox-kept-actions.tsx@@ -5,14 +5,16 @@ import { Archive, ArrowDown, Undo2 } from "@multica/ui/icons";import { Button } from "@multica/ui/components/ui/button";import { TooltipHint } from "@multica/ui/components/common/tooltip-hint";import { useIssueStatuses } from "@multica/core/issue-statuses/hooks";+import type { InboxBarAction } from "@multica/core/inbox/auto-archive";import type { KeptInboxRow } from "@multica/core/inbox/open-row";+import { useActorName } from "@multica/core/workspace/hooks";import type { InboxItem } from "@multica/core/types";import { useLocale, useT } from "../../i18n";import { ActionShortcutKeycaps } from "../../common/shortcut-keycaps";import { useStatusLabel } from "../../issues/utils/status-label";import { formatSnoozeTime } from "./inbox-snooze-time";import { getInboxDisplayTitle, isAutopilotQuotaNotice } from "./inbox-display";-import { InboxBar, InboxBarStatus } from "./inbox-bar";+import { InboxBar, InboxBarSeparator, InboxBarStatus } from "./inbox-bar";/*** How a kept row (`keepOpenInboxRow`) says why it is settled: `line` in its@@ -23,6 +25,7 @@ export function useKeptInboxRowText(wsId: string) {const locale = useLocale();const { categoryOf } = useIssueStatuses(wsId);const statusLabelOf = useStatusLabel(wsId);+ const { getActorName } = useActorName();// Finishing the issue is what archives its notifications on its own, so the// status says why where it can.const finished = (item: InboxItem) => {@@ -35,16 +38,29 @@ export function useKeptInboxRowText(wsId: string) {item.snoozed_until? t(($) => $.snooze.back_at, { time: formatSnoozeTime(new Date(item.snoozed_until), new Date(), locale) }): t(($) => $.kept.archived);+ const did = (action: InboxBarAction) => {+ switch (action.type) {+ case "status":+ return t(($) => $.kept.changed_status, { status: statusLabelOf(action.status) });+ case "assignee":+ return action.assignee+ ? t(($) => $.kept.reassigned, { name: getActorName(action.assignee.type, action.assignee.id) })+ : t(($) => $.kept.unassigned);+ case "quick_action":+ return t(($) => $.kept.ran_quick_action, { name: action.name });+ }+ };return {line: (kept: KeptInboxRow) => {if (kept.reason === "filtered") return t(($) => $.kept.filtered);const why = kept.reason === "snoozed" ? backAt(kept.item) : (finished(kept.item) ?? t(($) => $.kept.archived));return `${why} · ${t(($) => $.kept.leaves)}`;},- notice: (kept: KeptInboxRow) => {+ /** `cause` is the bar action that archived it (`useMoveOnAfterAutoArchive`). */+ notice: (kept: KeptInboxRow, cause?: InboxBarAction | null) => {if (kept.reason === "snoozed") return backAt(kept.item);- const status = finished(kept.item);- return status ? `${status} · ${t(($) => $.kept.notification_archived)}` : t(($) => $.kept.notification_archived);+ const why = (cause && kept.reason === "archived" ? did(cause) : null) ?? finished(kept.item);+ return why ? `${why} · ${t(($) => $.kept.notification_archived)}` : t(($) => $.kept.notification_archived);},};}@@ -52,12 +68,14 @@ export function useKeptInboxRowText(wsId: string) {/*** What the open notification's bar offers once it has left the Inbox on its* own (its issue reached Done, another window archived it) and stays on- * screen until the user moves on: what happened, the way to undo it, and the- * next notification.+ * screen until the user moves on: what happened, the issue's own actions+ * when it was archived, so the next change needs no trip to its properties,+ * then the way to undo it and the next notification.*/export function InboxKeptActions({label,icon,+ issueActions,onUndo,next,onNext,@@ -65,6 +83,7 @@ export function InboxKeptActions({label: ReactNode;/** Defaults to the archive icon. */icon?: ReactNode;+ issueActions?: ReactNode;onUndo?: () => void;/** The notification `onNext` opens; without one there is nothing to move on to. */next: InboxItem | null;@@ -74,6 +93,8 @@ export function InboxKeptActions({return (<InboxBar settled><InboxBarStatus icon={icon ?? <Archive />} label={label} />+ {issueActions}+ {issueActions && (onUndo || next) && <InboxBarSeparator />}{onUndo && (<Button size="sm" variant="ghost" className="shrink-0 text-muted-foreground" onClick={onUndo}><Undo2 />diff --git a/packages/views/inbox/components/inbox-page-query.test.tsx b/packages/views/inbox/components/inbox-page-query.test.tsxindex 36768243c7..897e65be69 100644--- a/packages/views/inbox/components/inbox-page-query.test.tsx+++ b/packages/views/inbox/components/inbox-page-query.test.tsx@@ -27,9 +27,9 @@ vi.mock("../../modals/use-limit-recovery-prompt", () => ({const detailUnmounted = vi.hoisted(() => vi.fn());vi.mock("../../issues/components/issue-detail", () => ({- IssueDetail: ({ issueId, notice }: { issueId: string; notice?: ReactNode }) => {+ IssueDetail: ({ issueId, notice }: { issueId: string; notice?: (issueActions: ReactNode) => ReactNode }) => {useEffect(() => () => detailUnmounted(issueId), [issueId]);- return <div data-testid="detail">{issueId}<div data-testid="notice">{notice}</div></div>;+ return <div data-testid="detail">{issueId}<div data-testid="notice">{notice?.(null)}</div></div>;},issueHighlightMementoKey: (issueId: string) => `highlight:${issueId}`,}));diff --git a/packages/views/inbox/components/inbox-page.test.tsx b/packages/views/inbox/components/inbox-page.test.tsxindex bd504b76eb..8352035c21 100644--- a/packages/views/inbox/components/inbox-page.test.tsx+++ b/packages/views/inbox/components/inbox-page.test.tsx@@ -1,3 +1,4 @@+import type { ReactNode } from "react";import { act, fireEvent, render, screen, within } from "@testing-library/react";import { describe, expect, it, vi } from "vitest";import { toast } from "sonner";@@ -989,14 +990,15 @@ describe("InboxPage", () => {item({ id: "inbox-a", issue_id: "issue-a" }),item({ id: "inbox-b", issue_id: "issue-b" }),];+ const notice = () => (issueDetailProps.at(-1)?.notice as ((issueActions: ReactNode) => ReactNode) | undefined)?.(null);const { rerender } = render(<InboxPage />);- expect(issueDetailProps.at(-1)?.notice).toBeFalsy();+ expect(notice()).toBeFalsy();listData.active = [item({ id: "inbox-b", issue_id: "issue-b" })];rerender(<InboxPage />);expect(screen.getByTestId("issue-detail")).toHaveTextContent("issue-a");- expect(issueDetailProps.at(-1)?.notice).toBeTruthy();+ expect(notice()).toBeTruthy();expect(replace).not.toHaveBeenCalledWith("/acme/inbox");});diff --git a/packages/views/inbox/components/inbox-page.tsx b/packages/views/inbox/components/inbox-page.tsxindex cdfd7a8d54..43879e40ae 100644--- a/packages/views/inbox/components/inbox-page.tsx+++ b/packages/views/inbox/components/inbox-page.tsx@@ -641,7 +641,7 @@ export function InboxPage() {});};- useMoveOnAfterAutoArchive({+ const settledCause = useMoveOnAfterAutoArchive({settled: settledRow,next: settledRow ? nextInboxRow(listedItems, settledRow.key) : null,onNext: () => {@@ -969,12 +969,13 @@ export function InboxPage() {) : null;// The open notification left the Inbox on its own: say so above it, with- // the way back and the way on.- const keptNotice =+ // the issue's actions once archived, the way back and the way on.+ const keptNotice = (issueActions?: ReactNode) =>settledRow && detailItem && inboxRowKey(detailItem) === settledRow.key ? (<InboxKeptActions- label={keptText.notice(settledRow)}+ label={keptText.notice(settledRow, settledCause)}icon={settledRow.reason === "snoozed" ? <AlarmClock /> : undefined}+ issueActions={settledRow.reason === "archived" ? issueActions : undefined}onUndo={() =>settledRow.reason === "snoozed"? unsnooze(settledRow.item.id, settledRow.key)@@ -1044,7 +1045,7 @@ export function InboxPage() {</ErrorBoundary>) : detailItem ? (<>- {keptNotice}+ {keptNotice()}<div className="p-6"><h2 className="text-title font-semibold">{isAutopilotQuotaNotice(detailItem.type)diff --git a/packages/views/inbox/components/use-move-on-after-auto-archive.test.tsx b/packages/views/inbox/components/use-move-on-after-auto-archive.test.tsxindex afe0015c75..66af1b1d5b 100644--- a/packages/views/inbox/components/use-move-on-after-auto-archive.test.tsx+++ b/packages/views/inbox/components/use-move-on-after-auto-archive.test.tsx@@ -6,11 +6,12 @@ import { toast } from "sonner";import { setApiInstance } from "@multica/core/api";import type { ApiClient } from "@multica/core/api/client";import { I18nProvider } from "@multica/core/i18n/react";-import { noteInboxAutoArchive } from "@multica/core/inbox/auto-archive";+import { noteInboxAutoArchive, noteInboxBarAction } from "@multica/core/inbox/auto-archive";import type { KeptInboxRow } from "@multica/core/inbox/open-row";import { useInboxSelectionStore } from "@multica/core/inbox/selection-store";import { notificationPreferenceKeys } from "@multica/core/notification-preferences/queries";-import type { InboxItem } from "@multica/core/types";+import { issueDetailOptions } from "@multica/core/issues/queries";+import type { InboxItem, Issue } from "@multica/core/types";import { getTestResources } from "../../test/i18n";import { useMoveOnAfterAutoArchive } from "./use-move-on-after-auto-archive";@@ -58,7 +59,12 @@ function setup(preferences: Record<string, string>, initial: KeptInboxRow | null({ settled }: { settled: KeptInboxRow | null }) => useMoveOnAfterAutoArchive({ settled, next: nextRow, onNext }),{ wrapper, initialProps: { settled: initial } },);- return { onNext, settle: (row: KeptInboxRow | null) => view.rerender({ settled: row }) };+ return {+ onNext,+ settle: (row: KeptInboxRow | null) => view.rerender({ settled: row }),+ cause: () => view.result.current,+ qc,+ };}beforeEach(() => {@@ -111,4 +117,37 @@ describe("useMoveOnAfterAutoArchive", () => {settle(archived("issue-e"));expect(onNext).not.toHaveBeenCalled();});++ it("reports the bar action behind an archive it stays on", () => {+ const { settle, cause } = setup({});+ noteInboxBarAction("issue-f", { type: "status", status: "in_progress" });+ noteInboxAutoArchive({ issue_id: "issue-f", reason: "actor_acted" });+ settle(archived("issue-f"));+ expect(cause()).toEqual({ type: "status", status: "in_progress" });+ });++ it("reports no assignment the issue does not show, as one dismissed at its confirmation", () => {+ const { settle, cause, qc } = setup({});+ qc.setQueryData(issueDetailOptions("ws", "issue-h").queryKey, {+ id: "issue-h",+ status: "in_review",+ assignee_type: "member",+ assignee_id: "member-1",+ } as Issue);+ noteInboxBarAction("issue-h", { type: "assignee", assignee: { type: "agent", id: "agent-nova" } });+ noteInboxAutoArchive({ issue_id: "issue-h", reason: "actor_acted" });+ settle(archived("issue-h"));+ expect(cause()).toBeNull();+ });++ it("reports no action when something else archived it, and forgets the action", () => {+ const { settle, cause } = setup({});+ noteInboxBarAction("issue-g", { type: "status", status: "in_progress" });+ settle(archived("issue-g"));+ expect(cause()).toBeNull();+ settle(null);+ noteInboxAutoArchive({ issue_id: "issue-g", reason: "actor_acted" });+ settle(archived("issue-g"));+ expect(cause()).toBeNull();+ });});diff --git a/packages/views/inbox/components/use-move-on-after-auto-archive.ts b/packages/views/inbox/components/use-move-on-after-auto-archive.tsindex 8598ee74c5..83396d3f96 100644--- a/packages/views/inbox/components/use-move-on-after-auto-archive.ts+++ b/packages/views/inbox/components/use-move-on-after-auto-archive.ts@@ -1,15 +1,16 @@"use client";-import { useEffect, useRef } from "react";-import { useQuery } from "@tanstack/react-query";+import { useLayoutEffect, useRef, useState } from "react";+import { useQuery, useQueryClient } from "@tanstack/react-query";import { toast } from "sonner";import { useWorkspaceId } from "@multica/core/hooks";-import { takeInboxAutoArchive } from "@multica/core/inbox/auto-archive";+import { type InboxBarAction, takeInboxAutoArchive, takeInboxBarAction } from "@multica/core/inbox/auto-archive";import type { KeptInboxRow } from "@multica/core/inbox/open-row";import { useInboxSelectionStore } from "@multica/core/inbox/selection-store";+import { issueDetailOptions } from "@multica/core/issues/queries";import { notificationPreferenceOptions } from "@multica/core/notification-preferences/queries";import { notificationPreferenceValue } from "@multica/core/notification-preferences/patch";-import type { InboxItem } from "@multica/core/types";+import type { InboxItem, Issue } from "@multica/core/types";import { useT } from "../../i18n";import { useRestoreInbox } from "./use-leave-inbox-row";@@ -21,6 +22,9 @@ import { useRestoreInbox } from "./use-leave-inbox-row";** Only the focused window moves on: acting in another window or tab must not* pull this one away from what it shows.+ *+ * Returns the Inbox bar action that archived the settled row, when it was+ * taken in this window, so the bar can say what the user did.*/export function useMoveOnAfterAutoArchive({settled,@@ -30,24 +34,30 @@ export function useMoveOnAfterAutoArchive({settled: KeptInboxRow | null;next: InboxItem | null;onNext: () => void;-}) {+}): InboxBarAction | null {const { t } = useT("inbox");const wsId = useWorkspaceId();const { data } = useQuery(notificationPreferenceOptions(wsId));const movesOn = notificationPreferenceValue(data?.preferences ?? {}, "after_auto_archive") === "next";const restore = useRestoreInbox();+ const qc = useQueryClient();const archivedKey = settled?.reason === "archived" ? settled.key : null;+ const [cause, setCause] = useState<{ key: string; action: InboxBarAction } | null>(null);const latest = useRef({ settled, next, onNext, movesOn });- useEffect(() => {+ useLayoutEffect(() => {latest.current = { settled, next, onNext, movesOn };});- useEffect(() => {+ // Before paint, so the settled bar never shows the plain archive first.+ useLayoutEffect(() => {if (!archivedKey) return;const { settled: row, next: nextRow, onNext: moveOn, movesOn: moves } = latest.current;- if (!takeInboxAutoArchive(archivedKey)) return;- if (!moves || !row || !nextRow || !document.hasFocus()) return;+ const own = takeInboxAutoArchive(archivedKey);+ const action = takeInboxBarAction(archivedKey);+ const shown = own && action && reflects(qc.getQueryData(issueDetailOptions(wsId, archivedKey).queryKey), action);+ setCause(shown ? { key: archivedKey, action } : null);+ if (!own || !moves || !row || !nextRow || !document.hasFocus()) return;moveOn();toast.success(t(($) => $.toasts.archived), {action: {@@ -58,5 +68,23 @@ export function useMoveOnAfterAutoArchive({},},});- }, [archivedKey, wsId, restore, t]);+ }, [archivedKey, wsId, qc, restore, t]);++ return cause && cause.key === archivedKey ? cause.action : null;+}++/**+ * Whether the issue shows the change the bar asked for. Agent assignments+ * confirm first, and one dismissed there never happened.+ */+function reflects(issue: Issue | undefined, action: InboxBarAction): boolean {+ if (!issue) return true;+ switch (action.type) {+ case "status":+ return issue.status === action.status;+ case "assignee":+ return (issue.assignee_id ?? null) === (action.assignee?.id ?? null);+ case "quick_action":+ return true;+ }}diff --git a/packages/views/issues/actions/__tests__/issue-inbox-actions.test.tsx b/packages/views/issues/actions/__tests__/issue-inbox-actions.test.tsxindex cbf1e1487d..0fdb0bc3bb 100644--- a/packages/views/issues/actions/__tests__/issue-inbox-actions.test.tsx+++ b/packages/views/issues/actions/__tests__/issue-inbox-actions.test.tsx@@ -6,12 +6,13 @@ import { toast } from "sonner";import { agentTaskSnapshotOptions } from "@multica/core/agents";import { setApiInstance } from "@multica/core/api";import type { ApiClient } from "@multica/core/api/client";+import { type InboxBarAction, noteInboxAutoArchive, noteInboxBarAction } from "@multica/core/inbox/auto-archive";import { useInboxFilterStore } from "@multica/core/inbox/filter-store";import { inboxListOptions, snoozedInboxOptions } from "@multica/core/inbox/queries";import { useInboxSelectionStore } from "@multica/core/inbox/selection-store";import { childIssuesOptions, issueDetailOptions, issueSubscribersOptions } from "@multica/core/issues/queries";import { agentListOptions } from "@multica/core/workspace/queries";-import type { InboxItem, Issue, SnoozedInboxIssue } from "@multica/core/types";+import type { Agent, InboxItem, Issue, SnoozedInboxIssue } from "@multica/core/types";import { renderWithI18n } from "../../../test/i18n";import { NavigationProvider, type NavigationAdapter } from "../../../navigation";import { IssueInboxBar } from "../issue-inbox-actions";@@ -245,11 +246,59 @@ describe("IssueInboxBar", () => {expect(issueAction.compareDocumentPosition(snooze) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();});- it("drops the issue's actions once the notification has left the Inbox", async () => {+ it("keeps the issue's actions once the notification has left the Inbox", async () => {const nav = setup({ issueActions: <button type="button">Set status</button> });act(() => nav.qc.setQueryData(inboxListOptions("ws").queryKey, [ROWS[1]!]));expect(await screen.findByText("Notification archived")).toBeInTheDocument();- expect(screen.queryByRole("button", { name: "Set status" })).toBeNull();+ const issueAction = screen.getByRole("button", { name: "Set status" });+ const undo = screen.getByRole("button", { name: "Undo" });+ expect(issueAction.compareDocumentPosition(undo) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();+ });++ describe("after an action from the bar archives the notification", () => {+ /** The bar's action, then the server's archive of it as the user's own. */+ const actFromBar = (nav: ReturnType<typeof setup>, action: InboxBarAction) => {+ noteInboxBarAction("issue-1", action);+ noteInboxAutoArchive({ issue_id: "issue-1", reason: "actor_acted" });+ act(() => nav.qc.setQueryData(inboxListOptions("ws").queryKey, [ROWS[1]!]));+ };++ it("names the status it set, keeps the issue's actions, and undoes the archive", async () => {+ const nav = setup({ issueActions: <button type="button">Set status</button> });+ actFromBar(nav, { type: "status", status: "in_progress" });+ expect(await screen.findByText("Changed to In Progress · Notification archived")).toBeInTheDocument();+ expect(screen.getByRole("button", { name: "Set status" })).toBeInTheDocument();+ expect(nav.push).not.toHaveBeenCalled();++ await act(async () => fireEvent.click(screen.getByRole("button", { name: "Undo" })));+ expect(state.unarchiveInbox).toHaveBeenCalledWith("n-1");+ });++ it("names the new assignee", async () => {+ const nav = setup();+ nav.qc.setQueryData(agentListOptions("ws").queryKey, [{ id: "agent-nova", name: "Nova" } as Agent]);+ actFromBar(nav, { type: "assignee", assignee: { type: "agent", id: "agent-nova" } });+ expect(await screen.findByText("Reassigned to Nova · Notification archived")).toBeInTheDocument();+ });++ it("names the quick action it ran", async () => {+ const nav = setup();+ actFromBar(nav, { type: "quick_action", name: "Code Review" });+ expect(await screen.findByText("Ran Code Review · Notification archived")).toBeInTheDocument();+ });++ it("names the status for Done too, over the status alone", async () => {+ const nav = setup({ rows: [{ ...ROWS[0]!, issue_status: "done" }, ROWS[1]!] });+ actFromBar(nav, { type: "status", status: "done" });+ expect(await screen.findByText("Changed to Done · Notification archived")).toBeInTheDocument();+ });++ it("claims nothing when the archive came from elsewhere", async () => {+ const nav = setup();+ noteInboxBarAction("issue-1", { type: "status", status: "in_progress" });+ act(() => nav.qc.setQueryData(inboxListOptions("ws").queryKey, [ROWS[1]!]));+ expect(await screen.findByText("Notification archived")).toBeInTheDocument();+ });});it("offers snooze in place of a read toggle", () => {diff --git a/packages/views/issues/actions/issue-inbox-actions.tsx b/packages/views/issues/actions/issue-inbox-actions.tsxindex 3bbfea98b2..c360eb6e7a 100644--- a/packages/views/issues/actions/issue-inbox-actions.tsx+++ b/packages/views/issues/actions/issue-inbox-actions.tsx@@ -42,8 +42,9 @@ import { useLocale, useT } from "../../i18n";* so the Inbox can be worked through without leaving the page.** Once the notification leaves the Inbox on its own (the issue reached Done,- * another window archived it), the section keeps the row in place and the bar- * says so instead, with an undo and the way on to the next notification.+ * another window archived it, an action from this bar archived it), the+ * section keeps the row in place and the bar says so instead, with the+ * issue's actions still there, an undo and the way on to the next one.** A snoozed issue's bar says when it comes back instead, wherever it is* opened, with the way to bring it back now or change the time.@@ -88,7 +89,7 @@ export function IssueInboxBar({ issueId, issueActions }: { issueId: string; issu};const moveOn = () => leave(issueId, next);- useMoveOnAfterAutoArchive({ settled, next, onNext: moveOn });+ const cause = useMoveOnAfterAutoArchive({ settled, next, onNext: moveOn });const archiveRef = useRef<(() => void) | null>(null);const snoozeRef = useRef<(() => void) | null>(null);@@ -137,7 +138,8 @@ export function IssueInboxBar({ issueId, issueActions }: { issueId: string; issuif (!settled) return null;return (<InboxKeptActions- label={keptText.notice(settled)}+ label={keptText.notice(settled, cause)}+ issueActions={settled.reason === "archived" ? issueActions : undefined}onUndo={() => restore(settled.item.id, { quiet: true })}next={next}onNext={moveOn}diff --git a/packages/views/issues/components/inbox-issue-actions.tsx b/packages/views/issues/components/inbox-issue-actions.tsxindex 0a645c2568..84d56124e5 100644--- a/packages/views/issues/components/inbox-issue-actions.tsx+++ b/packages/views/issues/components/inbox-issue-actions.tsx@@ -3,6 +3,7 @@import { ChevronDown, UserRound } from "@multica/ui/icons";import { Button } from "@multica/ui/components/ui/button";import { useWorkspaceId } from "@multica/core/hooks";+import { noteInboxBarAction, takeInboxBarAction } from "@multica/core/inbox/auto-archive";import { useIssueStatuses } from "@multica/core/issue-statuses/hooks";import { useActorName } from "@multica/core/workspace/hooks";import type { Issue, UpdateIssueRequest } from "@multica/core/types";@@ -39,12 +40,22 @@ export function InboxIssueActions({const chip = <Button variant="ghost" size="sm" className="min-w-0 max-w-48 shrink-0" />;const chevron = <ChevronDown className="size-3 shrink-0 text-muted-foreground @max-[30rem]/inbox-bar:hidden" />;const assigned = issue.assignee_type && issue.assignee_id ? { type: issue.assignee_type, id: issue.assignee_id } : null;+ // Each of these archives the notification, and the settled bar names it.+ const update = (updates: Partial<UpdateIssueRequest>) => {+ if (updates.status) {+ noteInboxBarAction(issue.id, { type: "status", status: updates.status });+ } else if ("assignee_id" in updates) {+ const assignee = updates.assignee_type && updates.assignee_id ? { type: updates.assignee_type, id: updates.assignee_id } : null;+ noteInboxBarAction(issue.id, { type: "assignee", assignee });+ }+ onUpdate(updates);+ };return (<><StatusPickerstatus={issue.status}- onUpdate={onUpdate}+ onUpdate={update}projectId={issue.project_id}issue={issue}onMarkDuplicate={onMarkDuplicate}@@ -69,7 +80,7 @@ export function InboxIssueActions({<AssigneePickerassigneeType={issue.assignee_type}assigneeId={issue.assignee_id}- onUpdate={onUpdate}+ onUpdate={update}align="start"tooltip={t(($) => $.detail.prop_assignee)}triggerRender={chip}@@ -91,7 +102,13 @@ export function InboxIssueActions({)}/>- <QuickActionsMenu issueId={issue.id} />+ <QuickActionsMenu+ issueId={issue.id}+ onRun={(action, ran) => {+ noteInboxBarAction(issue.id, { type: "quick_action", name: action.name });+ void ran.then((posted) => posted || takeInboxBarAction(issue.id));+ }}+ /></>);}diff --git a/packages/views/issues/components/issue-detail.tsx b/packages/views/issues/components/issue-detail.tsxindex ebb97327c2..abc2730f9f 100644--- a/packages/views/issues/components/issue-detail.tsx+++ b/packages/views/issues/components/issue-detail.tsx@@ -1302,8 +1302,12 @@ interface IssueDetailProps {variant?: "page" | "peek";/** Peek only: host controls at the end of the header (open full page, close). */trailingActions?: ReactNode;- /** A bar the host shows under the header in place of the Inbox bar, above the scrolling body. */- notice?: ReactNode;+ /**+ * A bar the host shows under the header in place of the Inbox bar, above the+ * scrolling body, given the issue's own actions to keep in it. Returning+ * nothing shows the Inbox bar.+ */+ notice?: (issueActions: ReactNode) => ReactNode;/*** Read the viewer's inbox notifications on this issue while it is on screen* (MUL-8588). The inbox turns this off for the issue it has open: it reads@@ -3911,7 +3915,7 @@ export function IssueDetail({ issueId, onDelete, onArchive, onUnsubscribeArchive</>}/>- {notice ??+ {notice?.(inboxIssueActions) ??(onArchive ? (inboxItem && (<InboxOpenBar item={inboxItem} issueActions={inboxIssueActions}>diff --git a/packages/views/issues/components/quick-actions-section.tsx b/packages/views/issues/components/quick-actions-section.tsxindex ded254e880..482c46d6d7 100644--- a/packages/views/issues/components/quick-actions-section.tsx+++ b/packages/views/issues/components/quick-actions-section.tsx@@ -150,7 +150,8 @@ function useQuickActionRun(issueId: string, onBlocked: (action: QuickAction) =>const { t } = useT("issues");const runMutation = useRunQuickAction(issueId);- const run = async (action: QuickAction) => {+ /** Resolves to whether the action's comment was posted. */+ const run = async (action: QuickAction): Promise<boolean> => {const targetName = action.target_name || t(($) => $.detail.quick_action_target_fallback);try {const comment: Comment = await runMutation.mutateAsync({ quickActionId: action.id });@@ -158,15 +159,17 @@ function useQuickActionRun(issueId: string, onBlocked: (action: QuickAction) =>if (kind === "success") toast.success(message);else if (kind === "error") toast.error(message);else toast.info(message);+ return true;} catch (error) {// A permission refusal is a structured 403 the user needs explained, not// a transient failure they should retry — it gets the dialog. Everything// else stays a toast.if (dispatchReasonCode(error) === "invocation_not_allowed") {onBlocked(action);- return;+ return false;}toast.error(error instanceof Error ? error.message : String(error));+ return false;}};return { run, running: runMutation.isPending };@@ -262,7 +265,14 @@ function QuickActionRow({* The quick actions behind one button, for the Inbox bar. Nothing configured* renders nothing.*/-export function QuickActionsMenu({ issueId }: { issueId: string }) {+export function QuickActionsMenu({+ issueId,+ onRun,+}: {+ issueId: string;+ /** Called as an action starts, with whether its comment was posted. */+ onRun?: (action: QuickAction, ran: Promise<boolean>) => void;+}) {const { t } = useT("issues");const wsId = useCurrentWorkspace()?.id ?? "";const [blocked, setBlocked] = useState<QuickAction | null>(null);@@ -289,7 +299,13 @@ export function QuickActionsMenu({ issueId }: { issueId: string }) {</TooltipHint><DropdownMenuContent align="start" className="w-auto min-w-56 max-w-80">{actions.map((action) => (- <DropdownMenuItem key={action.id} onClick={() => void run(action)}>+ <DropdownMenuItem+ key={action.id}+ onClick={() => {+ const ran = run(action);+ onRun?.(action, ran);+ }}+ ><Zap className="h-4 w-4" /><span className="min-w-0 flex-1 truncate">{action.name}</span>{action.target_name ? (diff --git a/packages/views/locales/en/inbox.json b/packages/views/locales/en/inbox.jsonindex 0379d1807e..48bb4a595a 100644--- a/packages/views/locales/en/inbox.json+++ b/packages/views/locales/en/inbox.json@@ -148,6 +148,10 @@"leaves": "Leaves the Inbox when you move on","filtered": "No longer matches your filters","notification_archived": "Notification archived",+ "changed_status": "Changed to {{status}}",+ "reassigned": "Reassigned to {{name}}",+ "unassigned": "Unassigned",+ "ran_quick_action": "Ran {{name}}","next": "Next","next_tooltip": "Open next: {{title}}"},diff --git a/packages/views/locales/es/inbox.json b/packages/views/locales/es/inbox.jsonindex 650e9c5958..4b712e1cc0 100644--- a/packages/views/locales/es/inbox.json+++ b/packages/views/locales/es/inbox.json@@ -148,6 +148,10 @@"leaves": "Sale de la bandeja al continuar","filtered": "Ya no coincide con tus filtros","notification_archived": "Notificación archivada",+ "changed_status": "Estado cambiado a {{status}}",+ "reassigned": "Reasignada a {{name}}",+ "unassigned": "Desasignada",+ "ran_quick_action": "Se ejecutó {{name}}","next": "Siguiente","next_tooltip": "Abrir la siguiente: {{title}}"},diff --git a/packages/views/locales/fr/inbox.json b/packages/views/locales/fr/inbox.jsonindex 11da7305fe..895d0bb179 100644--- a/packages/views/locales/fr/inbox.json+++ b/packages/views/locales/fr/inbox.json@@ -148,6 +148,10 @@"leaves": "Quitte la boîte de réception quand vous passez à la suite","filtered": "Ne correspond plus à vos filtres","notification_archived": "Notification archivée",+ "changed_status": "Statut passé à {{status}}",+ "reassigned": "Réassigné à {{name}}",+ "unassigned": "Désassigné",+ "ran_quick_action": "Action lancée : {{name}}","next": "Suivante","next_tooltip": "Ouvrir la suivante : {{title}}"},diff --git a/packages/views/locales/ja/inbox.json b/packages/views/locales/ja/inbox.jsonindex c9e088c1f1..6255b2b7f7 100644--- a/packages/views/locales/ja/inbox.json+++ b/packages/views/locales/ja/inbox.json@@ -145,6 +145,10 @@"leaves": "移動するとインボックスから外れます","filtered": "フィルターに一致しなくなりました","notification_archived": "通知をアーカイブしました",+ "changed_status": "{{status}} に変更",+ "reassigned": "{{name}} に再割り当て",+ "unassigned": "割り当て解除",+ "ran_quick_action": "{{name}} を実行","next": "次へ","next_tooltip": "次を開く:{{title}}"},diff --git a/packages/views/locales/ko/inbox.json b/packages/views/locales/ko/inbox.jsonindex a78fca77d1..97666646f7 100644--- a/packages/views/locales/ko/inbox.json+++ b/packages/views/locales/ko/inbox.json@@ -145,6 +145,10 @@"leaves": "다른 곳으로 이동하면 인박스에서 빠집니다","filtered": "더 이상 필터와 일치하지 않음","notification_archived": "알림이 보관됨",+ "changed_status": "상태 변경됨: {{status}}",+ "reassigned": "{{name}}님에게 재할당됨",+ "unassigned": "할당 해제됨",+ "ran_quick_action": "{{name}} 실행됨","next": "다음","next_tooltip": "다음 열기: {{title}}"},diff --git a/packages/views/locales/ru/inbox.json b/packages/views/locales/ru/inbox.jsonindex f8b148386a..410967829b 100644--- a/packages/views/locales/ru/inbox.json+++ b/packages/views/locales/ru/inbox.json@@ -154,6 +154,10 @@"leaves": "Уйдёт из входящих, когда вы перейдёте дальше","filtered": "Больше не подходит под фильтры","notification_archived": "Уведомление в архиве",+ "changed_status": "Статус изменён на {{status}}",+ "reassigned": "Переназначено: {{name}}",+ "unassigned": "Исполнитель снят",+ "ran_quick_action": "Запущено: {{name}}","next": "Следующее","next_tooltip": "Открыть следующее: {{title}}"},diff --git a/packages/views/locales/zh-Hans/inbox.json b/packages/views/locales/zh-Hans/inbox.jsonindex 426527bb05..a1cc64bda6 100644--- a/packages/views/locales/zh-Hans/inbox.json+++ b/packages/views/locales/zh-Hans/inbox.json@@ -145,6 +145,10 @@"leaves": "离开后移出收件箱","filtered": "不再符合筛选","notification_archived": "通知已归档",+ "changed_status": "已改为{{status}}",+ "reassigned": "已改派给 {{name}}",+ "unassigned": "已取消分配",+ "ran_quick_action": "已运行 {{name}}","next": "下一条","next_tooltip": "打开下一条:{{title}}"},diff --git a/packages/views/locales/zh-Hant/inbox.json b/packages/views/locales/zh-Hant/inbox.jsonindex 7dc5fd7803..9291982dad 100644--- a/packages/views/locales/zh-Hant/inbox.json+++ b/packages/views/locales/zh-Hant/inbox.json@@ -145,6 +145,10 @@"leaves": "離開後移出收件箱","filtered": "不再符合篩選","notification_archived": "通知已歸檔",+ "changed_status": "已改為{{status}}",+ "reassigned": "已改派給 {{name}}",+ "unassigned": "已取消分配",+ "ran_quick_action": "已執行 {{name}}","next": "下一條","next_tooltip": "開啟下一條:{{title}}"},