Skip to content

feat: review static-export settings route coverage (#304)#361

Merged
marccampbell merged 2 commits into
mainfrom
feat/settings-static-export-coverage
Jun 6, 2026
Merged

feat: review static-export settings route coverage (#304)#361
marccampbell merged 2 commits into
mainfrom
feat/settings-static-export-coverage

Conversation

@elasticclaw-factory

Copy link
Copy Markdown
Contributor

Closes #304

Changes

  • Documented supported URL shapes in page.tsx with clear comments explaining static-export limitations and the _workspace placeholder pattern
  • Added explicit path validation in settings-content.tsx: redirect paths with >2 segments and invalid section names to /settings/workspaces, properly handle _workspace placeholder
  • Added production build smoke check (web/scripts/check-static-export.sh) that verifies all 30 expected settings paths are generated
  • Integrated smoke check into Makefile so it runs automatically during build-web and build-release

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.

- 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
@greptile-apps

greptile-apps Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "feat: review and improve static-export s..." | Re-trigger Greptile

Comment thread web/app/settings/[[...parts]]/settings-content.tsx Outdated
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.
@greptile-apps

greptile-apps Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Reviews (2): Last reviewed commit: "fix: handle _workspace placeholder in se..." | Re-trigger Greptile

@marccampbell marccampbell merged commit 388e24c into main Jun 6, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review static-export settings route coverage

1 participant