From 91edd6f14a2460175a4bc21fa5b0aa531b230b77 Mon Sep 17 00:00:00 2001 From: AgentSeal Date: Wed, 15 Apr 2026 05:24:34 -0700 Subject: [PATCH] chore: remove 120-day period, shrink Cursor lookback to 35 days 120 days was for testing. Max dashboard period is 30 days, so Cursor SQL lookback is now 35 days (30 + margin for This Month). Smaller scan window = faster cold starts, smaller cache file. --- src/cli.ts | 5 ++--- src/dashboard.tsx | 15 +++++---------- src/providers/cursor.ts | 2 +- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index 7eb8bef..3f8d1c9 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -50,11 +50,10 @@ function getDateRange(period: string): { range: DateRange; label: string } { } } -function toPeriod(s: string): 'today' | 'week' | '30days' | '120days' | 'month' { +function toPeriod(s: string): 'today' | 'week' | '30days' | 'month' { if (s === 'today') return 'today' if (s === 'month') return 'month' if (s === '30days') return '30days' - if (s === '120days') return '120days' return 'week' } @@ -70,7 +69,7 @@ program.hook('preAction', async () => { program .command('report', { isDefault: true }) .description('Interactive usage dashboard') - .option('-p, --period ', 'Starting period: today, week, 30days, 90days, month', 'week') + .option('-p, --period ', 'Starting period: today, week, 30days, month', 'week') .option('--provider ', 'Filter by provider: all, claude, codex, cursor', 'all') .option('--refresh ', 'Auto-refresh interval in seconds', parseInt) .action(async (opts) => { diff --git a/src/dashboard.tsx b/src/dashboard.tsx index e41ebab..1108277 100644 --- a/src/dashboard.tsx +++ b/src/dashboard.tsx @@ -8,14 +8,13 @@ import { parseAllSessions } from './parser.js' import { loadPricing } from './models.js' import { getAllProviders } from './providers/index.js' -type Period = 'today' | 'week' | 'month' | '30days' | '120days' +type Period = 'today' | 'week' | '30days' | 'month' -const PERIODS: Period[] = ['today', 'week', '30days', '120days', 'month'] +const PERIODS: Period[] = ['today', 'week', '30days', 'month'] const PERIOD_LABELS: Record = { today: 'Today', week: '7 Days', '30days': '30 Days', - '120days': '120 Days', month: 'This Month', } @@ -87,7 +86,6 @@ function getDateRange(period: Period): { start: Date; end: Date } { case 'today': return { start: new Date(now.getFullYear(), now.getMonth(), now.getDate()), end } case 'week': return { start: new Date(now.getFullYear(), now.getMonth(), now.getDate() - 7), end } case '30days': return { start: new Date(now.getFullYear(), now.getMonth(), now.getDate() - 30), end } - case '120days': return { start: new Date(now.getFullYear(), now.getMonth(), now.getDate() - 120), end } case 'month': return { start: new Date(now.getFullYear(), now.getMonth(), 1), end } } } @@ -458,10 +456,8 @@ function StatusBar({ width, showProvider }: { width: number; showProvider?: bool 2 week 3 - 30d + 30 days 4 - 120d - 5 month {showProvider && ( <> @@ -493,7 +489,7 @@ function DashboardContent({ projects, period, columns, activeProvider }: { proje } const pw = wide ? halfWidth : dashWidth - const days = period === 'month' || period === '30days' ? 31 : period === '120days' ? 120 : 14 + const days = period === 'month' || period === '30days' ? 31 : 14 return ( @@ -613,8 +609,7 @@ function InteractiveDashboard({ initialProjects, initialPeriod, initialProvider, } else if (input === '1') switchPeriodImmediate('today') else if (input === '2') switchPeriodImmediate('week') else if (input === '3') switchPeriodImmediate('30days') - else if (input === '4') switchPeriodImmediate('120days') - else if (input === '5') switchPeriodImmediate('month') + else if (input === '4') switchPeriodImmediate('month') }) if (loading) { diff --git a/src/providers/cursor.ts b/src/providers/cursor.ts index 236f69b..b371dec 100644 --- a/src/providers/cursor.ts +++ b/src/providers/cursor.ts @@ -135,7 +135,7 @@ function parseBubbles(db: SqliteDatabase, seenKeys: Set): { calls: Parse const results: ParsedProviderCall[] = [] let skipped = 0 - const DEFAULT_LOOKBACK_DAYS = 120 + const DEFAULT_LOOKBACK_DAYS = 35 const timeFloor = new Date(Date.now() - DEFAULT_LOOKBACK_DAYS * 24 * 60 * 60 * 1000).toISOString() const userMessages = buildUserMessageMap(db, timeFloor)