Skip to content

Fix Team Dashboard slow initial render by caching last fetch result#418

Merged
rajbos merged 3 commits intomainfrom
copilot/fix-dashboard-loading-issue
Mar 18, 2026
Merged

Fix Team Dashboard slow initial render by caching last fetch result#418
rajbos merged 3 commits intomainfrom
copilot/fix-dashboard-loading-issue

Conversation

Copy link
Contributor

Copilot AI commented Mar 17, 2026

Every time the Team Dashboard opened, it blocked on a full backend fetch + local maturity score calculation before rendering anything, making the panel feel unresponsive.

Changes

  • Cache getDashboardData() result in a new lastDashboardData property, mirroring the existing pattern for lastDetailedStats, lastDailyStats, and lastUsageAnalysisStats.
  • Render immediately from cache — if lastDashboardData is populated, it is posted to the webview right after panel creation, before the background fetch completes.
  • Background refresh — fresh data is always fetched after opening; the webview updates silently when it arrives.
  • Fallback-aware error handling — the error state is only shown when there is no cached data to display; if the refresh fails but a previous result exists, the stale data remains visible.
  • Cache invalidationlastDashboardData is cleared together with the other stat caches on explicit cache clear.
  • Refresh caches toorefreshDashboardPanel() now writes the new result to lastDashboardData.
// If we have cached data, show it immediately so the panel renders fast
if (this.lastDashboardData) {
  this.dashboardPanel.webview.postMessage({
    command: "dashboardData",
    data: this.lastDashboardData,
  });
}

// Fetch fresh data in the background; update cache and webview when done
const dashboardData = await this.getDashboardData();
this.lastDashboardData = dashboardData;
this.dashboardPanel?.webview.postMessage({ command: "dashboardData", data: dashboardData });
Original prompt

Currently the team Dashboard, does not low pretty Quickly. It seems like it do a full scan or refresh or something before it's Starts to show. so you have the klik on the button and wait for quit a while. Look at this Behaviour en implement a fix.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Add `lastDashboardData` cache property so that when the Team Dashboard
panel is opened after the first load, cached data is sent to the webview
immediately instead of waiting for a full backend fetch + maturity score
calculation. Fresh data is still fetched in the background and replaces
the cached view when ready. The cache is cleared alongside other stat
caches when the user explicitly clears the session cache.

Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix slow loading behavior of team dashboard Fix Team Dashboard slow initial render by caching last fetch result Mar 17, 2026
Copilot AI requested a review from rajbos March 17, 2026 21:43
@rajbos rajbos marked this pull request as ready for review March 18, 2026 07:36
@rajbos rajbos merged commit 806060f into main Mar 18, 2026
16 of 17 checks passed
@rajbos rajbos deleted the copilot/fix-dashboard-loading-issue branch March 18, 2026 07:36
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