You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(chart): persist period selection and compact period picker UI (#595)
* feat(chart): persist period selection and move toggles inline with section header
- Add lastChartPeriod field to extension; defaults to 'day'
- Handle 'setPeriodPreference' message in showChart() to store chosen period
- Pass initialPeriod in getChartHtml() so chart reopens on the last-used period
- In bootstrap(), set currentPeriod from initialData.initialPeriod before render
- In switchPeriod(), post setPeriodPreference message to extension
- Move period toggle buttons from separate row into chart section header (right-aligned)
- Period pills are smaller (11px font, 4px/9px padding) and sit alongside the heading
- Saves one full row of vertical space; compact pills save screen real estate
- Add .chart-section-header flex layout and .period-controls compact overrides
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* perf(cache): raise session file cache limit from 1000 to 3000 entries
With ~1100 session files, the old 1000-entry limit caused constant evictions
on every analysis cycle, keeping cache hit rates around 50-60%.
3000 entries gives comfortable headroom (3x current file count). Memory cost
is ~1-2 MB which is well within VS Code extension and globalState limits.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* feat(chart): group minor models into 'Other' and exclude Unknown from repo view
By Model chart:
- Rank all models by total tokens for the active period
- Show top 5 models individually (largest usage first)
- Collapse remaining models into a single 'Other models' dataset (gray)
- Eliminates the wall of 20+ legend entries visible in the screenshot
By Repository chart:
- Exclude 'Unknown' entries from repository datasets and summary cards
- 'Unknown' represents sessions with no repo context (empty window chats,
global CLI sessions, etc.) which add noise to a per-repo breakdown
- Same filter applied to repositoryTotalsMap used for the detail panel
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix(repo-detection): extract repo from CLI tool args and handle git worktrees
Two bugs that caused CLI sessions in worktrees to show as 'Unknown' in
the By Repository chart:
1. CLI JSONL path extraction was dead code:
allContentReferences was defined but never populated for non-delta
(Copilot CLI) JSONL files. The loop only read rename_session calls.
Now also reads tool.execution_start argument values that look like
file paths and pushes them into allContentReferences, which is then
fed to extractRepositoryFromContentReferences as before.
2. Git worktree detection missing in workspaceHelpers.ts:
extractRepositoryFromContentReferences only checked for .git/config
(standard git repo). Worktrees have .git as a FILE containing
'gitdir: <path>/.git/worktrees/<name>'. This file was unreadable as
a directory, silently caught, and the walk continued upward past the
repo root without finding the remote URL.
Now also reads .git as a file, follows the gitdir pointer, resolves
the main .git dir (2 levels up from the worktree-specific dir), and
reads the remote URL from its config.
Bump CACHE_VERSION 37 → 38 to invalidate stale 'no repo' cache entries
so all existing CLI sessions are re-scanned on next reload.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* feat: open Usage Analysis panel immediately, load stats in background
Previously showUsageAnalysis() awaited calculateUsageAnalysisStats() before
creating the panel, causing a ~20s blank delay when the cache was cold
(e.g. while the chart was computing its 365-day background load).
Apply the same two-phase pattern used by the chart view:
- Create the webview panel immediately
- If lastUsageAnalysisStats is cached, render it instantly
- Otherwise show a loading spinner; fire calculateUsageAnalysisStats() in the
background and push 'updateStats' to the webview when it completes
- getUsageAnalysisHtml() now accepts UsageAnalysisStats | null
- bootstrap() shows a loading message instead of 'No data available.' when
null, since the updateStats message handler already calls renderLayout()
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments