Repository navigation
feat: interactive dashboard opens on Today, falls back to 7 days when today is empty - #1113
Merged
Merged
Conversation
… when today is empty The unset default opened on 7 days everywhere. It now opens on today and only falls back to 7 days when today holds no sessions yet — the decision is made from the today-scoped slice of the parse the first paint already runs, so the probe costs a filter, not a second pass. Explicit selections are untouched: -p/--period, --day, --from/--to, the TUI period keys, the app's persisted default period, and every one-shot (--format json, report/sessions/status, the piped non-TTY render) keep the 7-day default they had. Fixes #1111
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1111. Stacked on #1109 (base =
perf/1107-progressive-cold; retarget as the stack merges).Where the defaults actually lived
Only the CLI TUI defaulted to 7 days (
src/main.tsreport-pdefault). The desktop app and web dashboard already opened on Today — they only needed the fallback half. Menubar untouched.Decision flow
-pcame from the default source, no--day/--from/--to, and TTY. The probe is the today-slice of the parse the dashboard already runs insidewithSinglePassParse(6-month declared range → slicing is free). Zero sessions today → open 7 Days. (A project-count probe was wrong — a project survived the slice on subagent anchors with 0 sessions; caught by measurement, probe counts sessions.)[ Today ]/[ 7 Days ]); keys 1-6 and every explicit selection win; app's persisteddefaultPeriodpreference always wins.Parity (frozen 16.7k-file corpus, isolated caches, vs base)
12 command/flag combinations (
reportunset/-p today|week|month|30days/--day/--from--to,status --format menubar-json×2,sessions,models,export): all identical (same/generated-only exception as #1105/#1108/#1109). Piped/non-TTYcodeburnand all JSON defaults are byte-for-byte unmoved (still week).Perf (real corpus, pty, time to first frame, median of 3)
Docs
README updated (2 lines +
-phelp). Website repo lines that need the same edit are listed in the report on the issue — separate repo, will follow up there.Tests
tests/default-today-period.test.ts(5) + 2 app tests. CLI suite 234 files / 3195 green; app suite 41 files / 540 green; tsc clean in root, app/, dash/. No cache/payload/dep changes.