Fix calculator navigation flash with persistent layout#925
Open
SakshiKekre wants to merge 7 commits intomainfrom
Open
Fix calculator navigation flash with persistent layout#925SakshiKekre wants to merge 7 commits intomainfrom
SakshiKekre wants to merge 7 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ee837f1 to
3034999
Compare
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.
Context
Navigating between calculator pages (reports, policies, simulations, households) caused a visible white flash because each page mounted its own
StandardLayoutandCalculatorProviders. Next.js unmounted the entire component tree on every navigation, destroying and rebuilding the sidebar/header DOM.This was tested across 4 approaches on Vercel preview deployments with a perf instrumentation harness (PRs #915-#918). See #917 for detailed benchmarks and comparison data.
Summary
Navigation flash fix
StandardLayout+CalculatorProvidersinto[countryId]/layout.tsxso they persist across all page navigationsFullScreenPortalcomponent — the parameter selector renders as a fixed full-screen overlay via React portal, covering the sidebar/header naturallyStandardLayout— full-screen views use<FullScreenPortal>insteadCalculatorProvidersandStandardLayoutfrom all individual page filesAPI error handling fix
SocietyWideCalcStrategy.execute()in try/catch — returns errorCalcStatusinstead of throwing (matchesHouseholdCalcStrategypattern). Previously, a 500 from the Modal gateway would propagate as an uncaught async error and corrupt the Next.js router state, freezing all internal navigation.throw errorfromCalcOrchestratorManager.startCalculation()catch block — logs and cleans up without re-throwingPerf results (from #917 preview testing)
Test plan