fix: export/import — отмена пользователем не показывает error toast

Bug: при отмене save-dialog или open-dialog DataCard показывал тост
«Не удалось сохранить» / «Файл не подошёл». Но cancel — это не ошибка.

Расширил IPC возврат: { ok, canceled, path?, error? }. UI теперь
различает: ok → success toast, !ok && canceled → молча, !ok && !canceled
→ error toast.

+9 тестов на validateSettingsPatch для voicePromptsEnabled,
meetingAutoPause, lastSeenVersion (semver-regex / null-сброс /
malformed). Итого 159 → 168 тестов.

Settings → About теперь показывает текущую версию приложения
(раньше была только кнопка «Что нового»). Загружается через
IPC.getAppVersion при mount.
This commit is contained in:
AnRil
2026-05-22 23:26:11 +07:00
parent 0c813c3ac8
commit 2b7eb412c7
4 changed files with 84 additions and 12 deletions

View File

@@ -122,10 +122,17 @@ const api = {
ipcRenderer.invoke(IPC.clearHistory, beforeTs),
// Export / Import — открывают native save/open dialogs из main process.
exportState: (): Promise<{ ok: boolean; path: string | null }> =>
ipcRenderer.invoke(IPC.exportState),
importState: (): Promise<{ ok: boolean; error?: string }> =>
ipcRenderer.invoke(IPC.importState),
exportState: (): Promise<{
ok: boolean
canceled: boolean
path: string | null
error?: string
}> => ipcRenderer.invoke(IPC.exportState),
importState: (): Promise<{
ok: boolean
canceled: boolean
error?: string
}> => ipcRenderer.invoke(IPC.importState),
onTick: (h: Handler<Tick[]>): Unsub => on(IPC.evtTick, h),
onFire: (h: Handler<Exercise>): Unsub => on(IPC.evtFire, h),