§22 S2: collection directory at /p/<project>/ (1 → redirect, 2+ → list)

Replace DefaultCollectionRedirect with a CollectionDirectory that lists the
project's visible collections, or redirects into the sole one when there is
exactly one (preserving the S1 C3.7/C3.8 single-collection UX). The
create-first-collection empty state is S4.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ben Stull
2026-06-05 13:14:18 -07:00
parent 2b32e124ab
commit 17bdd5fd9a
3 changed files with 109 additions and 8 deletions
+10 -8
View File
@@ -15,6 +15,7 @@ import RFCView from './components/RFCView.jsx'
import PRView from './components/PRView.jsx'
import ProposalView from './components/ProposalView.jsx'
import ProposeModal from './components/ProposeModal.jsx'
import CollectionDirectory from './components/CollectionDirectory.jsx'
import ContributeRequestForm from './components/ContributeRequestForm.jsx'
import Landing from './components/Landing.jsx'
import Login from './components/Login.jsx'
@@ -364,9 +365,10 @@ export default function App() {
/>
<main className="main-pane">
<Routes>
{/* §22 three-tier (C3.7): the project landing redirects into
its sole/default collection (S1: the `default` one). */}
<Route path="" element={<DefaultCollectionRedirect />} />
{/* §22 S2: the project landing is the collection directory —
it lists collections, or (C3.7/C3.8) redirects into the
sole visible collection when there is exactly one. */}
<Route path="" element={<CollectionDirectoryRoute />} />
{/* Backcompat: the shipped v0.35.0 corpus URLs without a
/c/<collection>/ segment redirect into the default
collection, so old bookmarks keep working. */}
@@ -419,12 +421,12 @@ export default function App() {
)
}
// §22 three-tier — corpus redirects mounted under /p/:projectId/*.
// C3.7: the project landing skips the (single-collection) directory and lands in
// the project's default collection.
function DefaultCollectionRedirect() {
// §22 S2 — the project landing at /p/:projectId/ is the collection directory.
// A tiny wrapper reads the route's projectId and hands it to CollectionDirectory
// (which lists collections, or redirects into the sole one — C3.7/C3.8).
function CollectionDirectoryRoute() {
const { projectId } = useParams()
return <Navigate to={`/p/${projectId}/c/${DEFAULT_COLLECTION}/`} replace />
return <CollectionDirectory projectId={projectId} />
}
// Backcompat for the shipped v0.35.0 corpus URLs that lacked the