Skip to content

Commit 9733146

Browse files
ataibarkaiclaude
andcommitted
fix(showcase/shell): redirect /<framework>/unselected/<path> → /<framework>/<path>
A framework-scoped URL asserting "unselected" in its path is incoherent — you can't be both on langgraph-python AND in the no-framework state. Collapse the redundant segment: if the framework catch-all receives a slug that starts with unselected/, permanent- redirect to the same path without that prefix (the framework-scoped version serves the same content, just with Snippets resolved against the selected framework's cells). /docs/unselected/<path> remains a valid framework-agnostic URL. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 6751bce commit 9733146

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

  • showcase/shell/src/app/[framework]/[[...slug]]

showcase/shell/src/app/[framework]/[[...slug]]/page.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// none of which are framework slugs, so there are no collisions.
1717

1818
import React from "react";
19-
import { notFound } from "next/navigation";
19+
import { notFound, redirect } from "next/navigation";
2020
import Link from "next/link";
2121
import { DocsPageView } from "@/components/docs-page-view";
2222
import { SidebarFrameworkSelector } from "@/components/sidebar-framework-selector";
@@ -73,6 +73,15 @@ export default async function FrameworkScopedDocsPage({
7373
return <FrameworkLandingPage framework={framework} />;
7474
}
7575

76+
// `/<framework>/unselected/<path>` is incoherent — a framework IS
77+
// selected, so the URL should never assert the "unselected" state
78+
// alongside. Collapse to the framework-scoped path (which serves the
79+
// same underlying content, just with Snippets resolved against the
80+
// selected framework's cells).
81+
if (slugPath.startsWith("unselected/")) {
82+
redirect(`/${framework}/${slugPath.slice("unselected/".length)}`);
83+
}
84+
7685
// When the page doesn't exist at all, 404.
7786
const doc = loadDoc(slugPath);
7887
if (!doc) notFound();

0 commit comments

Comments
 (0)