docs: web comments say what the app does, not how it came to be (#6277)
Rewrites the web app's comments to rule 32. Task, milestone, rule and spec ids are gone; regression stories are restated as the trap they guard (public auth routes, the menu's stopPropagation, universal loads under adapter-static, metric deltas with their margin). Flutter and Tauri mentions now name the Android app or a native shell, operator quotes and dates are dropped, and one library's counts no longer appear outside test fixtures. Verified with a TypeScript-scanner token comparison (template literals and regex literals re-scanned): only comment text changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
|
||||
// /playlists (list) moved to /library/playlists on 2026-06-01 as part of
|
||||
// the nav restructure (Scribe 518). The detail route /playlists/[id]
|
||||
// /playlists (the list) redirects to /library/playlists. The detail route
|
||||
// /playlists/[id]
|
||||
// still lives here at /routes/playlists/[id]/+page.svelte — that URL
|
||||
// matches the server API shape and is unchanged.
|
||||
// 308 = permanent + preserve method; old bookmarks land on the new URL.
|
||||
//
|
||||
// Drift #559: this was a +page.server.ts which DOES NOT run in
|
||||
// production (adapter-static + ssr=false, see +layout.ts). +page.ts
|
||||
// universal load runs client-side and IS what the SPA executes.
|
||||
// A universal load (+page.ts), not +page.server.ts: the app is
|
||||
// adapter-static with ssr=false (see +layout.ts), so a server load never
|
||||
// runs.
|
||||
export const load = () => {
|
||||
throw redirect(308, '/library/playlists');
|
||||
};
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
const moved = cur.splice(fromPos, 1)[0];
|
||||
cur.splice(clamped, 0, moved);
|
||||
// Show the new order on drop rather than after the round trip, so the
|
||||
// dragged row lands in its slot at once (#5393). Positions are
|
||||
// dragged row lands in its slot at once. Positions are
|
||||
// renumbered the way the server renumbers them; the invalidate below
|
||||
// replaces this with the server's copy either way.
|
||||
const previous = playlistQuery.data;
|
||||
@@ -81,8 +81,8 @@
|
||||
}
|
||||
|
||||
// Every entry that can be played, in playlist order. playlistTrackToRef
|
||||
// drops both kinds of dead entry, removed tracks and missing files
|
||||
// (#2527), so neither is ever queued.
|
||||
// drops both kinds of dead entry, removed tracks and missing files,
|
||||
// so neither is ever queued.
|
||||
function playable(data: PlaylistDetail): { refs: TrackRef[]; positions: number[] } {
|
||||
const refs: TrackRef[] = [];
|
||||
const positions: number[] = [];
|
||||
@@ -97,7 +97,7 @@
|
||||
}
|
||||
|
||||
function startQueue(data: PlaylistDetail, tracks: TrackRef[], startIdx: number) {
|
||||
// #968: a system playlist played from its detail page is tagged with its
|
||||
// A system playlist played from its detail page is tagged with its
|
||||
// source (so play_started advances the rotation, matching the home tile and
|
||||
// the Android detail screen) and gets the self-heal closure so a stale
|
||||
// snapshot re-pulls on total failure.
|
||||
@@ -180,7 +180,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
// --- System-playlist refresh (#411 R2: generic by-kind) ---
|
||||
// --- System-playlist refresh (generic by-kind) ---
|
||||
let refreshingSystem = $state(false);
|
||||
|
||||
async function onRefreshSystem(variant: string) {
|
||||
@@ -197,7 +197,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
// --- #980: stale-view banner for an open system-playlist detail page ---
|
||||
// --- Stale-view banner for an open system-playlist detail page ---
|
||||
// The daily rebuild rotates the playlist id, so this page's cached data goes
|
||||
// stale and can't be refetched in place (the old id 404s). Watch the global
|
||||
// rebuild counter; when it advances while we're on a system playlist, offer a
|
||||
|
||||
@@ -35,7 +35,8 @@ vi.mock('#lib/player/store.svelte.js', () => ({
|
||||
player: { current: undefined }
|
||||
}));
|
||||
|
||||
// Cascade through PlaylistTrackRow's mocks (LikeButton + TrackMenu transitively).
|
||||
// Cascade through PlaylistTrackRow's mocks (LikeButton + TrackMenu
|
||||
// transitively).
|
||||
vi.mock('#lib/api/likes.js', () => ({
|
||||
createLikedIdsQuery: () => ({ subscribe: () => () => {}, data: { track_ids: [], album_ids: [], artist_ids: [] } }),
|
||||
likeEntity: vi.fn(),
|
||||
@@ -62,9 +63,9 @@ const ownDetail: PlaylistDetail = {
|
||||
afterEach(() => vi.clearAllMocks());
|
||||
|
||||
describe('Playlist detail page', () => {
|
||||
// A missing file (#2527) stays in the list but is never queued: the
|
||||
// page used to build its queue with its own converter, which only
|
||||
// skipped removed tracks.
|
||||
// A missing file stays in the list but is never queued: the page builds
|
||||
// its queue through playlistTrackToRef, which skips it as it skips a
|
||||
// removed track.
|
||||
test('Play queues every playable entry and skips a missing file', async () => {
|
||||
const withMissing: PlaylistDetail = {
|
||||
...ownDetail,
|
||||
|
||||
Reference in New Issue
Block a user