From e19f6a8de7b042ecde6693f4008be1e65641e405 Mon Sep 17 00:00:00 2001 From: altair823 Date: Thu, 7 May 2026 09:49:09 +0900 Subject: [PATCH] =?UTF-8?q?chore(v027):=20PR=20review=20minor=20cleanup=20?= =?UTF-8?q?3=EA=B1=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - types.ts:119 stale "Task 25 cleanup" comment 제거 (Task 25 이미 완료) - BackupSection.tsx 의 dead try/catch 제거 + status 단순화 — 모든 IPC 핸들러가 자체 try/catch + Notification 으로 결과 알림. 컴포넌트 status 는 진행 표시 보조용 - index.ts startup #45 autostart 진단 로그를 AutostartDiagnostic.collectAutostartState() 호출로 통합 — single source of truth (SettingsPage 진단 패널과 동일 데이터 소스) 460/460 pass, typecheck 0. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/main/index.ts | 11 +++-------- .../inbox/components/settings/BackupSection.tsx | 10 ++++------ src/shared/types.ts | 2 +- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/main/index.ts b/src/main/index.ts index 073556c..52f9f4a 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -32,6 +32,7 @@ import { ImportService } from './services/ImportService.js'; import { SyncService } from './services/SyncService.js'; import { TelemetryService } from './services/TelemetryService.js'; import { SettingsService } from './services/SettingsService.js'; +import { collectAutostartState } from './services/AutostartDiagnostic.js'; import { DEFAULT_OLLAMA_ENDPOINT, DEFAULT_OLLAMA_MODEL } from '../shared/constants.js'; const HIDDEN_ARG = '--hidden'; @@ -84,14 +85,8 @@ app.whenReady().then(async () => { writeFileSync(initFlag, new Date().toISOString()); logger.info('autostart.enabled.firstRun'); } - // v0.2.6 #45 진단 — 실제 LoginItem 상태 확인 (args 전달 vs 미전달 차이) - const withArgs = app.getLoginItemSettings({ args: [HIDDEN_ARG] }); - const noArgs = app.getLoginItemSettings(); - logger.info('autostart.state', { - withArgs: { openAtLogin: withArgs.openAtLogin, executableWillLaunchAtLogin: withArgs.executableWillLaunchAtLogin }, - noArgs: { openAtLogin: noArgs.openAtLogin, executableWillLaunchAtLogin: noArgs.executableWillLaunchAtLogin }, - expectedArgs: [HIDDEN_ARG] - }); + // v0.2.6 #45 진단 — startup 로그. 같은 정보가 SettingsPage 진단 패널에도 surface (collectAutostartState single source of truth). + void collectAutostartState().then((state) => logger.info('autostart.state', { ...state })); } const db = openDb(paths.dbFile); const repo = new NoteRepository(db); diff --git a/src/renderer/inbox/components/settings/BackupSection.tsx b/src/renderer/inbox/components/settings/BackupSection.tsx index 37722ef..d1d9d7b 100644 --- a/src/renderer/inbox/components/settings/BackupSection.tsx +++ b/src/renderer/inbox/components/settings/BackupSection.tsx @@ -4,14 +4,12 @@ import { inboxApi } from '../../api.js'; export function BackupSection(): React.ReactElement { const [status, setStatus] = useState(null); + // IPC 핸들러 (settingsApi.ts) 가 자체 try/catch + Notification 으로 결과를 사용자에게 알림. + // 이 컴포넌트의 status 는 보조 진행 표시 — 결과 (성공/실패) 는 native UX 에 의존. async function run(label: string, fn: () => Promise): Promise { setStatus(`${label}: 진행 중...`); - try { - await fn(); - setStatus(`${label}: 완료`); - } catch (e) { - setStatus(`${label}: 실패 — ${(e as Error).message}`); - } + await fn(); + setStatus(null); } return ( diff --git a/src/shared/types.ts b/src/shared/types.ts index cb1eb9f..883651e 100644 --- a/src/shared/types.ts +++ b/src/shared/types.ts @@ -116,7 +116,7 @@ export interface InboxApi { runImport(): Promise<{ ok: true }>; runSync(): Promise<{ ok: true }>; runExportTelemetry(): Promise<{ ok: true }>; - // v0.2.7 정보 섹션 (Task 11) — 트레이 showAboutDialog 의 IPC 대응. 트레이 잔류 → Task 25 cleanup. + // 정보 섹션 — 트레이 showAboutDialog 의 IPC 대응. getAppInfo(): Promise<{ version: string; electron: string;