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

@@ -300,7 +300,7 @@ export const DEFAULT_SETTINGS: Settings = {
const HHMM_RE = /^(\d{1,2}):(\d{2})$/
/** Parse `HH:MM` into minutes-since-midnight, or `null` if malformed. */
function parseHHMM(s: string): number | null {
export function parseHHMM(s: string): number | null {
const m = HHMM_RE.exec(s)
if (!m) return null
const h = Number(m[1])
@@ -455,3 +455,45 @@ export type UpdaterStatus =
}
| { kind: 'downloaded'; version: string }
| { kind: 'error'; message: string }
export type DiagnosticsInfo = {
generatedAt: number
app: {
version: string
isPackaged: boolean
platform: string
arch: string
}
runtime: {
electron: string
chrome: string
node: string
}
paths: {
userData: string
store: string
logs: string
}
store: {
bytes: number | null
exercises: number
meals: number
challenges: number
history: number
}
updater: UpdaterStatus
games: GameStatus[]
gsi: {
running: boolean
port: number
baseUrl: string
}
meetingActive: boolean
}
export type RendererErrorReport = {
message: string
stack?: string
componentStack?: string
source?: string
}