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?.(); }} >