Show Route Transitions with Suspense Boundaries
Wrap each route in a Suspense boundary with a fallback spinner so navigation shows a skeleton instead of a blank flash.
Task
Add <Suspense fallback={<Skeleton />}> <Route /> </Suspense> so the interface remains usable and accessible under the edge cases that manual testing skips.
When to use this
A screen reader user reports the page is unusable because <Suspense fallback={<Skeleton />}> <Route /> </Suspense> was never implemented, flagged in a support ticket.
Prerequisites
- A frontend component or page in the codebase
- A build with the relevant framework configured
Steps
1. Configure <Suspense fallback={<Skeleton />}> <Route /> </Suspense> in the project configuration file with the recommended defaults.
<Suspense fallback={<Skeleton />}> <Route /> </Suspense>
Expected output: The configuration is accepted and <Suspense fallback={<Skeleton />}> <Route /> </Suspense> runs without errors on the first invocation.
2. Run the check locally to verify <Suspense fallback={<Skeleton />}> <Route /> </Suspense> produces the expected result before pushing.
pnpm test
Expected output: Local run matches CI behavior; no surprises after push.
3. Add the gate to the CI pipeline so <Suspense fallback={<Skeleton />}> <Route /> </Suspense> blocks merge on failure.
- name: Run add route transition suspense
run: pnpm test
Expected output: Pull requests with failing <Suspense fallback={<Skeleton />}> <Route /> </Suspense> are blocked from merging.
Troubleshooting
Problem
The check passes locally but fails in CI
Solution
Pin dependency versions and the runtime to match CI exactly; reproduce with the same Docker image or act.
Problem
Configuration is rejected with a schema error
Solution
Check the tool version matches the config schema; older versions may not support newer fields.
Limitations
- The gate only runs on events that trigger the workflow; locally pushed commits bypass it.
- Configuration drift is possible if someone edits settings outside version control.
Handle the edge case
Start by measuring the problem. Wrap each route in a Suspense boundary with a fallback spinner so navigation shows a skeleton instead of a blank flash. The most common mistake is adding the gate without first confirming it catches the issue you care about. Run <Suspense fallback={
<Suspense fallback={<Skeleton />}> <Route /> </Suspense>
Test with real tools
Once the gate is in place, make failures actionable. A failing <Suspense fallback={