v4: the playlists page is reachable at every width, and lists the user's own — below 1150px the header's text link was hidden and nothing replaced it: the avatar menu's "My playlists" led to the user's own, and a guest has no menu. The menu's entry is now "Playlists", to /playlists, at every width, and the page gains a tab after its orders, "Mine", for a signed-in user: their own playlists, private ones too, from GET /api/users/:id/playlists in the default order, narrowed by the category menu and kept live as the others are. It is /playlists?mine=1 (PLAYLISTS_TABS, parsePlaylistsTab, shared/paths.ts), a tab taking the order's place; a guest isn't offered it, and its link sends one to sign in. PlaylistSortTabs takes the tabs it shows, a profile's being the orders alone. The text link shows to a guest at every width, their header giving up its margins under 400px rather than the link, and to a signed-in user where the row has room beside the icons, as measured in every style and both languages: from 560px up to 860px, where the index page's tabs move into the header, and from 1150px as before. A guest in French in the kanagawa style still overflows the header under 340px, by up to 19px.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
||||
dumpPath,
|
||||
feedPath,
|
||||
parsePagePath,
|
||||
parsePlaylistsTab,
|
||||
playlistPath,
|
||||
playlistSortQuery,
|
||||
playlistsPath,
|
||||
@@ -43,6 +44,14 @@ Deno.test("builders: one hierarchy, default views bare", () => {
|
||||
assertEquals(playlistsPath("mixes"), "/playlists/mixes");
|
||||
assertEquals(playlistsPath(undefined, "updated"), "/playlists");
|
||||
assertEquals(playlistsPath("mixes", "new"), "/playlists/mixes?sort=new");
|
||||
assertEquals(playlistsPath("mixes", "mine"), "/playlists/mixes?mine=1");
|
||||
// The page's tab is one or the other: its own playlists come in one order.
|
||||
const tab = (query: string) => parsePlaylistsTab(new URLSearchParams(query));
|
||||
assertEquals(tab(""), "updated");
|
||||
assertEquals(tab("sort=dumps"), "dumps");
|
||||
assertEquals(tab("sort=nope"), "updated");
|
||||
assertEquals(tab("mine=1"), "mine");
|
||||
assertEquals(tab("mine=1&sort=dumps"), "mine");
|
||||
// The query of a list that has other parameters: the default order takes
|
||||
// an old `sort` out, and leaves the rest.
|
||||
const category = new URLSearchParams({ category: "mixes", sort: "new" });
|
||||
|
||||
Reference in New Issue
Block a user