chore(web): post-#363 cleanup — DRY tripwires, drop unused description, singular playlist title

M2 — Add TODO(#375) tripwire comments where the dark/light theme-color
hex pair is duplicated outside tokens.json (vite.config.ts and
applyMetaThemeColor.svelte.ts). Refactoring is out of scope for #363;
the comments are stop signs for the next person who edits these.

M5 — The SPA never reads window.__MINSTREL__.description. The OG meta
description is server-rendered and complete on its own. Drop the dead
inline-script field and the corresponding helpers in branding.ts.
Server-side BrandingConfig.Description stays — it's still used for
<meta name="description"> and og:description.

Copy nit — Playlist detail page title becomes "Playlist · Foo"
matching the singular form already used by Artist · / Album ·.
This commit is contained in:
2026-05-03 19:04:59 -04:00
parent a8fd33d4ed
commit 180d85eec0
5 changed files with 14 additions and 28 deletions
+1 -10
View File
@@ -1,12 +1,10 @@
declare global {
interface Window {
__MINSTREL__?: { appName: string; description: string };
__MINSTREL__?: { appName: string };
}
}
const DEFAULT_APP_NAME = 'Minstrel';
const DEFAULT_DESCRIPTION =
'Self-hosted music server with Subsonic compatibility, smart shuffle, and Lidarr integration.';
const isRenderedToken = (v: string | undefined): v is string =>
typeof v === 'string' && v.length > 0 && !v.includes('{{');
@@ -18,13 +16,6 @@ export const appName = (): string => {
: DEFAULT_APP_NAME;
};
export const description = (): string => {
if (typeof window === 'undefined') return DEFAULT_DESCRIPTION;
return isRenderedToken(window.__MINSTREL__?.description)
? window.__MINSTREL__!.description
: DEFAULT_DESCRIPTION;
};
export const pageTitle = (section?: string): string =>
section ? `${appName()} · ${section}` : appName();