Skip to content

Lazy-load Light and Sun stylesheets#1336

Merged
elkimek merged 3 commits into
mainfrom
agent/lazy-load-light-sun-stylesheets
Jul 24, 2026
Merged

Lazy-load Light and Sun stylesheets#1336
elkimek merged 3 commits into
mainfrom
agent/lazy-load-light-sun-stylesheets

Conversation

@elkimek

@elkimek elkimek commented Jul 24, 2026

Copy link
Copy Markdown
Owner

What changed

  • defer the seven Light & Sun stylesheets until a visible Light UI entry point is opened
  • keep background Light/Sun session analysis on the existing module-only loader so it does not fetch presentation assets
  • preserve the original cascade position with an ordered stylesheet anchor and make concurrent loading single-flight and retry-safe
  • move the two cross-feature style consumers (marker history controls and context-card Ott badges) into their eager owning bundles
  • retain all deferred resources in the service-worker app shell for offline first use
  • add browser coverage for cold startup, ordering, concurrency, failure/retry, dashboard widgets, sidebar assessment, route rendering, and Firefox offline navigation
  • make the Light Today browser flow wait for the observable lazy-loaded UI state instead of a fixed runner-dependent delay

Why

Returning users paid for seven Light-only stylesheets on every startup even when they never opened Light & Sun. This moves that cost to first visual use without delaying background analysis or weakening offline behavior.

Impact

Measured on the same fresh mobile returning-user scenario with browser cache and service workers disabled:

  • requests: 448 → 441 (-7)
  • compressed transfer: 1,900,879 → 1,857,409 bytes (-43,470)
  • decoded bytes: 5,843,728 → 5,650,563 (-193,165)

The ratcheted cold-load budget and architecture notes are updated, and the app version advances to 1.10.356.

Validation

  • COVERAGE=1 PORT=8265 ./run-tests.sh
    • 487 Vitest tests passed
    • 396 Chromium tests passed
    • 472 responsive/theme checks passed
    • combined function coverage passed at 67.11% against the 67.10% ratchet
    • Firefox smoke and offline first-use coverage passed in the preceding full run
  • Light Today browser fixture passed 10/10 consecutive stress runs
  • real sidebar-to-lazy-Light assessment integration passed 5/5 consecutive stress runs
  • npm run quality — 11/11 guardrails passed
  • TypeScript typecheck, JS check, architecture, vendor integrity, and git diff --check passed
  • cold-load measurement reproduced 441 requests / 1,857,409 transfer bytes / 5,650,563 decoded bytes

@elkimek
elkimek marked this pull request as ready for review July 24, 2026 08:16
@elkimek
elkimek merged commit 0fa94ac into main Jul 24, 2026
3 checks passed
@elkimek
elkimek deleted the agent/lazy-load-light-sun-stylesheets branch July 24, 2026 08:16
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