Commit 0a6e132d authored by Aryan Noshirvnai's avatar Aryan Noshirvnai

Fix Home album expand layout, app-wide text contrast, and FullPlayer lyrics UX

- HomeAlbumCard: a non-owned album's inline-expand path nested a
  full-width HomeSongRow inside a ~160px grid cell, squeezing the title
  down to one character. Expanded cards now span the full grid row and
  switch to a compact list-row header.
- index.css: `outline` (used as text color in ~65 places - timestamps,
  subtitles, hints) was bridged to `--border`, a value shadcn keeps
  deliberately near-invisible for hairline dividers. Repointed to
  `--muted-foreground`, the token actually meant to be legible.
  `outline-variant` (borders/dividers only) is unaffected.
- FullPlayer: Lyrics screen gained a persistent mini transport (seek,
  timestamps, prev/play/next) so playback stays controllable without
  backing out, and the root panel now caps at h-svh instead of inset-0's
  implicit 100% so it can never be taller than what's actually visible
  when the mobile browser chrome is shown - that overflow was letting
  the Lyrics header peek in below the fold and drag on scroll.
Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
parent 26606975
...@@ -239,7 +239,14 @@ export function FullPlayer() { ...@@ -239,7 +239,14 @@ export function FullPlayer() {
role="dialog" role="dialog"
aria-modal="true" aria-modal="true"
aria-label={`Now playing: ${currentSong.title} by ${currentSong.artist}`} aria-label={`Now playing: ${currentSong.title} by ${currentSong.artist}`}
className={`fixed inset-0 z-30 overflow-hidden bg-background text-on-surface will-change-transform transition-all duration-300 ease-out motion-reduce:transition-none ${ // h-svh (small viewport height), not just inset-0's implicit 100%: mobile browsers size a
// fixed element's height against the *large* viewport (as if the address bar were already
// hidden) by default. When the bar is actually showing, that leaves this panel taller than
// what's visible - its bottom edge (the Lyrics screen's own header, in practice) peeks in
// below the fold and a real touch scroll can drag the whole thing, which is what read as
// "lyrics bleed in and shift the UI". svh is always sized for the bar being visible, so
// there's never more height here than can actually be shown at once.
className={`fixed inset-0 z-30 h-svh overflow-hidden bg-background text-on-surface will-change-transform transition-all duration-300 ease-out motion-reduce:transition-none ${
visible ? 'translate-y-0 opacity-100' : 'translate-y-6 opacity-0' visible ? 'translate-y-0 opacity-100' : 'translate-y-6 opacity-0'
}`} }`}
> >
...@@ -544,6 +551,70 @@ export function FullPlayer() { ...@@ -544,6 +551,70 @@ export function FullPlayer() {
<EmptyState icon={ScrollText} message="No lyrics available for this track." /> <EmptyState icon={ScrollText} message="No lyrics available for this track." />
)} )}
</div> </div>
{/* Mini transport footer, pinned below the scrollable lyrics - without this, the lyrics
screen had zero way to play/pause/seek/skip without backing out to the main screen
first. Same controls as there, just smaller, matching how Spotify's own lyrics view
keeps a persistent mini-bar rather than making lyrics a dead-end text dump. */}
<div
className="relative mx-auto w-full max-w-md shrink-0 px-6 pb-4 pt-2"
style={{ paddingBottom: 'calc(env(safe-area-inset-bottom) + 1rem)' }}
>
<input
type="range"
min={0}
max={duration || 0}
value={Math.min(progress, duration || 0)}
step={0.1}
onChange={(e) => seek(Number(e.target.value))}
disabled={!duration}
tabIndex={lyricsOpen ? 0 : -1}
aria-label="Seek"
aria-valuetext={`${formatTime(progress)} of ${formatTime(duration)}`}
className="seek-range w-full disabled:opacity-40"
style={{
background: `linear-gradient(to right, var(--color-primary) ${pct}%, var(--color-surface-container-high) ${pct}%)`,
}}
/>
<div className="mb-2 mt-1 flex justify-between text-xs text-outline">
<span>{formatTime(progress)}</span>
<span>{formatTime(duration)}</span>
</div>
<div className="flex items-center justify-center gap-8">
<button
onClick={previous}
tabIndex={lyricsOpen ? 0 : -1}
aria-label="Previous"
className="rounded-full p-1 text-on-surface transition-colors hover:text-on-surface focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"
>
<SkipBack size={22} strokeWidth={2} fill="currentColor" />
</button>
<button
onClick={() => toggle(currentSong)}
disabled={isLoading}
tabIndex={lyricsOpen ? 0 : -1}
aria-label={isPlaying ? 'Pause' : 'Play'}
className="flex h-12 w-12 items-center justify-center rounded-full bg-primary text-on-primary transition-transform duration-150 ease-out active:scale-90 disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background"
>
{isLoading ? (
<span className="h-4 w-4 animate-spin rounded-full border-2 border-on-primary/30 border-t-on-primary" />
) : isPlaying ? (
<Pause size={20} strokeWidth={2} fill="currentColor" />
) : (
<Play size={20} strokeWidth={2} fill="currentColor" className="ml-0.5" />
)}
</button>
<button
onClick={next}
disabled={!hasNext}
tabIndex={lyricsOpen ? 0 : -1}
aria-label="Next"
className="rounded-full p-1 text-on-surface transition-colors hover:text-on-surface disabled:opacity-30 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"
>
<SkipForward size={22} strokeWidth={2} fill="currentColor" />
</button>
</div>
</div>
</div> </div>
{/* Queue screen: still a dedicated push-navigation screen with its own header, since {/* Queue screen: still a dedicated push-navigation screen with its own header, since
......
...@@ -31,20 +31,36 @@ export function HomeAlbumCard({ ...@@ -31,20 +31,36 @@ export function HomeAlbumCard({
} }
return ( return (
<div className="flex min-w-0 flex-col gap-2"> // col-span-full while expanded: HomeSongRow is built for a full-width list context (fixed-size
// artwork + gap + two icon buttons), not a ~160px grid cell - cramming it into one column
// squeezed the title down to a single truncated character. Spanning the full grid row instead
// gives the expanded tracks the width they need; sibling cards just reflow below.
<div className={`flex min-w-0 flex-col gap-2 ${expanded ? 'col-span-full' : ''}`}>
<button <button
onClick={handleOpen} onClick={handleOpen}
aria-expanded={isOwnAlbum ? undefined : expanded} aria-expanded={isOwnAlbum ? undefined : expanded}
className="flex min-w-0 flex-col gap-2 rounded-xl border border-transparent p-1 text-left transition-colors hover:border-outline-variant hover:bg-surface-container focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary" className={`flex min-w-0 rounded-xl border border-transparent text-left transition-colors hover:border-outline-variant hover:bg-surface-container focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary ${
expanded ? 'items-center gap-3 p-2' : 'flex-col gap-2 p-1'
}`}
> >
{album.coverart ? ( {album.coverart ? (
<img src={album.coverart} alt="" loading="lazy" decoding="async" className="aspect-square w-full rounded-lg object-cover" /> <img
src={album.coverart}
alt=""
loading="lazy"
decoding="async"
className={expanded ? 'h-12 w-12 shrink-0 rounded-lg object-cover' : 'aspect-square w-full rounded-lg object-cover'}
/>
) : ( ) : (
<div className="flex aspect-square w-full items-center justify-center rounded-lg bg-surface-container-high text-on-surface-variant"> <div
<Music2 size={28} strokeWidth={1.5} /> className={`flex shrink-0 items-center justify-center rounded-lg bg-surface-container-high text-on-surface-variant ${
expanded ? 'h-12 w-12' : 'aspect-square w-full'
}`}
>
<Music2 size={expanded ? 18 : 28} strokeWidth={1.5} />
</div> </div>
)} )}
<div className="min-w-0 px-1"> <div className={`min-w-0 ${expanded ? '' : 'px-1'}`}>
<p className="truncate text-sm font-medium text-on-surface">{album.album}</p> <p className="truncate text-sm font-medium text-on-surface">{album.album}</p>
<p className="truncate text-xs text-on-surface-variant"> <p className="truncate text-xs text-on-surface-variant">
{album.artist} · {album.track_count} track{album.track_count === 1 ? '' : 's'} {album.artist} · {album.track_count} track{album.track_count === 1 ? '' : 's'}
......
...@@ -40,7 +40,13 @@ ...@@ -40,7 +40,13 @@
--color-inverse-surface: var(--foreground); --color-inverse-surface: var(--foreground);
--color-inverse-on-surface: var(--background); --color-inverse-on-surface: var(--background);
--color-outline: var(--border); /* outline is used app-wide as TEXT color (timestamps, subtitles, hints, muted icons) -
muted-foreground is the token actually designed to be legible at that size/weight.
outline-variant is only ever used for hairline borders/dividers (never text), so it keeps
mapping to --border, which is deliberately low-contrast for that purpose. Mapping both to
--border (as a naive 1:1 port of the old names would do) made every label using the first
one nearly invisible, worst in dark mode where --border is a 10%-opacity white hairline. */
--color-outline: var(--muted-foreground);
--color-outline-variant: var(--border); --color-outline-variant: var(--border);
--color-primary: var(--primary); --color-primary: var(--primary);
......
...@@ -109,6 +109,7 @@ const BACKEND_DONE: DoneGroup[] = [ ...@@ -109,6 +109,7 @@ const BACKEND_DONE: DoneGroup[] = [
items: [ items: [
'New GET /home/feed (2026-10-06): a global landing feed, distinct from the per-user Library page - latest_songs (the 8 most-recently-added songs across every user), new_albums, and suggestions. Suggestions is explicitly a placeholder, commented as such in code - a lightweight non-personalized pick excluding the caller\'s own songs (and any song matching an identity they already own), softly biased toward genres already in their own library when they have any; a real algorithm driven by search/listening habits is future work, not built yet.', 'New GET /home/feed (2026-10-06): a global landing feed, distinct from the per-user Library page - latest_songs (the 8 most-recently-added songs across every user), new_albums, and suggestions. Suggestions is explicitly a placeholder, commented as such in code - a lightweight non-personalized pick excluding the caller\'s own songs (and any song matching an identity they already own), softly biased toward genres already in their own library when they have any; a real algorithm driven by search/listening habits is future work, not built yet.',
'Deduped + unattributed (2026-10-07): every section is now deduped by (title, artist)/(album, artist) identity - the same song or album tagged by several different users used to eat one display slot per uploader (a popular track could fill most of an 8-item list with copies of itself), now shows once. Albums merge across uploaders by picking one representative copy to display (the caller\'s own, if they have one, so the card can navigate straight to their real album page instead of needing a claim; otherwise the most recently added) rather than literally merging different people\'s track data together - still never reconciles mismatched coverart/track-subsets from different uploads, just avoids showing the same album twice. No uploader identity (username) is attached to any global-feed entry - the feed reads as one shared pool of music, not "added by X". New `is_liked` field (only ever true for a song the caller already owns, via the same liked_song_ids helper library.py uses - now shared from services/favorites.py) powers a favorite heart directly on Home rows.', 'Deduped + unattributed (2026-10-07): every section is now deduped by (title, artist)/(album, artist) identity - the same song or album tagged by several different users used to eat one display slot per uploader (a popular track could fill most of an 8-item list with copies of itself), now shows once. Albums merge across uploaders by picking one representative copy to display (the caller\'s own, if they have one, so the card can navigate straight to their real album page instead of needing a claim; otherwise the most recently added) rather than literally merging different people\'s track data together - still never reconciles mismatched coverart/track-subsets from different uploads, just avoids showing the same album twice. No uploader identity (username) is attached to any global-feed entry - the feed reads as one shared pool of music, not "added by X". New `is_liked` field (only ever true for a song the caller already owns, via the same liked_song_ids helper library.py uses - now shared from services/favorites.py) powers a favorite heart directly on Home rows.',
'Tapping a non-owned album in New Albums no longer renders broken (fixed 2026-10-07): the inline-expand path (used when the caller has no copy of their own to navigate to) nested a HomeSongRow - built for a full-width list, with a 48px thumbnail plus two icon buttons - inside a single ~160px grid cell, which left almost no room for the title and truncated it down to one character. The card now spans the full grid row (col-span-full) while expanded, with its own header shrinking to match the same compact list-row style instead of staying a large square tile; collapsed cards are untouched.',
], ],
}, },
{ {
...@@ -173,6 +174,9 @@ const FRONTEND_DONE: DoneGroup[] = [ ...@@ -173,6 +174,9 @@ const FRONTEND_DONE: DoneGroup[] = [
'Real light/dark mode (2026-10-07), the app\'s first - previously deliberately dark-only with no toggle at all, which is exactly why plugging in the shadcn preset directly (its CSS defines genuinely different light vs. dark values) would have silently broken without this: the preset\'s `.dark` class was never applied anywhere, so background/primary/secondary would have resolved to its light-mode values sitting next to the rest of the still-dark-styled app. New ThemeContext (light/dark/system, persisted to localStorage) toggles `.dark` on <html>; a blocking inline script in index.html applies the right class before React even mounts, avoiding a flash - and defaults a first-time visitor with no stored preference to dark specifically (not "system"), so a returning user on a light-mode OS doesn\'t get surprised by their familiar dark app turning white. New "Appearance" segmented control (Light/Dark/System) on the Settings page, a local-only preference with no backend round trip, next to the existing privacy toggles.', 'Real light/dark mode (2026-10-07), the app\'s first - previously deliberately dark-only with no toggle at all, which is exactly why plugging in the shadcn preset directly (its CSS defines genuinely different light vs. dark values) would have silently broken without this: the preset\'s `.dark` class was never applied anywhere, so background/primary/secondary would have resolved to its light-mode values sitting next to the rest of the still-dark-styled app. New ThemeContext (light/dark/system, persisted to localStorage) toggles `.dark` on <html>; a blocking inline script in index.html applies the right class before React even mounts, avoiding a flash - and defaults a first-time visitor with no stored preference to dark specifically (not "system"), so a returning user on a light-mode OS doesn\'t get surprised by their familiar dark app turning white. New "Appearance" segmented control (Light/Dark/System) on the Settings page, a local-only preference with no backend round trip, next to the existing privacy toggles.',
'Space Grotesk (Google Fonts, external CDN link in index.html) replaced by the preset\'s own DM Sans Variable / Outfit Variable, both self-hosted via @fontsource-variable - no external font request at all now, consistent with how the rest of the app avoids third-party runtime dependencies.', 'Space Grotesk (Google Fonts, external CDN link in index.html) replaced by the preset\'s own DM Sans Variable / Outfit Variable, both self-hosted via @fontsource-variable - no external font request at all now, consistent with how the rest of the app avoids third-party runtime dependencies.',
'Settings toggle switches no longer render their thumb outside the pill (fixed 2026-10-07, reported right after the above shipped): the thumb relied on left:auto plus a translate-x offset for its position, but the native <button>\'s text-align:center UA default - never neutralized by an explicit left - made the auto-resolved static position land near the pill\'s right edge regardless of checked state, so the translate pushed it visibly outside the pill in both states instead of sliding within it. Anchored with an explicit left-0.5 base position instead (the standard Tailwind switch recipe), so it no longer depends on the browser\'s static-position resolution for an auto-positioned box.', 'Settings toggle switches no longer render their thumb outside the pill (fixed 2026-10-07, reported right after the above shipped): the thumb relied on left:auto plus a translate-x offset for its position, but the native <button>\'s text-align:center UA default - never neutralized by an explicit left - made the auto-resolved static position land near the pill\'s right edge regardless of checked state, so the translate pushed it visibly outside the pill in both states instead of sliding within it. Anchored with an explicit left-0.5 base position instead (the standard Tailwind switch recipe), so it no longer depends on the browser\'s static-position resolution for an auto-positioned box.',
'Fixed a real app-wide contrast bug in the token bridge above (2026-10-07, reported as "timestamps not visible" and "dark mode harder to read than light"): `outline` - used as TEXT color in ~65 places (timestamps, subtitles, hints, muted icons) - had been bridged to `--border`, a value shadcn deliberately keeps near-invisible for hairline dividers (10%-opacity white in dark mode, barely contains a dark-on-white page in light mode). `outline-variant`, which actually is only ever used for borders/dividers, was correctly left pointing at `--border`; `outline` now points at `--muted-foreground`, the token shadcn designs to be legible at caption size. One-line fix, every page benefits since the token is shared app-wide.',
'FullPlayer\'s Lyrics screen gained a persistent mini transport (seek bar, timestamps, previous/play-pause/next) pinned below the scrollable text (2026-10-07, reported as "controls aren\'t visible" and "lyrics tab is a bit dry") - previously the only way to pause or skip while reading lyrics was backing out to the main Now Playing screen first, and the screen was just a wall of text with nothing else going on. Same approach Spotify\'s own lyrics view takes: lyrics don\'t have to be a dead end.',
'FullPlayer\'s root panel now caps its height at h-svh (small viewport height) instead of relying on inset-0\'s implicit 100% (fixed 2026-10-07, reported as "lyrics bleed in at the bottom and shifts the UI"): mobile browsers size a fixed element against the *large* viewport by default (as if the address bar were already hidden), so with the bar actually showing, the panel was taller than what could be seen - its bottom edge (the Lyrics screen\'s own header, in practice) peeked in below the fold, and a real touch scroll could drag the whole thing. svh is always sized for the bar being visible, so there\'s never more height than can be shown at once.',
'First full visual redesign (2026-08-23), sourced from a Stitch design export: cobalt/periwinkle-on-deep-ink Material-3-style token system (primary #b8c3ff / primary-container #2e5bff on #131313), Space Grotesk, sharp 4px-radius geometry - deliberately not the export\'s mint-green "Stax" variant, which read too close to an existing music app\'s brand color. Superseded by the shadcn swap above, but the token *names* and page structure it established are still exactly what every component uses today.', 'First full visual redesign (2026-08-23), sourced from a Stitch design export: cobalt/periwinkle-on-deep-ink Material-3-style token system (primary #b8c3ff / primary-container #2e5bff on #131313), Space Grotesk, sharp 4px-radius geometry - deliberately not the export\'s mint-green "Stax" variant, which read too close to an existing music app\'s brand color. Superseded by the shadcn swap above, but the token *names* and page structure it established are still exactly what every component uses today.',
'Tailwind v4 @theme tokens (bg-background, bg-surface-container*, text-on-surface*, bg-primary, etc.) replace the old ad-hoc neutral-900/emerald-500 classes app-wide, including UI primitives (Button, Input, EmptyState, Skeleton, ProgressBar)', 'Tailwind v4 @theme tokens (bg-background, bg-surface-container*, text-on-surface*, bg-primary, etc.) replace the old ad-hoc neutral-900/emerald-500 classes app-wide, including UI primitives (Button, Input, EmptyState, Skeleton, ProgressBar)',
'Desktop: 256px fixed sidebar with the full nav list. Mobile: 5-tab bottom bar (Library, Discover, Social, Soundmarks, Remix) + a "More" sheet for the rest - the export\'s own floating-pill nav only assumed ~4 destinations, not enough for this app\'s real feature count', 'Desktop: 256px fixed sidebar with the full nav list. Mobile: 5-tab bottom bar (Library, Discover, Social, Soundmarks, Remix) + a "More" sheet for the rest - the export\'s own floating-pill nav only assumed ~4 destinations, not enough for this app\'s real feature count',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment