From 6cfd6317e98bee9bb8fa3228374b39d13651b948 Mon Sep 17 00:00:00 2001 From: parva3105 Date: Fri, 20 Mar 2026 20:39:58 -0400 Subject: [PATCH] fix: resolve brand-brief routing conflict by moving to /brand/briefs/new MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .claude/memory/iterations.md | 16 ++++++++++++++++ .claude/memory/requests.md | 8 ++++++++ app/(brand)/{ => brand}/briefs/new/page.tsx | 0 components/layout/RoleSwitcher.tsx | 2 +- components/layout/Sidebar.tsx | 2 +- 5 files changed, 26 insertions(+), 2 deletions(-) rename app/(brand)/{ => brand}/briefs/new/page.tsx (100%) diff --git a/.claude/memory/iterations.md b/.claude/memory/iterations.md index 9f98115..0878aae 100644 --- a/.claude/memory/iterations.md +++ b/.claude/memory/iterations.md @@ -452,3 +452,19 @@ Public: - lib/utils.ts **Issues found**: None. No fixes were required. + +--- + +## 2026-03-20 — fix/brand-brief-route +**Type**: Bug fix +**Branch**: fix/brand-brief-route + +**Root cause**: URL routing conflict between `app/(agency)/briefs/[id]/page.tsx` and `app/(brand)/briefs/new/page.tsx`. Both resolved to `/briefs/new`. Next.js served the agency dynamic route (`[id]="new"`), which immediately called `notFound()` because no brief with id="new" exists. The brand manager Submit Brief form was never rendered. + +**Fix**: +- Moved `app/(brand)/briefs/new/page.tsx` → `app/(brand)/brand/briefs/new/page.tsx` (new URL: `/brand/briefs/new`) +- Updated `components/layout/Sidebar.tsx`: brand_manager Submit Brief href `/briefs/new` → `/brand/briefs/new` +- Updated `components/layout/RoleSwitcher.tsx`: brand_manager home route `/briefs/new` → `/brand/briefs/new` +- Removed now-empty `app/(brand)/briefs/` directories + +**Result**: `/brand/briefs/new` serves the SubmitBriefForm correctly under the brand layout; no conflict with agency `/briefs/*` routes. diff --git a/.claude/memory/requests.md b/.claude/memory/requests.md index 6058a5f..f4d604a 100644 --- a/.claude/memory/requests.md +++ b/.claude/memory/requests.md @@ -121,3 +121,11 @@ Dragging cards to PENDING_APPROVAL or LIVE columns shows an error toast. Users m ### Partnership Request dialog — no role check in Phase 1 In Phase 1, the "Send Partnership Request" button is always visible on /creators/[handle]. Phase 3: restrict to agency role only. + +--- + +## [DONE] Phase 1: /brand/briefs/new routing conflict +**Type**: Bug fix +**Priority**: P1 (blocker) +**What**: Brand manager "Submit Brief" page at `/briefs/new` was silently routed to the agency `briefs/[id]` dynamic route (id="new"), returning 404. Fixed by moving the brand route to `/brand/briefs/new` which has no overlap with any agency route. +**Status**: [DONE] — fix/brand-brief-route (2026-03-20) diff --git a/app/(brand)/briefs/new/page.tsx b/app/(brand)/brand/briefs/new/page.tsx similarity index 100% rename from app/(brand)/briefs/new/page.tsx rename to app/(brand)/brand/briefs/new/page.tsx diff --git a/components/layout/RoleSwitcher.tsx b/components/layout/RoleSwitcher.tsx index dee2f7f..e9a8283 100644 --- a/components/layout/RoleSwitcher.tsx +++ b/components/layout/RoleSwitcher.tsx @@ -13,7 +13,7 @@ import { const ROLE_HOME_ROUTES: Record = { agency: '/dashboard', creator: '/creator/deals', - brand_manager: '/briefs/new', + brand_manager: '/brand/briefs/new', } export function RoleSwitcher() { diff --git a/components/layout/Sidebar.tsx b/components/layout/Sidebar.tsx index faaeb5c..03f9fca 100644 --- a/components/layout/Sidebar.tsx +++ b/components/layout/Sidebar.tsx @@ -33,7 +33,7 @@ const NAV_ITEMS: Record = { { label: 'Profile', href: '/creator/profile', icon: User }, ], brand_manager: [ - { label: 'Submit Brief', href: '/briefs/new', icon: PenLine }, + { label: 'Submit Brief', href: '/brand/briefs/new', icon: PenLine }, { label: 'My Briefs', href: '/brand/briefs', icon: Inbox }, ], }