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

@ -247,7 +247,7 @@ program
.option('--format <format>', 'Output format: tui, json', 'tui')
.option('--project <name>', 'Show only projects matching name (repeatable)', collect, [])
.option('--exclude <name>', 'Exclude projects matching name (repeatable)', collect, [])
.option('--refresh <seconds>', 'Auto-refresh interval in seconds', parseInt)
.option('--refresh <seconds>', 'Auto-refresh interval in seconds (0 to disable)', parseInt, 30)
.action(async (opts) => {
let customRange: DateRange | null = null
try {
@ -502,7 +502,7 @@ program
.option('--format <format>', 'Output format: tui, json', 'tui')
.option('--project <name>', 'Show only projects matching name (repeatable)', collect, [])
.option('--exclude <name>', 'Exclude projects matching name (repeatable)', collect, [])
.option('--refresh <seconds>', 'Auto-refresh interval in seconds', parseInt)
.option('--refresh <seconds>', 'Auto-refresh interval in seconds (0 to disable)', parseInt, 30)
.action(async (opts) => {
if (opts.format === 'json') {
await runJsonReport('today', opts.provider, opts.project, opts.exclude)
@ -518,7 +518,7 @@ program
.option('--format <format>', 'Output format: tui, json', 'tui')
.option('--project <name>', 'Show only projects matching name (repeatable)', collect, [])
.option('--exclude <name>', 'Exclude projects matching name (repeatable)', collect, [])
.option('--refresh <seconds>', 'Auto-refresh interval in seconds', parseInt)
.option('--refresh <seconds>', 'Auto-refresh interval in seconds (0 to disable)', parseInt, 30)
.action(async (opts) => {
if (opts.format === 'json') {
await runJsonReport('month', opts.provider, opts.project, opts.exclude)