Handle unsupported paths with a 404 page and /preview redirect - #46
Merged
Conversation
Unmatched routes previously rendered Header/Footer with an empty main, producing a broken stacked-logo layout. Add a catch-all route and NotFound page matching the site's design system. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Home's motion animations previously replayed every time the page remounted via client-side navigation (e.g. scroll to bottom, visit another page, navigate back). Track a module-level flag that flips after Home's first mount and use it to skip initial/whileInView animations on subsequent mounts within the same page load. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Previously fell through to the 404 page like any other unsupported path; give it a dedicated redirect to home instead. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
Unmatched routes (e.g.
/preview) previously rendered the Header and Footer with an empty<main>, producing a broken stacked-logo layout instead of any real content. This adds a proper 404 page, a dedicated redirect for/preview, and fixes a related animation bug on the home page discovered along the way.Changes
*route rendering a newNotFoundpage (src/pages/not-found/), styled consistently with the existing legal pages./previewroute that redirects (client-side,replace) to/instead of falling through to the 404 page./. A module-level flag now tracks whether Home has already mounted during the current page load, soinitial/whileInViewanimations only play on a genuine fresh load.Testing
pnpm build(tsc + vite build) passespnpm lintpassesvercel.jsonalready rewrites all paths to/index.html, so/previewand other unsupported paths reach the SPA router correctly in production