feat(web): library homepage, chain in settings
Implements the §9.7 shell rulings (issue #173): "/" renders the library and the board route is gone — every former board target (Esc, cleared search, detail parent routes, the not-found fallback) lands on the library. The signal chain moves into /settings as its first section, lamps still driven by the health poll; the master lamp stays on the rail. The wordmark is now a real anchor that navigates home. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
+4
-9
@@ -3,7 +3,6 @@
|
||||
// state passed to pushState, so a manually edited or copy-pasted URL works.
|
||||
|
||||
export type Route =
|
||||
| { kind: "board" }
|
||||
| { kind: "library" }
|
||||
| { kind: "queues" }
|
||||
| { kind: "settings" }
|
||||
@@ -16,9 +15,6 @@ export type Route =
|
||||
|
||||
export function parseRoute(url: URL): Route {
|
||||
const segments = url.pathname.split("/").filter(Boolean);
|
||||
if (segments.length === 1 && segments[0] === "library") {
|
||||
return { kind: "library" };
|
||||
}
|
||||
if (segments.length === 1 && segments[0] === "queues") {
|
||||
return { kind: "queues" };
|
||||
}
|
||||
@@ -27,7 +23,7 @@ export function parseRoute(url: URL): Route {
|
||||
}
|
||||
if (segments.length === 1 && segments[0] === "search") {
|
||||
const query = url.searchParams.get("q") ?? "";
|
||||
return query === "" ? { kind: "board" } : { kind: "search", query };
|
||||
return query === "" ? { kind: "library" } : { kind: "search", query };
|
||||
}
|
||||
if (segments.length === 2 && segments[0] === "movies") {
|
||||
const movieId = Number(segments[1]);
|
||||
@@ -70,15 +66,14 @@ export function parseRoute(url: URL): Route {
|
||||
return { kind: "episodeReleases", episodeId };
|
||||
}
|
||||
}
|
||||
return { kind: "board" };
|
||||
// §9.7: the library is the homepage — "/" and every unrecognised path land here
|
||||
return { kind: "library" };
|
||||
}
|
||||
|
||||
export function routePath(route: Route): string {
|
||||
switch (route.kind) {
|
||||
case "board":
|
||||
return "/";
|
||||
case "library":
|
||||
return "/library";
|
||||
return "/";
|
||||
case "queues":
|
||||
return "/queues";
|
||||
case "settings":
|
||||
|
||||
Reference in New Issue
Block a user