Skip to content

perf(web): prune duplicate shell chrome update during page rendering - #36

Merged
K-Laron merged 1 commit into
mainfrom
perf/prune-redundant-shell-update
Oct 17, 2026
Merged

K-Laron merged 1 commit into
mainfrom
perf/prune-redundant-shell-update

Conversation

@K-Laron

@K-Laron K-Laron commented Oct 17, 2026

Copy link
Copy Markdown
Owner

Problem

renderPage(path) in src/main.js was invoking updateShellChrome(normalizedPath) twice during each route navigation:

  • Once synchronously before loading the dynamic page module (ensureShell(); bindShellEvents(); updateShellChrome(normalizedPath);)
  • And once again immediately after the async module chunk resolved (updateShellChrome(normalizedPath);)

Because store stats, user details, and the active route path do not change while the page module chunk is resolving, the second invocation was entirely redundant. It performed repeated calculations of store.getProgress() and store.getTotalHours(), alongside duplicate DOM writes to sidebar navigation classes, theme toggle labels, and progress bars.

Mechanism

Remove the redundant updateShellChrome(normalizedPath) call in src/main.js.
The initial call is preserved so that sidebar navigation links update immediately upon user interaction before module resolution.

Upstream Inspiration

Before / After Numbers

  • npm test: 124/124 tests passing.
  • npm run build: Vite build passes cleanly.
  • Page navigation: reduces shell chrome DOM writes and store calculations from 2 runs to 1 run per route navigation.

Risk

Very Low. The shell chrome has already been rendered and updated by the initial call before module resolution.

Inspired by pingdotgg/t3code#20860, pingdotgg/t3code#18416.
renderPage previously invoked updateShellChrome twice: once before loading
the async page module chunk and once immediately after. The second call was
completely redundant since store stats and route path are unchanged.
Copilot AI balanced review requested due to automatic review settings October 17, 2026 15:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Oct 17, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 333ba44c-a523-41a9-b39d-9adef7e74732
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@K-Laron
K-Laron merged commit e0d59a8 into main Oct 17, 2026
5 checks passed
@K-Laron
K-Laron deleted the perf/prune-redundant-shell-update branch October 17, 2026 23:12
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