From c87c248e89e5893618fbef32b9b3856713d46d89 Mon Sep 17 00:00:00 2001 From: altair823 Date: Tue, 5 May 2026 00:12:56 +0900 Subject: [PATCH] =?UTF-8?q?refactor(v024):=20NoteCard=20onDeleted=20option?= =?UTF-8?q?al=20+=20trash=20mode=20=EB=AF=B8=EC=A0=84=EB=8B=AC=20(backlog?= =?UTF-8?q?=20#13)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - onDeleted: () => void → onDeleted?: () => void (inbox mode 전용 명시) - handleDelete 내부 onDeleted() → onDeleted?.() - App.tsx 의 trash mode NoteCard 가 onDeleted prop 미전달 (dead-code 제거) - API 시그니처 정리 — trash mode 는 onPermanentDelete/onRestore 만 의미 Co-Authored-By: Claude Opus 4.7 (1M context) --- src/renderer/inbox/App.tsx | 1 - src/renderer/inbox/components/NoteCard.tsx | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/renderer/inbox/App.tsx b/src/renderer/inbox/App.tsx index 0926b68..54aad1b 100644 --- a/src/renderer/inbox/App.tsx +++ b/src/renderer/inbox/App.tsx @@ -147,7 +147,6 @@ export function App(): React.ReactElement { trashNotes.map((n) => ( removeNote(n.id)} onUpdated={(u) => upsertNote(u)} onRestore={() => void restoreNote(n.id)} onPermanentDelete={() => void permanentDeleteNote(n.id)} diff --git a/src/renderer/inbox/components/NoteCard.tsx b/src/renderer/inbox/components/NoteCard.tsx index 46fd9af..b9242e2 100644 --- a/src/renderer/inbox/components/NoteCard.tsx +++ b/src/renderer/inbox/components/NoteCard.tsx @@ -8,7 +8,7 @@ import { pushTagUndo } from './TagUndoToast.js'; interface Props { note: Note; - onDeleted: () => void; + onDeleted?: () => void; // inbox mode 전용 (trash mode 에서 미사용) onUpdated: (n: Note) => void; mode?: 'inbox' | 'trash'; // default 'inbox' onRestore?: () => void; @@ -119,7 +119,7 @@ export function NoteCard({ note, onDeleted, onUpdated, mode = 'inbox', onRestore async function handleDelete() { if (!window.confirm('이 기억을 버릴까요? 되돌릴 수 없습니다.')) return; await inboxApi.deleteNote(note.id); - onDeleted(); + onDeleted?.(); } async function saveTitle(next: string) {