feat: review static-export settings route coverage (#304)#361
Merged
Conversation
- Document supported URL shapes and static-export limitations in page.tsx - Add explicit handling for unsupported paths (redirect to /settings/workspaces) - Add _workspace placeholder sentinel with proper redirect behavior - Add production build smoke check script for static export paths - Integrate smoke check into Makefile build-web target
Contributor
|
Reviews (1): Last reviewed commit: "feat: review and improve static-export s..." | Re-trigger Greptile |
When firstPartIsPlaceholder is true (URL is /settings/_workspace/{section}),
hasRouteWorkspace was false, so rawSection fell back to firstPart which is
"_workspace" (not a valid section). This caused:
1. Invalid-section redirect to fire, landing on /settings/workspaces
2. Workspace-selection effect to redirect to /settings/{workspace} instead of
/settings/{workspace}/{section}
Fix: Include firstPartIsPlaceholder in the rawSection ternary so that
_workspace/{section} URLs correctly resolve the section from secondPart.
Contributor
|
Reviews (2): Last reviewed commit: "fix: handle _workspace placeholder in se..." | Re-trigger Greptile |
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.
Closes #304
Changes
Why
The settings route uses a Next.js optional catch-all [[...parts]] which can theoretically match any path. However, static export only generates finite paths from generateStaticParams(). Since workspace names are dynamic (loaded from API), we cannot pre-generate all workspace-specific paths. This PR makes the behavior explicit: static export covers system-section paths + _workspace placeholder, client-side routing handles workspace-specific paths, unsupported paths redirect to a safe fallback, and build-time smoke check ensures static export completeness.