From bdaab89c8ea190a1a1497a41569b6b8da613b731 Mon Sep 17 00:00:00 2001 From: Jiayuan Date: Wed, 29 Apr 2026 17:51:55 +0200 Subject: [PATCH] fix(inbox): auto-archive inbox item when marking done from issue detail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When viewing an inbox notification's issue detail and clicking the "Mark as done" toolbar button, the inbox item was not archived — only the issue status changed. Add an onDone callback to IssueDetail so the inbox page can archive the notification alongside the status update, matching the behavior of the list-item Done button. Closes MUL-1594 --- packages/views/inbox/components/inbox-page.tsx | 6 ++++++ packages/views/issues/components/issue-detail.tsx | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/views/inbox/components/inbox-page.tsx b/packages/views/inbox/components/inbox-page.tsx index cd2b7dff9..3abc42a3e 100644 --- a/packages/views/inbox/components/inbox-page.tsx +++ b/packages/views/inbox/components/inbox-page.tsx @@ -277,6 +277,12 @@ export function InboxPage() { // longer exists. setSelectedKey(""); }} + onDone={() => { + setSelectedKey(""); + archiveMutation.mutate(selected.id, { + onError: () => toast.error("Failed to archive"), + }); + }} /> ) : selected ? (
diff --git a/packages/views/issues/components/issue-detail.tsx b/packages/views/issues/components/issue-detail.tsx index 2b35c6239..218bb1833 100644 --- a/packages/views/issues/components/issue-detail.tsx +++ b/packages/views/issues/components/issue-detail.tsx @@ -139,6 +139,8 @@ function formatTokenCount(n: number): string { interface IssueDetailProps { issueId: string; onDelete?: () => void; + /** Called after the issue is marked as done via the toolbar button. */ + onDone?: () => void; defaultSidebarOpen?: boolean; layoutId?: string; /** When set, the issue detail will auto-scroll to this comment and briefly highlight it. */ @@ -149,7 +151,7 @@ interface IssueDetailProps { // IssueDetail // --------------------------------------------------------------------------- -export function IssueDetail({ issueId, onDelete, defaultSidebarOpen = true, layoutId = "multica_issue_detail_layout", highlightCommentId }: IssueDetailProps) { +export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = true, layoutId = "multica_issue_detail_layout", highlightCommentId }: IssueDetailProps) { const id = issueId; const router = useNavigation(); const user = useAuthStore((s) => s.user); @@ -520,7 +522,7 @@ export function IssueDetail({ issueId, onDelete, defaultSidebarOpen = true, layo variant="ghost" size="icon-sm" className="text-muted-foreground" - onClick={() => handleUpdateField({ status: "done" })} + onClick={() => { handleUpdateField({ status: "done" }); onDone?.(); }} >