feat(report): reuse years loading across page switches

This commit is contained in:
tisonhuang
2026-03-04 17:07:00 +08:00
parent 423d760f36
commit e1944783d0
6 changed files with 621 additions and 76 deletions

View File

@@ -486,6 +486,21 @@ export interface ElectronAPI {
startAvailableYearsLoad: () => Promise<{
success: boolean
taskId?: string
reused?: boolean
snapshot?: {
years?: number[]
done: boolean
error?: string
canceled?: boolean
strategy?: 'cache' | 'native' | 'hybrid'
phase?: 'cache' | 'native' | 'scan' | 'done'
statusText?: string
nativeElapsedMs?: number
scanElapsedMs?: number
totalElapsedMs?: number
switched?: boolean
nativeTimedOut?: boolean
}
error?: string
}>
cancelAvailableYearsLoad: (taskId: string) => Promise<{
@@ -582,6 +597,14 @@ export interface ElectronAPI {
done: boolean
error?: string
canceled?: boolean
strategy?: 'cache' | 'native' | 'hybrid'
phase?: 'cache' | 'native' | 'scan' | 'done'
statusText?: string
nativeElapsedMs?: number
scanElapsedMs?: number
totalElapsedMs?: number
switched?: boolean
nativeTimedOut?: boolean
}) => void) => () => void
onProgress: (callback: (payload: { status: string; progress: number }) => void) => () => void
}