/playlists is the new page of every public playlist, newest first (GET /api/playlists), and /playlists/<slug> a playlist category's, with a menu of the categories, linked from the user menu as "All playlists"; `playlists` is reserved as a dump category's slug, and one that had it is renamed. A profile's Playlists tab narrows to a playlist category with the same menu as its Dumps tab (?category=), and so do the Dumps and Playlists tabs of /search, each with its own kind (category and playlistCategory for GET /api/search), another tab dropping it. The category service takes the kind throughout, so a dump can't be filed under a playlist category nor the other way round, and categoryJoin is the one filter join the dump, follow and playlist services share. useCategories(kind) gives one kind's set from the one fetch, CategoryChips replaces the chips the dump card and page each drew, useCategoryFilter keeps a list to its category as the socket brings more, and useCategorySelection holds a form's picked categories. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
25 lines
619 B
TypeScript
25 lines
619 B
TypeScript
import "../setup.ts";
|
|
import { assert, assertFalse } from "@std/assert";
|
|
import { isReservedSlug } from "../../lib/reserved-slugs.ts";
|
|
|
|
Deno.test("category slugs: the feed tabs, app pages and server paths are reserved", () => {
|
|
for (
|
|
const word of [
|
|
"hot",
|
|
"follow",
|
|
"settings",
|
|
"manage",
|
|
"community",
|
|
"playlists",
|
|
"api",
|
|
"ws",
|
|
]
|
|
) {
|
|
assert(isReservedSlug(word), word);
|
|
}
|
|
// v3's words are free again: nothing lives at /dumps or /users now.
|
|
for (const word of ["music", "dumps", "users", "~"]) {
|
|
assertFalse(isReservedSlug(word), word);
|
|
}
|
|
});
|