Skip to content

feat(vs-extension): Load all views with a single CLI call instead of one per view#500

Merged
rajbos merged 4 commits intomainfrom
copilot/feature-run-all-cli-calls
Mar 27, 2026
Merged

feat(vs-extension): Load all views with a single CLI call instead of one per view#500
rajbos merged 4 commits intomainfrom
copilot/feature-run-all-cli-calls

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 26, 2026

Each tab navigation in the Visual Studio extension triggered a separate CLI process (usage --json, chart --json, usage-analysis --json, fluency --json), producing a spinner for every view the user visited.

CLI: new all --json command

cli/src/commands/all.ts — single process that runs all four data computations in parallel and emits one combined JSON payload:

{ "details": {...}, "chart": {...}, "usage": {...}, "fluency": {...} }

The three main stat passes (calculateDetailedStats, calculateDailyStats, calculateUsageAnalysisStats) run via Promise.all(); the in-memory session-file cache ensures each file is parsed only once across all three.

VS Extension: preload all views on startup

  • CliBridgeGetAllDataAsync() calls all --json once, parses the envelope, and populates four independent view caches (_cachedStats, _cachedChartJson, _cachedUsageAnalysisJson, _cachedMaturity). In-flight deduplication ensures concurrent callers share a single process. The existing per-view Get*Async() methods now hit their respective caches first, falling back to individual CLI calls only when stale.

  • TokenTrackerControlPrewarmAllViewsAsync() replaces the single RefreshAsync() call in InitWebViewAsync(). It awaits GetAllDataAsync(), then builds and caches the HTML for all five views (details, chart, usage, environmental, maturity). Navigation between views after startup is instant — no per-view spinner.


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Copilot AI changed the title [WIP] Add functionality to run all CLI calls in one go feat(vs-extension): Load all views with a single CLI call instead of one per view Mar 26, 2026
Copilot AI requested a review from rajbos March 26, 2026 23:59
@rajbos rajbos marked this pull request as ready for review March 27, 2026 21:32
@rajbos rajbos enabled auto-merge (squash) March 27, 2026 21:34
@rajbos rajbos merged commit 9e1a79f into main Mar 27, 2026
19 of 21 checks passed
@rajbos rajbos deleted the copilot/feature-run-all-cli-calls branch March 27, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants