Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
refactor(inbox): simplify Inbox Zero empty state (MUL-9848) (#11193)
Jiayuan Zhang58ee5f29ccb4
diff --git a/apps/docs/content/docs/inbox.fr.mdx b/apps/docs/content/docs/inbox.fr.mdxindex 24daeec4af..cd1b8b35b9 100644--- a/apps/docs/content/docs/inbox.fr.mdx+++ b/apps/docs/content/docs/inbox.fr.mdx@@ -139,7 +139,7 @@ Lire une notification ne la retire pas. Une ligne quitte la boîte de réceptionLes 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**.-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** pour revenir en arrière, indique combien de tâches sont reportées et quand la prochaine revient, et renvoie vers **Mon travail**, les agents au travail et **Voir les archives**. 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.+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.diff --git a/apps/docs/content/docs/inbox.ja.mdx b/apps/docs/content/docs/inbox.ja.mdxindex c6911094b5..ecb8154e90 100644--- a/apps/docs/content/docs/inbox.ja.mdx+++ b/apps/docs/content/docs/inbox.ja.mdx@@ -139,7 +139,7 @@ multica inbox snooze <id>... --until tomorrow # RFC 3339、30m、3h、1d、1wアーカイブされた行は、開いているウィンドウからもすぐに消えます。ただし、いま開いている行は別です。その通知がほかの理由でインボックスから外れたとき(ステータスからタスクを `done` にした、別のウィンドウでアーカイブされた、編集でセクションのフィルターに合わなくなった)、行は元の位置でハイライトされたまま残り、インボックスバーに何が起きたかが表示されます。バーの **ステータス**、**担当者**、**クイックアクション** で変更して通知がアーカイブされたときは、「進行中 に変更 · 通知をアーカイブしました」のようにその操作が示され、これらの操作はバーに残るので続けて変更できます。**元に戻す**(または `Z`)で通知が戻り、**次へ**(または `E`)で次の行が開きます。行が消えるのは、ほかへ移ったときです。それがインボックスの最後の通知だった場合、バーには代わりに **インボックスは空です** とスヌーズ中のタスク数が表示され、**次へ** の代わりに **自分の作業へ** が出ます。`E` で空になったインボックスが開きます。これは既定の **アーカイブ後 → このタスクに留まる** の動きです。**次の通知を開く** にすると、あなたの操作で開いている通知がアーカイブされたとき、すぐ次の行(なければ空になったインボックス)が開き、確認メッセージに **元に戻す** が出ます。-開いている行を自分で処理したとき(インボックスバー、その行、ホバーカード、その行を含む一括操作)は、代わりに次の行が開きます。残りがなければ、インボックスのページが開き、**インボックスは空です** と表示されます。直前の操作が示されて **元に戻す** で取り戻せるほか、スヌーズ中のタスク数と次に戻る時刻、**自分の作業**、作業中のエージェント、**アーカイブを見る** へのリンクがあります。フィルターでほかの通知が隠れているだけのときは、残りの件数と **フィルターを解除して続ける** が代わりに表示されます。戻るとタスクに戻れます。アーカイブと一括操作の確認には **元に戻す** があり、通知は戻りますが、タスクのステータスはそのままです。**元に戻す** のある確認メッセージ(アーカイブ、スヌーズ、購読解除のいずれも)は 10 秒間表示され、表示中に `Z` を押すとその操作を取り消せます。+開いている行を自分で処理したとき(インボックスバー、その行、ホバーカード、その行を含む一括操作)は、代わりに次の行が開きます。残りがなければ、インボックスのページが開き、**インボックスは空です** と表示されます。直前の操作が示されて **元に戻す**(または `Z`)で取り戻せるほか、スヌーズ中のタスク数と次に戻る時刻が表示されます。フィルターでほかの通知が隠れているだけのときは、残りの件数と **フィルターを解除して続ける** が代わりに表示されます。戻るとタスクに戻れます。アーカイブと一括操作の確認には **元に戻す** があり、通知は戻りますが、タスクのステータスはそのままです。**元に戻す** のある確認メッセージ(アーカイブ、スヌーズ、購読解除のいずれも)は 10 秒間表示され、表示中に `Z` を押すとその操作を取り消せます。その後に届いた通知は、再びインボックスに入ります。diff --git a/apps/docs/content/docs/inbox.ko.mdx b/apps/docs/content/docs/inbox.ko.mdxindex 5cbb3eaa4e..29807f4662 100644--- a/apps/docs/content/docs/inbox.ko.mdx+++ b/apps/docs/content/docs/inbox.ko.mdx@@ -139,7 +139,7 @@ multica inbox snooze <id>... --until tomorrow # RFC 3339, 30m, 3h, 1d, 1w; uns보관된 행은 열려 있는 창에서도 바로 사라집니다. 단, 지금 열어 둔 행은 예외입니다. 그 알림이 다른 이유로 인박스에서 빠지면(상태에서 태스크를 `done`으로 바꿨거나, 다른 창에서 보관했거나, 편집으로 섹션 필터에 더 이상 맞지 않게 된 경우) 행은 제자리에서 강조된 채 남고, 인박스 바에 무슨 일이 있었는지 표시됩니다. 바의 **상태**, **담당자**, **퀵 액션**으로 바꿔서 알림이 보관되면 '상태 변경됨: 진행 중 · 알림이 보관됨'처럼 그 동작이 표시되고, 이 동작들은 바에 그대로 남아 이어서 바꿀 수 있습니다. **실행 취소**(또는 `Z`)로 알림을 되돌리고, **다음**(또는 `E`)으로 다음 행을 엽니다. 행은 다른 곳으로 이동할 때 사라집니다. 그것이 인박스의 마지막 알림이었다면 바에는 대신 **인박스가 비었습니다**와 미뤄 둔 태스크 수가 표시되고, **다음** 대신 **내 작업으로 이동**이 나옵니다. `E`를 누르면 비워진 인박스가 열립니다. 이는 기본값인 **보관한 뒤 → 이 태스크에 머무르기**의 동작입니다. **다음 알림 열기**를 고르면 내 동작으로 열어 둔 알림이 보관될 때 바로 다음 행(없으면 비워진 인박스)이 열리고, 확인 알림에 **실행 취소**가 나옵니다.-열어 둔 행을 직접 처리하면(인박스 바, 그 행, 호버 카드, 그 행을 포함한 일괄 작업) 대신 다음 행이 열립니다. 남은 행이 없으면 인박스 페이지가 열리고 **인박스가 비었습니다**가 표시됩니다. 방금 한 동작이 표시되고 **실행 취소**로 되돌릴 수 있으며, 미뤄 둔 태스크 수와 다음으로 돌아오는 시각, **내 작업**, 작업 중인 에이전트, **보관함 보기** 링크가 있습니다. 필터 때문에 나머지 알림이 가려진 경우에는 남은 알림 수와 **필터 지우고 계속하기**가 대신 표시됩니다. 뒤로 가면 태스크로 돌아갑니다. 보관과 일괄 작업의 확인에는 **실행 취소**가 있으며, 알림은 돌아오고 태스크 상태는 그대로 유지됩니다. **실행 취소**가 있는 확인 알림(보관, 미루기, 구독 해제 모두)은 10초 동안 표시되며, 표시되는 동안 `Z`를 누르면 그 동작을 취소합니다.+열어 둔 행을 직접 처리하면(인박스 바, 그 행, 호버 카드, 그 행을 포함한 일괄 작업) 대신 다음 행이 열립니다. 남은 행이 없으면 인박스 페이지가 열리고 **인박스가 비었습니다**가 표시됩니다. 방금 한 동작이 표시되고 **실행 취소**(또는 `Z`)로 되돌릴 수 있으며, 미뤄 둔 태스크 수와 다음으로 돌아오는 시각이 표시됩니다. 필터 때문에 나머지 알림이 가려진 경우에는 남은 알림 수와 **필터 지우고 계속하기**가 대신 표시됩니다. 뒤로 가면 태스크로 돌아갑니다. 보관과 일괄 작업의 확인에는 **실행 취소**가 있으며, 알림은 돌아오고 태스크 상태는 그대로 유지됩니다. **실행 취소**가 있는 확인 알림(보관, 미루기, 구독 해제 모두)은 10초 동안 표시되며, 표시되는 동안 `Z`를 누르면 그 동작을 취소합니다.이후 그 태스크에 새 알림이 오면 다시 인박스에 들어옵니다.diff --git a/apps/docs/content/docs/inbox.mdx b/apps/docs/content/docs/inbox.mdxindex 325329b5c0..0b927d5678 100644--- a/apps/docs/content/docs/inbox.mdx+++ b/apps/docs/content/docs/inbox.mdx@@ -139,7 +139,7 @@ Reading a notification doesn't remove it. A row leaves the inbox only when: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**.-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, shows how many issues are snoozed and when the next one returns, and links to **My work**, the agents that are working, and **View archived**. 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.+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.diff --git a/apps/docs/content/docs/inbox.zh-Hant.mdx b/apps/docs/content/docs/inbox.zh-Hant.mdxindex d230750043..b627ca4105 100644--- a/apps/docs/content/docs/inbox.zh-Hant.mdx+++ b/apps/docs/content/docs/inbox.zh-Hant.mdx@@ -139,7 +139,7 @@ multica inbox snooze <id>... --until tomorrow # RFC 3339、30m、3h、1d、1w開著的視窗會立即移除已歸檔的列,但你正開著的那一列除外。它的通知因為其他原因離開收件箱時(你在狀態裡把任務改為 `done`、別的視窗歸檔了它,或修改後不再符合分區的篩選),這一列會在原位保持高亮,收件箱列會說明發生了什麼。在列裡改**狀態**、**負責人**或執行**快捷操作**後通知被歸檔時,列會寫明是哪一項,例如「已改為進行中 · 通知已歸檔」,這幾個操作也留在列裡,可以接著改。**復原**(或按 `Z`)讓通知回來,**下一條**(或按 `E`)開啟下一列。你離開之後,這一列才會移出。如果這是收件箱裡的最後一條通知,列會改為顯示**收件箱已清空**和延後中的任務數,用**前往我的工作**代替**下一條**;按 `E` 會開啟已清空的收件箱。這是**歸檔後 → 停在目前任務**(預設)的行為;選**打開下一條**時,你的操作歸檔了正開著的通知後,會直接開啟下一列(沒有下一列時開啟已清空的收件箱),提示裡可以**復原**。-如果是你自己把正開著的這一列處理掉(在收件箱列、它所在的列、懸停卡片,或包含它的批次操作裡),會直接開啟下一列;沒有剩下的列時,會開啟收件箱頁面,顯示**收件箱已清空**:寫明你剛才的操作,可以**復原**把它找回,顯示延後中的任務數和下一條回來的時間,並提供**我的工作**、正在工作的代理和**查看已歸檔**入口。如果是篩選隱藏了收件箱裡的其餘通知,會改為說明還剩多少條,並提供**清除篩選,繼續處理**。返回上一頁可以回到任務。歸檔和批次操作的提示裡都可以**復原**:通知會回來,任務的狀態保持不變。帶**復原**的提示(歸檔、延後、取消訂閱都一樣)會停留 10 秒;提示還在時,按 `Z` 復原這次操作。+如果是你自己把正開著的這一列處理掉(在收件箱列、它所在的列、懸停卡片,或包含它的批次操作裡),會直接開啟下一列;沒有剩下的列時,會開啟收件箱頁面,顯示**收件箱已清空**:寫明你剛才的操作,可以**復原**(或按 `Z`)把它找回,並顯示延後中的任務數和下一條回來的時間。如果是篩選隱藏了收件箱裡的其餘通知,會改為說明還剩多少條,並提供**清除篩選,繼續處理**。返回上一頁可以回到任務。歸檔和批次操作的提示裡都可以**復原**:通知會回來,任務的狀態保持不變。帶**復原**的提示(歸檔、延後、取消訂閱都一樣)會停留 10 秒;提示還在時,按 `Z` 復原這次操作。之後該任務再有新通知,會重新進入收件箱。diff --git a/apps/docs/content/docs/inbox.zh.mdx b/apps/docs/content/docs/inbox.zh.mdxindex 2b5f7c9723..ef335f696d 100644--- a/apps/docs/content/docs/inbox.zh.mdx+++ b/apps/docs/content/docs/inbox.zh.mdx@@ -139,7 +139,7 @@ multica inbox snooze <id>... --until tomorrow # RFC 3339、30m、3h、1d、1w打开着的窗口会立即移除已归档的行,但你正打开的那一行除外。它的通知因为其他原因离开收件箱时(你在状态里把任务改为 `done`、别的窗口归档了它,或修改后不再符合分区的筛选),这一行会在原位保持高亮,收件箱栏会说明发生了什么。在栏里改**状态**、**负责人**或运行**快捷操作**后通知被归档时,栏会写明是哪一项,比如“已改为进行中 · 通知已归档”,这几个操作也留在栏里,可以接着改。**撤销**(或按 `Z`)让通知回来,**下一条**(或按 `E`)打开下一行。你离开之后,这一行才会移出。如果这是收件箱里的最后一条通知,栏会改为显示**收件箱已清空**和延后中的任务数,用**前往我的工作**代替**下一条**;按 `E` 会打开已清空的收件箱。这是**归档后 → 停在当前任务**(默认)的行为;选**打开下一条**时,你的操作归档了正打开的通知后,会直接打开下一行(没有下一行时打开已清空的收件箱),提示里可以**撤销**。-如果是你自己把正打开的这一行处理掉(在收件箱栏、它所在的行、悬停卡片,或包含它的批量操作里),会直接打开下一行;没有剩下的行时,会打开收件箱页面,显示**收件箱已清空**:写明你刚才的操作,可以**撤销**(或按 `Z`)把它找回,显示延后中的任务数和下一条回来的时间,并提供**我的工作**、正在工作的智能体和**查看已归档**入口。如果是筛选隐藏了收件箱里的其余通知,会改为说明还剩多少条,并提供**清除筛选,继续处理**。返回上一页可以回到任务。归档和批量操作的提示里都可以**撤销**:通知会回来,任务的状态保持不变。带**撤销**的提示(归档、延后、取消订阅都一样)会停留 10 秒;提示还在时,按 `Z` 撤销这次操作。+如果是你自己把正打开的这一行处理掉(在收件箱栏、它所在的行、悬停卡片,或包含它的批量操作里),会直接打开下一行;没有剩下的行时,会打开收件箱页面,显示**收件箱已清空**:写明你刚才的操作,可以**撤销**(或按 `Z`)把它找回,并显示延后中的任务数和下一条回来的时间。如果是筛选隐藏了收件箱里的其余通知,会改为说明还剩多少条,并提供**清除筛选,继续处理**。返回上一页可以回到任务。归档和批量操作的提示里都可以**撤销**:通知会回来,任务的状态保持不变。带**撤销**的提示(归档、延后、取消订阅都一样)会停留 10 秒;提示还在时,按 `Z` 撤销这次操作。之后该任务再有新通知,会重新进入收件箱。diff --git a/packages/views/inbox/components/inbox-empty-state.test.tsx b/packages/views/inbox/components/inbox-empty-state.test.tsxindex a1eaf5fa06..851300d0cb 100644--- a/packages/views/inbox/components/inbox-empty-state.test.tsx+++ b/packages/views/inbox/components/inbox-empty-state.test.tsx@@ -1,10 +1,9 @@import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";import { act, cleanup, fireEvent, screen } from "@testing-library/react";import { QueryClient, QueryClientProvider } from "@tanstack/react-query";-import { workspaceWorkingAgentsOptions } from "@multica/core/agents";import { inboxKeys, snoozedInboxOptions } from "@multica/core/inbox/queries";import { useInboxSelectionStore } from "@multica/core/inbox/selection-store";-import type { SnoozedInboxIssue, WorkspaceWorkingAgent } from "@multica/core/types";+import type { SnoozedInboxIssue } from "@multica/core/types";import { renderWithI18n } from "../../test/i18n";import { NavigationProvider, type NavigationAdapter } from "../../navigation";import { InboxEmptyState } from "./inbox-empty-state";@@ -15,11 +14,9 @@ const spies = vi.hoisted(() => ({unsnoozeAsync: vi.fn(() => Promise.resolve()),undoUnsubscribe: vi.fn((..._args: unknown[]) => Promise.resolve()),undoBatch: vi.fn((..._args: unknown[]) => Promise.resolve()),- guest: false,}));vi.mock("@multica/core/hooks", () => ({ useWorkspaceId: () => "ws" }));-vi.mock("@multica/core/permissions", () => ({ useIsGuest: () => spies.guest }));vi.mock("@multica/core/paths", async (importOriginal) => {const actual = await importOriginal<typeof import("@multica/core/paths")>();return { ...actual, useWorkspacePaths: () => actual.paths.workspace("acme") };@@ -56,9 +53,7 @@ function renderEmpty({inboxZeroRises = false,isCompact = false,snoozed = [],- workingAgents = [],onClearFiltersAndContinue = vi.fn(),- onViewArchived = vi.fn(),}: {isArchivedView?: boolean;visibleCount?: number;@@ -67,9 +62,7 @@ function renderEmpty({inboxZeroRises?: boolean;isCompact?: boolean;snoozed?: SnoozedInboxIssue[];- workingAgents?: WorkspaceWorkingAgent[];onClearFiltersAndContinue?: () => void;- onViewArchived?: () => void;} = {}) {const nav: NavigationAdapter = {push: vi.fn(),@@ -82,7 +75,6 @@ function renderEmpty({};const qc = new QueryClient({ defaultOptions: { queries: { retry: false, staleTime: Infinity } } });qc.setQueryData(snoozedInboxOptions("ws").queryKey, snoozed);- qc.setQueryData(workspaceWorkingAgentsOptions("ws", "issue").queryKey, workingAgents);const view = renderWithI18n(<QueryClientProvider client={qc}><NavigationProvider value={nav}>@@ -95,17 +87,15 @@ function renderEmpty({inboxZeroRises={inboxZeroRises}isCompact={isCompact}onClearFiltersAndContinue={onClearFiltersAndContinue}- onViewArchived={onViewArchived}/></NavigationProvider></QueryClientProvider>,);- return { ...view, nav, qc, onClearFiltersAndContinue, onViewArchived };+ return { ...view, nav, qc, onClearFiltersAndContinue };}beforeEach(() => {vi.clearAllMocks();- spies.guest = false;useInboxSelectionStore.setState({lastClearedByWorkspace: {},leftRowKeyByWorkspace: {},@@ -118,27 +108,23 @@ afterEach(() => {});describe("InboxEmptyState", () => {- it("shows calm Inbox Zero with My work, working agents, snoozed summary, and View archived", () => {+ it("shows minimal Inbox Zero with snoozed summary and no redundant navigation controls", () => {const until = new Date(Date.now() + 2 * 60 * 60 * 1000).toISOString();- const { nav, onViewArchived } = renderEmpty({+ const { nav } = renderEmpty({snoozed: [{ issue_id: "issue-9", item_id: "n-9", snoozed_until: until, snoozed_at: new Date().toISOString(), updates: 0 },],- workingAgents: [- { id: "a-1", name: "Emacs", avatar_url: null, running_task_count: 1, issue_ids: ["issue-1"] },- { id: "a-2", name: "Codex", avatar_url: null, running_task_count: 1, issue_ids: ["issue-2"] },- ],});expect(screen.getByRole("heading", { name: "Inbox cleared" })).toBeInTheDocument();- expect(screen.getByText(/1 snoozed/)).toBeInTheDocument();- expect(screen.getByRole("button", { name: "2 agents working" })).toBeInTheDocument();-- fireEvent.click(screen.getByRole("button", { name: "My work" }));- expect(nav.push).toHaveBeenCalledWith(expect.stringContaining("/acme/issues"));+ expect(screen.queryByText("Your inbox is empty")).toBeNull();+ expect(screen.queryByRole("button", { name: "My work" })).toBeNull();+ expect(screen.queryByRole("button", { name: "View archived" })).toBeNull();+ expect(screen.queryByRole("button", { name: /Quick jump/ })).toBeNull();+ expect(screen.queryByRole("button", { name: /New issue/ })).toBeNull();- fireEvent.click(screen.getByRole("button", { name: "View archived" }));- expect(onViewArchived).toHaveBeenCalledTimes(1);+ fireEvent.click(screen.getByRole("button", { name: /1 snoozed/ }));+ expect(nav.push).toHaveBeenCalledWith(expect.stringContaining("/acme/issues?view=snoozed"));});it("offers inline undo for the just-archived notification and navigates back on click", async () => {@@ -316,19 +302,6 @@ describe("InboxEmptyState", () => {expect(onClearFiltersAndContinue).toHaveBeenCalledTimes(1);});- it("hides member-only shortcuts and working agents for guests", () => {- spies.guest = true;- renderEmpty({- workingAgents: [- { id: "a-1", name: "Emacs", avatar_url: null, running_task_count: 1, issue_ids: ["issue-1"] },- ],- });-- expect(screen.queryByRole("button", { name: "My work" })).toBeNull();- expect(screen.queryByRole("button", { name: /agent/i })).toBeNull();- expect(screen.getByRole("button", { name: "View archived" })).toBeInTheDocument();- });-it("keeps the archived empty state quiet and separate from Inbox Zero", () => {renderEmpty({ isArchivedView: true });expect(screen.getByText("No archived notifications")).toBeInTheDocument();diff --git a/packages/views/inbox/components/inbox-empty-state.tsx b/packages/views/inbox/components/inbox-empty-state.tsxindex 85b48d6113..1724f8f9d7 100644--- a/packages/views/inbox/components/inbox-empty-state.tsx+++ b/packages/views/inbox/components/inbox-empty-state.tsx@@ -7,16 +7,12 @@ import {AlarmClock,Archive,Check,- CircleUser,Filter,- History,Inbox,Undo2,} from "@multica/ui/icons";import { Button } from "@multica/ui/components/ui/button";import { MulticaBleedMark } from "@multica/ui/components/common/multica-graphics";-import { workspaceWorkingAgentsOptions } from "@multica/core/agents";-import { useSearchStore } from "@multica/core/command-bar";import {undoArchiveInboxBatch,undoUnsubscribeArchiveInbox,@@ -27,9 +23,7 @@ import {useInboxSelectionStore,type LastInboxCleared,} from "@multica/core/inbox/selection-store";-import { openCreateIssueWithPreference } from "@multica/core/issues/stores";-import { useIsGuest } from "@multica/core/permissions";-import type { SnoozedInboxIssue, WorkspaceWorkingAgent } from "@multica/core/types";+import type { SnoozedInboxIssue } from "@multica/core/types";import { ActionShortcutKeycaps } from "../../common/shortcut-keycaps";import { useLocale, useT } from "../../i18n";import { useBuiltinViewNavigation } from "../../issue-views/builtin-views";@@ -39,7 +33,6 @@ import { useInboxUndoShortcut } from "./use-inbox-shortcut";import { useRestoreInbox } from "./use-leave-inbox-row";const NO_SNOOZED: SnoozedInboxIssue[] = [];-const NO_AGENTS: WorkspaceWorkingAgent[] = [];/*** The empty detail canvas of `/inbox`:@@ -48,8 +41,8 @@ const NO_AGENTS: WorkspaceWorkingAgent[] = [];* - Filtered-empty state when active filters hid remaining notifications* (never confused with true Inbox Zero).* - Calm Inbox Zero state with MulticaBleedMark, persistent inline undo for- * the action that just cleared the Inbox, snoozed summary, and quiet next- * steps (My work, working agents, Archived, keyboard hints).+ * the action that just cleared the Inbox, and snoozed summary when any+ * issues are waiting to return.*/export function InboxEmptyState({wsId,@@ -60,7 +53,6 @@ export function InboxEmptyState({inboxZeroRises,isCompact = false,onClearFiltersAndContinue,- onViewArchived,}: {wsId: string;isArchivedView: boolean;@@ -71,15 +63,12 @@ export function InboxEmptyState({inboxZeroRises: boolean;isCompact?: boolean;onClearFiltersAndContinue: () => void;- onViewArchived: () => void;}) {const { t } = useT("inbox");- const { t: tLayout } = useT("layout");const locale = useLocale();const qc = useQueryClient();const { push } = useNavigation();const builtinNav = useBuiltinViewNavigation();- const guest = useIsGuest(wsId);const restoreInbox = useRestoreInbox();const { mutateAsync: unsnoozeAsync } = useUnsnoozeInbox();@@ -93,10 +82,6 @@ export function InboxEmptyState({...snoozedInboxOptions(wsId),enabled: isInboxZero && !!wsId,});- const { data: workingAgents = NO_AGENTS } = useQuery({- ...workspaceWorkingAgentsOptions(wsId, "issue"),- enabled: isInboxZero && !guest && !!wsId,- });const activeSnoozed = useMemo(() => {const now = Date.now();@@ -105,8 +90,6 @@ export function InboxEmptyState({.sort((a, b) => new Date(a.snoozed_until).getTime() - new Date(b.snoozed_until).getTime());}, [snoozed]);- const workingCount = workingAgents.length;-const [undoing, setUndoing] = useState(false);/** Resolves whether the undo went through; a failure is toasted. */@@ -257,7 +240,7 @@ export function InboxEmptyState({<Check className="size-5" /></div><h2 className="text-title font-semibold text-foreground">{t(($) => $.zero.cleared_title)}</h2>- {lastCleared ? (+ {lastCleared && (<p className="mt-1.5 flex flex-wrap items-center justify-center gap-1.5 text-label text-muted-foreground"><span>{clearedSummary(lastCleared)}</span>{canUndoCleared(lastCleared) && (@@ -267,7 +250,7 @@ export function InboxEmptyState({type="button"disabled={undoing}onClick={() => void handleUndoCleared(lastCleared)}- className="inline-flex items-center gap-1 rounded-md bg-muted px-2 py-0.5 text-caption font-medium text-foreground transition-colors hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50"+ className="-mx-1.5 inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-caption font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50"><Undo2 className="size-3" />{t(($) => $.toasts.undo)}@@ -276,8 +259,6 @@ export function InboxEmptyState({</>)}</p>- ) : (- <p className="mt-1.5 text-label text-muted-foreground">{t(($) => $.detail.empty)}</p>)}{activeSnoozed.length > 0 && earliestSnooze && (@@ -298,67 +279,6 @@ export function InboxEmptyState({</span></button>)}-- <div className="mt-6 flex flex-wrap items-center justify-center gap-2">- {!guest && (- <Button- size="sm"- variant="outline"- onClick={() => {- builtinNav.prepare("my_work");- push?.(builtinNav.hrefFor("my_work"));- }}- >- <CircleUser />- <span>{t(($) => $.zero.my_work)}</span>- </Button>- )}- {!guest && workingCount > 0 && (- <Button- size="sm"- variant="outline"- onClick={() => {- builtinNav.prepare("working");- push?.(builtinNav.hrefFor("working"));- }}- >- <span aria-hidden className="size-1.5 shrink-0 rounded-full bg-brand ring-3 ring-brand/20" />- <span>{t(($) => $.zero.agents_working, { count: workingCount })}</span>- </Button>- )}- <Button- size="sm"- variant="outline"- className="text-muted-foreground"- onClick={onViewArchived}- >- <History />- <span>{t(($) => $.zero.view_archived)}</span>- </Button>- </div>-- {!isCompact && (- <div className="mt-5 flex items-center justify-center gap-4 text-caption text-faint-foreground">- {!guest && (- <button- type="button"- onClick={() => openCreateIssueWithPreference()}- className="inline-flex items-center gap-1.5 rounded-md px-1 py-0.5 transition-colors hover:text-muted-foreground focus-visible:outline-2 focus-visible:outline-ring"- >- <ActionShortcutKeycaps action="createIssue" />- <span>{tLayout(($) => $.sidebar.new_issue)}</span>- </button>- )}- <button- type="button"- onClick={() => useSearchStore.getState().setOpen(true)}- className="inline-flex items-center gap-1.5 rounded-md px-1 py-0.5 transition-colors hover:text-muted-foreground focus-visible:outline-2 focus-visible:outline-ring"- >- <ActionShortcutKeycaps action="openSearch" />- <span>{t(($) => $.zero.quick_jump)}</span>- </button>- </div>- )}</div></div>);diff --git a/packages/views/inbox/components/inbox-page.test.tsx b/packages/views/inbox/components/inbox-page.test.tsxindex d5e48a89c5..cb5925b907 100644--- a/packages/views/inbox/components/inbox-page.test.tsx+++ b/packages/views/inbox/components/inbox-page.test.tsx@@ -792,6 +792,25 @@ describe("InboxPage", () => {expect(screen.getByTestId("list").dataset.view).toBe("archived");});+ it("switches to the archive from the page header title menu on desktop", async () => {+ reset();+ layout.width = DESKTOP;+ listData.active = [];+ listData.archived = [item({ id: "archived-1", archived: true })];+ const { container } = render(<InboxPage />);++ expect(screen.queryByTestId("list")).toBeNull();+ const titleMenu = container.querySelector("h1 [aria-haspopup='menu']") as HTMLElement;+ expect(titleMenu).not.toBeNull();+ fireEvent.click(titleMenu);+ const [inboxOption, archivedOption] = await screen.findAllByRole("menuitemradio");+ expect(inboxOption).toHaveAttribute("aria-checked", "true");+ fireEvent.click(archivedOption!);++ expect(replace).toHaveBeenLastCalledWith("/acme/inbox?view=archived");+ expect(screen.getByTestId("list").dataset.view).toBe("archived");+ });+it("hides the batch-actions menu in the archived view", () => {// Every batch action archives from the MAIN inbox; offering them over the// archived list would read as "archive all of these" and do the opposite.diff --git a/packages/views/inbox/components/inbox-page.tsx b/packages/views/inbox/components/inbox-page.tsxindex 043e239969..e512c0f6f8 100644--- a/packages/views/inbox/components/inbox-page.tsx+++ b/packages/views/inbox/components/inbox-page.tsx@@ -770,41 +770,45 @@ export function InboxPage() {// -- Shared sub-components --------------------------------------------------+ // The archive is a second list of the same page, so the title doubles as+ // the switch between the two instead of costing a row of its own. Reused in+ // the desktop empty-detail header so guests (whose sidebar has no Inbox menu)+ // and collapsed-list layouts keep the same switcher.+ const viewSwitcher = (+ <DropdownMenu>+ <DropdownMenuTrigger className="-ml-1.5 mr-1.5 flex min-w-0 items-center gap-1 rounded-md px-1.5 py-0.5 outline-none transition-colors hover:bg-accent/60 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring aria-expanded:bg-accent/60">+ <span className="min-w-0 truncate">+ {isArchivedView ? t(($) => $.list.archived_title) : t(($) => $.page.title)}+ </span>+ <ChevronDown className="size-3.5 shrink-0 text-muted-foreground" />+ </DropdownMenuTrigger>+ <DropdownMenuContent align="start" className="w-auto min-w-44">+ <DropdownMenuRadioGroup+ value={view}+ onValueChange={(value) => setView(value as InboxView)}+ >+ <DropdownMenuRadioItem value="inbox">+ <Inbox className="h-4 w-4" />+ <span className="flex-1">{t(($) => $.page.title)}</span>+ {unreadCount > 0 && (+ <span className="text-caption tabular-nums text-muted-foreground">+ {unreadCount}+ </span>+ )}+ </DropdownMenuRadioItem>+ <DropdownMenuRadioItem value="archived">+ <Archive className="h-4 w-4" />+ {t(($) => $.list.archived_title)}+ </DropdownMenuRadioItem>+ </DropdownMenuRadioGroup>+ </DropdownMenuContent>+ </DropdownMenu>+ );+const listHeader = (<PanelHeaderas="h1"- title={- // The archive is a second list of the same page, so the title doubles- // as the switch between the two instead of costing a row of its own.- <DropdownMenu>- <DropdownMenuTrigger className="-ml-1.5 mr-1.5 flex min-w-0 items-center gap-1 rounded-md px-1.5 py-0.5 outline-none transition-colors hover:bg-accent/60 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring aria-expanded:bg-accent/60">- <span className="min-w-0 truncate">- {isArchivedView ? t(($) => $.list.archived_title) : t(($) => $.page.title)}- </span>- <ChevronDown className="size-3.5 shrink-0 text-muted-foreground" />- </DropdownMenuTrigger>- <DropdownMenuContent align="start" className="w-auto min-w-44">- <DropdownMenuRadioGroup- value={view}- onValueChange={(value) => setView(value as InboxView)}- >- <DropdownMenuRadioItem value="inbox">- <Inbox className="h-4 w-4" />- <span className="flex-1">{t(($) => $.page.title)}</span>- {unreadCount > 0 && (- <span className="text-caption tabular-nums text-muted-foreground">- {unreadCount}- </span>- )}- </DropdownMenuRadioItem>- <DropdownMenuRadioItem value="archived">- <Archive className="h-4 w-4" />- {t(($) => $.list.archived_title)}- </DropdownMenuRadioItem>- </DropdownMenuRadioGroup>- </DropdownMenuContent>- </DropdownMenu>- }+ title={viewSwitcher}leading={<CollapsedNavTrigger />}meta={!isArchivedView && unreadCount > 0 && (@@ -1290,9 +1294,7 @@ export function InboxPage() {<>{(!archiveSplit || listCollapsed) && (<PageHeader>- <h1 className="text-body font-semibold">- {isArchivedView ? t(($) => $.list.archived_title) : t(($) => $.page.title)}- </h1>+ <h1 className="text-body font-semibold">{viewSwitcher}</h1></PageHeader>)}{liveFailed ? (@@ -1307,7 +1309,6 @@ export function InboxPage() {inboxZeroRises={inboxZeroRises}isCompact={isCompact}onClearFiltersAndContinue={handleClearFiltersAndContinue}- onViewArchived={() => setView("archived")}/>)}</>diff --git a/packages/views/locales/en/inbox.json b/packages/views/locales/en/inbox.jsonindex 6c1c7c8c57..cc7d2bdb10 100644--- a/packages/views/locales/en/inbox.json+++ b/packages/views/locales/en/inbox.json@@ -65,7 +65,6 @@},"detail": {"select_prompt": "Select a notification to view details",- "empty": "Your inbox is empty","original_input": "Original input","retry_with_context": "Retry with context","edit_advanced": "Open full form",@@ -243,12 +242,7 @@"snoozed_summary_other": "{{count}} snoozed · next returns {{time}}","bar_snoozed_one": "{{count}} snoozed","bar_snoozed_other": "{{count}} snoozed",- "my_work": "My work","go_to_my_work": "Go to My work",- "agents_working_one": "{{count}} agent working",- "agents_working_other": "{{count}} agents working",- "view_archived": "View archived",- "quick_jump": "Quick jump","filtered_title": "All caught up for this filter","filtered_remaining_one": "{{count}} other notification in your inbox","filtered_remaining_other": "{{count}} other notifications in your inbox",diff --git a/packages/views/locales/es/inbox.json b/packages/views/locales/es/inbox.jsonindex 2936a25b4b..f12862eaba 100644--- a/packages/views/locales/es/inbox.json+++ b/packages/views/locales/es/inbox.json@@ -65,7 +65,6 @@},"detail": {"select_prompt": "Selecciona una notificación para ver los detalles",- "empty": "Tu bandeja de entrada está vacía","original_input": "Entrada original","retry_with_context": "Reintentar con contexto","edit_advanced": "Abrir formulario completo",@@ -243,12 +242,7 @@"snoozed_summary_other": "{{count}} pospuestas · la próxima vuelve {{time}}","bar_snoozed_one": "{{count}} pospuesta","bar_snoozed_other": "{{count}} pospuestas",- "my_work": "Mi trabajo","go_to_my_work": "Ir a Mi trabajo",- "agents_working_one": "{{count}} agente trabajando",- "agents_working_other": "{{count}} agentes trabajando",- "view_archived": "Ver archivadas",- "quick_jump": "Ir rápido","filtered_title": "Todo al día para este filtro","filtered_remaining_one": "Hay {{count}} otra notificación en tu bandeja","filtered_remaining_other": "Hay {{count}} otras notificaciones en tu bandeja",diff --git a/packages/views/locales/fr/inbox.json b/packages/views/locales/fr/inbox.jsonindex 8b5691eede..062c1b4491 100644--- a/packages/views/locales/fr/inbox.json+++ b/packages/views/locales/fr/inbox.json@@ -65,7 +65,6 @@},"detail": {"select_prompt": "Sélectionnez une notification pour afficher les détails",- "empty": "Votre boîte de réception est vide","original_input": "Saisie d'origine","retry_with_context": "Réessayer avec le contexte","edit_advanced": "Ouvrir le formulaire complet",@@ -243,12 +242,7 @@"snoozed_summary_other": "{{count}} reportées · prochain retour {{time}}","bar_snoozed_one": "{{count}} reportée","bar_snoozed_other": "{{count}} reportées",- "my_work": "Mon travail","go_to_my_work": "Aller à Mon travail",- "agents_working_one": "{{count}} agent en cours",- "agents_working_other": "{{count}} agents en cours",- "view_archived": "Voir les archives",- "quick_jump": "Accès rapide","filtered_title": "Tout est traité pour ce filtre","filtered_remaining_one": "{{count}} autre notification dans votre boîte de réception","filtered_remaining_other": "{{count}} autres notifications dans votre boîte de réception",diff --git a/packages/views/locales/ja/inbox.json b/packages/views/locales/ja/inbox.jsonindex 78e5b9cf85..c404406990 100644--- a/packages/views/locales/ja/inbox.json+++ b/packages/views/locales/ja/inbox.json@@ -63,7 +63,6 @@},"detail": {"select_prompt": "詳細を表示する通知を選択してください",- "empty": "インボックスは空です","original_input": "元の入力","retry_with_context": "コンテキストを保持して再試行","edit_advanced": "詳細フォームを開く",@@ -235,11 +234,7 @@"just_archived_many_other": "{{count}} 件の通知をアーカイブしました","snoozed_summary_other": "スヌーズ中 {{count}} 件 · 最短 {{time}} に復帰","bar_snoozed_other": "スヌーズ中 {{count}} 件",- "my_work": "自分の作業","go_to_my_work": "自分の作業へ",- "agents_working_other": "{{count}} 体のエージェントが稼働中",- "view_archived": "アーカイブを見る",- "quick_jump": "クイック移動","filtered_title": "このフィルターの通知はすべて処理済みです","filtered_remaining_other": "インボックスに他の通知が {{count}} 件あります","clear_and_continue": "フィルターを解除して続ける",diff --git a/packages/views/locales/ko/inbox.json b/packages/views/locales/ko/inbox.jsonindex c7cb7591b0..317b996c6e 100644--- a/packages/views/locales/ko/inbox.json+++ b/packages/views/locales/ko/inbox.json@@ -63,7 +63,6 @@},"detail": {"select_prompt": "자세히 볼 알림을 선택하세요",- "empty": "인박스가 비어 있습니다","original_input": "원본 입력","retry_with_context": "컨텍스트를 유지하여 재시도","edit_advanced": "전체 양식 열기",@@ -235,11 +234,7 @@"just_archived_many_other": "알림 {{count}}개를 보관했습니다","snoozed_summary_other": "미룬 알림 {{count}}개 · 가장 빠른 복귀 {{time}}","bar_snoozed_other": "미룸 {{count}}개",- "my_work": "내 작업","go_to_my_work": "내 작업으로 이동",- "agents_working_other": "에이전트 {{count}}개 작업 중",- "view_archived": "보관함 보기",- "quick_jump": "빠른 이동","filtered_title": "현재 필터의 알림을 모두 처리했습니다","filtered_remaining_other": "인박스에 다른 알림 {{count}}개가 남아 있습니다","clear_and_continue": "필터 지우고 계속하기",diff --git a/packages/views/locales/ru/inbox.json b/packages/views/locales/ru/inbox.jsonindex c80cdb99c1..c63e17074d 100644--- a/packages/views/locales/ru/inbox.json+++ b/packages/views/locales/ru/inbox.json@@ -69,7 +69,6 @@},"detail": {"select_prompt": "Выберите уведомление, чтобы посмотреть детали",- "empty": "Ваши входящие пусты","original_input": "Исходный ввод","retry_with_context": "Повторить с контекстом","edit_advanced": "Открыть полную форму",@@ -259,14 +258,7 @@"bar_snoozed_few": "{{count}} отложено","bar_snoozed_many": "{{count}} отложено","bar_snoozed_other": "{{count}} отложено",- "my_work": "Моя работа","go_to_my_work": "Перейти к «Моей работе»",- "agents_working_one": "Работает {{count}} агент",- "agents_working_few": "Работают {{count}} агента",- "agents_working_many": "Работают {{count}} агентов",- "agents_working_other": "Работают {{count}} агентов",- "view_archived": "Открыть архив",- "quick_jump": "Быстрый переход","filtered_title": "По этому фильтру всё разобрано","filtered_remaining_one": "Во входящих осталось ещё {{count}} уведомление","filtered_remaining_few": "Во входящих осталось ещё {{count}} уведомления",diff --git a/packages/views/locales/zh-Hans/inbox.json b/packages/views/locales/zh-Hans/inbox.jsonindex 1410e9cd69..bf45b3c7fc 100644--- a/packages/views/locales/zh-Hans/inbox.json+++ b/packages/views/locales/zh-Hans/inbox.json@@ -63,7 +63,6 @@},"detail": {"select_prompt": "选择一条通知查看详情",- "empty": "收件箱为空","original_input": "原始输入","retry_with_context": "保留上下文重试","edit_advanced": "在完整表单中编辑",@@ -235,11 +234,7 @@"just_archived_many_other": "已归档 {{count}} 条通知","snoozed_summary_other": "{{count}} 条延后通知 · 最早 {{time}} 回来","bar_snoozed_other": "{{count}} 条已延后",- "my_work": "我的工作","go_to_my_work": "前往我的工作",- "agents_working_other": "{{count}} 个智能体正在工作",- "view_archived": "查看已归档",- "quick_jump": "快速跳转","filtered_title": "当前筛选下的通知已处理完","filtered_remaining_other": "收件箱里还有 {{count}} 条其他通知待处理","clear_and_continue": "清除筛选,继续处理",diff --git a/packages/views/locales/zh-Hant/inbox.json b/packages/views/locales/zh-Hant/inbox.jsonindex 248ac78da4..ce3696a613 100644--- a/packages/views/locales/zh-Hant/inbox.json+++ b/packages/views/locales/zh-Hant/inbox.json@@ -63,7 +63,6 @@},"detail": {"select_prompt": "選擇一條通知檢視詳情",- "empty": "收件箱為空","original_input": "原始輸入","retry_with_context": "保留上下文重試","edit_advanced": "開啟完整表單",@@ -235,11 +234,7 @@"just_archived_many_other": "已歸檔 {{count}} 則通知","snoozed_summary_other": "{{count}} 則延後通知 · 最早 {{time}} 回來","bar_snoozed_other": "{{count}} 則已延後",- "my_work": "我的工作","go_to_my_work": "前往我的工作",- "agents_working_other": "{{count}} 個智能體正在工作",- "view_archived": "查看已歸檔",- "quick_jump": "快速跳轉","filtered_title": "目前篩選下的通知已處理完","filtered_remaining_other": "收件箱裡還有 {{count}} 則其他通知待處理","clear_and_continue": "清除篩選,繼續處理",