Skip to content

Fix/mos 0006#11

Merged
Lidizz merged 7 commits into
mainfrom
fix/MOS-0006
Feb 27, 2026
Merged

Fix/mos 0006#11
Lidizz merged 7 commits into
mainfrom
fix/MOS-0006

Conversation

@Lidizz

@Lidizz Lidizz commented Feb 27, 2026

Copy link
Copy Markdown
Owner

No description provided.

- Replace static imports with React.lazy() for route-level code splitting
- Wrap each lazy route in Suspense with LoadingSpinner fallback
- HomePage remains eagerly loaded (landing page, must be instant)
- Vite will produce separate chunks for simulator and about pages
- New NotFoundPage component with link back to home
- Added as catch-all (*) route inside Layout so header/nav remain visible
- Lazy-loaded like other secondary pages
- Class-based ErrorBoundary with getDerivedStateFromError + componentDidCatch
- Route-level boundary wraps SimulatorPage in App.tsx
- Granular boundary wraps SimulationResults in SimulatorPage
- Fallback UI with retry button styled using design tokens
….tsx

SW now registers at app startup regardless of which route the user lands on,
instead of only when SimulatorPage mounts.
- useHealthCheck: encapsulates health/assets/loading/error state + fetch
- useSimulation: encapsulates simulation lifecycle, timeframe, toast state
- SimulatorPage reduced from 228 to ~120 lines of pure rendering logic
The old code used setTimeout(7 days) to re-enable the PWA prompt, which
would never fire because the timer dies on page reload. Now stores a
timestamp in localStorage and checks elapsed time on mount. Installs
are marked permanent (timestamp 0); dismissals expire after 7 days.
Previously handleTimeframeChange kept old chart data visible while the
new request was in-flight. Now nulls simulationResults immediately so
the loading spinner renders during the fetch.
@Lidizz
Lidizz merged commit 671ae2d into main Feb 27, 2026
2 checks passed
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