mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-05 13:29:44 +02:00
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
This commit is contained in:
@@ -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">
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user