Skip to content

fix: resolve brand brief routing conflict (/briefs/new → /brand/briefs/new)#13

Merged
parva3105 merged 1 commit intomasterfrom
fix/brand-brief-route
Mar 21, 2026
Merged

fix: resolve brand brief routing conflict (/briefs/new → /brand/briefs/new)#13
parva3105 merged 1 commit intomasterfrom
fix/brand-brief-route

Conversation

@parva3105
Copy link
Copy Markdown
Owner

Summary

  • app/(agency)/briefs/[id] and app/(brand)/briefs/new both resolved to the URL /briefs/new
  • Next.js served the agency dynamic route with id="new", which immediately called notFound() since no brief has that ID
  • The brand manager Submit Brief form was never rendered — users saw a 404

Root cause

Next.js App Router route groups are purely organizational. Two pages in different route groups can collide at the same URL. Since the agency has briefs/[id] (dynamic) and the brand had briefs/new (static), they overlap at /briefs/new. In practice Next.js resolved to the agency route first.

Fix

  • Moved app/(brand)/briefs/new/page.tsxapp/(brand)/brand/briefs/new/page.tsx (URL: /brand/briefs/new)
  • Updated Sidebar.tsx: brand_manager Submit Brief href → /brand/briefs/new
  • Updated RoleSwitcher.tsx: brand_manager home route → /brand/briefs/new

Test plan

  • Switch role switcher to "Brand Portal" — confirms redirect to /brand/briefs/new (not 404)
  • Sidebar "Submit Brief" link navigates to /brand/briefs/new and renders the form
  • Agency /briefs/brief_001 still works and shows the agency brief detail (not the brand form)
  • Submit the form → success screen appears with "Brief Submitted!"
  • "Submit another" button resets and shows the form again

🤖 Generated with Claude Code

app/(agency)/briefs/[id] and app/(brand)/briefs/new both resolved to
/briefs/new. Next.js served the agency dynamic route with id="new",
which immediately called notFound(). The brand Submit Brief form was
never rendered.

Fix: move the brand page to app/(brand)/brand/briefs/new/page.tsx so
it serves at /brand/briefs/new — a URL with no overlap with any
agency route. Update Sidebar and RoleSwitcher to use the new URL.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 21, 2026

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

Project Deployment Actions Updated (UTC)
project-alpha Error Error Mar 21, 2026 0:40am

@parva3105 parva3105 merged commit 66e05c5 into master Mar 21, 2026
1 of 3 checks passed
@parva3105 parva3105 deleted the fix/brand-brief-route branch March 21, 2026 00:40
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.

1 participant