Compare commits

...

1 Commits

Author SHA1 Message Date
Jiayuan
bdaab89c8e fix(inbox): auto-archive inbox item when marking done from issue detail
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
2026-04-29 17:51:55 +02:00
2 changed files with 10 additions and 2 deletions

View File

@@ -277,6 +277,12 @@ export function InboxPage() {
// longer exists.
setSelectedKey("");
}}
onDone={() => {
setSelectedKey("");
archiveMutation.mutate(selected.id, {
onError: () => toast.error("Failed to archive"),
});
}}
/>
) : selected ? (
<div className="p-6">

View File

@@ -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?.(); }}
>
<CircleCheck />
</Button>