feat(app): add diagnostics and update runtime

This commit is contained in:
Codex
2026-06-06 20:42:34 +07:00
parent 925181a3b7
commit 7c40558cd3
23 changed files with 2232 additions and 2792 deletions

View File

@@ -43,7 +43,6 @@ const VALID_CATEGORIES: ReminderCategory[] = [
'eyes',
'posture'
]
const HHMM_RE = /^\d{1,2}:\d{2}$/
function isObj(v: unknown): v is Record<string, unknown> {
return typeof v === 'object' && v !== null && !Array.isArray(v)
@@ -130,7 +129,11 @@ export function validateExerciseInput(
// dailyGoal: undefined = не задан (нет soft-cap'a), null от UI приводим к
// undefined; иначе — должен пройти int-range, иначе reject (нельзя
// отправить из renderer'а NaN/негатив и тихо обнулить).
if (raw.dailyGoal !== undefined && raw.dailyGoal !== null && dailyGoal === undefined) {
if (
raw.dailyGoal !== undefined &&
raw.dailyGoal !== null &&
dailyGoal === undefined
) {
return null
}
if (
@@ -438,8 +441,8 @@ export function validateSettingsPatch(raw: unknown): Partial<Settings> | null {
enabled === undefined ||
from === undefined ||
to === undefined ||
!HHMM_RE.test(from) ||
!HHMM_RE.test(to)
validHHMM(from) === undefined ||
validHHMM(to) === undefined
) {
return null
}