Skip to content

refactor(routes): reorganize into (app)/(site)/(auth)/(dev) route groups#1178

Merged
timothyfroehlich merged 5 commits intomainfrom
claude/affectionate-herschel
Apr 13, 2026
Merged

refactor(routes): reorganize into (app)/(site)/(auth)/(dev) route groups#1178
timothyfroehlich merged 5 commits intomainfrom
claude/affectionate-herschel

Conversation

@timothyfroehlich
Copy link
Copy Markdown
Owner

Summary

  • Move static content pages (about, help, privacy, terms, whats-new, landing) to new (site) route group
  • Move report pages into (app) — inherits MainLayout automatically, removes manual imports
  • Move auth callback pages into (auth)/auth/ — gets card layout; rename loadingcallback-loading
  • Move dev pages into new (dev) route group; consolidate /debug/badges/dev/badges
  • Add (site)/layout.tsx and (dev)/layout.tsx (one-liner MainLayout wrappers)

MainLayout is now imported in layout files only — never in individual pages.

Test plan

  • pnpm run check passes (841 tests, types, lint)
  • All URLs unchanged except /auth/loading/auth/callback-loading and /debug/badges/dev/badges
  • No Supabase config changes required
  • Smoke E2E suite passes

🤖 Generated with Claude Code

- 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>
Copilot AI review requested due to automatic review settings April 13, 2026 01:56
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pin-point Ready Ready Preview, Comment Apr 13, 2026 2:25am

@supabase
Copy link
Copy Markdown

supabase bot commented Apr 13, 2026

Updates to Preview Branch (claude/affectionate-herschel) ↗︎

Deployments Status Updated
Database Mon, 13 Apr 2026 02:24:19 UTC
Services Mon, 13 Apr 2026 02:24:19 UTC
APIs Mon, 13 Apr 2026 02:24:19 UTC

Tasks are run on every commit but only new migration files are pushed.
Close and reopen this PR if you want to apply changes from existing seed or migration files.

Tasks Status Updated
Configurations Mon, 13 Apr 2026 02:24:20 UTC
Migrations Mon, 13 Apr 2026 02:24:20 UTC
Seeding Mon, 13 Apr 2026 02:24:20 UTC
Edge Functions Mon, 13 Apr 2026 02:24:20 UTC

View logs for this Workflow Run ↗︎.
Learn more about Supabase for Git ↗︎.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.tsx wrapper.
  • Move report flow into (app)/report (including new unified report form helpers/tests) and ensure pages inherit layout rather than importing MainLayout directly.
  • Consolidate dev tools under (dev) and adjust internal redirects/tests for /auth/callback-loading and /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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 44 changed files in this pull request and generated 2 comments.

Comment on lines 1 to 4
import { describe, it, expect } from "vitest";
import { publicIssueSchema } from "~/app/report/schemas";
import { publicIssueSchema } from "~/app/(app)/report/schemas";

describe("publicIssueSchema", () => {
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines 1 to 4
import { describe, it, expect } from "vitest";
import { parsePublicIssueForm } from "~/app/report/validation";
import { parsePublicIssueForm } from "~/app/(app)/report/validation";

const buildFormData = (
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/*.

Copilot uses AI. Check for mistakes.
timothyfroehlich and others added 2 commits April 12, 2026 21:22
- 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>
@timothyfroehlich timothyfroehlich enabled auto-merge (squash) April 13, 2026 02:32
@timothyfroehlich timothyfroehlich merged commit 086d231 into main Apr 13, 2026
23 checks passed
@timothyfroehlich timothyfroehlich deleted the claude/affectionate-herschel branch April 13, 2026 02:34
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.

2 participants