fix(interception): address codex review issues in sibling intercept implementation

- Pass effectiveParams to resolveAppPageHead so generateMetadata/generateViewport
  sees the intercepted route's params instead of the source route's params
- Rename SIBLING_INTERCEPT_SLOT_NAME from __page to __vinext_sibling_intercept
  to prevent collision with a user @__page parallel route directory
- Restore middleware-rewrite fixture link without locale prefix so the
  interception-dynamic-segment-middleware spec exercises the intended
  middleware rewrite path
This commit is contained in:
Divanshu Chauhan
2026-06-07 04:20:06 -07:00
parent 02e80c2670
commit 2248b8feda
3 changed files with 5 additions and 3 deletions
@@ -367,7 +367,7 @@ function createAppRouteGraphDefaultId(slotId: string): string {
return `default:${slotId}`;
}
const SIBLING_INTERCEPT_SLOT_NAME = "__page";
const SIBLING_INTERCEPT_SLOT_NAME = "__vinext_sibling_intercept";
function createAppRouteGraphSiblingInterceptSlotId(sourcePattern: string): string {
return createAppRouteGraphSlotId(SIBLING_INTERCEPT_SLOT_NAME, sourcePattern);
}
@@ -206,7 +206,7 @@ export async function buildPageElements<
routeSegments: route.routeSegments ?? [],
slots: route.slots ?? null,
}),
params,
params: effectiveParams,
routePath: route.pattern,
routeSegments: route.routeSegments ?? null,
searchParams,
@@ -4,7 +4,9 @@ export default async function Page({ params }: { params: Promise<{ locale: strin
const { locale } = await params;
return (
<div>
<Link href={`/interception-mw/${locale}/foo/p/1`} id="link-foo-p-1">
{/* Link without locale — middleware rewrites /interception-mw/foo/p/1
to /interception-mw/en/foo/p/1 so interception fires */}
<Link href="/interception-mw/foo/p/1" id="link-foo-p-1">
Foo
</Link>
</div>