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;