Fix/mos 0006#11
Merged
Merged
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.