Skip to content

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

Go

feat(inbox): stay on open issue with live agent status after triggering an agent (MUL-9963) (#11294)

Jiayuan Zhangf31506022850
diff --git a/apps/docs/content/docs/inbox.fr.mdx b/apps/docs/content/docs/inbox.fr.mdx
index f60fc439f2..031c40c6be 100644
--- a/apps/docs/content/docs/inbox.fr.mdx
+++ b/apps/docs/content/docs/inbox.fr.mdx
@@ -139,13 +139,13 @@ 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é. 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** (ou `Z`) fait revenir la notification, et **Suivante** (ou `E`) ouvre la ligne suivante. La ligne disparaît dès que vous passez à autre chose. Si c'était la dernière notification de votre boîte de réception, la barre affiche plutôt **Boîte de réception vide** avec le nombre de tâches reportées, et propose **Aller à Mon travail** à la place de **Suivante** ; `E` ouvre la boîte de réception vide. C'est le comportement de **Après l'archivage → Rester sur la tâche**, par défaut ; avec **Ouvrir la suivante**, un changement de votre part qui archive la notification ouverte ouvre aussitôt la ligne suivante, ou la boîte de réception vide, et la confirmation propose **Annuler**.
+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 d'elle-même (vous passez la tâche à `done` depuis son statut, vous déclenchez un agent, 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 vous déclenchez un agent, la barre affiche l'agent en cours d'exécution et précise que la tâche reviendra dans votre boîte de réception en cas de nouvelle activité, tandis que la ligne de la barre latérale se met à jour sur place jusqu'à votre départ. Quand un autre 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** (ou `Z`) fait revenir la notification, et **Suivante** (ou `E`) ouvre la ligne suivante. La ligne disparaît dès que vous passez à autre chose, et la tâche en cours reste visible sous **Vues → En cours**. Si c'était la dernière notification de votre boîte de réception, la barre affiche plutôt **Boîte de réception vide** avec le nombre de tâches reportées, et propose **Aller à Mon travail** à la place de **Suivante** ; `E` ouvre la boîte de réception vide.
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 page de la boîte de réception s'ouvre sur **Boîte de réception vide**. Elle rappelle ce que vous venez de faire, avec **Annuler** (ou `Z`) pour revenir en arrière, et indique combien de tâches sont reportées et quand la prochaine revient. Quand des filtres masquaient le reste de votre boîte de réception, elle indique plutôt combien de notifications restent et propose **Effacer les filtres et continuer**. Revenir en arrière ramène à la tâche. L'archivage et les actions groupées proposent **Annuler**, qui fait revenir les notifications sans changer le statut de la tâche. Les confirmations qui proposent **Annuler**, pour l'archivage, le report comme le désabonnement, restent 10 secondes ; tant que l'une d'elles est affichée, `Z` annule cette dernière action.
Une notification ultérieure sur la tâche revient dans la boîte de réception.
-**Paramètres → Notifications → Sortir de la boîte de réception** contient **Archiver les tâches que vous traitez** (**Jamais**, **Quand vous la terminez**, **Quand vous la terminez ou déclenchez un agent** ou **Personnalisé**), **Après l'archivage** (**Rester sur la tâche** ou **Ouvrir la suivante**) et un lien vers les notifications archivées.
+**Paramètres → Notifications → Sortir de la boîte de réception** contient **Archiver les tâches que vous traitez** (**Jamais**, **Quand vous la terminez**, **Quand vous la terminez ou déclenchez un agent** ou **Personnalisé**) et un lien vers les notifications archivées.
## Affichage et types de notification
diff --git a/apps/docs/content/docs/inbox.ja.mdx b/apps/docs/content/docs/inbox.ja.mdx
index 07de2d7e39..3c696865c0 100644
--- a/apps/docs/content/docs/inbox.ja.mdx
+++ b/apps/docs/content/docs/inbox.ja.mdx
@@ -139,13 +139,13 @@ multica inbox snooze <id>... --until tomorrow # RFC 3339、30m、3h、1d、1w
- 「実行失敗」の通知で、タスクが人に引き継がれるステータスになったとき。対象は `in_review`、`started` カテゴリのカスタムステータス、`done`・`closed` カテゴリのすべてのステータスです。誰がステータスを変えたかにかかわらず、そのタスクの全員分の「実行失敗」の通知がアーカイブされ、上の設定には左右されません。`blocked` は例外です。人に引き継がれはしますが作業は止まったままなので、それまでの失敗の記録はまだ確認する必要があります。
- そのワークスペースのインボックスが 2,000 件を超えたとき。新しい 2,000 件を残し、それより古い通知は既読かどうかにかかわらず、少し後に自動でアーカイブされます。スヌーズから戻った通知やアーカイブから戻した通知は、戻った時点の新しさで数えます。スヌーズ中のタスクの通知は数えず、そのまま残ります。
-アーカイブされた行は、開いているウィンドウからもすぐに消えます。ただし、いま開いている行は別です。その通知がほかの理由でインボックスから外れたとき(ステータスからタスクを `done` にした、別のウィンドウでアーカイブされた、編集でセクションのフィルターに合わなくなった)、行は元の位置でハイライトされたまま残り、インボックスバーに何が起きたかが表示されます。バーの **ステータス**、**担当者**、**クイックアクション** で変更して通知がアーカイブされたときは、「進行中 に変更 · 通知をアーカイブしました」のようにその操作が示され、これらの操作はバーに残るので続けて変更できます。**元に戻す**(または `Z`)で通知が戻り、**次へ**(または `E`)で次の行が開きます。行が消えるのは、ほかへ移ったときです。それがインボックスの最後の通知だった場合、バーには代わりに **インボックスは空です** とスヌーズ中のタスク数が表示され、**次へ** の代わりに **自分の作業へ** が出ます。`E` で空になったインボックスが開きます。これは既定の **アーカイブ後 → このタスクに留まる** の動きです。**次の通知を開く** にすると、あなたの操作で開いている通知がアーカイブされたとき、すぐ次の行(なければ空になったインボックス)が開き、確認メッセージに **元に戻す** が出ます。
+アーカイブされた行は、開いているウィンドウからもすぐに消えます。ただし、いま開いている行は別です。その通知が自動でインボックスから外れたとき(ステータスからタスクを `done` にした、エージェントを起動した、別のウィンドウでアーカイブされた、編集でセクションのフィルターに合わなくなった)、行は元の位置でハイライトされたまま残り、インボックスバーに何が起きたかが表示されます。エージェントを起動したときは、バーに実行中のエージェントと「新しい動きがあるとインボックスに戻ります」が表示され、サイドバーの行も移動するまでその場で更新されます。バーの **ステータス**、**担当者**、**クイックアクション** で変更して通知がアーカイブされたときは、「進行中 に変更 · 通知をアーカイブしました」のようにその操作が示され、これらの操作はバーに残るので続けて変更できます。**元に戻す**(または `Z`)で通知が戻り、**次へ**(または `E`)で次の行が開きます。行が消えるのはほかへ移ったときで、実行中のタスクは **ビュー → 実行中** で引き続き確認できます。それがインボックスの最後の通知だった場合、バーには代わりに **インボックスは空です** とスヌーズ中のタスク数が表示され、**次へ** の代わりに **自分の作業へ** が出ます。`E` で空になったインボックスが開きます。
開いている行を自分で処理したとき(インボックスバー、その行、ホバーカード、その行を含む一括操作)は、代わりに次の行が開きます。残りがなければ、インボックスのページが開き、**インボックスは空です** と表示されます。直前の操作が示されて **元に戻す**(または `Z`)で取り戻せるほか、スヌーズ中のタスク数と次に戻る時刻が表示されます。フィルターでほかの通知が隠れているだけのときは、残りの件数と **フィルターを解除して続ける** が代わりに表示されます。戻るとタスクに戻れます。アーカイブと一括操作の確認には **元に戻す** があり、通知は戻りますが、タスクのステータスはそのままです。**元に戻す** のある確認メッセージ(アーカイブ、スヌーズ、購読解除のいずれも)は 10 秒間表示され、表示中に `Z` を押すとその操作を取り消せます。
その後に届いた通知は、再びインボックスに入ります。
-**設定 → 通知 → インボックスから外れるとき** には、**自分が対応したタスクをアーカイブ**(**しない**、**完了したとき**、**完了またはエージェントを起動したとき**、**カスタム**)と **アーカイブ後**(**このタスクに留まる** または **次の通知を開く**)、アーカイブ済みの通知へのリンクがあります。
+**設定 → 通知 → インボックスから外れるとき** には、**自分が対応したタスクをアーカイブ**(**しない**、**完了したとき**、**完了またはエージェントを起動したとき**、**カスタム**)とアーカイブ済みの通知へのリンクがあります。
## 表示と通知タイプ
diff --git a/apps/docs/content/docs/inbox.ko.mdx b/apps/docs/content/docs/inbox.ko.mdx
index d4280dc959..4a47e6d37b 100644
--- a/apps/docs/content/docs/inbox.ko.mdx
+++ b/apps/docs/content/docs/inbox.ko.mdx
@@ -139,13 +139,13 @@ multica inbox snooze <id>... --until tomorrow # RFC 3339, 30m, 3h, 1d, 1w; uns
- "실행 실패함" 알림이고, 태스크가 사람에게 넘어가는 상태가 될 때. 해당 상태는 `in_review`, `started` 카테고리의 사용자 지정 상태, `done`·`closed` 카테고리의 모든 상태입니다. 누가 상태를 바꿨는지와 관계없이 그 태스크의 모든 사람의 "실행 실패함" 알림이 보관되며, 위 설정의 영향을 받지 않습니다. `blocked`는 예외입니다. 사람에게 넘어가기는 하지만 작업이 여전히 막혀 있으므로 지난 실패 기록을 계속 확인해야 합니다.
- 그 워크스페이스의 인박스가 알림 2,000개를 넘을 때. 최신 2,000개를 남기고, 그보다 오래된 알림은 읽음 여부와 관계없이 잠시 후 자동으로 보관됩니다. 미루기에서 돌아온 알림과 보관함에서 복원한 알림은 돌아온 시점을 기준으로 셉니다. 미룬 태스크의 알림은 개수에 포함되지 않으며 그대로 남습니다.
-보관된 행은 열려 있는 창에서도 바로 사라집니다. 단, 지금 열어 둔 행은 예외입니다. 그 알림이 다른 이유로 인박스에서 빠지면(상태에서 태스크를 `done`으로 바꿨거나, 다른 창에서 보관했거나, 편집으로 섹션 필터에 더 이상 맞지 않게 된 경우) 행은 제자리에서 강조된 채 남고, 인박스 바에 무슨 일이 있었는지 표시됩니다. 바의 **상태**, **담당자**, **퀵 액션**으로 바꿔서 알림이 보관되면 '상태 변경됨: 진행 중 · 알림이 보관됨'처럼 그 동작이 표시되고, 이 동작들은 바에 그대로 남아 이어서 바꿀 수 있습니다. **실행 취소**(또는 `Z`)로 알림을 되돌리고, **다음**(또는 `E`)으로 다음 행을 엽니다. 행은 다른 곳으로 이동할 때 사라집니다. 그것이 인박스의 마지막 알림이었다면 바에는 대신 **인박스가 비었습니다**와 미뤄 둔 태스크 수가 표시되고, **다음** 대신 **내 작업으로 이동**이 나옵니다. `E`를 누르면 비워진 인박스가 열립니다. 이는 기본값인 **보관한 뒤 → 이 태스크에 머무르기**의 동작입니다. **다음 알림 열기**를 고르면 내 동작으로 열어 둔 알림이 보관될 때 바로 다음 행(없으면 비워진 인박스)이 열리고, 확인 알림에 **실행 취소**가 나옵니다.
+보관된 행은 열려 있는 창에서도 바로 사라집니다. 단, 지금 열어 둔 행은 예외입니다. 그 알림이 자동으로 인박스에서 빠지면(상태에서 태스크를 `done`으로 바꿨거나, 에이전트를 실행했거나, 다른 창에서 보관했거나, 편집으로 섹션 필터에 더 이상 맞지 않게 된 경우) 행은 제자리에서 강조된 채 남고, 인박스 바에 무슨 일이 있었는지 표시됩니다. 에이전트를 실행하면 바에 실행 중인 에이전트와 함께 새 활동이 있으면 인박스로 돌아온다는 안내가 표시되고, 사이드바 행도 이동할 때까지 제자리에서 갱신됩니다. 바의 **상태**, **담당자**, **퀵 액션**으로 바꿔서 알림이 보관되면 '상태 변경됨: 진행 중 · 알림이 보관됨'처럼 그 동작이 표시되고, 이 동작들은 바에 그대로 남아 이어서 바꿀 수 있습니다. **실행 취소**(또는 `Z`)로 알림을 되돌리고, **다음**(또는 `E`)으로 다음 행을 엽니다. 행은 다른 곳으로 이동할 때 사라지며, 실행 중인 태스크는 **뷰 → 작업 중**에서 계속 확인할 수 있습니다. 그것이 인박스의 마지막 알림이었다면 바에는 대신 **인박스가 비었습니다**와 미뤄 둔 태스크 수가 표시되고, **다음** 대신 **내 작업으로 이동**이 나옵니다. `E`를 누르면 비워진 인박스가 열립니다.
열어 둔 행을 직접 처리하면(인박스 바, 그 행, 호버 카드, 그 행을 포함한 일괄 작업) 대신 다음 행이 열립니다. 남은 행이 없으면 인박스 페이지가 열리고 **인박스가 비었습니다**가 표시됩니다. 방금 한 동작이 표시되고 **실행 취소**(또는 `Z`)로 되돌릴 수 있으며, 미뤄 둔 태스크 수와 다음으로 돌아오는 시각이 표시됩니다. 필터 때문에 나머지 알림이 가려진 경우에는 남은 알림 수와 **필터 지우고 계속하기**가 대신 표시됩니다. 뒤로 가면 태스크로 돌아갑니다. 보관과 일괄 작업의 확인에는 **실행 취소**가 있으며, 알림은 돌아오고 태스크 상태는 그대로 유지됩니다. **실행 취소**가 있는 확인 알림(보관, 미루기, 구독 해제 모두)은 10초 동안 표시되며, 표시되는 동안 `Z`를 누르면 그 동작을 취소합니다.
이후 그 태스크에 새 알림이 오면 다시 인박스에 들어옵니다.
-**설정 → 알림 → 인박스에서 빠지는 경우**에 **내가 처리한 태스크 보관**(**안 함**, **완료했을 때**, **완료하거나 에이전트를 실행했을 때**, **사용자 지정**)과 **보관한 뒤**(**이 태스크에 머무르기** 또는 **다음 알림 열기**), 보관된 알림으로 가는 링크가 있습니다.
+**설정 → 알림 → 인박스에서 빠지는 경우**에 **내가 처리한 태스크 보관**(**안 함**, **완료했을 때**, **완료하거나 에이전트를 실행했을 때**, **사용자 지정**)과 보관된 알림으로 가는 링크가 있습니다.
## 표시와 알림 유형
diff --git a/apps/docs/content/docs/inbox.mdx b/apps/docs/content/docs/inbox.mdx
index bb1704013a..f2a42500b8 100644
--- a/apps/docs/content/docs/inbox.mdx
+++ b/apps/docs/content/docs/inbox.mdx
@@ -139,13 +139,13 @@ 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. 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** (or `Z`) brings the notification back, and **Next** (or `E`) opens the next row. The row leaves once you move on. When it was the last notification in your inbox, the bar says **Inbox cleared** instead, with how many issues are snoozed, and offers **Go to My work** in place of **Next**; `E` opens the cleared inbox. That is **After archiving → Stay on the issue**, the default; with **Open the next one**, a change you make that archives the open notification opens the next row, or the cleared inbox, right away, and the confirmation offers **Undo**.
+Open windows drop an archived row right away, except the one you have open. When its notification leaves the inbox on its own (you set the issue to `done` from its status, trigger an agent on it, 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 you trigger an agent, the bar shows the running agent and notes that the issue returns to your inbox on new activity, while the sidebar row updates in place until you move on. When another 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** (or `Z`) brings the notification back, and **Next** (or `E`) opens the next row. The row leaves once you move on, and any running issue stays visible under **Views → Working**. When it was the last notification in your inbox, the bar says **Inbox cleared** instead, with how many issues are snoozed, and offers **Go to My work** in place of **Next**; `E` opens the cleared inbox.
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 inbox page opens on **Inbox cleared**. It names what you just did, with **Undo** (or `Z`) to bring it back, and shows how many issues are snoozed and when the next one returns. When filters hid the rest of your inbox, it says how many notifications are left and offers **Clear filters and continue** instead. Going back returns to the issue. Archiving and the bulk actions confirm with **Undo**, which brings the notifications back and leaves the issue's status as it is. Confirmations that offer **Undo**, for archiving, snoozing and unsubscribing alike, stay for 10 seconds, and while one shows, `Z` undoes that latest action.
A later notification on the issue lands in the inbox again.
-**Settings → Notifications → Leaving the Inbox** holds **Archive issues you handle** (**Never**, **When you complete it**, **When you complete it or trigger an agent**, or **Custom**), **After archiving** (**Stay on the issue** or **Open the next one**), and a link to the archived notifications.
+**Settings → Notifications → Leaving the Inbox** holds **Archive issues you handle** (**Never**, **When you complete it**, **When you complete it or trigger an agent**, or **Custom**) and a link to the archived notifications.
## Display and notification types
diff --git a/apps/docs/content/docs/inbox.zh-Hant.mdx b/apps/docs/content/docs/inbox.zh-Hant.mdx
index 436a23a80e..73304aa80b 100644
--- a/apps/docs/content/docs/inbox.zh-Hant.mdx
+++ b/apps/docs/content/docs/inbox.zh-Hant.mdx
@@ -139,13 +139,13 @@ multica inbox snooze <id>... --until tomorrow # RFC 3339、30m、3h、1d、1w
- 它是"執行失敗"通知,且任務進入交回給人的狀態:`in_review`、`started` 分類下的自定義狀態,或 `done`、`closed` 分類下的任一狀態。這會歸檔所有人在該任務上的"執行失敗"通知,不論是誰改的狀態,也不受上面的開關影響。`blocked` 例外:它同樣交回給人,但工作還卡著,之前的失敗記錄還要看。
- 你在該工作區的收件箱超過 2,000 條通知。收件箱保留最新的 2,000 條,隨後自動歸檔更早的通知,無論是否已讀。從延後中回來或從歸檔中還原的通知,按回來的時間算作新通知。已延後任務上的通知不計入,也不會被歸檔。
-開著的視窗會立即移除已歸檔的列,但你正開著的那一列除外。它的通知因為其他原因離開收件箱時(你在狀態裡把任務改為 `done`、別的視窗歸檔了它,或修改後不再符合分區的篩選),這一列會在原位保持高亮,收件箱列會說明發生了什麼。在列裡改**狀態**、**負責人**或執行**快捷操作**後通知被歸檔時,列會寫明是哪一項,例如「已改為進行中 · 通知已歸檔」,這幾個操作也留在列裡,可以接著改。**復原**(或按 `Z`)讓通知回來,**下一條**(或按 `E`)開啟下一列。你離開之後,這一列才會移出。如果這是收件箱裡的最後一條通知,列會改為顯示**收件箱已清空**和延後中的任務數,用**前往我的工作**代替**下一條**;按 `E` 會開啟已清空的收件箱。這是**歸檔後 → 停在目前任務**(預設)的行為;選**打開下一條**時,你的操作歸檔了正開著的通知後,會直接開啟下一列(沒有下一列時開啟已清空的收件箱),提示裡可以**復原**。
+開著的視窗會立即移除已歸檔的列,但你正開著的那一列除外。它的通知自動離開收件箱時(你在狀態裡把任務改為 `done`、觸發了 AI 代理、別的視窗歸檔了它,或修改後不再符合分區的篩選),這一列會在原位保持高亮,收件箱列會說明發生了什麼。觸發 AI 代理時,收件箱列會顯示正在工作的 AI 代理並提示「有新動態時會回到收件箱」,側邊欄列也會原位更新直到你離開。在列裡改**狀態**、**負責人**或執行**快捷操作**後通知被歸檔時,列會寫明是哪一項,例如「已改為進行中 · 通知已歸檔」,這幾個操作也留在列裡,可以接著改。**復原**(或按 `Z`)讓通知回來,**下一條**(或按 `E`)開啟下一列。你離開之後,這一列才會移出,仍在執行中的任務會繼續顯示在**檢視 → 執行中**裡。如果這是收件箱裡的最後一條通知,列會改為顯示**收件箱已清空**和延後中的任務數,用**前往我的工作**代替**下一條**;按 `E` 會開啟已清空的收件箱。
如果是你自己把正開著的這一列處理掉(在收件箱列、它所在的列、懸停卡片,或包含它的批次操作裡),會直接開啟下一列;沒有剩下的列時,會開啟收件箱頁面,顯示**收件箱已清空**:寫明你剛才的操作,可以**復原**(或按 `Z`)把它找回,並顯示延後中的任務數和下一條回來的時間。如果是篩選隱藏了收件箱裡的其餘通知,會改為說明還剩多少條,並提供**清除篩選,繼續處理**。返回上一頁可以回到任務。歸檔和批次操作的提示裡都可以**復原**:通知會回來,任務的狀態保持不變。帶**復原**的提示(歸檔、延後、取消訂閱都一樣)會停留 10 秒;提示還在時,按 `Z` 復原這次操作。
之後該任務再有新通知,會重新進入收件箱。
-**設定 → 通知 → 移出收件箱**裡有**自動歸檔我處理過的任務**(**從不**、**完成任務時**、**完成或觸發 AI 代理時**、**自訂**)和**歸檔後**(**停在目前任務**或**打開下一條**),並提供已歸檔通知的入口。
+**設定 → 通知 → 移出收件箱**裡有**自動歸檔我處理過的任務**(**從不**、**完成任務時**、**完成或觸發 AI 代理時**、**自訂**),並提供已歸檔通知的入口。
## 顯示與通知類型
diff --git a/apps/docs/content/docs/inbox.zh.mdx b/apps/docs/content/docs/inbox.zh.mdx
index d63040cfb3..5fc798784d 100644
--- a/apps/docs/content/docs/inbox.zh.mdx
+++ b/apps/docs/content/docs/inbox.zh.mdx
@@ -139,13 +139,13 @@ multica inbox snooze <id>... --until tomorrow # RFC 3339、30m、3h、1d、1w
- 它是"运行失败"通知,且任务进入交回给人的状态:`in_review`、`started` 分类下的自定义状态,或 `done`、`closed` 分类下的任一状态。这会归档所有人在该任务上的"运行失败"通知,不论是谁改的状态,也不受上面的开关影响。`blocked` 例外:它同样交回给人,但工作还卡着,之前的失败记录还要看。
- 你在该工作区的收件箱超过 2,000 条通知。收件箱保留最新的 2,000 条,随后自动归档更早的通知,无论是否已读。从延后中回来或从归档中还原的通知,按回来的时间算作新通知。已延后任务上的通知不计入,也不会被归档。
-打开着的窗口会立即移除已归档的行,但你正打开的那一行除外。它的通知因为其他原因离开收件箱时(你在状态里把任务改为 `done`、别的窗口归档了它,或修改后不再符合分区的筛选),这一行会在原位保持高亮,收件箱栏会说明发生了什么。在栏里改**状态**、**负责人**或运行**快捷操作**后通知被归档时,栏会写明是哪一项,比如“已改为进行中 · 通知已归档”,这几个操作也留在栏里,可以接着改。**撤销**(或按 `Z`)让通知回来,**下一条**(或按 `E`)打开下一行。你离开之后,这一行才会移出。如果这是收件箱里的最后一条通知,栏会改为显示**收件箱已清空**和延后中的任务数,用**前往我的工作**代替**下一条**;按 `E` 会打开已清空的收件箱。这是**归档后 → 停在当前任务**(默认)的行为;选**打开下一条**时,你的操作归档了正打开的通知后,会直接打开下一行(没有下一行时打开已清空的收件箱),提示里可以**撤销**。
+打开着的窗口会立即移除已归档的行,但你正打开的那一行除外。它的通知自动离开收件箱时(你在状态里把任务改为 `done`、触发了智能体、别的窗口归档了它,或修改后不再符合分区的筛选),这一行会在原位保持高亮,收件箱栏会说明发生了什么。触发智能体时,栏会显示正在工作的智能体并提示"有新动态时会回到收件箱",侧边栏行也会原位更新直到你离开。在栏里改**状态**、**负责人**或运行**快捷操作**后通知被归档时,栏会写明是哪一项,比如"已改为进行中 · 通知已归档",这几个操作也留在栏里,可以接着改。**撤销**(或按 `Z`)让通知回来,**下一条**(或按 `E`)打开下一行。你离开之后,这一行才会移出,仍在运行中的任务会继续显示在**视图 → 运行中**里。如果这是收件箱里的最后一条通知,栏会改为显示**收件箱已清空**和延后中的任务数,用**前往我的工作**代替**下一条**;按 `E` 会打开已清空的收件箱。
如果是你自己把正打开的这一行处理掉(在收件箱栏、它所在的行、悬停卡片,或包含它的批量操作里),会直接打开下一行;没有剩下的行时,会打开收件箱页面,显示**收件箱已清空**:写明你刚才的操作,可以**撤销**(或按 `Z`)把它找回,并显示延后中的任务数和下一条回来的时间。如果是筛选隐藏了收件箱里的其余通知,会改为说明还剩多少条,并提供**清除筛选,继续处理**。返回上一页可以回到任务。归档和批量操作的提示里都可以**撤销**:通知会回来,任务的状态保持不变。带**撤销**的提示(归档、延后、取消订阅都一样)会停留 10 秒;提示还在时,按 `Z` 撤销这次操作。
之后该任务再有新通知,会重新进入收件箱。
-**设置 → 通知 → 移出收件箱**里有**自动归档我处理过的任务**(**从不**、**完成任务时**、**完成或触发智能体时**、**自定义**)和**归档后**(**停在当前任务**或**打开下一条**),并提供已归档通知的入口。
+**设置 → 通知 → 移出收件箱**里有**自动归档我处理过的任务**(**从不**、**完成任务时**、**完成或触发智能体时**、**自定义**),并提供已归档通知的入口。
## 显示与通知类型
diff --git a/packages/core/inbox/auto-archive.test.ts b/packages/core/inbox/auto-archive.test.ts
index d01a4ec9a5..e297abeb2e 100644
--- a/packages/core/inbox/auto-archive.test.ts
+++ b/packages/core/inbox/auto-archive.test.ts
@@ -1,12 +1,25 @@
import { describe, expect, it } from "vitest";
-import { noteInboxAutoArchive, noteInboxBarAction, takeInboxAutoArchive, takeInboxBarAction } from "./auto-archive";
+import {
+ noteInboxAutoArchive,
+ noteInboxBarAction,
+ takeInboxAutoArchive,
+ takeInboxAutoArchiveReason,
+ takeInboxBarAction,
+} from "./auto-archive";
describe("inbox auto-archive records", () => {
- it.each(["issue_status_terminal", "actor_acted"])("records an archive the user caused: %s", (reason) => {
- noteInboxAutoArchive({ issue_id: `issue-${reason}`, reason }, 1_000);
- expect(takeInboxAutoArchive(`issue-${reason}`, 2_000)).toBe(true);
- expect(takeInboxAutoArchive(`issue-${reason}`, 2_000)).toBe(false);
- });
+ it.each(["issue_status_terminal", "actor_acted", "agent_triggered"] as const)(
+ "records an archive the user caused: %s",
+ (reason) => {
+ noteInboxAutoArchive({ issue_id: `issue-${reason}`, reason }, 1_000);
+ expect(takeInboxAutoArchiveReason(`issue-${reason}`, 2_000)).toBe(reason);
+ expect(takeInboxAutoArchiveReason(`issue-${reason}`, 2_000)).toBeNull();
+
+ noteInboxAutoArchive({ issue_id: `issue-bool-${reason}`, reason }, 1_000);
+ expect(takeInboxAutoArchive(`issue-bool-${reason}`, 2_000)).toBe(true);
+ expect(takeInboxAutoArchive(`issue-bool-${reason}`, 2_000)).toBe(false);
+ },
+ );
it("ignores batches without a reason the user caused", () => {
noteInboxAutoArchive({ issue_id: "issue-a" }, 1_000);
diff --git a/packages/core/inbox/auto-archive.ts b/packages/core/inbox/auto-archive.ts
index aec231b4b2..eca61defc3 100644
--- a/packages/core/inbox/auto-archive.ts
+++ b/packages/core/inbox/auto-archive.ts
@@ -5,14 +5,25 @@ import type { IssueAssigneeType } from "../types";
* handled them (e.g. completed the issue or triggered an agent,
* `inbox:batch-archived` with one of these reasons). The Inbox reads this to
* tell such an archive apart from any other way the open notification left,
- * such as another window archiving it.
+ * such as another window archiving it, and to distinguish triggering an agent
+ * (which stays in place so the user sees the run start) from completing an
+ * issue or other handled edits.
*/
-const AUTO_ARCHIVE_REASONS = new Set(["issue_status_terminal", "actor_acted"]);
+export type InboxAutoArchiveReason =
+ | "issue_status_terminal"
+ | "actor_acted"
+ | "agent_triggered";
+
+const AUTO_ARCHIVE_REASONS = new Set<string>([
+ "issue_status_terminal",
+ "actor_acted",
+ "agent_triggered",
+]);
/** The archive lands within moments of the action; anything older is stale. */
const AUTO_ARCHIVE_TTL_MS = 30_000;
-const archivedAt = new Map<string, number>();
+const archivedEntries = new Map<string, { at: number; reason: InboxAutoArchiveReason }>();
/** Record an `inbox:batch-archived` payload, if it is an archive the user caused. */
export function noteInboxAutoArchive(
@@ -20,17 +31,28 @@ export function noteInboxAutoArchive(
now = Date.now(),
): void {
if (!payload.issue_id || !payload.reason || !AUTO_ARCHIVE_REASONS.has(payload.reason)) return;
- for (const [issueId, at] of archivedAt) {
- if (now - at > AUTO_ARCHIVE_TTL_MS) archivedAt.delete(issueId);
+ for (const [issueId, entry] of archivedEntries) {
+ if (now - entry.at > AUTO_ARCHIVE_TTL_MS) archivedEntries.delete(issueId);
}
- archivedAt.set(payload.issue_id, now);
+ archivedEntries.set(payload.issue_id, {
+ at: now,
+ reason: payload.reason as InboxAutoArchiveReason,
+ });
+}
+
+/** The user-caused reason that just archived `issueId`'s notifications, if any. Consumes the record. */
+export function takeInboxAutoArchiveReason(
+ issueId: string,
+ now = Date.now(),
+): InboxAutoArchiveReason | null {
+ const entry = archivedEntries.get(issueId);
+ archivedEntries.delete(issueId);
+ return entry && now - entry.at <= AUTO_ARCHIVE_TTL_MS ? entry.reason : null;
}
/** Whether the user's own action just archived `issueId`'s notifications. Consumes the record. */
export function takeInboxAutoArchive(issueId: string, now = Date.now()): boolean {
- const at = archivedAt.get(issueId);
- archivedAt.delete(issueId);
- return at !== undefined && now - at <= AUTO_ARCHIVE_TTL_MS;
+ return takeInboxAutoArchiveReason(issueId, now) !== null;
}
/**
diff --git a/packages/core/notification-preferences/patch.ts b/packages/core/notification-preferences/patch.ts
index fceaac4126..09c3d4dd9f 100644
--- a/packages/core/notification-preferences/patch.ts
+++ b/packages/core/notification-preferences/patch.ts
@@ -30,7 +30,6 @@ const PREFERENCE_DEFAULTS: { [K in PreferenceKey]-?: NonNullable<NotificationPre
auto_archive_on_dates: "muted",
auto_archive_on_labels: "muted",
others_issues: "key_updates",
- after_auto_archive: "stay",
};
const PREFERENCE_KEYS = Object.keys(PREFERENCE_DEFAULTS) as PreferenceKey[];
diff --git a/packages/core/types/events.ts b/packages/core/types/events.ts
index 361afe1b44..b0fd203cc1 100644
--- a/packages/core/types/events.ts
+++ b/packages/core/types/events.ts
@@ -277,7 +277,8 @@ export interface InboxBatchArchivedPayload {
issue_id?: string;
/**
* Why the server archived them on its own: "issue_status_terminal" when the
- * recipient completed the issue, "actor_acted" when they commented on it,
+ * recipient completed the issue, "agent_triggered" when their action started
+ * or steered an agent on it, or "actor_acted" when they commented on it,
* changed its status or reassigned it. Other values may appear; absent for user-requested batches.
*/
reason?: string;
diff --git a/packages/core/types/index.ts b/packages/core/types/index.ts
index 81a2cc46f1..e5a6c66c57 100644
--- a/packages/core/types/index.ts
+++ b/packages/core/types/index.ts
@@ -147,7 +147,7 @@ export type {
PluginTokenIssue,
} from "./plugin";
export type { InboxItem, InboxSeverity, InboxItemType, InboxWorkspaceUnread, ArchivedInboxPage, ArchivedInboxFacets, SnoozedInboxIssue } from "./inbox";
-export type { AfterAutoArchiveValue, AutoArchiveKey, NotificationGroupKey, NotificationGroupValue, NotificationPreferences, NotificationPreferenceResponse, OthersIssuesValue } from "./notification-preference";
+export type { AutoArchiveKey, NotificationGroupKey, NotificationGroupValue, NotificationPreferences, NotificationPreferenceResponse, OthersIssuesValue } from "./notification-preference";
export type { Comment, CommentType, CommentAuthorType, CommentSupplementReceipt, CommentSupplementStatus, CommentTriggerPreview, CommentTriggerPreviewAgent, CommentTriggerSource, CommentTriggerOutcome, CommentTriggerStatus, Reaction } from "./comment";
export type { Label, LabelResourceType, CreateLabelRequest, UpdateLabelRequest, ListLabelsResponse, IssueLabelsResponse, ResourceLabelsResponse } from "./label";
export type { IssueProperty, IssuePropertyType, ScalarIssuePropertyType, ListIssuePropertyType, IssuePropertyOption, IssuePropertyConfig, IssuePropertyValue, IssuePropertyValues, CreatePropertyRequest, UpdatePropertyRequest, ListPropertiesResponse, IssuePropertiesResponse, IssuePropertyActorKind, IssuePropertyActorRef, PropertyFilterOp, PropertyOperatorFilter, PropertyFilterValue } from "./property";
diff --git a/packages/core/types/notification-preference.ts b/packages/core/types/notification-preference.ts
index 151d6b5e7e..fbbc83574d 100644
--- a/packages/core/types/notification-preference.ts
+++ b/packages/core/types/notification-preference.ts
@@ -39,15 +39,8 @@ export type NotificationGroupValue = "all" | "muted";
*/
export type OthersIssuesValue = "all" | "key_updates";
-/**
- * Where the Inbox goes when the notification you are reading is archived
- * because you handled its issue. Missing means "stay".
- */
-export type AfterAutoArchiveValue = "stay" | "next";
-
export type NotificationPreferences = Partial<Record<NotificationGroupKey, NotificationGroupValue>> & {
others_issues?: OthersIssuesValue;
- after_auto_archive?: AfterAutoArchiveValue;
};
export interface NotificationPreferenceResponse {
diff --git a/packages/views/inbox/components/inbox-bar.tsx b/packages/views/inbox/components/inbox-bar.tsx
index ac57e9e15f..88653a3ef1 100644
--- a/packages/views/inbox/components/inbox-bar.tsx
+++ b/packages/views/inbox/components/inbox-bar.tsx
@@ -123,11 +123,11 @@ function InboxBarReason({ item }: { item: InboxItem }) {
/** What happened to a settled notification, before the bar's actions. */
export function InboxBarStatus({ icon, label }: { icon: ReactNode; label: ReactNode }) {
return (
- <span className="mr-1 flex min-w-0 flex-1 items-center gap-1 text-caption text-muted-foreground">
+ <span className="mr-1 flex min-w-0 flex-1 items-center gap-1.5 text-caption text-muted-foreground">
<span aria-hidden className="flex shrink-0 [&_svg]:size-3.5">
{icon}
</span>
- <span className="truncate">{label}</span>
+ <span className="min-w-0 truncate">{label}</span>
</span>
);
}
diff --git a/packages/views/inbox/components/inbox-kept-actions.tsx b/packages/views/inbox/components/inbox-kept-actions.tsx
index 46c63716d0..bbc69dd5e7 100644
--- a/packages/views/inbox/components/inbox-kept-actions.tsx
+++ b/packages/views/inbox/components/inbox-kept-actions.tsx
@@ -11,6 +11,7 @@ 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 type { IssueAgentState } from "../../issues/surface/use-issue-agent-state";
import { useStatusLabel } from "../../issues/utils/status-label";
import { formatSnoozeTime } from "./inbox-snooze-time";
import { getInboxDisplayTitle, isAutopilotQuotaNotice } from "./inbox-display";
@@ -23,6 +24,7 @@ import { useInboxUndoShortcut } from "./use-inbox-shortcut";
*/
export function useKeptInboxRowText(wsId: string) {
const { t } = useT("inbox");
+ const { t: tIssues } = useT("issues");
const locale = useLocale();
const { categoryOf } = useIssueStatuses(wsId);
const statusLabelOf = useStatusLabel(wsId);
@@ -35,6 +37,22 @@ export function useKeptInboxRowText(wsId: string) {
const category = categoryOf(status);
return category === "done" || category === "closed" ? statusLabelOf(status) : null;
};
+ const agentLabel = (agents: IssueAgentState) => {
+ if (!agents || agents.agentIds.length === 0) return null;
+ if (agents.agentIds.length === 1) {
+ return tIssues(
+ ($) => (agents.running ? $.agent_live.is_working : $.agent_live.is_queued),
+ { name: getActorName("agent", agents.agentIds[0] ?? "") },
+ );
+ }
+ return tIssues(
+ ($) =>
+ agents.running
+ ? $.agent_activity.hover_header
+ : $.agent_activity.hover_header_queued,
+ { count: agents.agentIds.length },
+ );
+ };
const backAt = (item: InboxItem) =>
item.snoozed_until
? t(($) => $.snooze.back_at, { time: formatSnoozeTime(new Date(item.snoozed_until), new Date(), locale) })
@@ -52,12 +70,17 @@ export function useKeptInboxRowText(wsId: string) {
}
};
return {
- line: (kept: KeptInboxRow) => {
+ isFinished: (item: InboxItem) => finished(item) !== null,
+ agentLabel,
+ line: (kept: KeptInboxRow, agents?: IssueAgentState) => {
if (kept.reason === "filtered") return t(($) => $.kept.filtered);
- const why = kept.reason === "snoozed" ? backAt(kept.item) : (finished(kept.item) ?? t(($) => $.kept.archived));
+ const why =
+ kept.reason === "snoozed"
+ ? backAt(kept.item)
+ : (finished(kept.item) ?? agentLabel(agents ?? null) ?? t(($) => $.kept.archived));
return `${why} · ${t(($) => $.kept.leaves)}`;
},
- /** `cause` is the bar action that archived it (`useMoveOnAfterAutoArchive`). */
+ /** `cause` is the bar action that archived it (`useAutoArchiveCause`). */
notice: (kept: KeptInboxRow, cause?: InboxBarAction | null) => {
if (kept.reason === "snoozed") return backAt(kept.item);
const why = (cause && kept.reason === "archived" ? did(cause) : null) ?? finished(kept.item);
@@ -105,9 +128,9 @@ export function InboxKeptActions({
icon ?? (inboxCleared ? <CheckCircle2 className="text-success" /> : <Archive />);
const statusLabel = inboxCleared ? (
<span className="flex min-w-0 items-center gap-1.5 truncate">
- <span className="font-medium text-foreground">{t(($) => $.zero.cleared_title)}</span>
+ <span className="shrink-0 font-medium text-foreground">{t(($) => $.zero.cleared_title)}</span>
<span aria-hidden className="text-faint-foreground">·</span>
- <span className="truncate">{label}</span>
+ <span className="min-w-0 truncate">{label}</span>
{snoozedCount > 0 && onSnoozedClick && (
<>
<span aria-hidden className="text-faint-foreground @max-[34rem]/inbox-bar:hidden">·</span>
diff --git a/packages/views/inbox/components/inbox-page.tsx b/packages/views/inbox/components/inbox-page.tsx
index 192472b2fd..02e9a64284 100644
--- a/packages/views/inbox/components/inbox-page.tsx
+++ b/packages/views/inbox/components/inbox-page.tsx
@@ -114,7 +114,7 @@ import { InboxEmptyState } from "./inbox-empty-state";
import { InboxKeptActions, useKeptInboxRowText } from "./inbox-kept-actions";
import { inboxListLoad, useFilteredInboxRows } from "./use-filtered-inbox-rows";
import { useKeptOpenInboxRow } from "./use-kept-open-inbox-row";
-import { useMoveOnAfterAutoArchive } from "./use-move-on-after-auto-archive";
+import { useAutoArchiveCause } from "./use-auto-archive-cause";
import {
clearedLabelForItem,
collectBatchArchiveIds,
@@ -703,24 +703,10 @@ export function InboxPage() {
void restoreInbox(id);
};
- // An issue's bar (`IssueInboxBar`) says, and moves on, when its row left
- // the Inbox on its own; the page does for a notification without an issue.
+ // An issue's bar (`IssueInboxBar`) says when its row left the Inbox on its
+ // own; the page does for a notification without an issue.
const settledNotice = settledRow && !settledRow.item.issue_id ? settledRow : null;
- const settledCause = useMoveOnAfterAutoArchive({
- settled: settledNotice,
- next: settledNotice ? nextInboxRow(listedItems, settledNotice.key) : null,
- onNext: () => {
- if (!settledNotice) return;
- advanceSelectionPast(settledNotice.item.id, listedItems, {
- kind: "archived",
- itemId: settledNotice.item.id,
- key: settledNotice.key,
- label: clearedLabelForItem(settledNotice.item),
- href: inboxRowHref(wsPaths, settledNotice.item),
- clearedAt: Date.now(),
- });
- },
- });
+ const { cause: settledCause } = useAutoArchiveCause(settledNotice);
const unsubscribable = useInboxUnsubscribable(wsId);
const unsubscribeArchive = useUnsubscribeArchive();
diff --git a/packages/views/inbox/components/use-auto-archive-cause.test.tsx b/packages/views/inbox/components/use-auto-archive-cause.test.tsx
new file mode 100644
index 0000000000..88a861a437
--- /dev/null
+++ b/packages/views/inbox/components/use-auto-archive-cause.test.tsx
@@ -0,0 +1,108 @@
+import { afterEach, describe, expect, it } from "vitest";
+import { cleanup, renderHook } from "@testing-library/react";
+import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
+import type { ReactNode } from "react";
+import { noteInboxAutoArchive, noteInboxBarAction } from "@multica/core/inbox/auto-archive";
+import type { KeptInboxRow } from "@multica/core/inbox/open-row";
+import { issueDetailOptions } from "@multica/core/issues/queries";
+import type { InboxItem, Issue } from "@multica/core/types";
+import { vi } from "vitest";
+import { useAutoArchiveCause } from "./use-auto-archive-cause";
+
+vi.mock("@multica/core/hooks", () => ({ useWorkspaceId: () => "ws" }));
+
+function item(id: string, issueId: string): InboxItem {
+ return {
+ id,
+ workspace_id: "ws",
+ recipient_type: "member",
+ recipient_id: "member-1",
+ actor_type: "agent",
+ actor_id: "agent-1",
+ type: "new_comment",
+ severity: "info",
+ issue_id: issueId,
+ title: id,
+ body: null,
+ issue_status: "in_review",
+ issue_priority: "none",
+ read: true,
+ archived: false,
+ created_at: "2026-11-21T08:00:00Z",
+ details: null,
+ };
+}
+
+const archived = (issueId: string): KeptInboxRow => ({
+ key: issueId,
+ item: item(`n-${issueId}`, issueId),
+ reason: "archived",
+});
+
+function setup(initial: KeptInboxRow | null = null) {
+ const qc = new QueryClient({ defaultOptions: { queries: { retry: false, staleTime: Infinity } } });
+ const wrapper = ({ children }: { children: ReactNode }) => (
+ <QueryClientProvider client={qc}>{children}</QueryClientProvider>
+ );
+ const view = renderHook(
+ ({ settled }: { settled: KeptInboxRow | null }) => useAutoArchiveCause(settled),
+ { wrapper, initialProps: { settled: initial } },
+ );
+ return {
+ settle: (row: KeptInboxRow | null) => view.rerender({ settled: row }),
+ cause: () => view.result.current.cause,
+ reason: () => view.result.current.reason,
+ qc,
+ };
+}
+
+afterEach(() => {
+ cleanup();
+});
+
+describe("useAutoArchiveCause", () => {
+ it("reports the reason for an agent-triggered archive", () => {
+ const { settle, cause, reason } = setup();
+ noteInboxAutoArchive({ issue_id: "issue-agent", reason: "agent_triggered" });
+ settle(archived("issue-agent"));
+ expect(reason()).toBe("agent_triggered");
+ expect(cause()).toBeNull();
+ });
+
+ it("reports the bar action and reason behind a user-caused archive", () => {
+ const { settle, cause, reason } = 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" });
+ expect(reason()).toBe("actor_acted");
+ });
+
+ it("reports no assignment the issue does not show, as one dismissed at its confirmation", () => {
+ const { settle, cause, reason, 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();
+ expect(reason()).toBe("actor_acted");
+ });
+
+ it("reports no action when something else archived it, and forgets the action", () => {
+ const { settle, cause, reason } = setup();
+ noteInboxBarAction("issue-g", { type: "status", status: "in_progress" });
+ settle(archived("issue-g"));
+ expect(cause()).toBeNull();
+ expect(reason()).toBeNull();
+ settle(null);
+ noteInboxAutoArchive({ issue_id: "issue-g", reason: "actor_acted" });
+ settle(archived("issue-g"));
+ expect(cause()).toBeNull();
+ expect(reason()).toBe("actor_acted");
+ });
+});
diff --git a/packages/views/inbox/components/use-auto-archive-cause.ts b/packages/views/inbox/components/use-auto-archive-cause.ts
new file mode 100644
index 0000000000..7621acda07
--- /dev/null
+++ b/packages/views/inbox/components/use-auto-archive-cause.ts
@@ -0,0 +1,71 @@
+"use client";
+
+import { useLayoutEffect, useState } from "react";
+import { useQueryClient } from "@tanstack/react-query";
+import { useWorkspaceId } from "@multica/core/hooks";
+import {
+ type InboxAutoArchiveReason,
+ type InboxBarAction,
+ takeInboxAutoArchiveReason,
+ takeInboxBarAction,
+} from "@multica/core/inbox/auto-archive";
+import type { KeptInboxRow } from "@multica/core/inbox/open-row";
+import { issueDetailOptions } from "@multica/core/issues/queries";
+import type { Issue } from "@multica/core/types";
+
+/**
+ * Resolves why an open Inbox notification was auto-archived in place: the
+ * Inbox bar action taken in this window (`cause`), if any, and the server's
+ * user-caused auto-archive `reason` (`issue_status_terminal`,
+ * `agent_triggered`, or `actor_acted`).
+ *
+ * Auto-archives always stay on the open issue (`keepOpenInboxRow`) so the
+ * user sees what happened — and confirms a triggered agent started — before
+ * moving on with E / Next. Only explicit Inbox actions (Archive, Snooze,
+ * Unsubscribe) advance immediately.
+ */
+export function useAutoArchiveCause(
+ settled: KeptInboxRow | null,
+): { cause: InboxBarAction | null; reason: InboxAutoArchiveReason | null } {
+ const wsId = useWorkspaceId();
+ const qc = useQueryClient();
+ const archivedKey = settled?.reason === "archived" ? settled.key : null;
+ const [settledMeta, setSettledMeta] = useState<{
+ key: string;
+ action: InboxBarAction | null;
+ reason: InboxAutoArchiveReason | null;
+ } | null>(null);
+
+ useLayoutEffect(() => {
+ if (!archivedKey) return;
+ const reason = takeInboxAutoArchiveReason(archivedKey);
+ const own = reason !== null;
+ const action = takeInboxBarAction(archivedKey);
+ const shown =
+ own &&
+ action !== null &&
+ reflects(qc.getQueryData(issueDetailOptions(wsId, archivedKey).queryKey), action);
+ setSettledMeta({ key: archivedKey, action: shown ? action : null, reason });
+ }, [archivedKey, wsId, qc]);
+
+ if (!settledMeta || settledMeta.key !== archivedKey) {
+ return { cause: null, reason: null };
+ }
+ return { cause: settledMeta.action, reason: settledMeta.reason };
+}
+
+/**
+ * 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/inbox/components/use-move-on-after-auto-archive.test.tsx b/packages/views/inbox/components/use-move-on-after-auto-archive.test.tsx
deleted file mode 100644
index 906209902e..0000000000
--- a/packages/views/inbox/components/use-move-on-after-auto-archive.test.tsx
+++ /dev/null
@@ -1,165 +0,0 @@
-import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
-import { act, cleanup, renderHook } from "@testing-library/react";
-import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
-import type { ReactNode } from "react";
-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, 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 { 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";
-
-vi.mock("sonner", () => ({ toast: { success: vi.fn(), error: vi.fn() } }));
-vi.mock("@multica/core/hooks", () => ({ useWorkspaceId: () => "ws" }));
-
-const api = { unarchiveInbox: vi.fn(async (id: string) => ({ id })) };
-
-function item(id: string, issueId: string): InboxItem {
- return {
- id,
- workspace_id: "ws",
- recipient_type: "member",
- recipient_id: "member-1",
- actor_type: "agent",
- actor_id: "agent-1",
- type: "new_comment",
- severity: "info",
- issue_id: issueId,
- title: id,
- body: null,
- issue_status: "in_review",
- issue_priority: "none",
- read: true,
- archived: false,
- created_at: "2026-11-21T08:00:00Z",
- details: null,
- };
-}
-
-const archived = (issueId: string): KeptInboxRow => ({ key: issueId, item: item(`n-${issueId}`, issueId), reason: "archived" });
-const nextRow = item("n-next", "issue-next");
-
-function setup(
- preferences: Record<string, string>,
- initial: KeptInboxRow | null = null,
- next: InboxItem | null = nextRow,
-) {
- const qc = new QueryClient({ defaultOptions: { queries: { retry: false, staleTime: Infinity } } });
- qc.setQueryData(notificationPreferenceKeys.all("ws"), { workspace_id: "ws", preferences });
- const resources = getTestResources();
- const wrapper = ({ children }: { children: ReactNode }) => (
- <I18nProvider locale="en" resources={resources}>
- <QueryClientProvider client={qc}>{children}</QueryClientProvider>
- </I18nProvider>
- );
- const onNext = vi.fn();
- const view = renderHook(
- ({ settled }: { settled: KeptInboxRow | null }) => useMoveOnAfterAutoArchive({ settled, next, onNext }),
- { wrapper, initialProps: { settled: initial } },
- );
- return {
- onNext,
- settle: (row: KeptInboxRow | null) => view.rerender({ settled: row }),
- cause: () => view.result.current,
- qc,
- };
-}
-
-beforeEach(() => {
- vi.clearAllMocks();
- setApiInstance(api as unknown as ApiClient);
- vi.spyOn(document, "hasFocus").mockReturnValue(true);
-});
-afterEach(() => {
- cleanup();
- vi.restoreAllMocks();
-});
-
-describe("useMoveOnAfterAutoArchive", () => {
- it("opens the next notification right away when your action archived the open one", () => {
- const { onNext, settle } = setup({ after_auto_archive: "next" });
- noteInboxAutoArchive({ issue_id: "issue-a", reason: "actor_acted" });
- settle(archived("issue-a"));
- expect(onNext).toHaveBeenCalledTimes(1);
- expect(toast.success).toHaveBeenCalledWith("Notification archived", expect.anything());
- });
-
- it("undoes by restoring the notification and returning its row", async () => {
- const returnRow = vi.spyOn(useInboxSelectionStore.getState(), "returnRow");
- const { settle } = setup({ after_auto_archive: "next" });
- noteInboxAutoArchive({ issue_id: "issue-b", reason: "issue_status_terminal" });
- settle(archived("issue-b"));
- const action = (vi.mocked(toast.success).mock.calls.at(-1)?.[1] as unknown as { action: { onClick: () => void } }).action;
- await act(async () => action.onClick());
- expect(returnRow).toHaveBeenCalledWith("ws", "issue-b");
- expect(api.unarchiveInbox).toHaveBeenCalledWith("n-issue-b");
- });
-
- it("stays by default", () => {
- const { onNext, settle } = setup({});
- noteInboxAutoArchive({ issue_id: "issue-c", reason: "actor_acted" });
- settle(archived("issue-c"));
- expect(onNext).not.toHaveBeenCalled();
- });
-
- it("stays when something other than your action archived it", () => {
- const { onNext, settle } = setup({ after_auto_archive: "next" });
- settle(archived("issue-d"));
- expect(onNext).not.toHaveBeenCalled();
- });
-
- it("moves on to Inbox Zero when the last notification auto-archives under after_auto_archive=next", () => {
- const { onNext, settle } = setup({ after_auto_archive: "next" }, null, null);
- noteInboxAutoArchive({ issue_id: "issue-last", reason: "actor_acted" });
- settle(archived("issue-last"));
- expect(onNext).toHaveBeenCalledTimes(1);
- expect(toast.success).toHaveBeenCalledWith("Notification archived", expect.anything());
- });
-
- it("stays when the action happened in another window", () => {
- vi.mocked(document.hasFocus).mockReturnValue(false);
- const { onNext, settle } = setup({ after_auto_archive: "next" });
- noteInboxAutoArchive({ issue_id: "issue-e", reason: "actor_acted" });
- 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.ts
deleted file mode 100644
index 37c2d87106..0000000000
--- a/packages/views/inbox/components/use-move-on-after-auto-archive.ts
+++ /dev/null
@@ -1,91 +0,0 @@
-"use client";
-
-import { useLayoutEffect, useRef, useState } from "react";
-import { useQuery, useQueryClient } from "@tanstack/react-query";
-import { useWorkspaceId } from "@multica/core/hooks";
-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, Issue } from "@multica/core/types";
-import { useT } from "../../i18n";
-import { toastInboxUndo } from "./inbox-undo-toast";
-import { useRestoreInbox } from "./use-leave-inbox-row";
-
-/**
- * Opens the next notification right away once the open one is archived because
- * the user handled its issue (`takeInboxAutoArchive`), when their
- * `after_auto_archive` preference says "next", and confirms it with a toast
- * that can undo it. Otherwise the row stays in place, settled, as
- * `keepOpenInboxRow` keeps it.
- *
- * 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 taken in
- * this window.
- */
-export function useMoveOnAfterAutoArchive({
- settled,
- next,
- onNext,
-}: {
- 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 });
- useLayoutEffect(() => {
- latest.current = { settled, next, onNext, movesOn };
- });
-
- // Before paint, so the settled bar never flashes before the next issue opens.
- useLayoutEffect(() => {
- if (!archivedKey) return;
- const { settled: row, onNext: moveOn, movesOn: moves } = latest.current;
- 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 || !document.hasFocus()) return;
- moveOn();
- toastInboxUndo(t(($) => $.toasts.archived), {
- label: t(($) => $.toasts.undo),
- undo: () => {
- const store = useInboxSelectionStore.getState();
- store.returnRow(wsId, archivedKey);
- store.clearLastCleared(wsId, archivedKey);
- void restore(row.item.id, { quiet: true });
- },
- });
- }, [archivedKey, wsId, restore, t, qc]);
-
- 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.tsx
index 056d72bd9f..35ec2f06f0 100644
--- a/packages/views/issues/actions/__tests__/issue-inbox-actions.test.tsx
+++ b/packages/views/issues/actions/__tests__/issue-inbox-actions.test.tsx
@@ -11,9 +11,8 @@ 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 { notificationPreferenceKeys } from "@multica/core/notification-preferences/queries";
import { agentListOptions } from "@multica/core/workspace/queries";
-import type { Agent, InboxItem, Issue, SnoozedInboxIssue } from "@multica/core/types";
+import type { Agent, AgentTask, InboxItem, Issue, SnoozedInboxIssue } from "@multica/core/types";
import { renderWithI18n } from "../../../test/i18n";
import { NavigationProvider, type NavigationAdapter } from "../../../navigation";
import { takeInboxUndo } from "../../../inbox/components/inbox-undo-toast";
@@ -561,25 +560,47 @@ describe("IssueInboxBar once an action is undone", () => {
expect(document.querySelector("[data-inbox-bar]")).not.toBeNull();
});
- it("opens the next notification immediately without a countdown when after_auto_archive=next", async () => {
- const focusSpy = vi.spyOn(document, "hasFocus").mockReturnValue(true);
- try {
- const nav = setup();
- act(() => {
- nav.qc.setQueryData(notificationPreferenceKeys.all("ws"), {
- workspace_id: "ws",
- preferences: { after_auto_archive: "next" },
- });
- });
- noteInboxBarAction("issue-1", { type: "status", status: "done" });
- noteInboxAutoArchive({ issue_id: "issue-1", reason: "actor_acted" });
- act(() => nav.qc.setQueryData(inboxListOptions("ws").queryKey, [ROWS[1]!]));
+ it("stays on the issue in place when completing an issue auto-archives it", async () => {
+ const nav = setup();
+ noteInboxBarAction("issue-1", { type: "status", status: "done" });
+ noteInboxAutoArchive({ issue_id: "issue-1", reason: "issue_status_terminal" });
+ act(() => nav.qc.setQueryData(inboxListOptions("ws").queryKey, [ROWS[1]!]));
+
+ expect(await screen.findByText("Changed to Done · Notification archived")).toBeInTheDocument();
+ expect(nav.push).not.toHaveBeenCalled();
+ expect(toast.success).not.toHaveBeenCalled();
+ expect(document.querySelector("[data-inbox-auto-advance-bar]")).toBeNull();
+ });
+
+ it("stays on the issue with live agent status when triggering an agent archives it", async () => {
+ const nav = setup();
+ act(() => {
+ nav.qc.setQueryData(agentListOptions("ws").queryKey, [{ id: "agent-1", name: "Emacs" } as Agent]);
+ nav.qc.setQueryData(agentTaskSnapshotOptions("ws").queryKey, [
+ { id: "task-1", issue_id: "issue-1", agent_id: "agent-1", status: "running" } as AgentTask,
+ ]);
+ });
+ noteInboxAutoArchive({ issue_id: "issue-1", reason: "agent_triggered" });
+ act(() => nav.qc.setQueryData(inboxListOptions("ws").queryKey, [ROWS[1]!]));
- await waitFor(() => expect(nav.push).toHaveBeenCalledWith("/acme/inbox?issue=issue-2"));
- expect(toast.success).toHaveBeenCalledWith("Notification archived", expect.anything());
- expect(document.querySelector("[data-inbox-auto-advance-bar]")).toBeNull();
- } finally {
- focusSpy.mockRestore();
- }
+ const statusBar = await screen.findByRole("status");
+ expect(statusBar).toHaveTextContent("Emacs is working");
+ expect(statusBar).toHaveTextContent("Returns to Inbox on new activity");
+ expect(screen.getByRole("button", { name: "Undo" })).toBeInTheDocument();
+ expect(screen.getByRole("button", { name: "Next" })).toBeInTheDocument();
+ expect(nav.push).not.toHaveBeenCalled();
+
+ fireEvent.keyDown(document, { key: "e", code: "KeyE" });
+ expect(nav.push).toHaveBeenCalledWith("/acme/inbox?issue=issue-2");
+ });
+
+ it("shows fallback agent-triggered copy before the agent snapshot updates", async () => {
+ const nav = setup();
+ noteInboxAutoArchive({ issue_id: "issue-1", reason: "agent_triggered" });
+ act(() => nav.qc.setQueryData(inboxListOptions("ws").queryKey, [ROWS[1]!]));
+
+ expect(await screen.findByText("Agent triggered")).toBeInTheDocument();
+ expect(screen.getByText("Returns to Inbox on new activity")).toBeInTheDocument();
+ expect(nav.push).not.toHaveBeenCalled();
});
});
diff --git a/packages/views/issues/actions/issue-inbox-actions.tsx b/packages/views/issues/actions/issue-inbox-actions.tsx
index 272e708cf8..4e1024acf6 100644
--- a/packages/views/issues/actions/issue-inbox-actions.tsx
+++ b/packages/views/issues/actions/issue-inbox-actions.tsx
@@ -2,8 +2,10 @@
import { useMemo, useRef, type ReactNode, useState } from "react";
import { useQuery } from "@tanstack/react-query";
-import { AlarmClock, Archive, ChevronDown } from "@multica/ui/icons";
+import { AlarmClock, Archive, Bot, ChevronDown } from "@multica/ui/icons";
+import { ShimmerText } from "@multica/ui/components/common/shimmer-text";
import { Button } from "@multica/ui/components/ui/button";
+import { cn } from "@multica/ui/lib/utils";
import { useWorkspaceId } from "@multica/core/hooks";
import type { InboxUnsubscribeScope } from "@multica/core/inbox/mutations";
import type { LastInboxCleared } from "@multica/core/inbox/selection-store";
@@ -23,16 +25,18 @@ import { useFilteredInboxRows } from "../../inbox/components/use-filtered-inbox-
import { inboxTabHref } from "../../inbox/components/inbox-view";
import { UnsubscribeArchiveButton } from "../../inbox/components/unsubscribe-archive-button";
import { useUnsubscribeArchive } from "../../inbox/components/use-unsubscribe-archive";
-import { useMoveOnAfterAutoArchive } from "../../inbox/components/use-move-on-after-auto-archive";
+import { useAutoArchiveCause } from "../../inbox/components/use-auto-archive-cause";
import {
clearedLabelForItem,
useArchiveInboxWithUndo,
useLeaveInboxRow,
useRestoreInbox,
} from "../../inbox/components/use-leave-inbox-row";
+import { AgentAvatarStack } from "../../agents/components/agent-avatar-stack";
import { useBuiltinViewNavigation } from "../../issue-views/builtin-views";
import { useNavigation } from "../../navigation";
import { useLocale, useT } from "../../i18n";
+import { useIssueAgentState } from "../surface/use-issue-agent-state";
/**
* The Inbox page's bar over an open issue notification: why it is here,
@@ -95,6 +99,7 @@ export function IssueInboxBar({
return (snoozedList ?? []).filter((entry) => new Date(entry.snoozed_until).getTime() > now).length;
}, [snoozedList]);
const keptText = useKeptInboxRowText(wsId);
+ const agents = useIssueAgentState(wsId, issueId);
const [snoozeOpen, setSnoozeOpen] = useState(false);
const archiveItem = () => {
@@ -164,7 +169,7 @@ export function IssueInboxBar({
: undefined;
leave(issueId, next, cleared);
};
- const cause = useMoveOnAfterAutoArchive({ settled, next, onNext: moveOn });
+ const { cause, reason: archiveReason } = useAutoArchiveCause(settled);
// Archived already, E moves on (to the next notification or Inbox Zero).
useInboxShortcut("archiveInboxItem", item ? archiveItem : settled ? moveOn : null);
@@ -198,9 +203,55 @@ export function IssueInboxBar({
return null;
}
const inboxCleared = !next && !filtered;
+ const showAgentWorking =
+ settled.reason === "archived" &&
+ !keptText.isFinished(settled.item) &&
+ (archiveReason === "agent_triggered" || (agents !== null && !cause));
+ const fallbackAgentId =
+ cause?.type === "assignee" && cause.assignee?.type === "agent" ? cause.assignee.id : null;
+ const settledIcon = showAgentWorking ? (
+ agents && agents.agentIds.length > 0 ? (
+ <AgentAvatarStack
+ agentIds={agents.agentIds}
+ size="xs"
+ max={2}
+ opacity={agents.running ? "full" : "half"}
+ />
+ ) : fallbackAgentId ? (
+ <AgentAvatarStack agentIds={[fallbackAgentId]} size="xs" max={2} opacity="half" />
+ ) : (
+ <Bot className="text-info" />
+ )
+ ) : undefined;
+ const agentWorkingText = showAgentWorking
+ ? (keptText.agentLabel(agents) ?? t(($) => $.kept.agent_triggered))
+ : null;
+ const settledLabel =
+ showAgentWorking && agentWorkingText ? (
+ <span className="inline-flex min-w-0 max-w-full items-center gap-1.5">
+ <ShimmerText
+ active={!!agents?.running}
+ className={cn(
+ "shrink-0 font-medium",
+ agents?.running ? "text-foreground" : "text-muted-foreground",
+ )}
+ >
+ {agentWorkingText}
+ </ShimmerText>
+ <span aria-hidden className="text-faint-foreground @max-[32rem]/inbox-bar:hidden">
+ ·
+ </span>
+ <span className="truncate text-muted-foreground @max-[32rem]/inbox-bar:hidden">
+ {t(($) => $.kept.returns_on_activity)}
+ </span>
+ </span>
+ ) : (
+ keptText.notice(settled, cause)
+ );
return (
<InboxKeptActions
- label={keptText.notice(settled, cause)}
+ icon={settledIcon}
+ label={settledLabel}
issueActions={settled.reason === "archived" ? issueActions : undefined}
onUndo={() => restore(settled.item.id, { quiet: true })}
next={next}
diff --git a/packages/views/issues/surface/use-issue-agent-state.ts b/packages/views/issues/surface/use-issue-agent-state.ts
new file mode 100644
index 0000000000..29a9b29a18
--- /dev/null
+++ b/packages/views/issues/surface/use-issue-agent-state.ts
@@ -0,0 +1,29 @@
+"use client";
+
+import { useCallback } from "react";
+import { useQuery } from "@tanstack/react-query";
+import { agentTaskSnapshotOptions } from "@multica/core/agents";
+import type { AgentTask } from "@multica/core/types";
+import { selectIssueTasks } from "./activity";
+
+export type IssueAgentState = { running: boolean; agentIds: string[] } | null;
+
+/** The agents running on an issue, or queued for it when none is running yet. */
+export function useIssueAgentState(wsId: string, issueId: string): IssueAgentState {
+ const select = useCallback(
+ (snapshot: AgentTask[]): IssueAgentState => {
+ if (!issueId) return null;
+ const { running, queued } = selectIssueTasks(snapshot, issueId);
+ const tasks = running.length > 0 ? running : queued;
+ if (tasks.length === 0) return null;
+ return { running: running.length > 0, agentIds: [...new Set(tasks.map((task) => task.agent_id))] };
+ },
+ [issueId],
+ );
+ const { data = null } = useQuery({
+ ...agentTaskSnapshotOptions(wsId),
+ enabled: Boolean(issueId),
+ select,
+ });
+ return data;
+}
diff --git a/packages/views/layout/panels/inbox-section.test.tsx b/packages/views/layout/panels/inbox-section.test.tsx
index d966fac79c..24fddb1457 100644
--- a/packages/views/layout/panels/inbox-section.test.tsx
+++ b/packages/views/layout/panels/inbox-section.test.tsx
@@ -1113,3 +1113,22 @@ describe("InboxSection while the Inbox loads", () => {
expect(screen.queryByRole("alert")).toBeNull();
});
});
+
+describe("InboxSection kept open row while an agent works", () => {
+ it("shows the running agent status on the kept row instead of generic Archived", async () => {
+ const first = item({ id: "n1", issue_id: "issue-a", title: "Run agent on this", read: true });
+ const second = item({ id: "n2", issue_id: "issue-b", title: "Next item", read: true });
+ const { client } = renderSection(
+ [first, second],
+ "issue-a",
+ "/acme/inbox?issue=issue-a",
+ [{ id: "t1", issue_id: "issue-a", agent_id: "agent-1", status: "running" }],
+ );
+ // The open issue is auto-archived while its agent runs.
+ act(() => client.setQueryData(["inbox", "ws-1", "list"], [second]));
+
+ expect(
+ await screen.findByText("Leo Park is working · Leaves the Inbox when you move on"),
+ ).toBeInTheDocument();
+ });
+});
diff --git a/packages/views/layout/panels/inbox-section.tsx b/packages/views/layout/panels/inbox-section.tsx
index 3a7c3b2fc5..03f92b8860 100644
--- a/packages/views/layout/panels/inbox-section.tsx
+++ b/packages/views/layout/panels/inbox-section.tsx
@@ -155,6 +155,10 @@ export function InboxSection({
const isCompact = useIsCompact();
const { list, rows: all, displayed, expanded, limit, setExpanded } = rows;
const keptText = useKeptInboxRowText(wsId);
+ const keptAgents = useIssueAgentState(
+ wsId,
+ list.kept?.reason === "archived" ? (list.kept.item.issue_id ?? "") : "",
+ );
const clearFilters = useInboxFilterStore((state) => state.clearFilters);
// Follow the Inbox page's URL whenever navigation arrives at a new `/inbox`
// state, while letting the user switch sidebar tabs freely without closing
@@ -286,7 +290,7 @@ export function InboxSection({
href={inboxRowHref(p, item)}
active={!!openRowKey && inboxRowKey(item) === openRowKey}
compact={compact}
- kept={list.kept?.item.id === item.id ? keptText.line(list.kept) : null}
+ kept={list.kept?.item.id === item.id ? keptText.line(list.kept, keptAgents) : null}
settled={list.kept?.item.id === item.id && list.kept.reason !== "filtered"}
updatesWhileSnoozed={item.issue_id ? (updatesWhileSnoozed.get(item.issue_id) ?? 0) : 0}
unsubscribable={!!item.issue_id && unsubscribable(item)}
diff --git a/packages/views/layout/panels/sidebar-tree.tsx b/packages/views/layout/panels/sidebar-tree.tsx
index ddce16e9ac..d82a364910 100644
--- a/packages/views/layout/panels/sidebar-tree.tsx
+++ b/packages/views/layout/panels/sidebar-tree.tsx
@@ -1,6 +1,6 @@
"use client";
-import { forwardRef, memo, useCallback, useLayoutEffect, useRef, useState } from "react";
+import { forwardRef, memo, useLayoutEffect, useRef, useState } from "react";
import { keepPreviousData, useQuery } from "@tanstack/react-query";
import { ChevronDown, ChevronRight, ChevronUp, Lock } from "@multica/ui/icons";
import { cn } from "@multica/ui/lib/utils";
@@ -8,7 +8,6 @@ import { TooltipHint } from "@multica/ui/components/common/tooltip-hint";
import { TruncatedTooltip } from "@multica/ui/components/common/truncated-tooltip";
import { ShimmerText } from "@multica/ui/components/common/shimmer-text";
import { Tooltip, TooltipContent, TooltipTrigger } from "@multica/ui/components/ui/tooltip";
-import { agentTaskSnapshotOptions } from "@multica/core/agents";
import { useIssueStatuses } from "@multica/core/issue-statuses/hooks";
import { issueStatusCategory } from "@multica/core/issues";
import { issueDetailOptions, sidebarIssuesOptions } from "@multica/core/issues/queries";
@@ -18,14 +17,14 @@ import { useSidebarTreeStore } from "@multica/core/issues/stores/sidebar-tree-st
import { issueUnreadTarget, useIssueUnread } from "@multica/core/issues/unread";
import { useWorkspacePaths, issueRouteRef } from "@multica/core/paths";
import { useActorName } from "@multica/core/workspace/hooks";
-import type { AgentTask, Issue, IssueUnread } from "@multica/core/types";
+import type { Issue, IssueUnread } from "@multica/core/types";
import { AppLink, useWarmRoute } from "../../navigation";
import { AgentAvatarStack } from "../../agents/components/agent-avatar-stack";
import { StatusIcon } from "../../issues/components/status-icon";
import { StatusPicker } from "../../issues/components/pickers/status-picker";
import { IssueActionsContextMenu } from "../../issues/actions";
import { useIssueActions } from "../../issues/actions/use-issue-actions";
-import { selectIssueTasks } from "../../issues/surface/activity";
+import { type IssueAgentState, useIssueAgentState } from "../../issues/surface/use-issue-agent-state";
import { useStatusLabel } from "../../issues/utils/status-label";
import { DeferredPopup } from "../../common/deferred-popup";
import { useT, useTimeAgo } from "../../i18n";
@@ -450,22 +449,7 @@ export function SidebarIssueList({
);
}
-type IssueAgentState = { running: boolean; agentIds: string[] } | null;
-
-/** The agents running on an issue, or queued for it when none is running yet. */
-export function useIssueAgentState(wsId: string, issueId: string): IssueAgentState {
- const select = useCallback(
- (snapshot: AgentTask[]): IssueAgentState => {
- const { running, queued } = selectIssueTasks(snapshot, issueId);
- const tasks = running.length > 0 ? running : queued;
- if (tasks.length === 0) return null;
- return { running: running.length > 0, agentIds: [...new Set(tasks.map((task) => task.agent_id))] };
- },
- [issueId],
- );
- const { data = null } = useQuery({ ...agentTaskSnapshotOptions(wsId), select });
- return data;
-}
+export { type IssueAgentState, useIssueAgentState };
export function IssueAgentBadge({ agents }: { agents: NonNullable<IssueAgentState> }) {
const { t } = useT("issues");
diff --git a/packages/views/locales/en/inbox.json b/packages/views/locales/en/inbox.json
index 461d766064..51c775d3e6 100644
--- a/packages/views/locales/en/inbox.json
+++ b/packages/views/locales/en/inbox.json
@@ -154,6 +154,8 @@
"reassigned": "Reassigned to {{name}}",
"unassigned": "Unassigned",
"ran_quick_action": "Ran {{name}}",
+ "agent_triggered": "Agent triggered",
+ "returns_on_activity": "Returns to Inbox on new activity",
"next": "Next",
"next_tooltip": "Open next: {{title}}"
},
diff --git a/packages/views/locales/en/settings.json b/packages/views/locales/en/settings.json
index 090fd51e10..19acfa5580 100644
--- a/packages/views/locales/en/settings.json
+++ b/packages/views/locales/en/settings.json
@@ -888,10 +888,6 @@
"dates": "Change dates",
"labels": "Change labels"
},
- "after_label": "After archiving",
- "after_description": "When the notification you're reading is archived this way. Archiving by hand (E) still opens the next one.",
- "after_stay": "Stay on the issue",
- "after_next": "Open the next one",
"archived_label": "Archived notifications",
"archived_description": "Find them again and unarchive them",
"archived_action": "View archived"
diff --git a/packages/views/locales/es/inbox.json b/packages/views/locales/es/inbox.json
index 598e651e9b..120965d8ad 100644
--- a/packages/views/locales/es/inbox.json
+++ b/packages/views/locales/es/inbox.json
@@ -154,6 +154,8 @@
"reassigned": "Reasignada a {{name}}",
"unassigned": "Desasignada",
"ran_quick_action": "Se ejecutó {{name}}",
+ "agent_triggered": "Agente activado",
+ "returns_on_activity": "Vuelve a la bandeja con nueva actividad",
"next": "Siguiente",
"next_tooltip": "Abrir la siguiente: {{title}}"
},
diff --git a/packages/views/locales/es/settings.json b/packages/views/locales/es/settings.json
index da483473b5..88540f1ff7 100644
--- a/packages/views/locales/es/settings.json
+++ b/packages/views/locales/es/settings.json
@@ -888,10 +888,6 @@
"dates": "Cambiar fechas",
"labels": "Cambiar etiquetas"
},
- "after_label": "Después de archivar",
- "after_description": "Cuando la notificación que estás leyendo se archiva así. Archivar a mano (E) sigue abriendo la siguiente.",
- "after_stay": "Quedarse en la tarea",
- "after_next": "Abrir la siguiente",
"archived_label": "Notificaciones archivadas",
"archived_description": "Encuéntralas de nuevo y desarchívalas",
"archived_action": "Ver archivadas"
diff --git a/packages/views/locales/fr/inbox.json b/packages/views/locales/fr/inbox.json
index ea371bfad0..70c00b2ed2 100644
--- a/packages/views/locales/fr/inbox.json
+++ b/packages/views/locales/fr/inbox.json
@@ -154,6 +154,8 @@
"reassigned": "Réassigné à {{name}}",
"unassigned": "Désassigné",
"ran_quick_action": "Action lancée : {{name}}",
+ "agent_triggered": "Agent déclenché",
+ "returns_on_activity": "Revient dans la boîte de réception en cas de nouvelle activité",
"next": "Suivante",
"next_tooltip": "Ouvrir la suivante : {{title}}"
},
diff --git a/packages/views/locales/fr/settings.json b/packages/views/locales/fr/settings.json
index 646ea39fe4..66bcce17e8 100644
--- a/packages/views/locales/fr/settings.json
+++ b/packages/views/locales/fr/settings.json
@@ -888,10 +888,6 @@
"dates": "Changer les dates",
"labels": "Changer les libellés"
},
- "after_label": "Après l'archivage",
- "after_description": "Quand la notification que vous lisez est archivée ainsi. Archiver à la main (E) ouvre toujours la suivante.",
- "after_stay": "Rester sur la tâche",
- "after_next": "Ouvrir la suivante",
"archived_label": "Notifications archivées",
"archived_description": "Retrouvez-les et désarchivez-les",
"archived_action": "Voir les archivées"
diff --git a/packages/views/locales/ja/inbox.json b/packages/views/locales/ja/inbox.json
index 856395b04f..4f9495e09a 100644
--- a/packages/views/locales/ja/inbox.json
+++ b/packages/views/locales/ja/inbox.json
@@ -151,6 +151,8 @@
"reassigned": "{{name}} に再割り当て",
"unassigned": "割り当て解除",
"ran_quick_action": "{{name}} を実行",
+ "agent_triggered": "エージェントを起動しました",
+ "returns_on_activity": "新しい動きがあるとインボックスに戻ります",
"next": "次へ",
"next_tooltip": "次を開く:{{title}}"
},
diff --git a/packages/views/locales/ja/settings.json b/packages/views/locales/ja/settings.json
index 427b54a999..dfd148df7f 100644
--- a/packages/views/locales/ja/settings.json
+++ b/packages/views/locales/ja/settings.json
@@ -878,10 +878,6 @@
"dates": "日付変更",
"labels": "ラベル変更"
},
- "after_label": "アーカイブ後",
- "after_description": "表示中の通知がこの方法でアーカイブされたとき。手動のアーカイブ(E)は従来どおり次を開きます。",
- "after_stay": "このタスクに留まる",
- "after_next": "次の通知を開く",
"archived_label": "アーカイブ済みの通知",
"archived_description": "ここから見つけてアーカイブを解除できます",
"archived_action": "アーカイブ済みを表示"
diff --git a/packages/views/locales/ko/inbox.json b/packages/views/locales/ko/inbox.json
index 3fb869e4a5..b09fc95401 100644
--- a/packages/views/locales/ko/inbox.json
+++ b/packages/views/locales/ko/inbox.json
@@ -151,6 +151,8 @@
"reassigned": "{{name}}님에게 재할당됨",
"unassigned": "할당 해제됨",
"ran_quick_action": "{{name}} 실행됨",
+ "agent_triggered": "에이전트를 실행함",
+ "returns_on_activity": "새 활동이 있으면 인박스로 돌아옵니다",
"next": "다음",
"next_tooltip": "다음 열기: {{title}}"
},
diff --git a/packages/views/locales/ko/settings.json b/packages/views/locales/ko/settings.json
index 26c6006803..ec145bd25f 100644
--- a/packages/views/locales/ko/settings.json
+++ b/packages/views/locales/ko/settings.json
@@ -878,10 +878,6 @@
"dates": "날짜 변경",
"labels": "라벨 변경"
},
- "after_label": "보관한 뒤",
- "after_description": "보고 있는 알림이 이렇게 보관될 때. 직접 보관(E)하면 지금처럼 다음 알림을 엽니다.",
- "after_stay": "이 태스크에 머무르기",
- "after_next": "다음 알림 열기",
"archived_label": "보관된 알림",
"archived_description": "여기서 다시 찾고 보관을 해제할 수 있습니다",
"archived_action": "보관된 알림 보기"
diff --git a/packages/views/locales/ru/inbox.json b/packages/views/locales/ru/inbox.json
index 153c5c0ba7..68891b5952 100644
--- a/packages/views/locales/ru/inbox.json
+++ b/packages/views/locales/ru/inbox.json
@@ -160,6 +160,8 @@
"reassigned": "Переназначено: {{name}}",
"unassigned": "Исполнитель снят",
"ran_quick_action": "Запущено: {{name}}",
+ "agent_triggered": "Агент запущен",
+ "returns_on_activity": "Вернётся во входящие при новой активности",
"next": "Следующее",
"next_tooltip": "Открыть следующее: {{title}}"
},
diff --git a/packages/views/locales/ru/settings.json b/packages/views/locales/ru/settings.json
index f4781a0010..bd1393f85c 100644
--- a/packages/views/locales/ru/settings.json
+++ b/packages/views/locales/ru/settings.json
@@ -908,10 +908,6 @@
"dates": "Сменить даты",
"labels": "Сменить метки"
},
- "after_label": "После архивации",
- "after_description": "Когда уведомление, которое вы читаете, архивируется таким образом. Ручная архивация (E) по-прежнему открывает следующее.",
- "after_stay": "Остаться на задаче",
- "after_next": "Открыть следующее",
"archived_label": "Архивные уведомления",
"archived_description": "Здесь их можно найти и вернуть из архива",
"archived_action": "Открыть архив"
diff --git a/packages/views/locales/zh-Hans/inbox.json b/packages/views/locales/zh-Hans/inbox.json
index eb3e87fc2b..72ac9d5b75 100644
--- a/packages/views/locales/zh-Hans/inbox.json
+++ b/packages/views/locales/zh-Hans/inbox.json
@@ -151,6 +151,8 @@
"reassigned": "已改派给 {{name}}",
"unassigned": "已取消分配",
"ran_quick_action": "已运行 {{name}}",
+ "agent_triggered": "已触发智能体",
+ "returns_on_activity": "有新动态时会回到收件箱",
"next": "下一条",
"next_tooltip": "打开下一条:{{title}}"
},
diff --git a/packages/views/locales/zh-Hans/settings.json b/packages/views/locales/zh-Hans/settings.json
index f89e1dc38b..0be5dda320 100644
--- a/packages/views/locales/zh-Hans/settings.json
+++ b/packages/views/locales/zh-Hans/settings.json
@@ -878,10 +878,6 @@
"dates": "改日期",
"labels": "改标签"
},
- "after_label": "归档后",
- "after_description": "正在看的通知被自动归档时。手动归档(E)照旧打开下一条。",
- "after_stay": "停在当前任务",
- "after_next": "打开下一条",
"archived_label": "已归档的通知",
"archived_description": "可以在这里找回并取消归档",
"archived_action": "查看已归档"
diff --git a/packages/views/locales/zh-Hant/inbox.json b/packages/views/locales/zh-Hant/inbox.json
index 6f12668c65..807f7f3d8d 100644
--- a/packages/views/locales/zh-Hant/inbox.json
+++ b/packages/views/locales/zh-Hant/inbox.json
@@ -151,6 +151,8 @@
"reassigned": "已改派給 {{name}}",
"unassigned": "已取消分配",
"ran_quick_action": "已執行 {{name}}",
+ "agent_triggered": "已觸發 AI 代理",
+ "returns_on_activity": "有新動態時會回到收件箱",
"next": "下一條",
"next_tooltip": "開啟下一條:{{title}}"
},
diff --git a/packages/views/locales/zh-Hant/settings.json b/packages/views/locales/zh-Hant/settings.json
index eeac7dff8e..aeb2f97733 100644
--- a/packages/views/locales/zh-Hant/settings.json
+++ b/packages/views/locales/zh-Hant/settings.json
@@ -878,10 +878,6 @@
"dates": "改日期",
"labels": "改標籤"
},
- "after_label": "歸檔後",
- "after_description": "正在看的通知被自動歸檔時。手動歸檔(E)照舊打開下一條。",
- "after_stay": "停在目前任務",
- "after_next": "打開下一條",
"archived_label": "已歸檔的通知",
"archived_description": "可以在這裡找回並取消歸檔",
"archived_action": "查看已歸檔"
diff --git a/packages/views/settings/components/notifications-tab.test.tsx b/packages/views/settings/components/notifications-tab.test.tsx
index d99e9df04c..446d79ab87 100644
--- a/packages/views/settings/components/notifications-tab.test.tsx
+++ b/packages/views/settings/components/notifications-tab.test.tsx
@@ -219,31 +219,10 @@ describe("Inbox notification settings", () => {
expect(mutate).not.toHaveBeenCalled();
});
- it("nests where to go after archiving under the archive choice, hidden while it is off", () => {
- renderTab(ALL_ACTIONS_OFF);
- const leaving = screen.getByRole("region", { name: "Leaving the Inbox" });
- expect(within(leaving).queryByRole("combobox", { name: "After archiving" })).toBeNull();
- });
-
- it.each<{ preferences: Record<string, string>; shown: string }>([
- { preferences: {}, shown: "Stay on the issue" },
- { preferences: { after_auto_archive: "next" }, shown: "Open the next one" },
- ])("shows where to go after archiving: %j", ({ preferences, shown }) => {
- renderTab(preferences);
- const leaving = screen.getByRole("region", { name: "Leaving the Inbox" });
- expect(within(leaving).getByRole("combobox", { name: "After archiving" })).toHaveTextContent(shown);
- });
-
- it("saves opening the next notification after archiving", async () => {
- const user = userEvent.setup();
+ it("keeps the Leaving the Inbox card focused on when issues archive without an After archiving setting", () => {
renderTab();
const leaving = screen.getByRole("region", { name: "Leaving the Inbox" });
- await user.click(within(leaving).getByRole("combobox", { name: "After archiving" }));
- await user.click(await screen.findByRole("option", { name: "Open the next one" }));
- expect(mutate).toHaveBeenCalledWith(
- { after_auto_archive: "next" },
- expect.anything(),
- );
+ expect(within(leaving).queryByRole("combobox", { name: "After archiving" })).toBeNull();
});
});
diff --git a/packages/views/settings/components/notifications-tab.tsx b/packages/views/settings/components/notifications-tab.tsx
index 19e993959b..c13b0e0455 100644
--- a/packages/views/settings/components/notifications-tab.tsx
+++ b/packages/views/settings/components/notifications-tab.tsx
@@ -18,7 +18,6 @@ import {
type AutoArchivePreset,
} from "@multica/core/notification-preferences/auto-archive-presets";
import type {
- AfterAutoArchiveValue,
AutoArchiveKey,
NotificationGroupKey,
NotificationPreferences,
@@ -150,10 +149,6 @@ export function NotificationsTab() {
setAutoArchiveCustom(true);
saveAutoArchive(on ? [...autoArchiveOn, key] : autoArchiveOn.filter((k) => k !== key));
};
- const afterAutoArchiveItems: { value: AfterAutoArchiveValue; label: string }[] = [
- { value: "stay", label: t(($) => $.notifications.leaving.after_stay) },
- { value: "next", label: t(($) => $.notifications.leaving.after_next) },
- ];
const systemEnabled = preferences.system_notifications !== "muted";
@@ -305,37 +300,6 @@ export function NotificationsTab() {
</div>
)}
</div>
- {autoArchiveOn.length > 0 && (
- <SettingsRow
- anchor="after_auto_archive"
- className="pl-8"
- label={t(($) => $.notifications.leaving.after_label)}
- description={t(($) => $.notifications.leaving.after_description)}
- >
- <Select
- items={afterAutoArchiveItems}
- value={notificationPreferenceValue(preferences, "after_auto_archive")}
- onValueChange={(next) =>
- next && save({ ...preferences, after_auto_archive: next as AfterAutoArchiveValue })
- }
- >
- <SelectTrigger
- size="sm"
- className="w-56"
- aria-label={t(($) => $.notifications.leaving.after_label)}
- >
- <SelectValue />
- </SelectTrigger>
- <SelectContent align="end">
- {afterAutoArchiveItems.map((item) => (
- <SelectItem key={item.value} value={item.value}>
- {item.label}
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
- </SettingsRow>
- )}
<SettingsRow
anchor="archived"
label={t(($) => $.notifications.leaving.archived_label)}
diff --git a/packages/views/settings/components/use-settings-search-index.ts b/packages/views/settings/components/use-settings-search-index.ts
index e991219d4f..d679715b92 100644
--- a/packages/views/settings/components/use-settings-search-index.ts
+++ b/packages/views/settings/components/use-settings-search-index.ts
@@ -194,13 +194,6 @@ export function useSettingsSearchIndex(
title: t(($) => $.notifications.leaving.auto_label),
description: t(($) => $.notifications.leaving.auto_description),
},
- // Lands on the row above: this one is hidden while auto-archive is off.
- {
- tab: "notifications",
- anchor: "auto_archive_completed",
- title: t(($) => $.notifications.leaving.after_label),
- description: t(($) => $.notifications.leaving.after_description),
- },
{
tab: "notifications",
anchor: "archived",
diff --git a/server/internal/handler/auto_archive_agent_trigger_test.go b/server/internal/handler/auto_archive_agent_trigger_test.go
index a350dc764b..048e786e4f 100644
--- a/server/internal/handler/auto_archive_agent_trigger_test.go
+++ b/server/internal/handler/auto_archive_agent_trigger_test.go
@@ -79,8 +79,8 @@ func TestAutoArchiveOnAgentTrigger_UpdateIssue(t *testing.T) {
mu.Lock()
reasons := archivedReasons[issue.ID]
mu.Unlock()
- if len(reasons) != 1 || reasons[0] != "actor_acted" {
- t.Fatalf("reasons = %v, want [actor_acted]", reasons)
+ if len(reasons) != 1 || reasons[0] != "agent_triggered" {
+ t.Fatalf("reasons = %v, want [agent_triggered]", reasons)
}
})
diff --git a/server/internal/handler/notification_preference.go b/server/internal/handler/notification_preference.go
index ca39ebcf9a..4b6f4289a5 100644
--- a/server/internal/handler/notification_preference.go
+++ b/server/internal/handler/notification_preference.go
@@ -23,8 +23,8 @@ import (
// says whether one action you take on an issue archives your notifications on
// it. Completing and triggering an agent archive unless "muted"; commenting,
// status changes, reassigning, priority, project, date and label edits archive
-// only with "all". `after_auto_archive` is where the client goes when the
-// notification you are reading is archived that way.
+// only with "all". `after_auto_archive` is a legacy preference kept accepted
+// for older clients; current clients always stay on an auto-archived issue.
var validNotifGroups = map[string]bool{
"assignments": true,
"status_changes": true,
diff --git a/server/internal/inbox/auto_archive.go b/server/internal/inbox/auto_archive.go
index 520bff6e7d..7698497109 100644
--- a/server/internal/inbox/auto_archive.go
+++ b/server/internal/inbox/auto_archive.go
@@ -39,8 +39,9 @@ var autoArchiveOnByDefault = map[string]bool{
// Why the actor's notifications were archived, sent as `reason` on
// inbox:batch-archived so the client can tell its user's own action apart.
const (
- ArchiveReasonCompleted = "issue_status_terminal"
- ArchiveReasonActed = "actor_acted"
+ ArchiveReasonCompleted = "issue_status_terminal"
+ ArchiveReasonAgentTriggered = "agent_triggered"
+ ArchiveReasonActed = "actor_acted"
)
// AutoArchivesOn reports whether prefs archive the actor's notifications when
@@ -113,8 +114,11 @@ func ArchiveActorIssueInbox(
return
}
reason := ArchiveReasonActed
- if slices.Contains(archivedOn, AutoArchiveCompletedPref) {
+ switch {
+ case slices.Contains(archivedOn, AutoArchiveCompletedPref):
reason = ArchiveReasonCompleted
+ case slices.Contains(archivedOn, AutoArchiveAgentTriggerPref):
+ reason = ArchiveReasonAgentTriggered
}
count, err := queries.ArchiveInboxByIssue(ctx, db.ArchiveInboxByIssueParams{