refactor(routes): reorganize into (app)/(site)/(auth)/(dev) route groups#1178
refactor(routes): reorganize into (app)/(site)/(auth)/(dev) route groups#1178timothyfroehlich merged 5 commits intomainfrom
Conversation
- Move static content pages (about, help, privacy, terms, whats-new, landing) to new (site) route group - Move report + report/success into (app) — inherits MainLayout automatically, removes manual MainLayout imports - Move auth callback pages (callback, auth-code-error, loading) into (auth)/auth/ — gets card layout; rename loading→callback-loading - Move dev pages into new (dev) route group; consolidate /debug/badges under /dev/badges - Add (site)/layout.tsx and (dev)/layout.tsx (one-liner MainLayout wrappers) - Update internal redirect paths and cross-module imports MainLayout is now imported in layout files only — never in pages. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Updates to Preview Branch (claude/affectionate-herschel) ↗︎
Tasks are run on every commit but only new migration files are pushed.
View logs for this Workflow Run ↗︎. |
There was a problem hiding this comment.
Pull request overview
Reorganizes Next.js App Router pages into purpose-driven route groups ((app), (site), (auth), (dev)) so pages inherit layouts consistently (especially MainLayout) and dev/auth routes are separated cleanly, while keeping nearly all URLs stable.
Changes:
- Move landing + static content pages into
(site)and add a(site)/layout.tsxwrapper. - Move report flow into
(app)/report(including new unified report form helpers/tests) and ensure pages inherit layout rather than importingMainLayoutdirectly. - Consolidate dev tools under
(dev)and adjust internal redirects/tests for/auth/callback-loadingand/dev/badges.
Reviewed changes
Copilot reviewed 21 out of 43 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/unit/public-issue-validation.test.ts | Update import path for moved report validation helper. |
| src/test/unit/public-issue-security.test.ts | Update import path for moved report server action. |
| src/test/unit/public-issue-schema.test.ts | Update import path for moved report schema. |
| src/lib/supabase/middleware.test.ts | Update protected route fixture from /debug/badges to /dev/badges. |
| src/components/issues/RecentIssuesPanelClient.tsx | Update RecentIssueData type import to new report actions path. |
| src/app/report/success/page.tsx | Remove old report success page location (moved under (app)). |
| src/app/page.tsx | Remove old landing page location (moved under (site)). |
| src/app/auth/auth-code-error/page.tsx | Remove old auth error page location (moved under (auth)/auth/*). |
| src/app/(site)/whats-new/page.tsx | Add (site) “What’s New” page using MDX content + marker. |
| src/app/(site)/whats-new/changelog-seen-marker.tsx | Add client marker to write “seen” cookie and refresh layouts. |
| src/app/(site)/terms/terms-content.tsx | Add extracted Terms of Service content component. |
| src/app/(site)/terms/page.tsx | Add Terms of Service page wrapper + metadata. |
| src/app/(site)/privacy/privacy-content.tsx | Add extracted Privacy Policy content component. |
| src/app/(site)/privacy/page.tsx | Add Privacy Policy page wrapper + metadata. |
| src/app/(site)/page.tsx | Add landing page under (site) without manual MainLayout. |
| src/app/(site)/layout.tsx | Add (site) layout that wraps content in MainLayout. |
| src/app/(site)/help/page.tsx | Add Help hub page under (site). |
| src/app/(site)/help/admin/page.tsx | Add admin-only help page under (site) with role checks. |
| src/app/(site)/about/page.tsx | Add About page under (site). |
| src/app/(dev)/layout.tsx | Add (dev) layout that wraps content in MainLayout. |
| src/app/(dev)/dev/preview/preview-client.tsx | Add client-side responsive preview tool (iframe-based). |
| src/app/(dev)/dev/preview/page.tsx | Add dev-only preview page wrapper (server gate + renders client tool). |
| src/app/(dev)/dev/design-system/page.tsx | Add dev-only design-system reference page. |
| src/app/(dev)/dev/badges/page.tsx | Add /dev/badges badge debug page (moved from /debug/badges). |
| src/app/(auth)/reset-password/page.tsx | Update redirect to renamed /auth/callback-loading. |
| src/app/(auth)/auth/callback/route.ts | Update callback redirect behavior and add safe redirect resolver. |
| src/app/(auth)/auth/callback/route.test.ts | Add unit tests for redirect-path hardening logic. |
| src/app/(auth)/auth/callback-loading/page.tsx | Rename loading page to callback-loading and update component import. |
| src/app/(auth)/auth/callback-loading/CallbackLoadingClient.tsx | Rename exported client component to CallbackLoadingClient. |
| src/app/(auth)/auth/auth-code-error/page.tsx | Rework auth error page markup to fit (auth) card layout. |
| src/app/(app)/report/validation.ts | Add pure FormData parsing/validation helper for report submissions. |
| src/app/(app)/report/validation.test.ts | Add unit tests for parsePublicIssueForm. |
| src/app/(app)/report/unified-report-form.tsx | Add unified client report form with persistence + recent issues panel. |
| src/app/(app)/report/success/page.tsx | Add report success page under (app) using PageContainer. |
| src/app/(app)/report/success/clear-draft.tsx | Add client helper to clear local draft on success page mount. |
| src/app/(app)/report/schemas.ts | Add Zod schema for public issue submissions. |
| src/app/(app)/report/page.tsx | Remove manual MainLayout usage so (app) layout owns chrome. |
| src/app/(app)/report/default-machine.ts | Add helper to choose default machine from query params. |
| src/app/(app)/report/default-machine.test.ts | Add unit tests for default machine resolver. |
| src/app/(app)/report/actions.ts | Adjust imports for moved report code; keep server action behavior aligned. |
| src/app/(app)/report/actions.test.ts | Add unit tests for getRecentIssuesAction. |
| docs/superpowers/specs/2026-04-12-route-reorganization-design.md | Add route reorg design spec documenting final structure and risks. |
| docs/superpowers/plans/2026-04-12-route-reorganization.md | Add detailed implementation plan + reference update checklist. |
gh run watch can exit 0 prematurely when jobs haven't been assigned yet at run start. Previously only the non-zero exit path verified via API; now both paths do, making success detection symmetric with failure detection. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| import { describe, it, expect } from "vitest"; | ||
| import { publicIssueSchema } from "~/app/report/schemas"; | ||
| import { publicIssueSchema } from "~/app/(app)/report/schemas"; | ||
|
|
||
| describe("publicIssueSchema", () => { |
There was a problem hiding this comment.
After switching the import to ~/app/(app)/report/schemas, the test cases below no longer match the schema: severity: "playable" is not a valid enum value, frequency is now required, and the max lengths asserted (title/description) don’t match the schema limits (60 / 20000). Update the test data and boundary assertions to reflect the current schema so the unit tests don’t fail incorrectly.
| import { describe, it, expect } from "vitest"; | ||
| import { parsePublicIssueForm } from "~/app/report/validation"; | ||
| import { parsePublicIssueForm } from "~/app/(app)/report/validation"; | ||
|
|
||
| const buildFormData = ( |
There was a problem hiding this comment.
These tests still use severity: "playable" and omit required fields like frequency, which will fail against the current publicIssueSchema used by parsePublicIssueForm. Update the test inputs (severity values and required fields) to align with the schema under ~/app/(app)/report/*.
- Replace invalid severity "playable" with "minor" in reject-path tests - Add missing required frequency field to all negative test cases - Fix title/description boundary values to match schema limits (60/20000) - Remove claude/** from CI push trigger to eliminate duplicate push+PR runs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
(site)route group(app)— inheritsMainLayoutautomatically, removes manual imports(auth)/auth/— gets card layout; renameloading→callback-loading(dev)route group; consolidate/debug/badges→/dev/badges(site)/layout.tsxand(dev)/layout.tsx(one-linerMainLayoutwrappers)MainLayoutis now imported in layout files only — never in individual pages.Test plan
pnpm run checkpasses (841 tests, types, lint)/auth/loading→/auth/callback-loadingand/debug/badges→/dev/badges🤖 Generated with Claude Code