fix: real-time refresh for menubar and TUI dashboard

Menubar: reduce cache TTL from 300s to 30s, background refresh from
60s to 15s, always fetch fresh data on tab switch instead of serving
stale cache. TUI: default auto-refresh to 30s (--refresh 0 to disable).

Closes #107
This commit is contained in:
iamtoruk 2026-04-19 08:55:48 -07:00 committed by AgentSeal
parent bd43b15342
commit fc576f44ba
3 changed files with 7 additions and 9 deletions

View file

@ -2,7 +2,7 @@ import SwiftUI
import AppKit
import Observation
private let refreshIntervalSeconds: UInt64 = 60
private let refreshIntervalSeconds: UInt64 = 15
private let nanosPerSecond: UInt64 = 1_000_000_000
private let refreshIntervalNanos: UInt64 = refreshIntervalSeconds * nanosPerSecond
/// Fixed so the popover's anchor point doesn't shift each time today's cost changes.