Skip to content

Lazy-load Settings stylesheet#1335

Merged
elkimek merged 2 commits into
mainfrom
agent/lazy-load-settings-stylesheet
Jul 24, 2026
Merged

Lazy-load Settings stylesheet#1335
elkimek merged 2 commits into
mainfrom
agent/lazy-load-settings-stylesheet

Conversation

@elkimek

@elkimek elkimek commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • defer css/settings.css until the first Settings or Tweaks action and load it concurrently with the existing lazy Settings module
  • preserve the stylesheet's cascade position, keep shell-owned button styling eager, and retain the stylesheet in the offline app shell
  • retry stylesheet failures independently without re-evaluating a successfully loaded module
  • add startup, retry, offline, and responsive regression coverage and ratchet the cold-load budgets

Why

The Settings JavaScript was already lazy-loaded, but its 48 KB stylesheet still loaded for every returning-user startup even when Settings was never opened.

Impact

Identical same-machine cold-load runs improved from:

  • 449 to 448 requests
  • 1,908,524 to 1,900,879 transferred bytes
  • 5,890,546 to 5,843,728 decoded bytes

That saves one startup request, 7,645 transferred bytes, and 46,818 decoded bytes.

Validation

  • npm run test:playwright — 392 passed; responsive/theme suite 472 passed
  • npm run test:firefox — 3 passed, including offline first-use Settings
  • Settings-focused Playwright coverage — 15 passed
  • import benchmark parallel stress rerun — 34 passed
  • npm run typecheck
  • npm run typecheck:checkjs
  • npm run architecture:check
  • npm run quality
  • repeated cold-load measurement produced the same 448 / 1,900,879 / 5,843,728 result
  • git diff --check

@elkimek
elkimek marked this pull request as ready for review July 24, 2026 07:17
@elkimek
elkimek merged commit 087c567 into main Jul 24, 2026
3 checks passed
@elkimek
elkimek deleted the agent/lazy-load-settings-stylesheet branch July 24, 2026 07:18
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.

1 participant