Commit d68d0fb5 authored by Aryan Noshirvnai's avatar Aryan Noshirvnai

Full visual redesign + merge location/social features into Soundmarks and Social tabs

Implements the cobalt/periwinkle Stitch design across every page: new Tailwind v4
@theme token system, Space Grotesk, reskinned UI primitives, sidebar/bottom-nav
shell. Rooms+Channels+Posts now share one Social tab and Nearby+GeoDrops now
share one Soundmarks tab, each with an in-page sub-tab switcher, instead of
five separate top-level nav destinations. Login, Playlists, and Telegram
linking had no Stitch mockup, so they were designed to match the same system.
Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
parent 0fe649ce
Pipeline #1132 passed with stage
...@@ -4,10 +4,13 @@ ...@@ -4,10 +4,13 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" /> <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<meta name="theme-color" content="#0a0a0a" /> <meta name="theme-color" content="#131313" />
<meta name="mobile-web-app-capable" content="yes" /> <meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" /> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="" />
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap" rel="stylesheet" />
<title>Stax</title> <title>Stax</title>
</head> </head>
<body> <body>
......
...@@ -4,12 +4,9 @@ import { Playlists } from './pages/Playlists' ...@@ -4,12 +4,9 @@ import { Playlists } from './pages/Playlists'
import { TelegramLink } from './pages/TelegramLink' import { TelegramLink } from './pages/TelegramLink'
import { Upload } from './pages/Upload' import { Upload } from './pages/Upload'
import { Discovery } from './pages/Discovery' import { Discovery } from './pages/Discovery'
import { Rooms } from './pages/Rooms' import { Social } from './pages/Social'
import { Channels } from './pages/Channels'
import { GeoDrops } from './pages/GeoDrops'
import { Posts } from './pages/Posts'
import { Remix } from './pages/Remix' import { Remix } from './pages/Remix'
import { Nearby } from './pages/Nearby' import { Soundmarks } from './pages/Soundmarks'
import { BusinessPanel } from './pages/BusinessPanel' import { BusinessPanel } from './pages/BusinessPanel'
import { AdminPanel } from './pages/AdminPanel' import { AdminPanel } from './pages/AdminPanel'
import { Roadmap } from './pages/Roadmap' import { Roadmap } from './pages/Roadmap'
...@@ -30,12 +27,15 @@ export function App() { ...@@ -30,12 +27,15 @@ export function App() {
<Route path="/telegram-link" element={protect(<TelegramLink />)} /> <Route path="/telegram-link" element={protect(<TelegramLink />)} />
<Route path="/upload" element={protect(<Upload />)} /> <Route path="/upload" element={protect(<Upload />)} />
<Route path="/discovery" element={protect(<Discovery />)} /> <Route path="/discovery" element={protect(<Discovery />)} />
<Route path="/rooms" element={protect(<Rooms />)} /> <Route path="/social" element={protect(<Social />)} />
<Route path="/channels" element={protect(<Channels />)} />
<Route path="/drops" element={protect(<GeoDrops />)} />
<Route path="/posts" element={protect(<Posts />)} />
<Route path="/remix" element={protect(<Remix />)} /> <Route path="/remix" element={protect(<Remix />)} />
<Route path="/nearby" element={protect(<Nearby />)} /> <Route path="/soundmarks" element={protect(<Soundmarks />)} />
{/* Old, now-merged routes - redirect rather than 404 in case anything still links here. */}
<Route path="/rooms" element={<Navigate to="/social" replace />} />
<Route path="/channels" element={<Navigate to="/social" replace />} />
<Route path="/posts" element={<Navigate to="/social" replace />} />
<Route path="/nearby" element={<Navigate to="/soundmarks" replace />} />
<Route path="/drops" element={<Navigate to="/soundmarks" replace />} />
<Route <Route
path="/business" path="/business"
element={ element={
......
...@@ -79,15 +79,15 @@ export function AddToPlaylistModal({ song, onClose }: AddToPlaylistModalProps) { ...@@ -79,15 +79,15 @@ export function AddToPlaylistModal({ song, onClose }: AddToPlaylistModalProps) {
onClick={onClose} onClick={onClose}
> >
<div <div
className="flex max-h-[80vh] w-full max-w-md flex-col overflow-hidden rounded-t-2xl bg-neutral-900 sm:rounded-2xl" className="flex max-h-[80vh] w-full max-w-md flex-col overflow-hidden rounded-t-2xl bg-surface-container sm:rounded-2xl"
onClick={(e) => e.stopPropagation()} onClick={(e) => e.stopPropagation()}
> >
<div className="flex items-center justify-between border-b border-neutral-800 px-4 py-3"> <div className="flex items-center justify-between border-b border-outline-variant px-4 py-3">
<p className="min-w-0 truncate text-sm font-semibold text-white">Add "{song.title}" to playlist</p> <p className="min-w-0 truncate text-sm font-semibold text-white">Add "{song.title}" to playlist</p>
<button <button
onClick={onClose} onClick={onClose}
aria-label="Close" aria-label="Close"
className="shrink-0 rounded-full p-1.5 text-neutral-400 transition-colors hover:bg-white/10 hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400" className="shrink-0 rounded-full p-1.5 text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"
> >
<X size={18} strokeWidth={2} /> <X size={18} strokeWidth={2} />
</button> </button>
...@@ -105,11 +105,11 @@ export function AddToPlaylistModal({ song, onClose }: AddToPlaylistModalProps) { ...@@ -105,11 +105,11 @@ export function AddToPlaylistModal({ song, onClose }: AddToPlaylistModalProps) {
</Button> </Button>
</form> </form>
{error && <p className="px-4 pt-2 text-sm text-red-400">{error}</p>} {error && <p className="px-4 pt-2 text-sm text-error">{error}</p>}
<ul className="mt-2 flex-1 overflow-y-auto px-2 pb-3"> <ul className="mt-2 flex-1 overflow-y-auto px-2 pb-3">
{!loading && playlists.length === 0 && ( {!loading && playlists.length === 0 && (
<p className="px-2 py-8 text-center text-sm text-neutral-500">No playlists yet - create one above.</p> <p className="px-2 py-8 text-center text-sm text-outline">No playlists yet - create one above.</p>
)} )}
{playlists.map((playlist) => { {playlists.map((playlist) => {
const added = addedIds.has(playlist.id) const added = addedIds.has(playlist.id)
...@@ -118,18 +118,18 @@ export function AddToPlaylistModal({ song, onClose }: AddToPlaylistModalProps) { ...@@ -118,18 +118,18 @@ export function AddToPlaylistModal({ song, onClose }: AddToPlaylistModalProps) {
<button <button
onClick={() => handleAdd(playlist)} onClick={() => handleAdd(playlist)}
disabled={added || busyId === playlist.id} disabled={added || busyId === playlist.id}
className="flex w-full items-center gap-3 rounded-lg px-2 py-2 text-left transition-colors hover:bg-white/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400 disabled:cursor-default" className="flex w-full items-center gap-3 rounded-lg px-2 py-2 text-left transition-colors hover:bg-surface-container-high/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary disabled:cursor-default"
> >
<div className="flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-neutral-800 text-neutral-600"> <div className="flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-surface-container-high text-on-surface-variant">
<ListMusic size={14} strokeWidth={1.75} /> <ListMusic size={14} strokeWidth={1.75} />
</div> </div>
<p className="min-w-0 flex-1 truncate text-sm font-medium text-white">{playlist.name}</p> <p className="min-w-0 flex-1 truncate text-sm font-medium text-white">{playlist.name}</p>
{added ? ( {added ? (
<Check size={16} strokeWidth={2} className="shrink-0 text-emerald-400" /> <Check size={16} strokeWidth={2} className="shrink-0 text-primary" />
) : busyId === playlist.id ? ( ) : busyId === playlist.id ? (
<span className="h-3.5 w-3.5 shrink-0 animate-spin rounded-full border-2 border-neutral-600 border-t-white" /> <span className="h-3.5 w-3.5 shrink-0 animate-spin rounded-full border-2 border-on-surface-variant/30 border-t-on-surface" />
) : ( ) : (
<Plus size={16} strokeWidth={2} className="shrink-0 text-neutral-500" /> <Plus size={16} strokeWidth={2} className="shrink-0 text-outline" />
)} )}
</button> </button>
</li> </li>
......
...@@ -134,7 +134,7 @@ export function FullPlayer() { ...@@ -134,7 +134,7 @@ 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-neutral-950 text-white transition-all duration-300 ease-out motion-reduce:transition-none ${ className={`fixed inset-0 z-30 overflow-hidden bg-background text-on-surface 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'
}`} }`}
> >
...@@ -150,7 +150,7 @@ export function FullPlayer() { ...@@ -150,7 +150,7 @@ export function FullPlayer() {
className="absolute inset-0 h-full w-full scale-110 object-cover opacity-20 blur-3xl" className="absolute inset-0 h-full w-full scale-110 object-cover opacity-20 blur-3xl"
/> />
)} )}
<div className="absolute inset-0 bg-neutral-950/75" /> <div className="absolute inset-0 bg-background/75" />
</div> </div>
{/* Main screen: cover/lyrics (crossfaded in place), transport, and a lyrics toggle bar. {/* Main screen: cover/lyrics (crossfaded in place), transport, and a lyrics toggle bar.
...@@ -170,17 +170,17 @@ export function FullPlayer() { ...@@ -170,17 +170,17 @@ export function FullPlayer() {
onClick={collapse} onClick={collapse}
tabIndex={queueOpen ? -1 : 0} tabIndex={queueOpen ? -1 : 0}
aria-label="Minimize player" aria-label="Minimize player"
className="flex h-10 w-10 items-center justify-center rounded-full text-neutral-400 transition-colors hover:bg-white/10 hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400" className="flex h-10 w-10 items-center justify-center rounded-full text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"
> >
<ChevronDown size={22} strokeWidth={2} /> <ChevronDown size={22} strokeWidth={2} />
</button> </button>
<p className="text-xs font-medium uppercase tracking-wide text-neutral-500">Now Playing</p> <p className="text-xs font-medium uppercase tracking-wide text-outline">Now Playing</p>
<button <button
ref={queueButtonRef} ref={queueButtonRef}
onClick={openQueue} onClick={openQueue}
tabIndex={queueOpen ? -1 : 0} tabIndex={queueOpen ? -1 : 0}
aria-label="Open queue" aria-label="Open queue"
className="flex h-10 w-10 items-center justify-center rounded-full text-neutral-400 transition-colors hover:bg-white/10 hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400" className="flex h-10 w-10 items-center justify-center rounded-full text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"
> >
<ListMusic size={19} strokeWidth={2} /> <ListMusic size={19} strokeWidth={2} />
</button> </button>
...@@ -205,7 +205,7 @@ export function FullPlayer() { ...@@ -205,7 +205,7 @@ export function FullPlayer() {
/> />
) : ( ) : (
<div <div
className={`flex aspect-square w-full max-w-sm items-center justify-center rounded-2xl bg-neutral-900 text-neutral-700 ${ className={`flex aspect-square w-full max-w-sm items-center justify-center rounded-2xl bg-surface-container text-outline ${
isLoading ? 'animate-pulse' : '' isLoading ? 'animate-pulse' : ''
}`} }`}
> >
...@@ -218,7 +218,7 @@ export function FullPlayer() { ...@@ -218,7 +218,7 @@ export function FullPlayer() {
role="region" role="region"
aria-label="Lyrics" aria-label="Lyrics"
aria-hidden={!showLyrics} aria-hidden={!showLyrics}
className={`absolute inset-0 overflow-y-auto rounded-2xl bg-white/5 px-5 py-6 transition-opacity duration-300 ease-out motion-reduce:transition-none ${ className={`absolute inset-0 overflow-y-auto rounded-2xl bg-surface-container px-5 py-6 transition-opacity duration-300 ease-out motion-reduce:transition-none ${
showLyrics ? 'opacity-100' : 'pointer-events-none opacity-0' showLyrics ? 'opacity-100' : 'pointer-events-none opacity-0'
}`} }`}
style={{ style={{
...@@ -228,7 +228,7 @@ export function FullPlayer() { ...@@ -228,7 +228,7 @@ export function FullPlayer() {
}} }}
> >
{currentSong.lyrics ? ( {currentSong.lyrics ? (
<p className="whitespace-pre-wrap text-[17px] leading-loose text-neutral-200">{currentSong.lyrics}</p> <p className="whitespace-pre-wrap text-[17px] leading-loose text-on-surface">{currentSong.lyrics}</p>
) : ( ) : (
<EmptyState icon={ScrollText} message="No lyrics available for this track." /> <EmptyState icon={ScrollText} message="No lyrics available for this track." />
)} )}
...@@ -241,7 +241,7 @@ export function FullPlayer() { ...@@ -241,7 +241,7 @@ export function FullPlayer() {
> >
<div className="mb-5"> <div className="mb-5">
<p className="truncate text-xl font-semibold">{currentSong.title}</p> <p className="truncate text-xl font-semibold">{currentSong.title}</p>
<p className="truncate text-sm text-neutral-400"> <p className="truncate text-sm text-on-surface-variant">
{currentSong.artist} {currentSong.artist}
{currentSong.album ? ` · ${currentSong.album}` : ''} {currentSong.album ? ` · ${currentSong.album}` : ''}
</p> </p>
...@@ -259,9 +259,11 @@ export function FullPlayer() { ...@@ -259,9 +259,11 @@ export function FullPlayer() {
aria-label="Seek" aria-label="Seek"
aria-valuetext={`${formatTime(progress)} of ${formatTime(duration)}`} aria-valuetext={`${formatTime(progress)} of ${formatTime(duration)}`}
className="seek-range w-full disabled:opacity-40" className="seek-range w-full disabled:opacity-40"
style={{ background: `linear-gradient(to right, white ${pct}%, #262626 ${pct}%)` }} style={{
background: `linear-gradient(to right, var(--color-primary) ${pct}%, var(--color-surface-container-high) ${pct}%)`,
}}
/> />
<div className="mt-1 flex justify-between text-xs text-neutral-500"> <div className="mt-1 flex justify-between text-xs text-outline">
{isLoading ? ( {isLoading ? (
<span className="mx-auto">Loading…</span> <span className="mx-auto">Loading…</span>
) : ( ) : (
...@@ -278,8 +280,8 @@ export function FullPlayer() { ...@@ -278,8 +280,8 @@ export function FullPlayer() {
tabIndex={queueOpen ? -1 : 0} tabIndex={queueOpen ? -1 : 0}
aria-label="Shuffle" aria-label="Shuffle"
aria-pressed={isShuffled} aria-pressed={isShuffled}
className={`rounded-full p-2 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400 ${ className={`rounded-full p-2 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary ${
isShuffled ? 'text-emerald-400' : 'text-neutral-400 hover:text-white' isShuffled ? 'text-primary' : 'text-on-surface-variant hover:text-on-surface'
}`} }`}
> >
<Shuffle size={18} strokeWidth={2} /> <Shuffle size={18} strokeWidth={2} />
...@@ -290,7 +292,7 @@ export function FullPlayer() { ...@@ -290,7 +292,7 @@ export function FullPlayer() {
onClick={previous} onClick={previous}
tabIndex={queueOpen ? -1 : 0} tabIndex={queueOpen ? -1 : 0}
aria-label="Previous" aria-label="Previous"
className="rounded-full p-1 text-neutral-300 transition-colors hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400" 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={26} strokeWidth={2} fill="currentColor" /> <SkipBack size={26} strokeWidth={2} fill="currentColor" />
</button> </button>
...@@ -299,10 +301,10 @@ export function FullPlayer() { ...@@ -299,10 +301,10 @@ export function FullPlayer() {
disabled={isLoading} disabled={isLoading}
tabIndex={queueOpen ? -1 : 0} tabIndex={queueOpen ? -1 : 0}
aria-label={isPlaying ? 'Pause' : 'Play'} aria-label={isPlaying ? 'Pause' : 'Play'}
className="flex h-16 w-16 items-center justify-center rounded-full bg-white text-neutral-950 transition-transform duration-150 ease-out active:scale-90 disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400 focus-visible:ring-offset-2 focus-visible:ring-offset-neutral-950" className="flex h-16 w-16 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 ? ( {isLoading ? (
<span className="h-5 w-5 animate-spin rounded-full border-2 border-neutral-400 border-t-neutral-950" /> <span className="h-5 w-5 animate-spin rounded-full border-2 border-on-primary/30 border-t-on-primary" />
) : isPlaying ? ( ) : isPlaying ? (
<Pause size={24} strokeWidth={2} fill="currentColor" /> <Pause size={24} strokeWidth={2} fill="currentColor" />
) : ( ) : (
...@@ -314,7 +316,7 @@ export function FullPlayer() { ...@@ -314,7 +316,7 @@ export function FullPlayer() {
disabled={!hasNext} disabled={!hasNext}
tabIndex={queueOpen ? -1 : 0} tabIndex={queueOpen ? -1 : 0}
aria-label="Next" aria-label="Next"
className="rounded-full p-1 text-neutral-300 transition-colors hover:text-white disabled:opacity-30 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400" 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={26} strokeWidth={2} fill="currentColor" /> <SkipForward size={26} strokeWidth={2} fill="currentColor" />
</button> </button>
...@@ -325,8 +327,8 @@ export function FullPlayer() { ...@@ -325,8 +327,8 @@ export function FullPlayer() {
tabIndex={queueOpen ? -1 : 0} tabIndex={queueOpen ? -1 : 0}
aria-label={`Repeat: ${repeatMode}`} aria-label={`Repeat: ${repeatMode}`}
aria-pressed={repeatMode !== 'off'} aria-pressed={repeatMode !== 'off'}
className={`rounded-full p-2 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400 ${ className={`rounded-full p-2 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary ${
repeatMode !== 'off' ? 'text-emerald-400' : 'text-neutral-400 hover:text-white' repeatMode !== 'off' ? 'text-primary' : 'text-on-surface-variant hover:text-on-surface'
}`} }`}
> >
<RepeatIcon size={18} strokeWidth={2} /> <RepeatIcon size={18} strokeWidth={2} />
...@@ -343,20 +345,20 @@ export function FullPlayer() { ...@@ -343,20 +345,20 @@ export function FullPlayer() {
tabIndex={queueOpen ? -1 : 0} tabIndex={queueOpen ? -1 : 0}
aria-label={showLyrics ? 'Show cover art' : 'Show lyrics'} aria-label={showLyrics ? 'Show cover art' : 'Show lyrics'}
aria-pressed={showLyrics} aria-pressed={showLyrics}
className="mt-5 flex w-full items-center gap-2 rounded-xl bg-white/5 px-4 py-3 text-left transition-colors hover:bg-white/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400" className="mt-5 flex w-full items-center gap-2 rounded-xl bg-surface-container px-4 py-3 text-left transition-colors hover:bg-surface-container-high focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"
> >
{showLyrics ? ( {showLyrics ? (
<> <>
<Disc3 size={15} strokeWidth={2} className="shrink-0 text-neutral-400" /> <Disc3 size={15} strokeWidth={2} className="shrink-0 text-on-surface-variant" />
<span className="min-w-0 flex-1 truncate text-sm text-neutral-300">Cover art</span> <span className="min-w-0 flex-1 truncate text-sm text-on-surface">Cover art</span>
</> </>
) : ( ) : (
<> <>
<ScrollText size={15} strokeWidth={2} className="shrink-0 text-neutral-400" /> <ScrollText size={15} strokeWidth={2} className="shrink-0 text-on-surface-variant" />
<span className="min-w-0 flex-1 truncate text-sm text-neutral-300">{lyricsPreview}</span> <span className="min-w-0 flex-1 truncate text-sm text-on-surface">{lyricsPreview}</span>
</> </>
)} )}
<ChevronRight size={16} strokeWidth={2} className="shrink-0 text-neutral-500" /> <ChevronRight size={16} strokeWidth={2} className="shrink-0 text-outline" />
</button> </button>
)} )}
</div> </div>
...@@ -380,7 +382,7 @@ export function FullPlayer() { ...@@ -380,7 +382,7 @@ export function FullPlayer() {
onClick={closeQueue} onClick={closeQueue}
tabIndex={queueOpen ? 0 : -1} tabIndex={queueOpen ? 0 : -1}
aria-label="Back to now playing" aria-label="Back to now playing"
className="flex h-10 w-10 items-center justify-center rounded-full text-neutral-400 transition-colors hover:bg-white/10 hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400" className="flex h-10 w-10 items-center justify-center rounded-full text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"
> >
<ChevronLeft size={22} strokeWidth={2} /> <ChevronLeft size={22} strokeWidth={2} />
</button> </button>
...@@ -400,23 +402,23 @@ export function FullPlayer() { ...@@ -400,23 +402,23 @@ export function FullPlayer() {
onClick={() => jumpTo(song)} onClick={() => jumpTo(song)}
tabIndex={queueOpen ? 0 : -1} tabIndex={queueOpen ? 0 : -1}
aria-current={isCurrent ? 'true' : undefined} aria-current={isCurrent ? 'true' : undefined}
className={`flex w-full items-center gap-3 rounded-lg px-2 py-2.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400 ${ className={`flex w-full items-center gap-3 rounded-lg px-2 py-2.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary ${
isCurrent ? 'text-emerald-400' : 'text-neutral-300 hover:bg-white/5 hover:text-white' isCurrent ? 'text-primary' : 'text-on-surface hover:bg-surface-container hover:text-on-surface'
}`} }`}
> >
<span className="flex w-5 shrink-0 items-center justify-center text-xs text-neutral-500"> <span className="flex w-5 shrink-0 items-center justify-center text-xs text-outline">
{isCurrent ? <AudioLines size={15} strokeWidth={2} /> : index + 1} {isCurrent ? <AudioLines size={15} strokeWidth={2} /> : index + 1}
</span> </span>
{song.coverart ? ( {song.coverart ? (
<img src={song.coverart} alt="" className="h-10 w-10 shrink-0 rounded-md object-cover" /> <img src={song.coverart} alt="" className="h-10 w-10 shrink-0 rounded-md object-cover" />
) : ( ) : (
<div className="flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-neutral-800 text-neutral-600"> <div className="flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-surface-container-high text-on-surface-variant">
<Music2 size={15} strokeWidth={1.75} /> <Music2 size={15} strokeWidth={1.75} />
</div> </div>
)} )}
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<p className="truncate text-sm font-medium">{song.title}</p> <p className="truncate text-sm font-medium">{song.title}</p>
<p className="truncate text-xs text-neutral-500">{song.artist}</p> <p className="truncate text-xs text-outline">{song.artist}</p>
</div> </div>
</button> </button>
</li> </li>
......
import type { ReactNode } from 'react' import { useState, type ReactNode } from 'react'
import { Link, useLocation } from 'react-router-dom' import { Link, useLocation } from 'react-router-dom'
import { import {
Compass, Compass,
Disc3,
Headphones, Headphones,
Library, Library,
Link2, Link2,
...@@ -10,13 +9,13 @@ import { ...@@ -10,13 +9,13 @@ import {
LogOut, LogOut,
Map, Map,
MapPin, MapPin,
MapPinned, MoreHorizontal,
Radio, Radio,
Rss,
ShieldCheck, ShieldCheck,
Store, Store,
Upload, Upload,
Wand2, Wand2,
X,
type LucideIcon, type LucideIcon,
} from 'lucide-react' } from 'lucide-react'
import { useAuth } from '../context/AuthContext' import { useAuth } from '../context/AuthContext'
...@@ -26,24 +25,32 @@ import { NowPlayingBar } from './NowPlayingBar' ...@@ -26,24 +25,32 @@ import { NowPlayingBar } from './NowPlayingBar'
import { FullPlayer } from './FullPlayer' import { FullPlayer } from './FullPlayer'
import { PlaybackErrorToast } from './PlaybackErrorToast' import { PlaybackErrorToast } from './PlaybackErrorToast'
// Rooms/Channels/Posts share one "Social" destination and Nearby/Drops share one
// "Soundmarks" destination (both merged 2026-08-23) - each hub page owns its own in-page
// sub-tab switcher instead of splitting related features across the top-level nav.
const NAV_ITEMS: { to: string; label: string; icon: LucideIcon }[] = [ const NAV_ITEMS: { to: string; label: string; icon: LucideIcon }[] = [
{ to: '/library', label: 'Library', icon: Library }, { to: '/library', label: 'Library', icon: Library },
{ to: '/playlists', label: 'Playlists', icon: ListMusic }, { to: '/playlists', label: 'Playlists', icon: ListMusic },
{ to: '/upload', label: 'Upload', icon: Upload }, { to: '/upload', label: 'Upload', icon: Upload },
{ to: '/discovery', label: 'Discover', icon: Compass }, { to: '/discovery', label: 'Discover', icon: Compass },
{ to: '/rooms', label: 'Rooms', icon: Radio }, { to: '/social', label: 'Social', icon: Radio },
{ to: '/channels', label: 'Channels', icon: Rss },
{ to: '/posts', label: 'Posts', icon: Disc3 },
{ to: '/remix', label: 'Remix', icon: Wand2 }, { to: '/remix', label: 'Remix', icon: Wand2 },
{ to: '/nearby', label: 'Soundmarks', icon: MapPin }, { to: '/soundmarks', label: 'Soundmarks', icon: MapPin },
{ to: '/drops', label: 'Drops', icon: MapPinned },
{ to: '/telegram-link', label: 'Telegram', icon: Link2 }, { to: '/telegram-link', label: 'Telegram', icon: Link2 },
] ]
// The 5 most-reached destinations get a fixed mobile tab (matches the design system's
// "5-tab reachability" spec); everything else lives behind the More sheet, 6th tab. Desktop's
// sidebar has room to just list all of NAV_ITEMS, so this split is mobile-only.
const MOBILE_TAB_PATHS = new Set(['/library', '/discovery', '/social', '/soundmarks', '/remix'])
const mobileTabs = NAV_ITEMS.filter((item) => MOBILE_TAB_PATHS.has(item.to))
const overflowItems = NAV_ITEMS.filter((item) => !MOBILE_TAB_PATHS.has(item.to))
export function Layout({ title, children }: { title: string; children: ReactNode }) { export function Layout({ title, children }: { title: string; children: ReactNode }) {
const { logout, isBusinessAdmin, isSuperAdmin } = useAuth() const { logout, isBusinessAdmin, isSuperAdmin } = useAuth()
const { currentSong } = usePlayer() const { currentSong } = usePlayer()
const location = useLocation() const location = useLocation()
const [moreOpen, setMoreOpen] = useState(false)
async function handleLogout() { async function handleLogout() {
// No reload needed: once isAuthenticated flips false, the ProtectedRoute/RequireRole // No reload needed: once isAuthenticated flips false, the ProtectedRoute/RequireRole
...@@ -53,99 +60,101 @@ export function Layout({ title, children }: { title: string; children: ReactNode ...@@ -53,99 +60,101 @@ export function Layout({ title, children }: { title: string; children: ReactNode
await logout() await logout()
} }
const adminLinks = [
isBusinessAdmin && { to: '/business', label: 'Business', icon: Store },
isSuperAdmin && { to: '/admin', label: 'Admin', icon: ShieldCheck },
isSuperAdmin && { to: '/roadmap', label: 'Roadmap', icon: Map },
].filter((x): x is { to: string; label: string; icon: LucideIcon } => !!x)
return ( return (
<div className="min-h-screen bg-neutral-950 text-white"> <div className="min-h-screen bg-background text-on-background">
{/* Top bar: branding + logout everywhere; the nav links move down here only on {/* Desktop: 256px fixed sidebar, full nav list (there's room, unlike the mobile tab bar) */}
screens wide enough to show all six comfortably without scrolling. */} <aside
<header className="fixed inset-y-0 left-0 z-10 hidden w-64 flex-col border-r border-outline-variant bg-surface-container-low sm:flex"
className="sticky top-0 z-10 border-b border-neutral-800/80 bg-neutral-950/95 px-4 backdrop-blur sm:px-6"
style={{ paddingTop: 'env(safe-area-inset-top)' }} style={{ paddingTop: 'env(safe-area-inset-top)' }}
> >
<div className="flex h-14 items-center justify-between"> <Link to="/library" className="flex items-center gap-2 px-6 py-6 text-lg font-bold tracking-tight text-primary">
<Link to="/library" className="flex items-center gap-2 text-[15px] font-semibold tracking-tight"> <Headphones size={22} strokeWidth={2} />
<Headphones size={20} strokeWidth={2} className="text-emerald-400" /> Stax
Stax </Link>
</Link> <nav className="flex-1 space-y-0.5 overflow-y-auto px-3">
<div className="flex items-center gap-1">
{isBusinessAdmin && (
<Link
to="/business"
aria-label="Business panel"
className={`flex items-center gap-1.5 rounded-full px-3 py-1.5 text-sm transition-colors duration-150 ${
location.pathname === '/business' ? 'bg-neutral-900 text-white' : 'text-neutral-400 hover:text-white'
}`}
>
<Store size={15} strokeWidth={2} aria-hidden="true" />
<span className="hidden sm:inline" aria-hidden="true">Business</span>
</Link>
)}
{isSuperAdmin && (
<Link
to="/admin"
aria-label="Admin panel"
className={`flex items-center gap-1.5 rounded-full px-3 py-1.5 text-sm transition-colors duration-150 ${
location.pathname === '/admin' ? 'bg-neutral-900 text-white' : 'text-neutral-400 hover:text-white'
}`}
>
<ShieldCheck size={15} strokeWidth={2} aria-hidden="true" />
<span className="hidden sm:inline" aria-hidden="true">Admin</span>
</Link>
)}
{isSuperAdmin && (
<Link
to="/roadmap"
aria-label="Status and roadmap"
className={`flex items-center gap-1.5 rounded-full px-3 py-1.5 text-sm transition-colors duration-150 ${
location.pathname === '/roadmap' ? 'bg-neutral-900 text-white' : 'text-neutral-400 hover:text-white'
}`}
>
<Map size={15} strokeWidth={2} aria-hidden="true" />
<span className="hidden sm:inline" aria-hidden="true">Roadmap</span>
</Link>
)}
<Button variant="ghost" size="sm" onClick={handleLogout} aria-label="Log out" className="gap-1.5 !px-3">
<LogOut size={15} strokeWidth={2} aria-hidden="true" />
<span className="hidden sm:inline" aria-hidden="true">Log out</span>
</Button>
</div>
</div>
<nav className="hidden gap-1 pb-2 text-sm sm:flex">
{NAV_ITEMS.map((item) => { {NAV_ITEMS.map((item) => {
const active = location.pathname === item.to const active = location.pathname === item.to
return ( return (
<Link <Link
key={item.to} key={item.to}
to={item.to} to={item.to}
className={`flex items-center gap-1.5 rounded-full px-3 py-1.5 transition-colors duration-150 ${ className={`flex items-center gap-3 rounded-lg border-l-2 px-3 py-2.5 text-sm transition-colors duration-150 ${
active ? 'bg-neutral-900 text-white' : 'text-neutral-400 hover:text-white' active
? 'border-primary bg-surface-container text-primary'
: 'border-transparent text-on-surface-variant hover:border-outline-variant hover:bg-surface-container/60 hover:text-on-surface'
}`} }`}
> >
<item.icon size={15} strokeWidth={2} className={active ? 'text-emerald-400' : ''} /> <item.icon size={18} strokeWidth={active ? 2.25 : 1.75} />
{item.label} {item.label}
</Link> </Link>
) )
})} })}
</nav> </nav>
{adminLinks.length > 0 && (
<nav className="space-y-0.5 border-t border-outline-variant px-3 py-3">
{adminLinks.map((item) => {
const active = location.pathname === item.to
return (
<Link
key={item.to}
to={item.to}
className={`flex items-center gap-3 rounded-lg px-3 py-2.5 text-sm transition-colors duration-150 ${
active ? 'bg-surface-container text-primary' : 'text-on-surface-variant hover:text-on-surface'
}`}
>
<item.icon size={18} strokeWidth={1.75} />
{item.label}
</Link>
)
})}
</nav>
)}
<div className="border-t border-outline-variant p-3">
<Button variant="ghost" size="sm" onClick={handleLogout} className="w-full justify-start gap-3 !px-3">
<LogOut size={18} strokeWidth={1.75} />
Log out
</Button>
</div>
</aside>
{/* Mobile top bar: sticky, logo only (matches the design system's mobile app-bar spec) */}
<header
className="sticky top-0 z-10 border-b border-outline-variant bg-background/90 px-4 backdrop-blur-xl sm:hidden"
style={{ paddingTop: 'env(safe-area-inset-top)' }}
>
<div className="flex h-14 items-center justify-center">
<Link to="/library" className="flex items-center gap-2 text-[15px] font-bold tracking-tight text-primary">
<Headphones size={20} strokeWidth={2} />
Stax
</Link>
</div>
</header> </header>
<main <main
className={`mx-auto max-w-2xl px-4 py-6 transition-[padding] duration-300 ease-out motion-reduce:transition-none sm:px-6 sm:py-8 ${currentSong ? 'pb-40 sm:pb-24' : 'pb-24 sm:pb-8'}`} className={`px-4 py-6 transition-[padding] duration-300 ease-out motion-reduce:transition-none sm:ml-64 sm:px-8 sm:py-8 ${currentSong ? 'pb-40 sm:pb-24' : 'pb-24 sm:pb-8'}`}
> >
<h1 className="mb-6 text-xl font-semibold tracking-tight">{title}</h1> <div className="mx-auto max-w-2xl sm:max-w-3xl">
{children} <h1 className="mb-6 text-xl font-semibold tracking-tight sm:text-2xl">{title}</h1>
{children}
</div>
</main> </main>
<NowPlayingBar /> <NowPlayingBar />
<FullPlayer /> <FullPlayer />
<PlaybackErrorToast /> <PlaybackErrorToast />
{/* Bottom tab bar: mobile only, fixed, thumb-reachable. Hidden entirely at sm+ where {/* Bottom tab bar: mobile only, fixed, thumb-reachable - 5 core destinations + More. */}
the top nav takes over instead. */}
<nav <nav
className="fixed inset-x-0 bottom-0 z-10 flex border-t border-neutral-800/80 bg-neutral-950/95 backdrop-blur sm:hidden" className="fixed inset-x-0 bottom-0 z-10 flex h-16 border-t border-outline-variant bg-surface-container-low/95 backdrop-blur-xl sm:hidden"
style={{ paddingBottom: 'env(safe-area-inset-bottom)' }} style={{ paddingBottom: 'env(safe-area-inset-bottom)' }}
> >
{NAV_ITEMS.map((item) => { {mobileTabs.map((item) => {
const active = location.pathname === item.to const active = location.pathname === item.to
return ( return (
<Link <Link
...@@ -156,13 +165,71 @@ export function Layout({ title, children }: { title: string; children: ReactNode ...@@ -156,13 +165,71 @@ export function Layout({ title, children }: { title: string; children: ReactNode
<item.icon <item.icon
size={20} size={20}
strokeWidth={active ? 2.25 : 1.75} strokeWidth={active ? 2.25 : 1.75}
className={`transition-transform duration-150 ${active ? 'scale-110 text-emerald-400' : 'text-neutral-500'}`} className={`transition-transform duration-150 ${active ? 'scale-110 text-primary' : 'text-on-surface-variant'}`}
/> />
<span className={active ? 'text-white' : 'text-neutral-500'}>{item.label}</span> <span className={active ? 'text-primary' : 'text-on-surface-variant'}>{item.label}</span>
</Link> </Link>
) )
})} })}
<button
onClick={() => setMoreOpen(true)}
aria-label="More"
className="flex min-h-[56px] flex-1 flex-col items-center justify-center gap-1 text-[10.5px] text-on-surface-variant transition-colors duration-150"
>
<MoreHorizontal size={20} strokeWidth={1.75} />
<span>More</span>
</button>
</nav> </nav>
{moreOpen && (
<div className="fixed inset-0 z-30 sm:hidden" role="dialog" aria-label="More">
<button
aria-label="Close"
onClick={() => setMoreOpen(false)}
className="absolute inset-0 bg-black/60 backdrop-blur-sm"
/>
<div
className="absolute inset-x-0 bottom-0 rounded-t-2xl border-t border-outline-variant bg-surface-container-low p-4"
style={{ paddingBottom: 'calc(env(safe-area-inset-bottom) + 16px)' }}
>
<div className="mb-3 flex items-center justify-between">
<span className="text-sm font-semibold text-on-surface">More</span>
<button
onClick={() => setMoreOpen(false)}
aria-label="Close"
className="flex h-8 w-8 items-center justify-center rounded-full text-on-surface-variant hover:bg-surface-container hover:text-on-surface"
>
<X size={16} strokeWidth={2} />
</button>
</div>
<div className="grid grid-cols-3 gap-2">
{[...overflowItems, ...adminLinks].map((item) => {
const active = location.pathname === item.to
return (
<Link
key={item.to}
to={item.to}
onClick={() => setMoreOpen(false)}
className={`flex flex-col items-center gap-1.5 rounded-xl px-2 py-3 text-center text-[11px] transition-colors duration-150 ${
active ? 'bg-surface-container text-primary' : 'text-on-surface-variant hover:bg-surface-container/60 hover:text-on-surface'
}`}
>
<item.icon size={20} strokeWidth={active ? 2.25 : 1.75} />
{item.label}
</Link>
)
})}
<button
onClick={handleLogout}
className="flex flex-col items-center gap-1.5 rounded-xl px-2 py-3 text-center text-[11px] text-on-surface-variant transition-colors duration-150 hover:bg-surface-container/60 hover:text-on-surface"
>
<LogOut size={20} strokeWidth={1.75} />
Log out
</button>
</div>
</div>
</div>
)}
</div> </div>
) )
} }
...@@ -127,7 +127,7 @@ export function LocationPicker({ latitude, longitude, onChange }: LocationPicker ...@@ -127,7 +127,7 @@ export function LocationPicker({ latitude, longitude, onChange }: LocationPicker
<Search <Search
size={16} size={16}
strokeWidth={2} strokeWidth={2}
className="pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-neutral-500" className="pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-outline"
/> />
<Input <Input
placeholder="Search for an address or place" placeholder="Search for an address or place"
...@@ -137,15 +137,15 @@ export function LocationPicker({ latitude, longitude, onChange }: LocationPicker ...@@ -137,15 +137,15 @@ export function LocationPicker({ latitude, longitude, onChange }: LocationPicker
className="pl-9" className="pl-9"
/> />
{showResults && results.length > 0 && ( {showResults && results.length > 0 && (
<ul className="absolute z-[1000] mt-1 max-h-56 w-full overflow-y-auto rounded-lg border border-neutral-700 bg-neutral-800 shadow-xl"> <ul className="absolute z-[1000] mt-1 max-h-56 w-full overflow-y-auto rounded-lg border border-outline-variant bg-surface-container-high shadow-xl">
{results.map((r, i) => ( {results.map((r, i) => (
<li key={i}> <li key={i}>
<button <button
type="button" type="button"
onClick={() => selectResult(r)} onClick={() => selectResult(r)}
className="flex w-full items-start gap-2 px-3 py-2 text-left text-sm text-neutral-200 hover:bg-neutral-700" className="flex w-full items-start gap-2 px-3 py-2 text-left text-sm text-on-surface hover:bg-surface-container-high"
> >
<MapPin size={14} strokeWidth={2} className="mt-0.5 shrink-0 text-neutral-500" /> <MapPin size={14} strokeWidth={2} className="mt-0.5 shrink-0 text-outline" />
<span className="line-clamp-2">{r.display_name}</span> <span className="line-clamp-2">{r.display_name}</span>
</button> </button>
</li> </li>
...@@ -154,7 +154,7 @@ export function LocationPicker({ latitude, longitude, onChange }: LocationPicker ...@@ -154,7 +154,7 @@ export function LocationPicker({ latitude, longitude, onChange }: LocationPicker
)} )}
</div> </div>
<div className="relative z-0 mt-3 h-56 overflow-hidden rounded-lg border border-neutral-700"> <div className="relative z-0 mt-3 h-56 overflow-hidden rounded-lg border border-outline-variant">
<MapContainer center={initialCenter} zoom={initialZoom} className="h-full w-full" scrollWheelZoom> <MapContainer center={initialCenter} zoom={initialZoom} className="h-full w-full" scrollWheelZoom>
<TileLayer attribution={DARK_TILE_ATTRIBUTION} url={DARK_TILE_URL} /> <TileLayer attribution={DARK_TILE_ATTRIBUTION} url={DARK_TILE_URL} />
<FlyToOnJump jumpTo={jumpTo} /> <FlyToOnJump jumpTo={jumpTo} />
...@@ -179,13 +179,13 @@ export function LocationPicker({ latitude, longitude, onChange }: LocationPicker ...@@ -179,13 +179,13 @@ export function LocationPicker({ latitude, longitude, onChange }: LocationPicker
disabled={locating} disabled={locating}
aria-label="Use my current location" aria-label="Use my current location"
title="Use my current location" title="Use my current location"
className="absolute bottom-2.5 right-2.5 z-[1000] flex h-9 w-9 items-center justify-center rounded-full border border-neutral-700 bg-neutral-900/90 text-neutral-200 shadow-lg backdrop-blur transition-colors duration-150 hover:bg-neutral-800 disabled:opacity-50" className="absolute bottom-2.5 right-2.5 z-[1000] flex h-9 w-9 items-center justify-center rounded-full border border-outline-variant bg-surface-container/90 text-on-surface shadow-lg backdrop-blur transition-colors duration-150 hover:bg-surface-container-high disabled:opacity-50"
> >
<LocateFixed size={17} strokeWidth={2} className={locating ? 'animate-pulse' : ''} /> <LocateFixed size={17} strokeWidth={2} className={locating ? 'animate-pulse' : ''} />
</button> </button>
</div> </div>
{locateError && <p className="mt-1 text-xs text-red-400">{locateError}</p>} {locateError && <p className="mt-1 text-xs text-error">{locateError}</p>}
<p className="mt-1 text-xs text-neutral-500"> <p className="mt-1 text-xs text-outline">
Search an address, tap <LocateFixed size={11} strokeWidth={2} className="inline -translate-y-px" />, or click the map to place the pin - drag to fine-tune. Search an address, tap <LocateFixed size={11} strokeWidth={2} className="inline -translate-y-px" />, or click the map to place the pin - drag to fine-tune.
{hasPin && ` ${latitude.toFixed(5)}, ${longitude.toFixed(5)}`} {hasPin && ` ${latitude.toFixed(5)}, ${longitude.toFixed(5)}`}
</p> </p>
......
...@@ -25,40 +25,40 @@ export function NowPlayingBar() { ...@@ -25,40 +25,40 @@ export function NowPlayingBar() {
return ( return (
<div <div
className={`fixed inset-x-0 bottom-14 z-20 border-t border-neutral-800 bg-neutral-900/95 backdrop-blur transition-all duration-300 ease-out motion-reduce:transition-none sm:bottom-0 ${ className={`fixed inset-x-0 bottom-16 z-20 border-t border-outline-variant bg-surface-container-low/95 backdrop-blur-xl transition-all duration-300 ease-out motion-reduce:transition-none sm:bottom-0 sm:left-64 ${
visible ? 'translate-y-0 opacity-100' : 'translate-y-full opacity-0' visible ? 'translate-y-0 opacity-100' : 'translate-y-full opacity-0'
}`} }`}
style={{ paddingBottom: 'env(safe-area-inset-bottom)' }} style={{ paddingBottom: 'env(safe-area-inset-bottom)' }}
> >
<div className="mx-auto flex max-w-2xl items-center gap-3 px-4 py-2.5 sm:px-6"> <div className="mx-auto flex max-w-2xl items-center gap-3 px-4 py-2.5 sm:max-w-3xl sm:px-8">
{/* Separate <button> from the play/pause control below - two sibling buttons rather {/* Separate <button> from the play/pause control below - two sibling buttons rather
than nesting one inside the other, which isn't valid HTML. */} than nesting one inside the other, which isn't valid HTML. */}
<button <button
ref={openButtonRef} ref={openButtonRef}
onClick={expand} onClick={expand}
aria-label={`Open player - ${currentSong.title}`} aria-label={`Open player - ${currentSong.title}`}
className="flex min-w-0 flex-1 items-center gap-3 rounded-lg text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400" className="flex min-w-0 flex-1 items-center gap-3 rounded-lg text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"
> >
{currentSong.coverart ? ( {currentSong.coverart ? (
<img src={currentSong.coverart} alt="" className="h-10 w-10 shrink-0 rounded-md object-cover" /> <img src={currentSong.coverart} alt="" className="h-10 w-10 shrink-0 rounded-md object-cover" />
) : ( ) : (
<div className="flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-neutral-800 text-neutral-600"> <div className="flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-surface-container-high text-on-surface-variant">
<Music2 size={16} strokeWidth={1.75} /> <Music2 size={16} strokeWidth={1.75} />
</div> </div>
)} )}
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<p className="truncate text-sm font-medium text-white">{currentSong.title}</p> <p className="truncate text-sm font-medium text-on-surface">{currentSong.title}</p>
<p className="truncate text-xs text-neutral-400">{currentSong.artist}</p> <p className="truncate text-xs text-on-surface-variant">{currentSong.artist}</p>
</div> </div>
</button> </button>
<button <button
onClick={() => toggle(currentSong)} onClick={() => toggle(currentSong)}
disabled={isLoading} disabled={isLoading}
aria-label={isPlaying ? 'Pause' : 'Play'} aria-label={isPlaying ? 'Pause' : 'Play'}
className="flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-neutral-800 text-white transition-transform duration-150 ease-out active:scale-90 disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400" className="flex h-10 w-10 shrink-0 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"
> >
{isLoading ? ( {isLoading ? (
<span className="h-3.5 w-3.5 animate-spin rounded-full border-2 border-neutral-600 border-t-white" /> <span className="h-3.5 w-3.5 animate-spin rounded-full border-2 border-on-primary/40 border-t-on-primary" />
) : isPlaying ? ( ) : isPlaying ? (
<Pause size={16} strokeWidth={2} fill="currentColor" /> <Pause size={16} strokeWidth={2} fill="currentColor" />
) : ( ) : (
......
...@@ -31,16 +31,16 @@ export function PlaybackErrorToast() { ...@@ -31,16 +31,16 @@ export function PlaybackErrorToast() {
style={{ top: 'calc(env(safe-area-inset-top) + 3.75rem)' }} style={{ top: 'calc(env(safe-area-inset-top) + 3.75rem)' }}
> >
<div <div
className={`flex w-full max-w-sm items-start gap-2.5 rounded-xl border border-red-900/50 bg-neutral-900 px-4 py-3 shadow-lg shadow-black/40 transition-all duration-200 ease-out motion-reduce:transition-none ${ className={`flex w-full max-w-sm items-start gap-2.5 rounded-xl border border-error/30 bg-surface-container px-4 py-3 shadow-lg shadow-black/40 transition-all duration-200 ease-out motion-reduce:transition-none ${
visible ? 'translate-y-0 opacity-100' : '-translate-y-2 opacity-0' visible ? 'translate-y-0 opacity-100' : '-translate-y-2 opacity-0'
}`} }`}
> >
<AlertCircle size={18} strokeWidth={2} className="mt-0.5 shrink-0 text-red-400" /> <AlertCircle size={18} strokeWidth={2} className="mt-0.5 shrink-0 text-error" />
<p className="flex-1 text-sm text-neutral-200">{playbackError}</p> <p className="flex-1 text-sm text-on-surface">{playbackError}</p>
<button <button
onClick={dismissError} onClick={dismissError}
aria-label="Dismiss" aria-label="Dismiss"
className="shrink-0 rounded-full p-0.5 text-neutral-500 transition-colors hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400" className="shrink-0 rounded-full p-0.5 text-outline transition-colors hover:text-on-surface focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"
> >
<X size={16} strokeWidth={2} /> <X size={16} strokeWidth={2} />
</button> </button>
......
...@@ -59,15 +59,15 @@ export function RemixSongPicker({ selected, onChange, onClose }: RemixSongPicker ...@@ -59,15 +59,15 @@ export function RemixSongPicker({ selected, onChange, onClose }: RemixSongPicker
onClick={onClose} onClick={onClose}
> >
<div <div
className="flex max-h-[80vh] w-full max-w-md flex-col overflow-hidden rounded-t-2xl bg-neutral-900 sm:rounded-2xl" className="flex max-h-[80vh] w-full max-w-md flex-col overflow-hidden rounded-t-2xl bg-surface-container sm:rounded-2xl"
onClick={(e) => e.stopPropagation()} onClick={(e) => e.stopPropagation()}
> >
<div className="flex items-center justify-between border-b border-neutral-800 px-4 py-3"> <div className="flex items-center justify-between border-b border-outline-variant px-4 py-3">
<p className="text-sm font-semibold text-white">Choose up to {MAX_REMIX_SONGS} songs</p> <p className="text-sm font-semibold text-white">Choose up to {MAX_REMIX_SONGS} songs</p>
<button <button
onClick={onClose} onClick={onClose}
aria-label="Close" aria-label="Close"
className="rounded-full p-1.5 text-neutral-400 transition-colors hover:bg-white/10 hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400" className="rounded-full p-1.5 text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"
> >
<X size={18} strokeWidth={2} /> <X size={18} strokeWidth={2} />
</button> </button>
...@@ -79,7 +79,7 @@ export function RemixSongPicker({ selected, onChange, onClose }: RemixSongPicker ...@@ -79,7 +79,7 @@ export function RemixSongPicker({ selected, onChange, onClose }: RemixSongPicker
<ul className="mt-2 flex-1 overflow-y-auto px-2 pb-3"> <ul className="mt-2 flex-1 overflow-y-auto px-2 pb-3">
{filtered.length === 0 && ( {filtered.length === 0 && (
<p className="px-2 py-8 text-center text-sm text-neutral-500"> <p className="px-2 py-8 text-center text-sm text-outline">
{library.length === 0 ? 'Your library is empty.' : 'No songs found.'} {library.length === 0 ? 'Your library is empty.' : 'No songs found.'}
</p> </p>
)} )}
...@@ -92,20 +92,20 @@ export function RemixSongPicker({ selected, onChange, onClose }: RemixSongPicker ...@@ -92,20 +92,20 @@ export function RemixSongPicker({ selected, onChange, onClose }: RemixSongPicker
onClick={() => toggle(song)} onClick={() => toggle(song)}
disabled={disabled} disabled={disabled}
aria-pressed={isSelected} aria-pressed={isSelected}
className={`flex w-full items-center gap-3 rounded-lg px-2 py-2 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400 disabled:cursor-not-allowed disabled:opacity-40 ${ className={`flex w-full items-center gap-3 rounded-lg px-2 py-2 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary disabled:cursor-not-allowed disabled:opacity-40 ${
isSelected ? 'bg-emerald-500/10' : 'hover:bg-white/5' isSelected ? 'bg-primary/10' : 'hover:bg-surface-container-high/60'
}`} }`}
> >
<div <div
className={`flex h-9 w-9 shrink-0 items-center justify-center rounded-md ${ className={`flex h-9 w-9 shrink-0 items-center justify-center rounded-md ${
isSelected ? 'bg-emerald-500/20 text-emerald-400' : 'bg-neutral-800 text-neutral-600' isSelected ? 'bg-primary/20 text-primary' : 'bg-surface-container-high text-on-surface-variant'
}`} }`}
> >
{isSelected ? <Check size={16} strokeWidth={2.5} /> : <Music2 size={14} strokeWidth={1.75} />} {isSelected ? <Check size={16} strokeWidth={2.5} /> : <Music2 size={14} strokeWidth={1.75} />}
</div> </div>
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<p className="truncate text-sm font-medium text-white">{song.title}</p> <p className="truncate text-sm font-medium text-white">{song.title}</p>
<p className="truncate text-xs text-neutral-500">{song.artist}</p> <p className="truncate text-xs text-outline">{song.artist}</p>
</div> </div>
</button> </button>
</li> </li>
...@@ -113,7 +113,7 @@ export function RemixSongPicker({ selected, onChange, onClose }: RemixSongPicker ...@@ -113,7 +113,7 @@ export function RemixSongPicker({ selected, onChange, onClose }: RemixSongPicker
})} })}
</ul> </ul>
<div className="border-t border-neutral-800 p-3"> <div className="border-t border-outline-variant p-3">
<Button onClick={onClose} className="w-full"> <Button onClick={onClose} className="w-full">
Done ({selected.length}/{MAX_REMIX_SONGS}) Done ({selected.length}/{MAX_REMIX_SONGS})
</Button> </Button>
......
...@@ -17,7 +17,7 @@ export function RequireRole({ role, children }: { role: 'business_admin' | 'supe ...@@ -17,7 +17,7 @@ export function RequireRole({ role, children }: { role: 'business_admin' | 'supe
const allowed = role === 'super_admin' ? isSuperAdmin : isBusinessAdmin const allowed = role === 'super_admin' ? isSuperAdmin : isBusinessAdmin
if (!allowed) { if (!allowed) {
return ( return (
<div className="flex min-h-screen items-center justify-center bg-neutral-950 px-4 text-center text-neutral-400"> <div className="flex min-h-screen items-center justify-center bg-background px-4 text-center text-on-surface-variant">
<p>You don't have access to this page.</p> <p>You don't have access to this page.</p>
</div> </div>
) )
......
...@@ -115,19 +115,19 @@ export function RoomView({ roomId, onLeave }: { roomId: number; onLeave: () => v ...@@ -115,19 +115,19 @@ export function RoomView({ roomId, onLeave }: { roomId: number; onLeave: () => v
const isCurrent = !!active && playerSong?.id === active.id const isCurrent = !!active && playerSong?.id === active.id
return ( return (
<div className="flex h-dvh flex-col bg-neutral-950 text-white"> <div className="flex h-dvh flex-col bg-background text-on-surface">
<header <header
className="flex shrink-0 items-center justify-between border-b border-neutral-800/80 px-4 py-3" className="flex shrink-0 items-center justify-between border-b border-outline-variant/80 px-4 py-3"
style={{ paddingTop: 'calc(env(safe-area-inset-top) + 0.75rem)' }} style={{ paddingTop: 'calc(env(safe-area-inset-top) + 0.75rem)' }}
> >
<button <button
onClick={onLeave} onClick={onLeave}
className="flex min-h-[44px] items-center gap-1.5 pr-2 text-sm text-neutral-400 transition-colors hover:text-white" className="flex min-h-[44px] items-center gap-1.5 pr-2 text-sm text-on-surface-variant transition-colors hover:text-on-surface"
> >
<ArrowLeft size={16} strokeWidth={2} /> <ArrowLeft size={16} strokeWidth={2} />
Leave Leave
</button> </button>
<div className="flex items-center gap-2 text-sm text-neutral-400"> <div className="flex items-center gap-2 text-sm text-on-surface-variant">
DJ #{djId} DJ #{djId}
{fireCount > 0 && ( {fireCount > 0 && (
<span className="flex items-center gap-1 text-orange-400"> <span className="flex items-center gap-1 text-orange-400">
...@@ -138,28 +138,28 @@ export function RoomView({ roomId, onLeave }: { roomId: number; onLeave: () => v ...@@ -138,28 +138,28 @@ export function RoomView({ roomId, onLeave }: { roomId: number; onLeave: () => v
</div> </div>
</header> </header>
<div className="shrink-0 border-b border-neutral-800/80 px-4 py-3"> <div className="shrink-0 border-b border-outline-variant/80 px-4 py-3">
{currentSong && active ? ( {currentSong && active ? (
<button <button
onClick={() => toggle(active)} onClick={() => toggle(active)}
disabled={isCurrent && streamLoading} disabled={isCurrent && streamLoading}
aria-label={isCurrent && isPlaying ? 'Pause' : 'Play'} aria-label={isCurrent && isPlaying ? 'Pause' : 'Play'}
className="flex w-full items-center gap-3 rounded-lg p-1 text-left transition-colors hover:bg-white/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400 disabled:cursor-not-allowed" className="flex w-full items-center gap-3 rounded-lg p-1 text-left transition-colors hover:bg-surface-container focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary disabled:cursor-not-allowed"
> >
{currentSong.coverart ? ( {currentSong.coverart ? (
<img src={currentSong.coverart} alt="" className="h-12 w-12 shrink-0 rounded-lg object-cover" /> <img src={currentSong.coverart} alt="" className="h-12 w-12 shrink-0 rounded-lg object-cover" />
) : ( ) : (
<div className="flex h-12 w-12 shrink-0 items-center justify-center rounded-lg bg-neutral-800 text-neutral-600"> <div className="flex h-12 w-12 shrink-0 items-center justify-center rounded-lg bg-surface-container-high text-on-surface-variant">
<Music2 size={18} strokeWidth={1.75} /> <Music2 size={18} strokeWidth={1.75} />
</div> </div>
)} )}
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<p className="truncate text-sm font-medium text-white">{currentSong.title}</p> <p className="truncate text-sm font-medium text-on-surface">{currentSong.title}</p>
<p className="truncate text-xs text-neutral-400">{currentSong.artist}</p> <p className="truncate text-xs text-on-surface-variant">{currentSong.artist}</p>
</div> </div>
<span className="flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-neutral-800 text-white"> <span className="flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-surface-container-high text-on-surface">
{isCurrent && streamLoading ? ( {isCurrent && streamLoading ? (
<span className="h-3.5 w-3.5 animate-spin rounded-full border-2 border-neutral-600 border-t-white" /> <span className="h-3.5 w-3.5 animate-spin rounded-full border-2 border-on-surface-variant/30 border-t-on-surface" />
) : isCurrent && isPlaying ? ( ) : isCurrent && isPlaying ? (
<Pause size={16} strokeWidth={2} fill="currentColor" /> <Pause size={16} strokeWidth={2} fill="currentColor" />
) : ( ) : (
...@@ -168,7 +168,7 @@ export function RoomView({ roomId, onLeave }: { roomId: number; onLeave: () => v ...@@ -168,7 +168,7 @@ export function RoomView({ roomId, onLeave }: { roomId: number; onLeave: () => v
</span> </span>
</button> </button>
) : ( ) : (
<p className="px-1 py-2 text-sm text-neutral-500"> <p className="px-1 py-2 text-sm text-outline">
{isDj ? 'Nothing playing - pick a song below.' : "Nothing playing yet - waiting on the DJ."} {isDj ? 'Nothing playing - pick a song below.' : "Nothing playing yet - waiting on the DJ."}
</p> </p>
)} )}
...@@ -191,14 +191,14 @@ export function RoomView({ roomId, onLeave }: { roomId: number; onLeave: () => v ...@@ -191,14 +191,14 @@ export function RoomView({ roomId, onLeave }: { roomId: number; onLeave: () => v
</div> </div>
{errorMessage && ( {errorMessage && (
<p className="shrink-0 bg-red-950/40 px-4 py-2 text-center text-xs text-red-400">{errorMessage}</p> <p className="shrink-0 bg-red-950/40 px-4 py-2 text-center text-xs text-error">{errorMessage}</p>
)} )}
<div className="flex-1 overflow-y-auto px-4 py-4"> <div className="flex-1 overflow-y-auto px-4 py-4">
<ul className="space-y-2"> <ul className="space-y-2">
{messages.map((m, i) => ( {messages.map((m, i) => (
<li key={i} className="animate-message-enter text-sm"> <li key={i} className="animate-message-enter text-sm">
<span className="text-neutral-500">#{m.user_id}:</span> {m.text} <span className="text-outline">#{m.user_id}:</span> {m.text}
</li> </li>
))} ))}
</ul> </ul>
...@@ -206,7 +206,7 @@ export function RoomView({ roomId, onLeave }: { roomId: number; onLeave: () => v ...@@ -206,7 +206,7 @@ export function RoomView({ roomId, onLeave }: { roomId: number; onLeave: () => v
</div> </div>
<div <div
className="shrink-0 border-t border-neutral-800/80 px-4 pt-3" className="shrink-0 border-t border-outline-variant/80 px-4 pt-3"
style={{ paddingBottom: 'calc(env(safe-area-inset-bottom) + 0.75rem)' }} style={{ paddingBottom: 'calc(env(safe-area-inset-bottom) + 0.75rem)' }}
> >
<div className="mb-3 flex gap-2"> <div className="mb-3 flex gap-2">
......
...@@ -63,15 +63,15 @@ export function SongPicker({ onSelect, onClose }: SongPickerProps) { ...@@ -63,15 +63,15 @@ export function SongPicker({ onSelect, onClose }: SongPickerProps) {
onClick={onClose} onClick={onClose}
> >
<div <div
className="flex max-h-[80vh] w-full max-w-md flex-col overflow-hidden rounded-t-2xl bg-neutral-900 sm:rounded-2xl" className="flex max-h-[80vh] w-full max-w-md flex-col overflow-hidden rounded-t-2xl bg-surface-container sm:rounded-2xl"
onClick={(e) => e.stopPropagation()} onClick={(e) => e.stopPropagation()}
> >
<div className="flex items-center justify-between border-b border-neutral-800 px-4 py-3"> <div className="flex items-center justify-between border-b border-outline-variant px-4 py-3">
<p className="text-sm font-semibold text-white">Choose an anthem</p> <p className="text-sm font-semibold text-on-surface">Choose an anthem</p>
<button <button
onClick={onClose} onClick={onClose}
aria-label="Close" aria-label="Close"
className="rounded-full p-1.5 text-neutral-400 transition-colors hover:bg-white/10 hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400" className="rounded-full p-1.5 text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"
> >
<X size={18} strokeWidth={2} /> <X size={18} strokeWidth={2} />
</button> </button>
...@@ -83,7 +83,7 @@ export function SongPicker({ onSelect, onClose }: SongPickerProps) { ...@@ -83,7 +83,7 @@ export function SongPicker({ onSelect, onClose }: SongPickerProps) {
key={t} key={t}
onClick={() => setTab(t)} onClick={() => setTab(t)}
className={`rounded-full px-3.5 py-1.5 text-sm font-medium transition-colors ${ className={`rounded-full px-3.5 py-1.5 text-sm font-medium transition-colors ${
tab === t ? 'bg-neutral-100 text-neutral-950' : 'text-neutral-400 hover:text-white' tab === t ? 'bg-primary text-on-primary' : 'text-on-surface-variant hover:text-on-surface'
}`} }`}
> >
{t === 'mine' ? 'My Library' : 'Public Library'} {t === 'mine' ? 'My Library' : 'Public Library'}
...@@ -104,7 +104,7 @@ export function SongPicker({ onSelect, onClose }: SongPickerProps) { ...@@ -104,7 +104,7 @@ export function SongPicker({ onSelect, onClose }: SongPickerProps) {
<ul className="mt-2 flex-1 overflow-y-auto px-2 pb-3"> <ul className="mt-2 flex-1 overflow-y-auto px-2 pb-3">
{list.length === 0 && ( {list.length === 0 && (
<p className="px-2 py-8 text-center text-sm text-neutral-500"> <p className="px-2 py-8 text-center text-sm text-outline">
{loading ? 'Searching…' : tab === 'mine' ? 'Your library is empty.' : 'No songs found.'} {loading ? 'Searching…' : tab === 'mine' ? 'Your library is empty.' : 'No songs found.'}
</p> </p>
)} )}
...@@ -112,14 +112,14 @@ export function SongPicker({ onSelect, onClose }: SongPickerProps) { ...@@ -112,14 +112,14 @@ export function SongPicker({ onSelect, onClose }: SongPickerProps) {
<li key={song.id}> <li key={song.id}>
<button <button
onClick={() => onSelect(song)} onClick={() => onSelect(song)}
className="flex w-full items-center gap-3 rounded-lg px-2 py-2 text-left transition-colors hover:bg-white/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400" className="flex w-full items-center gap-3 rounded-lg px-2 py-2 text-left transition-colors hover:bg-surface-container focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"
> >
<div className="flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-neutral-800 text-neutral-600"> <div className="flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-surface-container-high text-on-surface-variant">
<Music2 size={14} strokeWidth={1.75} /> <Music2 size={14} strokeWidth={1.75} />
</div> </div>
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<p className="truncate text-sm font-medium text-white">{song.title}</p> <p className="truncate text-sm font-medium text-on-surface">{song.title}</p>
<p className="truncate text-xs text-neutral-500">{song.artist}</p> <p className="truncate text-xs text-outline">{song.artist}</p>
</div> </div>
</button> </button>
</li> </li>
......
...@@ -36,7 +36,7 @@ export function SoundmarkMap({ userLocation, soundmarks }: SoundmarkMapProps) { ...@@ -36,7 +36,7 @@ export function SoundmarkMap({ userLocation, soundmarks }: SoundmarkMapProps) {
} }
return ( return (
<div className="relative h-64 overflow-hidden rounded-xl border border-neutral-800"> <div className="relative h-64 overflow-hidden rounded-xl border border-outline-variant">
<MapContainer <MapContainer
ref={setMap} ref={setMap}
center={[userLocation.lat, userLocation.lon]} center={[userLocation.lat, userLocation.lon]}
...@@ -49,7 +49,7 @@ export function SoundmarkMap({ userLocation, soundmarks }: SoundmarkMapProps) { ...@@ -49,7 +49,7 @@ export function SoundmarkMap({ userLocation, soundmarks }: SoundmarkMapProps) {
<CircleMarker <CircleMarker
center={[userLocation.lat, userLocation.lon]} center={[userLocation.lat, userLocation.lon]}
radius={8} radius={8}
pathOptions={{ color: '#10b981', fillColor: '#34d399', fillOpacity: 1, weight: 2 }} pathOptions={{ color: '#2e5bff', fillColor: '#b8c3ff', fillOpacity: 1, weight: 2 }}
> >
<Popup>You are here</Popup> <Popup>You are here</Popup>
</CircleMarker> </CircleMarker>
...@@ -70,7 +70,7 @@ export function SoundmarkMap({ userLocation, soundmarks }: SoundmarkMapProps) { ...@@ -70,7 +70,7 @@ export function SoundmarkMap({ userLocation, soundmarks }: SoundmarkMapProps) {
<button <button
onClick={centerOnMe} onClick={centerOnMe}
aria-label="Center on me" aria-label="Center on me"
className="absolute bottom-3 right-3 z-[1000] flex h-9 w-9 items-center justify-center rounded-full bg-neutral-900/90 text-white shadow-lg backdrop-blur transition-colors hover:bg-neutral-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400" className="absolute bottom-3 right-3 z-[1000] flex h-9 w-9 items-center justify-center rounded-full bg-surface-container/90 text-on-surface shadow-lg backdrop-blur transition-colors hover:bg-surface-container-high focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"
> >
<LocateFixed size={16} strokeWidth={2} /> <LocateFixed size={16} strokeWidth={2} />
</button> </button>
......
...@@ -29,7 +29,7 @@ describe('Button', () => { ...@@ -29,7 +29,7 @@ describe('Button', () => {
it('applies variant-specific styling', () => { it('applies variant-specific styling', () => {
render(<Button variant="secondary">Log out</Button>) render(<Button variant="secondary">Log out</Button>)
expect(screen.getByRole('button')).toHaveClass('bg-neutral-800') expect(screen.getByRole('button')).toHaveClass('bg-surface-container-high')
}) })
it('forwards a ref to the underlying <button> element', () => { it('forwards a ref to the underlying <button> element', () => {
......
...@@ -4,9 +4,9 @@ type Variant = 'primary' | 'secondary' | 'ghost' ...@@ -4,9 +4,9 @@ type Variant = 'primary' | 'secondary' | 'ghost'
type Size = 'default' | 'sm' | 'icon' type Size = 'default' | 'sm' | 'icon'
const VARIANT_CLASSES: Record<Variant, string> = { const VARIANT_CLASSES: Record<Variant, string> = {
primary: 'bg-emerald-500 text-neutral-950 hover:bg-emerald-400 disabled:hover:bg-emerald-500', primary: 'bg-primary text-on-primary hover:bg-primary-fixed disabled:hover:bg-primary',
secondary: 'bg-neutral-800 text-white hover:bg-neutral-700 disabled:hover:bg-neutral-800', secondary: 'bg-surface-container-high text-on-surface hover:bg-surface-bright disabled:hover:bg-surface-container-high',
ghost: 'bg-transparent text-neutral-400 hover:bg-neutral-900 hover:text-white', ghost: 'bg-transparent text-on-surface-variant hover:bg-surface-container hover:text-on-surface',
} }
const SIZE_CLASSES: Record<Size, string> = { const SIZE_CLASSES: Record<Size, string> = {
...@@ -27,7 +27,7 @@ export const Button = forwardRef<HTMLButtonElement, Props>(function Button( ...@@ -27,7 +27,7 @@ export const Button = forwardRef<HTMLButtonElement, Props>(function Button(
return ( return (
<button <button
ref={ref} ref={ref}
className={`inline-flex items-center justify-center gap-1.5 rounded-full font-medium transition-all duration-150 ease-out active:scale-[0.96] disabled:cursor-not-allowed disabled:opacity-40 disabled:active:scale-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400 focus-visible:ring-offset-2 focus-visible:ring-offset-neutral-950 ${VARIANT_CLASSES[variant]} ${SIZE_CLASSES[size]} ${className}`} className={`inline-flex items-center justify-center gap-1.5 rounded-full font-medium transition-all duration-150 ease-out active:scale-[0.96] disabled:cursor-not-allowed disabled:opacity-40 disabled:active:scale-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background ${VARIANT_CLASSES[variant]} ${SIZE_CLASSES[size]} ${className}`}
{...props} {...props}
/> />
) )
......
...@@ -2,7 +2,7 @@ import type { LucideIcon } from 'lucide-react' ...@@ -2,7 +2,7 @@ import type { LucideIcon } from 'lucide-react'
export function EmptyState({ icon: Icon, message }: { icon: LucideIcon; message: string }) { export function EmptyState({ icon: Icon, message }: { icon: LucideIcon; message: string }) {
return ( return (
<div className="flex flex-col items-center gap-3 py-16 text-center text-neutral-500"> <div className="flex flex-col items-center gap-3 py-16 text-center text-outline">
<Icon size={28} strokeWidth={1.5} /> <Icon size={28} strokeWidth={1.5} />
<p className="max-w-xs text-sm">{message}</p> <p className="max-w-xs text-sm">{message}</p>
</div> </div>
......
...@@ -2,7 +2,7 @@ import { forwardRef, type InputHTMLAttributes, type TextareaHTMLAttributes } fro ...@@ -2,7 +2,7 @@ import { forwardRef, type InputHTMLAttributes, type TextareaHTMLAttributes } fro
const FIELD_CLASSES = const FIELD_CLASSES =
// text-base (16px), not smaller: anything under 16px triggers iOS Safari's auto-zoom-on-focus // text-base (16px), not smaller: anything under 16px triggers iOS Safari's auto-zoom-on-focus
'min-h-[44px] w-full rounded-lg border border-neutral-700 bg-neutral-800 px-3.5 text-base text-white placeholder-neutral-500 outline-none transition-colors duration-150 focus:border-emerald-500' 'min-h-[44px] w-full rounded-lg border border-outline-variant bg-surface-container px-3.5 text-base text-on-surface placeholder-outline outline-none transition-colors duration-150 focus:border-primary'
export const Input = forwardRef<HTMLInputElement, InputHTMLAttributes<HTMLInputElement>>(function Input( export const Input = forwardRef<HTMLInputElement, InputHTMLAttributes<HTMLInputElement>>(function Input(
{ className = '', ...props }, { className = '', ...props },
......
...@@ -4,18 +4,18 @@ ...@@ -4,18 +4,18 @@
export function ProgressBar({ percent, label }: { percent: number | null; label: string }) { export function ProgressBar({ percent, label }: { percent: number | null; label: string }) {
return ( return (
<div> <div>
<div className="mb-1.5 flex items-center justify-between text-xs text-neutral-400"> <div className="mb-1.5 flex items-center justify-between text-xs text-on-surface-variant">
<span>{label}</span> <span>{label}</span>
{percent !== null && <span className="tabular-nums text-neutral-500">{percent}%</span>} {percent !== null && <span className="tabular-nums text-outline">{percent}%</span>}
</div> </div>
<div className="h-1.5 overflow-hidden rounded-full bg-neutral-800"> <div className="h-1.5 overflow-hidden rounded-full bg-surface-container-high">
{percent !== null ? ( {percent !== null ? (
<div <div
className="h-full rounded-full bg-emerald-500 transition-[width] duration-200 ease-out" className="h-full rounded-full bg-primary transition-[width] duration-200 ease-out"
style={{ width: `${percent}%` }} style={{ width: `${percent}%` }}
/> />
) : ( ) : (
<div className="h-full w-1/3 animate-[indeterminate_1.2s_ease-in-out_infinite] rounded-full bg-emerald-500" /> <div className="h-full w-1/3 animate-[indeterminate_1.2s_ease-in-out_infinite] rounded-full bg-primary" />
)} )}
</div> </div>
</div> </div>
......
export function Skeleton({ className = '' }: { className?: string }) { export function Skeleton({ className = '' }: { className?: string }) {
return <div className={`animate-pulse rounded-md bg-neutral-800/80 ${className}`} /> return <div className={`animate-pulse rounded-md bg-surface-container-high/80 ${className}`} />
} }
/** A row shaped like a library/discovery list item, for use while data is loading instead of /** A row shaped like a library/discovery list item, for use while data is loading instead of
......
@import "tailwindcss"; @import "tailwindcss";
@import "leaflet/dist/leaflet.css"; @import "leaflet/dist/leaflet.css";
/* Design system tokens - cobalt/periwinkle palette, Material-3-style naming to match the
Stitch design export these were sourced from (verified against library_bauhaus_edition's
and stax_web_home's applied tailwind.config, not just their doc files - some of the export's
named "editions" don't actually match their own DESIGN.md). Deliberately dark-only: this
product has never had a light theme and isn't getting one as part of this pass.
rounded/rounded-lg/rounded-xl/rounded-full already equal the spec's 4px/8px/12px/full with
zero overrides, since Tailwind's stock radius scale happens to match exactly. */
@theme {
--font-sans: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
--color-background: #131313;
--color-surface: #131313;
--color-surface-dim: #131313;
--color-surface-bright: #3a3939;
--color-surface-variant: #353534;
--color-surface-container-lowest: #0e0e0e;
--color-surface-container-low: #1c1b1b;
--color-surface-container: #201f1f;
--color-surface-container-high: #2a2a2a;
--color-surface-container-highest: #353534;
--color-on-background: #e5e2e1;
--color-on-surface: #e5e2e1;
--color-on-surface-variant: #c4c5d9;
--color-inverse-surface: #e5e2e1;
--color-inverse-on-surface: #313030;
--color-outline: #8e90a2;
--color-outline-variant: #434656;
--color-primary: #b8c3ff;
--color-on-primary: #002388;
--color-primary-container: #2e5bff;
--color-on-primary-container: #efefff;
--color-primary-fixed: #dde1ff;
--color-primary-fixed-dim: #b8c3ff;
--color-inverse-primary: #124af0;
--color-secondary: #c6c6c6;
--color-on-secondary: #2f3131;
--color-secondary-container: #454747;
--color-on-secondary-container: #b4b5b5;
--color-secondary-fixed: #e2e2e2;
--color-secondary-fixed-dim: #c6c6c6;
--color-tertiary: #ffb4aa;
--color-on-tertiary: #690003;
--color-tertiary-container: #d71a18;
--color-on-tertiary-container: #ffece9;
--color-error: #ffb4ab;
--color-on-error: #690005;
--color-error-container: #93000a;
--color-on-error-container: #ffdad6;
}
@keyframes message-enter { @keyframes message-enter {
from { from {
opacity: 0; opacity: 0;
...@@ -75,7 +131,7 @@ ...@@ -75,7 +131,7 @@
opacity: 1; opacity: 1;
} }
.seek-range:focus-visible { .seek-range:focus-visible {
outline: 2px solid #34d399; outline: 2px solid var(--color-primary);
outline-offset: 4px; outline-offset: 4px;
border-radius: 9999px; border-radius: 9999px;
} }
......
...@@ -12,7 +12,7 @@ export type MarkerTier = 'major' | 'business' | 'community' | 'generic' ...@@ -12,7 +12,7 @@ export type MarkerTier = 'major' | 'business' | 'community' | 'generic'
const TIER_COLOR: Record<MarkerTier, string> = { const TIER_COLOR: Record<MarkerTier, string> = {
major: '#fbbf24', // amber - curated landmark major: '#fbbf24', // amber - curated landmark
business: '#818cf8', // indigo - business business: '#818cf8', // indigo - business
community: '#34d399', // emerald - community, matches the app's own accent color community: '#b8c3ff', // periwinkle - community, matches the app's own accent color
generic: '#f5f5f5', // neutral white - used where tier isn't known yet (e.g. LocationPicker) generic: '#f5f5f5', // neutral white - used where tier isn't known yet (e.g. LocationPicker)
} }
......
...@@ -66,7 +66,7 @@ function formFromSoundmark(sm: Soundmark): SoundmarkFormValues { ...@@ -66,7 +66,7 @@ function formFromSoundmark(sm: Soundmark): SoundmarkFormValues {
} }
const SELECT_CLASSES = const SELECT_CLASSES =
'min-h-[44px] w-full rounded-lg border border-neutral-700 bg-neutral-800 px-3.5 text-base text-white outline-none transition-colors duration-150 focus:border-emerald-500' 'min-h-[44px] w-full rounded-lg border border-outline-variant bg-surface-container-high px-3.5 text-base text-on-surface outline-none transition-colors duration-150 focus:border-primary'
function SoundmarkFormModal({ function SoundmarkFormModal({
initial, initial,
...@@ -96,10 +96,10 @@ function SoundmarkFormModal({ ...@@ -96,10 +96,10 @@ function SoundmarkFormModal({
onClick={onClose} onClick={onClose}
> >
<div <div
className="max-h-[85vh] w-full max-w-md overflow-y-auto rounded-t-2xl bg-neutral-900 p-4 sm:rounded-2xl" className="max-h-[85vh] w-full max-w-md overflow-y-auto rounded-t-2xl bg-surface-container p-4 sm:rounded-2xl"
onClick={(e) => e.stopPropagation()} onClick={(e) => e.stopPropagation()}
> >
<p className="mb-4 text-sm font-semibold text-white">{initial ? 'Edit soundmark' : 'New soundmark'}</p> <p className="mb-4 text-sm font-semibold text-on-surface">{initial ? 'Edit soundmark' : 'New soundmark'}</p>
<form <form
onSubmit={(e) => { onSubmit={(e) => {
e.preventDefault() e.preventDefault()
...@@ -115,7 +115,7 @@ function SoundmarkFormModal({ ...@@ -115,7 +115,7 @@ function SoundmarkFormModal({
rows={2} rows={2}
/> />
<div> <div>
<label htmlFor="soundmark-tier" className="mb-1 block text-xs font-medium text-neutral-400"> <label htmlFor="soundmark-tier" className="mb-1 block text-xs font-medium text-on-surface-variant">
Tier Tier
</label> </label>
<select <select
...@@ -146,7 +146,7 @@ function SoundmarkFormModal({ ...@@ -146,7 +146,7 @@ function SoundmarkFormModal({
/> />
{values.tier === 'business' && ( {values.tier === 'business' && (
<div> <div>
<label htmlFor="soundmark-owner" className="mb-1 block text-xs font-medium text-neutral-400"> <label htmlFor="soundmark-owner" className="mb-1 block text-xs font-medium text-on-surface-variant">
Owner Owner
</label> </label>
<select <select
...@@ -200,12 +200,12 @@ function PlaylistModal({ ...@@ -200,12 +200,12 @@ function PlaylistModal({
onClick={onClose} onClick={onClose}
> >
<div <div
className="max-h-[85vh] w-full max-w-md overflow-y-auto rounded-t-2xl bg-neutral-900 p-4 sm:rounded-2xl" className="max-h-[85vh] w-full max-w-md overflow-y-auto rounded-t-2xl bg-surface-container p-4 sm:rounded-2xl"
onClick={(e) => e.stopPropagation()} onClick={(e) => e.stopPropagation()}
> >
<div className="mb-3 flex items-center justify-between"> <div className="mb-3 flex items-center justify-between">
<p className="text-sm font-semibold text-white">{soundmark.name} — playlist</p> <p className="text-sm font-semibold text-on-surface">{soundmark.name} — playlist</p>
<button onClick={onClose} aria-label="Close" className="rounded-full p-1 text-neutral-500 hover:text-white"> <button onClick={onClose} aria-label="Close" className="rounded-full p-1 text-outline hover:text-on-surface">
<X size={18} strokeWidth={1.75} /> <X size={18} strokeWidth={1.75} />
</button> </button>
</div> </div>
...@@ -214,21 +214,21 @@ function PlaylistModal({ ...@@ -214,21 +214,21 @@ function PlaylistModal({
Add track Add track
</Button> </Button>
{soundmark.playlist.length === 0 ? ( {soundmark.playlist.length === 0 ? (
<p className="text-sm text-neutral-500">No tracks yet - add one to get this business playing.</p> <p className="text-sm text-outline">No tracks yet - add one to get this business playing.</p>
) : ( ) : (
<ul className="divide-y divide-neutral-800/60"> <ul className="divide-y divide-outline-variant/60">
{soundmark.playlist.map((track, i) => ( {soundmark.playlist.map((track, i) => (
<li key={track.id} className="flex items-center gap-3 py-2"> <li key={track.id} className="flex items-center gap-3 py-2">
<span className="w-4 shrink-0 text-xs text-neutral-600">{i + 1}</span> <span className="w-4 shrink-0 text-xs text-on-surface-variant">{i + 1}</span>
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<p className="truncate text-sm font-medium text-white">{track.title}</p> <p className="truncate text-sm font-medium text-on-surface">{track.title}</p>
<p className="truncate text-xs text-neutral-500">{track.artist}</p> <p className="truncate text-xs text-outline">{track.artist}</p>
</div> </div>
<button <button
onClick={() => onRemove(track.id)} onClick={() => onRemove(track.id)}
disabled={savingSongId === track.id} disabled={savingSongId === track.id}
aria-label={`Remove ${track.title}`} aria-label={`Remove ${track.title}`}
className="shrink-0 rounded-full p-1.5 text-neutral-500 transition-colors hover:bg-red-950/50 hover:text-red-400 disabled:opacity-40" className="shrink-0 rounded-full p-1.5 text-outline transition-colors hover:bg-error/15 hover:text-error disabled:opacity-40"
> >
<Trash2 size={15} strokeWidth={1.75} /> <Trash2 size={15} strokeWidth={1.75} />
</button> </button>
...@@ -406,18 +406,18 @@ export function AdminPanel() { ...@@ -406,18 +406,18 @@ export function AdminPanel() {
return ( return (
<Layout title="Admin"> <Layout title="Admin">
<div className="mb-6 flex w-fit gap-1 rounded-full bg-neutral-900 p-1"> <div className="mb-6 flex w-fit gap-1 rounded-full bg-surface-container p-1">
{(['soundmarks', 'review queue', 'users'] as const).map((s) => ( {(['soundmarks', 'review queue', 'users'] as const).map((s) => (
<button <button
key={s} key={s}
onClick={() => setSection(s)} onClick={() => setSection(s)}
className={`relative rounded-full px-4 py-1.5 text-sm font-medium capitalize transition-colors ${ className={`relative rounded-full px-4 py-1.5 text-sm font-medium capitalize transition-colors ${
section === s ? 'bg-neutral-100 text-neutral-950' : 'text-neutral-400 hover:text-white' section === s ? 'bg-primary text-on-primary' : 'text-on-surface-variant hover:text-on-surface'
}`} }`}
> >
{s} {s}
{s === 'review queue' && queue.length > 0 && ( {s === 'review queue' && queue.length > 0 && (
<span className="ml-1.5 rounded-full bg-emerald-500 px-1.5 py-0.5 text-[10px] font-bold text-neutral-950"> <span className="ml-1.5 rounded-full bg-primary px-1.5 py-0.5 text-[10px] font-bold text-on-primary">
{queue.length} {queue.length}
</span> </span>
)} )}
...@@ -425,7 +425,7 @@ export function AdminPanel() { ...@@ -425,7 +425,7 @@ export function AdminPanel() {
))} ))}
</div> </div>
{error && <p className="mb-4 text-sm text-red-400">{error}</p>} {error && <p className="mb-4 text-sm text-error">{error}</p>}
{section === 'soundmarks' && ( {section === 'soundmarks' && (
<> <>
...@@ -435,7 +435,7 @@ export function AdminPanel() { ...@@ -435,7 +435,7 @@ export function AdminPanel() {
</Button> </Button>
{loading && ( {loading && (
<div className="divide-y divide-neutral-800/80"> <div className="divide-y divide-outline-variant/80">
<SkeletonRow /> <SkeletonRow />
<SkeletonRow /> <SkeletonRow />
</div> </div>
...@@ -446,16 +446,16 @@ export function AdminPanel() { ...@@ -446,16 +446,16 @@ export function AdminPanel() {
<ul className="space-y-3"> <ul className="space-y-3">
{soundmarks.map((sm) => ( {soundmarks.map((sm) => (
<li key={sm.id} className="rounded-xl border border-neutral-800 bg-neutral-900 p-3"> <li key={sm.id} className="rounded-xl border border-outline-variant bg-surface-container p-3">
<div className="flex items-start justify-between gap-2"> <div className="flex items-start justify-between gap-2">
<div className="min-w-0"> <div className="min-w-0">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<p className="truncate font-medium text-white">{sm.name}</p> <p className="truncate font-medium text-on-surface">{sm.name}</p>
<span className="shrink-0 rounded-full bg-neutral-800 px-2 py-0.5 text-[10px] font-medium text-neutral-400"> <span className="shrink-0 rounded-full bg-surface-container-high px-2 py-0.5 text-[10px] font-medium text-on-surface-variant">
{TIER_LABEL[sm.tier]} {TIER_LABEL[sm.tier]}
</span> </span>
</div> </div>
<p className="truncate text-xs text-neutral-500"> <p className="truncate text-xs text-outline">
{sm.latitude.toFixed(4)}, {sm.longitude.toFixed(4)} · {sm.radius_meters}m {sm.latitude.toFixed(4)}, {sm.longitude.toFixed(4)} · {sm.radius_meters}m
{sm.business_owner_username ? ` · Owned by ${sm.business_owner_username}` : ''} {sm.business_owner_username ? ` · Owned by ${sm.business_owner_username}` : ''}
{sm.tier === 'community' ? ` · ${sm.proposal_count} proposal(s)` : ''} {sm.tier === 'community' ? ` · ${sm.proposal_count} proposal(s)` : ''}
...@@ -465,7 +465,7 @@ export function AdminPanel() { ...@@ -465,7 +465,7 @@ export function AdminPanel() {
onClick={() => handleDelete(sm)} onClick={() => handleDelete(sm)}
disabled={savingKey === `delete-${sm.id}`} disabled={savingKey === `delete-${sm.id}`}
aria-label={`Delete ${sm.name}`} aria-label={`Delete ${sm.name}`}
className="shrink-0 rounded-full p-1.5 text-neutral-500 transition-colors hover:bg-red-950/50 hover:text-red-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400 disabled:opacity-40" className="shrink-0 rounded-full p-1.5 text-outline transition-colors hover:bg-error/15 hover:text-error focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary disabled:opacity-40"
> >
<Trash2 size={16} strokeWidth={1.75} /> <Trash2 size={16} strokeWidth={1.75} />
</button> </button>
...@@ -475,18 +475,18 @@ export function AdminPanel() { ...@@ -475,18 +475,18 @@ export function AdminPanel() {
{sm.song?.coverart ? ( {sm.song?.coverart ? (
<img src={sm.song.coverart} alt="" className="h-12 w-12 shrink-0 rounded-md object-cover" /> <img src={sm.song.coverart} alt="" className="h-12 w-12 shrink-0 rounded-md object-cover" />
) : ( ) : (
<div className="flex h-12 w-12 shrink-0 items-center justify-center rounded-md bg-neutral-800 text-neutral-600"> <div className="flex h-12 w-12 shrink-0 items-center justify-center rounded-md bg-surface-container-high text-on-surface-variant">
<Music2 size={16} strokeWidth={1.75} /> <Music2 size={16} strokeWidth={1.75} />
</div> </div>
)} )}
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
{sm.song ? ( {sm.song ? (
<> <>
<p className="truncate text-sm font-medium text-white">{sm.song.title}</p> <p className="truncate text-sm font-medium text-on-surface">{sm.song.title}</p>
<p className="truncate text-xs text-neutral-400">{sm.song.artist}</p> <p className="truncate text-xs text-on-surface-variant">{sm.song.artist}</p>
</> </>
) : ( ) : (
<p className="text-sm text-neutral-500">No anthem set</p> <p className="text-sm text-outline">No anthem set</p>
)} )}
</div> </div>
</div> </div>
...@@ -521,7 +521,7 @@ export function AdminPanel() { ...@@ -521,7 +521,7 @@ export function AdminPanel() {
</Button> </Button>
)} )}
{sm.tier === 'community' && ( {sm.tier === 'community' && (
<p className="flex items-center py-1.5 text-xs text-neutral-500"> <p className="flex items-center py-1.5 text-xs text-outline">
Automated — top-voted proposal plays Automated — top-voted proposal plays
</p> </p>
)} )}
...@@ -538,7 +538,7 @@ export function AdminPanel() { ...@@ -538,7 +538,7 @@ export function AdminPanel() {
{section === 'review queue' && ( {section === 'review queue' && (
<> <>
{loading && ( {loading && (
<div className="divide-y divide-neutral-800/80"> <div className="divide-y divide-outline-variant/80">
<SkeletonRow /> <SkeletonRow />
<SkeletonRow /> <SkeletonRow />
</div> </div>
...@@ -548,11 +548,11 @@ export function AdminPanel() { ...@@ -548,11 +548,11 @@ export function AdminPanel() {
)} )}
<ul className="space-y-3"> <ul className="space-y-3">
{queue.map((s) => ( {queue.map((s) => (
<li key={s.id} className="rounded-xl border border-neutral-800 bg-neutral-900 p-3"> <li key={s.id} className="rounded-xl border border-outline-variant bg-surface-container p-3">
<p className="mb-2 flex items-center gap-1.5 text-xs text-neutral-500"> <p className="mb-2 flex items-center gap-1.5 text-xs text-outline">
<MapPin size={12} strokeWidth={2.5} /> <MapPin size={12} strokeWidth={2.5} />
{s.soundmark_name} {s.soundmark_name}
<span className="rounded-full bg-neutral-800 px-2 py-0.5 text-[10px] font-medium text-neutral-400"> <span className="rounded-full bg-surface-container-high px-2 py-0.5 text-[10px] font-medium text-on-surface-variant">
{s.soundmark_tier ? TIER_LABEL[s.soundmark_tier] : ''} {s.soundmark_tier ? TIER_LABEL[s.soundmark_tier] : ''}
</span> </span>
</p> </p>
...@@ -560,13 +560,13 @@ export function AdminPanel() { ...@@ -560,13 +560,13 @@ export function AdminPanel() {
{s.song?.coverart ? ( {s.song?.coverart ? (
<img src={s.song.coverart} alt="" className="h-12 w-12 shrink-0 rounded-md object-cover" /> <img src={s.song.coverart} alt="" className="h-12 w-12 shrink-0 rounded-md object-cover" />
) : ( ) : (
<div className="flex h-12 w-12 shrink-0 items-center justify-center rounded-md bg-neutral-800 text-neutral-600"> <div className="flex h-12 w-12 shrink-0 items-center justify-center rounded-md bg-surface-container-high text-on-surface-variant">
<Music2 size={16} strokeWidth={1.75} /> <Music2 size={16} strokeWidth={1.75} />
</div> </div>
)} )}
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<p className="truncate text-sm font-medium text-white">{s.song?.title}</p> <p className="truncate text-sm font-medium text-on-surface">{s.song?.title}</p>
<p className="truncate text-xs text-neutral-400"> <p className="truncate text-xs text-on-surface-variant">
{s.song?.artist} · suggested by {s.suggested_by_username ?? 'someone'} {s.song?.artist} · suggested by {s.suggested_by_username ?? 'someone'}
</p> </p>
</div> </div>
...@@ -601,25 +601,25 @@ export function AdminPanel() { ...@@ -601,25 +601,25 @@ export function AdminPanel() {
{section === 'users' && ( {section === 'users' && (
<> <>
{loading && ( {loading && (
<div className="divide-y divide-neutral-800/80"> <div className="divide-y divide-outline-variant/80">
<SkeletonRow /> <SkeletonRow />
<SkeletonRow /> <SkeletonRow />
</div> </div>
)} )}
{!loading && users.length === 0 && <EmptyState icon={MapPin} message="No users yet." />} {!loading && users.length === 0 && <EmptyState icon={MapPin} message="No users yet." />}
<ul className="divide-y divide-neutral-800/80"> <ul className="divide-y divide-outline-variant/80">
{users.map((u) => ( {users.map((u) => (
<li key={u.id} className="flex items-center justify-between gap-3 py-3"> <li key={u.id} className="flex items-center justify-between gap-3 py-3">
<div className="min-w-0"> <div className="min-w-0">
<p className="truncate font-medium text-white">{u.username ?? `User #${u.id}`}</p> <p className="truncate font-medium text-on-surface">{u.username ?? `User #${u.id}`}</p>
<p className="truncate text-xs text-neutral-500">{u.phone_number ?? '—'}</p> <p className="truncate text-xs text-outline">{u.phone_number ?? '—'}</p>
</div> </div>
<select <select
value={u.role} value={u.role}
onChange={(e) => handleRoleChange(u.id, e.target.value)} onChange={(e) => handleRoleChange(u.id, e.target.value)}
disabled={savingKey === `role-${u.id}`} disabled={savingKey === `role-${u.id}`}
aria-label={`Role for ${u.username ?? `User #${u.id}`}`} aria-label={`Role for ${u.username ?? `User #${u.id}`}`}
className="min-h-[38px] shrink-0 rounded-lg border border-neutral-700 bg-neutral-800 px-2.5 text-sm text-white outline-none transition-colors focus:border-emerald-500" className="min-h-[38px] shrink-0 rounded-lg border border-outline-variant bg-surface-container-high px-2.5 text-sm text-on-surface outline-none transition-colors focus:border-primary"
> >
<option value="user">user</option> <option value="user">user</option>
<option value="business_admin">business_admin</option> <option value="business_admin">business_admin</option>
......
...@@ -85,18 +85,18 @@ export function BusinessPanel() { ...@@ -85,18 +85,18 @@ export function BusinessPanel() {
return ( return (
<Layout title="Business Panel"> <Layout title="Business Panel">
<div className="mb-6 flex w-fit gap-1 rounded-full bg-neutral-900 p-1"> <div className="mb-6 flex w-fit gap-1 rounded-full bg-surface-container p-1">
{(['soundmarks', 'review queue'] as const).map((s) => ( {(['soundmarks', 'review queue'] as const).map((s) => (
<button <button
key={s} key={s}
onClick={() => setSection(s)} onClick={() => setSection(s)}
className={`relative rounded-full px-4 py-1.5 text-sm font-medium capitalize transition-colors ${ className={`relative rounded-full px-4 py-1.5 text-sm font-medium capitalize transition-colors ${
section === s ? 'bg-neutral-100 text-neutral-950' : 'text-neutral-400 hover:text-white' section === s ? 'bg-primary text-on-primary' : 'text-on-surface-variant hover:text-on-surface'
}`} }`}
> >
{s} {s}
{s === 'review queue' && queue.length > 0 && ( {s === 'review queue' && queue.length > 0 && (
<span className="ml-1.5 rounded-full bg-emerald-500 px-1.5 py-0.5 text-[10px] font-bold text-neutral-950"> <span className="ml-1.5 rounded-full bg-primary px-1.5 py-0.5 text-[10px] font-bold text-on-primary">
{queue.length} {queue.length}
</span> </span>
)} )}
...@@ -104,17 +104,17 @@ export function BusinessPanel() { ...@@ -104,17 +104,17 @@ export function BusinessPanel() {
))} ))}
</div> </div>
{error && <p className="mb-4 text-sm text-red-400">{error}</p>} {error && <p className="mb-4 text-sm text-error">{error}</p>}
{section === 'soundmarks' && ( {section === 'soundmarks' && (
<> <>
<p className="mb-6 text-sm leading-relaxed text-neutral-400"> <p className="mb-6 text-sm leading-relaxed text-on-surface-variant">
Build the playlist that plays at each of your soundmarks - pick from your own library or search every Build the playlist that plays at each of your soundmarks - pick from your own library or search every
tagged song on Stax. The first track is what's currently playing. tagged song on Stax. The first track is what's currently playing.
</p> </p>
{loading && ( {loading && (
<div className="divide-y divide-neutral-800/80"> <div className="divide-y divide-outline-variant/80">
<SkeletonRow /> <SkeletonRow />
<SkeletonRow /> <SkeletonRow />
</div> </div>
...@@ -125,46 +125,46 @@ export function BusinessPanel() { ...@@ -125,46 +125,46 @@ export function BusinessPanel() {
<ul className="space-y-3"> <ul className="space-y-3">
{soundmarks.map((sm) => ( {soundmarks.map((sm) => (
<li key={sm.id} className="rounded-xl border border-neutral-800 bg-neutral-900 p-3"> <li key={sm.id} className="rounded-xl border border-outline-variant bg-surface-container p-3">
<div className="mb-2 flex items-center gap-1.5 px-1 text-xs font-medium uppercase tracking-wide text-neutral-500"> <div className="mb-2 flex items-center gap-1.5 px-1 text-xs font-medium uppercase tracking-wide text-outline">
<MapPin size={12} strokeWidth={2.5} /> <MapPin size={12} strokeWidth={2.5} />
{sm.name} {sm.name}
<span className="text-neutral-600">· {sm.radius_meters}m radius</span> <span className="text-on-surface-variant">· {sm.radius_meters}m radius</span>
</div> </div>
<div className="flex items-center gap-4 p-1"> <div className="flex items-center gap-4 p-1">
{sm.song?.coverart ? ( {sm.song?.coverart ? (
<img src={sm.song.coverart} alt="" className="h-14 w-14 shrink-0 rounded-lg object-cover" /> <img src={sm.song.coverart} alt="" className="h-14 w-14 shrink-0 rounded-lg object-cover" />
) : ( ) : (
<div className="flex h-14 w-14 shrink-0 items-center justify-center rounded-lg bg-neutral-800 text-neutral-600"> <div className="flex h-14 w-14 shrink-0 items-center justify-center rounded-lg bg-surface-container-high text-on-surface-variant">
<Music2 size={18} strokeWidth={1.75} /> <Music2 size={18} strokeWidth={1.75} />
</div> </div>
)} )}
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
{sm.song ? ( {sm.song ? (
<> <>
<p className="truncate font-medium text-white">{sm.song.title}</p> <p className="truncate font-medium text-on-surface">{sm.song.title}</p>
<p className="truncate text-sm text-neutral-400">{sm.song.artist}</p> <p className="truncate text-sm text-on-surface-variant">{sm.song.artist}</p>
</> </>
) : ( ) : (
<p className="text-sm text-neutral-500">No anthem set</p> <p className="text-sm text-outline">No anthem set</p>
)} )}
</div> </div>
</div> </div>
{sm.playlist.length > 1 && ( {sm.playlist.length > 1 && (
<ul className="mt-2 divide-y divide-neutral-800/60 border-t border-neutral-800/60 px-1"> <ul className="mt-2 divide-y divide-outline-variant/60 border-t border-outline-variant/60 px-1">
{sm.playlist.slice(1).map((track) => ( {sm.playlist.slice(1).map((track) => (
<li key={track.id} className="flex items-center gap-3 py-2"> <li key={track.id} className="flex items-center gap-3 py-2">
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<p className="truncate text-sm text-neutral-300">{track.title}</p> <p className="truncate text-sm text-on-surface">{track.title}</p>
<p className="truncate text-xs text-neutral-500">{track.artist}</p> <p className="truncate text-xs text-outline">{track.artist}</p>
</div> </div>
<button <button
onClick={() => handleRemoveTrack(sm.id, track.id)} onClick={() => handleRemoveTrack(sm.id, track.id)}
disabled={savingKey === `track-${track.id}`} disabled={savingKey === `track-${track.id}`}
aria-label={`Remove ${track.title}`} aria-label={`Remove ${track.title}`}
className="shrink-0 rounded-full p-1.5 text-neutral-500 transition-colors hover:bg-red-950/50 hover:text-red-400 disabled:opacity-40" className="shrink-0 rounded-full p-1.5 text-outline transition-colors hover:bg-error/15 hover:text-error disabled:opacity-40"
> >
<Trash2 size={15} strokeWidth={1.75} /> <Trash2 size={15} strokeWidth={1.75} />
</button> </button>
...@@ -190,7 +190,7 @@ export function BusinessPanel() { ...@@ -190,7 +190,7 @@ export function BusinessPanel() {
)} )}
</div> </div>
{sm.description && <p className="mt-3 px-1 text-sm text-neutral-400">{sm.description}</p>} {sm.description && <p className="mt-3 px-1 text-sm text-on-surface-variant">{sm.description}</p>}
</li> </li>
))} ))}
</ul> </ul>
...@@ -199,12 +199,12 @@ export function BusinessPanel() { ...@@ -199,12 +199,12 @@ export function BusinessPanel() {
{section === 'review queue' && ( {section === 'review queue' && (
<> <>
<p className="mb-6 text-sm leading-relaxed text-neutral-400"> <p className="mb-6 text-sm leading-relaxed text-on-surface-variant">
Songs other users have suggested for your businesses. Approve to add straight to the playlist, or Songs other users have suggested for your businesses. Approve to add straight to the playlist, or
reject to dismiss. reject to dismiss.
</p> </p>
{loading && ( {loading && (
<div className="divide-y divide-neutral-800/80"> <div className="divide-y divide-outline-variant/80">
<SkeletonRow /> <SkeletonRow />
<SkeletonRow /> <SkeletonRow />
</div> </div>
...@@ -214,8 +214,8 @@ export function BusinessPanel() { ...@@ -214,8 +214,8 @@ export function BusinessPanel() {
)} )}
<ul className="space-y-3"> <ul className="space-y-3">
{queue.map((s) => ( {queue.map((s) => (
<li key={s.id} className="rounded-xl border border-neutral-800 bg-neutral-900 p-3"> <li key={s.id} className="rounded-xl border border-outline-variant bg-surface-container p-3">
<p className="mb-2 flex items-center gap-1.5 text-xs text-neutral-500"> <p className="mb-2 flex items-center gap-1.5 text-xs text-outline">
<MapPin size={12} strokeWidth={2.5} /> <MapPin size={12} strokeWidth={2.5} />
{s.soundmark_name} {s.soundmark_name}
</p> </p>
...@@ -223,13 +223,13 @@ export function BusinessPanel() { ...@@ -223,13 +223,13 @@ export function BusinessPanel() {
{s.song?.coverart ? ( {s.song?.coverart ? (
<img src={s.song.coverart} alt="" className="h-12 w-12 shrink-0 rounded-md object-cover" /> <img src={s.song.coverart} alt="" className="h-12 w-12 shrink-0 rounded-md object-cover" />
) : ( ) : (
<div className="flex h-12 w-12 shrink-0 items-center justify-center rounded-md bg-neutral-800 text-neutral-600"> <div className="flex h-12 w-12 shrink-0 items-center justify-center rounded-md bg-surface-container-high text-on-surface-variant">
<Music2 size={16} strokeWidth={1.75} /> <Music2 size={16} strokeWidth={1.75} />
</div> </div>
)} )}
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<p className="truncate text-sm font-medium text-white">{s.song?.title}</p> <p className="truncate text-sm font-medium text-on-surface">{s.song?.title}</p>
<p className="truncate text-xs text-neutral-400"> <p className="truncate text-xs text-on-surface-variant">
{s.song?.artist} · suggested by {s.suggested_by_username ?? 'someone'} {s.song?.artist} · suggested by {s.suggested_by_username ?? 'someone'}
</p> </p>
</div> </div>
......
import { useEffect, useState } from 'react' import { useEffect, useState } from 'react'
import { Rss } from 'lucide-react' import { Rss } from 'lucide-react'
import { Layout } from '../components/Layout'
import { Button } from '../components/ui/Button' import { Button } from '../components/ui/Button'
import { Input } from '../components/ui/Input' import { Input } from '../components/ui/Input'
import { EmptyState } from '../components/ui/EmptyState' import { EmptyState } from '../components/ui/EmptyState'
...@@ -55,7 +54,7 @@ export function Channels() { ...@@ -55,7 +54,7 @@ export function Channels() {
} }
return ( return (
<Layout title="Channels"> <>
<form onSubmit={handleCreate} className="mb-6 flex gap-2"> <form onSubmit={handleCreate} className="mb-6 flex gap-2">
<Input value={newName} onChange={(e) => setNewName(e.target.value)} placeholder="New channel name" /> <Input value={newName} onChange={(e) => setNewName(e.target.value)} placeholder="New channel name" />
<Button type="submit">Create</Button> <Button type="submit">Create</Button>
...@@ -75,11 +74,11 @@ export function Channels() { ...@@ -75,11 +74,11 @@ export function Channels() {
{channels.map((channel) => ( {channels.map((channel) => (
<li <li
key={channel.id} key={channel.id}
className="flex min-h-[52px] items-center justify-between gap-3 rounded-lg border border-neutral-800 bg-neutral-900 px-4 py-3 transition-colors duration-150 hover:border-neutral-700" className="flex min-h-[52px] items-center justify-between gap-3 rounded-lg border border-outline-variant bg-surface-container px-4 py-3 transition-colors duration-150 hover:border-outline-variant"
> >
<div className="min-w-0"> <div className="min-w-0">
<p className="truncate font-medium text-white">{channel.name}</p> <p className="truncate font-medium text-on-surface">{channel.name}</p>
<p className="text-xs text-neutral-500"> <p className="text-xs text-outline">
{followerCounts[channel.id] ?? 0} followers · owner #{channel.owner_id} {followerCounts[channel.id] ?? 0} followers · owner #{channel.owner_id}
</p> </p>
</div> </div>
...@@ -96,6 +95,6 @@ export function Channels() { ...@@ -96,6 +95,6 @@ export function Channels() {
</li> </li>
))} ))}
</ul> </ul>
</Layout> </>
) )
} }
...@@ -143,7 +143,7 @@ export function Discovery() { ...@@ -143,7 +143,7 @@ export function Discovery() {
return ( return (
<Layout title="Discovery"> <Layout title="Discovery">
{micSupported ? ( {micSupported ? (
<div className="mb-8 flex flex-col items-center gap-3 rounded-xl border border-neutral-800 p-8 text-center"> <div className="mb-8 flex flex-col items-center gap-3 rounded-xl border border-outline-variant p-8 text-center">
<button <button
type="button" type="button"
onClick={startListening} onClick={startListening}
...@@ -153,28 +153,28 @@ export function Discovery() { ...@@ -153,28 +153,28 @@ export function Discovery() {
> >
{listening && ( {listening && (
<> <>
<span className="absolute inset-0 animate-ping rounded-full bg-emerald-500/30" /> <span className="absolute inset-0 animate-ping rounded-full bg-primary/30" />
<span className="absolute inset-0 rounded-full bg-emerald-500/10" /> <span className="absolute inset-0 rounded-full bg-primary/10" />
</> </>
)} )}
<span <span
className={`relative flex h-20 w-20 items-center justify-center rounded-full border transition-colors duration-150 ${ className={`relative flex h-20 w-20 items-center justify-center rounded-full border transition-colors duration-150 ${
listening listening
? 'border-emerald-500 bg-emerald-500/15 text-emerald-400' ? 'border-primary bg-primary/15 text-primary'
: 'border-neutral-700 bg-neutral-900 text-neutral-400 hover:border-neutral-600 hover:text-neutral-200' : 'border-outline-variant bg-surface-container text-on-surface-variant hover:border-outline-variant hover:text-on-surface'
}`} }`}
> >
{listening ? <span className="text-xl font-semibold tabular-nums">{countdown}</span> : <Ear size={26} strokeWidth={1.5} />} {listening ? <span className="text-xl font-semibold tabular-nums">{countdown}</span> : <Ear size={26} strokeWidth={1.5} />}
</span> </span>
</button> </button>
<span className="text-sm text-neutral-400"> <span className="text-sm text-on-surface-variant">
{listening ? 'Listening…' : busy ? 'Identifying…' : "Tap to identify what's playing - listens for 5 seconds"} {listening ? 'Listening…' : busy ? 'Identifying…' : "Tap to identify what's playing - listens for 5 seconds"}
</span> </span>
</div> </div>
) : ( ) : (
<label className="mb-8 flex cursor-pointer flex-col items-center gap-3 rounded-xl border border-dashed border-neutral-700 p-8 text-center transition-colors duration-150 hover:border-neutral-600 hover:bg-neutral-900/50"> <label className="mb-8 flex cursor-pointer flex-col items-center gap-3 rounded-xl border border-dashed border-outline-variant p-8 text-center transition-colors duration-150 hover:border-outline-variant hover:bg-surface-container/50">
<Ear size={26} strokeWidth={1.5} className="text-neutral-500" /> <Ear size={26} strokeWidth={1.5} className="text-outline" />
<span className="text-sm text-neutral-400">Drop a short clip of what's playing to identify it</span> <span className="text-sm text-on-surface-variant">Drop a short clip of what's playing to identify it</span>
<input <input
type="file" type="file"
accept="audio/*" accept="audio/*"
...@@ -182,15 +182,15 @@ export function Discovery() { ...@@ -182,15 +182,15 @@ export function Discovery() {
onChange={(e) => e.target.files?.[0] && handleListen(e.target.files[0])} onChange={(e) => e.target.files?.[0] && handleListen(e.target.files[0])}
className="hidden" className="hidden"
/> />
{busy && <span className="text-xs text-neutral-500">Identifying…</span>} {busy && <span className="text-xs text-outline">Identifying…</span>}
</label> </label>
)} )}
{message && <p className="-mt-4 mb-6 text-sm text-emerald-400">{message}</p>} {message && <p className="-mt-4 mb-6 text-sm text-primary">{message}</p>}
<h2 className="mb-3 text-xs font-medium uppercase tracking-wider text-neutral-500">Last 24 hours</h2> <h2 className="mb-3 text-xs font-semibold uppercase tracking-[0.1em] text-primary">Last 24 hours</h2>
{loading && ( {loading && (
<div className="divide-y divide-neutral-800/80"> <div className="divide-y divide-outline-variant/80">
<SkeletonRow /> <SkeletonRow />
<SkeletonRow /> <SkeletonRow />
</div> </div>
...@@ -199,31 +199,31 @@ export function Discovery() { ...@@ -199,31 +199,31 @@ export function Discovery() {
<EmptyState icon={Music2} message="Nothing identified in the last 24 hours yet." /> <EmptyState icon={Music2} message="Nothing identified in the last 24 hours yet." />
)} )}
<ul className="divide-y divide-neutral-800/80"> <ul className="space-y-1">
{history.map((song) => { {history.map((song) => {
const isCurrent = song.library_song_id !== null && currentSong?.id === song.library_song_id const isCurrent = song.library_song_id !== null && currentSong?.id === song.library_song_id
return ( return (
<li key={song.id} className="flex items-center gap-4 py-3"> <li key={song.id} className="-mx-1 flex items-center gap-4 rounded-xl border border-transparent px-2 py-2.5 transition-colors hover:border-outline-variant hover:bg-surface-container">
{song.coverart ? ( {song.coverart ? (
<img src={song.coverart} alt="" className="h-10 w-10 shrink-0 rounded-md object-cover" /> <img src={song.coverart} alt="" className="h-10 w-10 shrink-0 rounded-md object-cover" />
) : ( ) : (
<div className="flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-neutral-800 text-neutral-600"> <div className="flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-surface-container-high text-on-surface-variant">
<Music2 size={16} strokeWidth={1.75} /> <Music2 size={16} strokeWidth={1.75} />
</div> </div>
)} )}
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<p className="truncate font-medium text-white">{song.title}</p> <p className="truncate font-medium text-on-surface">{song.title}</p>
<p className="truncate text-sm text-neutral-400">{song.artist}</p> <p className="truncate text-sm text-on-surface-variant">{song.artist}</p>
</div> </div>
{song.library_song_id !== null && ( {song.library_song_id !== null && (
<button <button
onClick={() => toggle(toPlayable(song), history.filter((s) => s.library_song_id !== null).map(toPlayable))} onClick={() => toggle(toPlayable(song), history.filter((s) => s.library_song_id !== null).map(toPlayable))}
disabled={isCurrent && streamLoading} disabled={isCurrent && streamLoading}
aria-label={isCurrent && isPlaying ? 'Pause' : 'Play'} aria-label={isCurrent && isPlaying ? 'Pause' : 'Play'}
className="flex min-h-[44px] min-w-[44px] items-center justify-center rounded-full text-neutral-400 transition-all duration-150 hover:text-white active:scale-90 disabled:cursor-not-allowed" className="flex min-h-[44px] min-w-[44px] items-center justify-center rounded-full text-on-surface-variant transition-all duration-150 hover:text-on-surface active:scale-90 disabled:cursor-not-allowed"
> >
{isCurrent && streamLoading ? ( {isCurrent && streamLoading ? (
<span className="h-4 w-4 animate-spin rounded-full border-2 border-neutral-600 border-t-white" /> <span className="h-4 w-4 animate-spin rounded-full border-2 border-outline-variant border-t-on-surface" />
) : isCurrent && isPlaying ? ( ) : isCurrent && isPlaying ? (
<Pause size={18} strokeWidth={2} fill="currentColor" /> <Pause size={18} strokeWidth={2} fill="currentColor" />
) : ( ) : (
...@@ -235,7 +235,7 @@ export function Discovery() { ...@@ -235,7 +235,7 @@ export function Discovery() {
onClick={() => handleSwipe(song.id, true)} onClick={() => handleSwipe(song.id, true)}
aria-label="Like" aria-label="Like"
className={`flex min-h-[44px] min-w-[44px] items-center justify-center rounded-full transition-all duration-150 active:scale-90 ${ className={`flex min-h-[44px] min-w-[44px] items-center justify-center rounded-full transition-all duration-150 active:scale-90 ${
song.liked === true ? 'text-emerald-400' : 'text-neutral-600 hover:text-neutral-300' song.liked === true ? 'text-primary' : 'text-on-surface-variant hover:text-on-surface'
}`} }`}
> >
<Heart size={19} strokeWidth={2} fill={song.liked === true ? 'currentColor' : 'none'} /> <Heart size={19} strokeWidth={2} fill={song.liked === true ? 'currentColor' : 'none'} />
...@@ -244,7 +244,7 @@ export function Discovery() { ...@@ -244,7 +244,7 @@ export function Discovery() {
onClick={() => handleSwipe(song.id, false)} onClick={() => handleSwipe(song.id, false)}
aria-label="Dismiss" aria-label="Dismiss"
className={`flex min-h-[44px] min-w-[44px] items-center justify-center rounded-full transition-all duration-150 active:scale-90 ${ className={`flex min-h-[44px] min-w-[44px] items-center justify-center rounded-full transition-all duration-150 active:scale-90 ${
song.liked === false ? 'text-red-400' : 'text-neutral-600 hover:text-neutral-300' song.liked === false ? 'text-error' : 'text-on-surface-variant hover:text-on-surface'
}`} }`}
> >
<X size={19} strokeWidth={2} /> <X size={19} strokeWidth={2} />
......
import { useEffect, useRef, useState } from 'react' import { useEffect, useRef, useState } from 'react'
import { MapPinned, Music2, Pause, Play, Radio, Shuffle } from 'lucide-react' import { MapPinned, Music2, Pause, Play, Radio, Shuffle } from 'lucide-react'
import { Layout } from '../components/Layout'
import { Button } from '../components/ui/Button' import { Button } from '../components/ui/Button'
import { EmptyState } from '../components/ui/EmptyState' import { EmptyState } from '../components/ui/EmptyState'
import { ApiError } from '../api/client' import { ApiError } from '../api/client'
...@@ -174,25 +173,25 @@ export function GeoDrops() { ...@@ -174,25 +173,25 @@ export function GeoDrops() {
const canPlayPlaylist = nearby.some((n) => n.listener.song) const canPlayPlaylist = nearby.some((n) => n.listener.song)
return ( return (
<Layout title="Live Nearby"> <>
<p className="mb-6 text-sm leading-relaxed text-neutral-400"> <p className="mb-6 text-sm leading-relaxed text-on-surface-variant">
Share your live location and whatever you're currently playing - as you switch songs, so does what Share your live location and whatever you're currently playing - as you switch songs, so does what
people nearby see. Or just browse: play a shuffled mix of what everyone around you is listening to people nearby see. Or just browse: play a shuffled mix of what everyone around you is listening to
right now. right now.
</p> </p>
{status === 'idle' && ( {status === 'idle' && (
<div className="flex flex-col items-center gap-4 rounded-xl border border-dashed border-neutral-700 p-10 text-center"> <div className="flex flex-col items-center gap-4 rounded-xl border border-dashed border-outline-variant p-10 text-center">
<MapPinned size={28} strokeWidth={1.5} className="text-neutral-500" /> <MapPinned size={28} strokeWidth={1.5} className="text-outline" />
<p className="text-sm text-neutral-400">Use your location to find live listeners near you.</p> <p className="text-sm text-on-surface-variant">Use your location to find live listeners near you.</p>
<Button onClick={start}>Find nearby listeners</Button> <Button onClick={start}>Find nearby listeners</Button>
</div> </div>
)} )}
{status === 'locating' && ( {status === 'locating' && (
<div className="flex flex-col items-center gap-3 py-16 text-neutral-500"> <div className="flex flex-col items-center gap-3 py-16 text-outline">
<span <span
className="h-6 w-6 animate-spin rounded-full border-2 border-neutral-700 border-t-emerald-400" className="h-6 w-6 animate-spin rounded-full border-2 border-outline-variant border-t-primary"
aria-hidden="true" aria-hidden="true"
/> />
<p className="text-sm">Getting your location…</p> <p className="text-sm">Getting your location…</p>
...@@ -200,8 +199,8 @@ export function GeoDrops() { ...@@ -200,8 +199,8 @@ export function GeoDrops() {
)} )}
{status === 'error' && ( {status === 'error' && (
<div className="rounded-xl border border-red-900/50 bg-neutral-900 p-4"> <div className="rounded-xl border border-error/30 bg-surface-container p-4">
<p className="text-sm text-red-400">{error}</p> <p className="text-sm text-error">{error}</p>
<Button variant="secondary" size="sm" onClick={start} className="mt-3"> <Button variant="secondary" size="sm" onClick={start} className="mt-3">
Try again Try again
</Button> </Button>
...@@ -217,7 +216,7 @@ export function GeoDrops() { ...@@ -217,7 +216,7 @@ export function GeoDrops() {
className="gap-1.5" className="gap-1.5"
aria-pressed={sharing} aria-pressed={sharing}
> >
<Radio size={16} strokeWidth={2} className={sharing ? 'text-emerald-400' : ''} /> <Radio size={16} strokeWidth={2} className={sharing ? 'text-primary' : ''} />
{sharing ? 'Stop sharing' : 'Share my live location'} {sharing ? 'Stop sharing' : 'Share my live location'}
</Button> </Button>
<Button variant="secondary" onClick={playGeoPlaylist} disabled={!canPlayPlaylist} className="gap-1.5"> <Button variant="secondary" onClick={playGeoPlaylist} disabled={!canPlayPlaylist} className="gap-1.5">
...@@ -226,13 +225,13 @@ export function GeoDrops() { ...@@ -226,13 +225,13 @@ export function GeoDrops() {
</Button> </Button>
</div> </div>
{sharing && ( {sharing && (
<p className="mb-4 text-xs text-neutral-500"> <p className="mb-4 text-xs text-outline">
Sharing live · broadcasting{' '} Sharing live · broadcasting{' '}
{currentSong && currentSong.id > 0 ? `"${currentSong.title}"` : 'no song right now'} {currentSong && currentSong.id > 0 ? `"${currentSong.title}"` : 'no song right now'}
</p> </p>
)} )}
{error && <p className="mb-4 text-sm text-red-400">{error}</p>} {error && <p className="mb-4 text-sm text-error">{error}</p>}
{nearby.length === 0 && ( {nearby.length === 0 && (
<EmptyState icon={MapPinned} message="No one nearby is sharing their location right now." /> <EmptyState icon={MapPinned} message="No one nearby is sharing their location right now." />
...@@ -243,31 +242,31 @@ export function GeoDrops() { ...@@ -243,31 +242,31 @@ export function GeoDrops() {
const active = listener.song ? toPlayable(listener) : null const active = listener.song ? toPlayable(listener) : null
const isCurrent = !!active && currentSong?.id === active.id const isCurrent = !!active && currentSong?.id === active.id
return ( return (
<li key={listener.user_id} className="rounded-xl border border-neutral-800 bg-neutral-900 p-3"> <li key={listener.user_id} className="rounded-xl border border-outline-variant bg-surface-container p-3">
{active ? ( {active ? (
<button <button
onClick={() => toggle(active)} onClick={() => toggle(active)}
disabled={isCurrent && streamLoading} disabled={isCurrent && streamLoading}
aria-label={isCurrent && isPlaying ? 'Pause' : 'Play'} aria-label={isCurrent && isPlaying ? 'Pause' : 'Play'}
className="flex w-full items-center gap-3 rounded-lg p-1 text-left transition-colors hover:bg-white/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400 disabled:cursor-not-allowed" className="flex w-full items-center gap-3 rounded-lg p-1 text-left transition-colors hover:bg-surface-container focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary disabled:cursor-not-allowed"
> >
{listener.song!.coverart ? ( {listener.song!.coverart ? (
<img src={listener.song!.coverart} alt="" className="h-12 w-12 shrink-0 rounded-lg object-cover" /> <img src={listener.song!.coverart} alt="" className="h-12 w-12 shrink-0 rounded-lg object-cover" />
) : ( ) : (
<div className="flex h-12 w-12 shrink-0 items-center justify-center rounded-lg bg-neutral-800 text-neutral-600"> <div className="flex h-12 w-12 shrink-0 items-center justify-center rounded-lg bg-surface-container-high text-on-surface-variant">
<Music2 size={18} strokeWidth={1.75} /> <Music2 size={18} strokeWidth={1.75} />
</div> </div>
)} )}
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<p className="truncate text-sm font-medium text-white">{listener.song!.title}</p> <p className="truncate text-sm font-medium text-on-surface">{listener.song!.title}</p>
<p className="truncate text-xs text-neutral-400">{listener.song!.artist}</p> <p className="truncate text-xs text-on-surface-variant">{listener.song!.artist}</p>
<p className="mt-0.5 text-xs text-neutral-500"> <p className="mt-0.5 text-xs text-outline">
{formatDistance(distance_km)} · {listener.username ?? `user #${listener.user_id}`} {formatDistance(distance_km)} · {listener.username ?? `user #${listener.user_id}`}
</p> </p>
</div> </div>
<span className="flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-neutral-800 text-white"> <span className="flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-surface-container-high text-on-surface">
{isCurrent && streamLoading ? ( {isCurrent && streamLoading ? (
<span className="h-3.5 w-3.5 animate-spin rounded-full border-2 border-neutral-600 border-t-white" /> <span className="h-3.5 w-3.5 animate-spin rounded-full border-2 border-on-surface-variant/30 border-t-on-surface" />
) : isCurrent && isPlaying ? ( ) : isCurrent && isPlaying ? (
<Pause size={16} strokeWidth={2} fill="currentColor" /> <Pause size={16} strokeWidth={2} fill="currentColor" />
) : ( ) : (
...@@ -277,12 +276,12 @@ export function GeoDrops() { ...@@ -277,12 +276,12 @@ export function GeoDrops() {
</button> </button>
) : ( ) : (
<div className="flex items-center gap-3 p-1"> <div className="flex items-center gap-3 p-1">
<div className="flex h-12 w-12 shrink-0 items-center justify-center rounded-lg bg-neutral-800 text-neutral-600"> <div className="flex h-12 w-12 shrink-0 items-center justify-center rounded-lg bg-surface-container-high text-on-surface-variant">
<Music2 size={18} strokeWidth={1.75} /> <Music2 size={18} strokeWidth={1.75} />
</div> </div>
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<p className="text-sm text-neutral-400">{listener.username ?? `user #${listener.user_id}`}</p> <p className="text-sm text-on-surface-variant">{listener.username ?? `user #${listener.user_id}`}</p>
<p className="text-xs text-neutral-500">{formatDistance(distance_km)} · not playing anything</p> <p className="text-xs text-outline">{formatDistance(distance_km)} · not playing anything</p>
</div> </div>
</div> </div>
)} )}
...@@ -292,6 +291,6 @@ export function GeoDrops() { ...@@ -292,6 +291,6 @@ export function GeoDrops() {
</ul> </ul>
</> </>
)} )}
</Layout> </>
) )
} }
...@@ -35,7 +35,7 @@ function SongRow({ ...@@ -35,7 +35,7 @@ function SongRow({
const { currentSong, isPlaying, isLoading: streamLoading, toggle } = usePlayer() const { currentSong, isPlaying, isLoading: streamLoading, toggle } = usePlayer()
const isCurrent = currentSong?.id === song.id const isCurrent = currentSong?.id === song.id
return ( return (
<li className="-mx-2 flex items-center gap-1 rounded-lg pr-2 hover:bg-white/5"> <li className="group -mx-1 flex items-center gap-1 rounded-xl border border-transparent pr-2 transition-colors hover:border-outline-variant hover:bg-surface-container">
{/* The whole row plays the song, not just the little icon on the right - the icon is {/* The whole row plays the song, not just the little icon on the right - the icon is
now a status indicator rendered inside this same button, not a separate control. now a status indicator rendered inside this same button, not a separate control.
The "add to playlist" button is a sibling, not nested inside this one, so it can The "add to playlist" button is a sibling, not nested inside this one, so it can
...@@ -44,25 +44,27 @@ function SongRow({ ...@@ -44,25 +44,27 @@ function SongRow({
onClick={() => toggle(toPlayable(song), queue.map(toPlayable))} onClick={() => toggle(toPlayable(song), queue.map(toPlayable))}
disabled={isCurrent && streamLoading} disabled={isCurrent && streamLoading}
aria-label={isCurrent && isPlaying ? 'Pause' : 'Play'} aria-label={isCurrent && isPlaying ? 'Pause' : 'Play'}
className="flex min-w-0 flex-1 items-center gap-4 rounded-lg px-2 py-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400 disabled:cursor-not-allowed" className="flex min-w-0 flex-1 items-center gap-4 rounded-lg px-2 py-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary disabled:cursor-not-allowed"
> >
{song.coverart ? ( {song.coverart ? (
<img src={song.coverart} alt="" className="h-12 w-12 shrink-0 rounded-md object-cover" /> <img src={song.coverart} alt="" className="h-12 w-12 shrink-0 rounded-lg object-cover" />
) : ( ) : (
<div className="flex h-12 w-12 shrink-0 items-center justify-center rounded-md bg-neutral-800 text-neutral-600"> <div className="flex h-12 w-12 shrink-0 items-center justify-center rounded-lg bg-surface-container-high text-on-surface-variant">
<Music2 size={18} strokeWidth={1.75} /> <Music2 size={18} strokeWidth={1.75} />
</div> </div>
)} )}
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<p className="truncate font-medium text-white">{song.title}</p> <p className="truncate font-medium text-on-surface group-hover:text-primary">{song.title}</p>
<p className="truncate text-sm text-neutral-400"> <p className="truncate text-sm text-on-surface-variant">
{song.artist} {song.artist}
{song.album ? ` · ${song.album}` : ''} {song.album ? ` · ${song.album}` : ''}
</p> </p>
</div> </div>
<span className="flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-neutral-800 text-white"> <span
className={`flex h-9 w-9 shrink-0 items-center justify-center rounded-full ${isCurrent ? 'bg-primary text-on-primary' : 'bg-surface-container-high text-on-surface'}`}
>
{isCurrent && streamLoading ? ( {isCurrent && streamLoading ? (
<span className="h-3.5 w-3.5 animate-spin rounded-full border-2 border-neutral-600 border-t-white" /> <span className="h-3.5 w-3.5 animate-spin rounded-full border-2 border-on-primary/40 border-t-on-primary" />
) : isCurrent && isPlaying ? ( ) : isCurrent && isPlaying ? (
<Pause size={16} strokeWidth={2} fill="currentColor" /> <Pause size={16} strokeWidth={2} fill="currentColor" />
) : ( ) : (
...@@ -73,7 +75,7 @@ function SongRow({ ...@@ -73,7 +75,7 @@ function SongRow({
<button <button
onClick={() => onAddToPlaylist(song)} onClick={() => onAddToPlaylist(song)}
aria-label={`Add ${song.title} to a playlist`} aria-label={`Add ${song.title} to a playlist`}
className="shrink-0 rounded-full p-2 text-neutral-500 transition-colors hover:bg-white/10 hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400" className="shrink-0 rounded-full p-2 text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"
> >
<ListPlus size={18} strokeWidth={1.75} /> <ListPlus size={18} strokeWidth={1.75} />
</button> </button>
...@@ -123,7 +125,7 @@ export function Library() { ...@@ -123,7 +125,7 @@ export function Library() {
return ( return (
<Layout title="Library"> <Layout title="Library">
<div className="relative mb-6"> <div className="relative mb-6">
<Search size={16} strokeWidth={2} className="pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-neutral-500" /> <Search size={16} strokeWidth={2} className="pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-on-surface-variant" />
<Input <Input
placeholder="Search songs and albums" placeholder="Search songs and albums"
value={query} value={query}
...@@ -133,13 +135,13 @@ export function Library() { ...@@ -133,13 +135,13 @@ export function Library() {
</div> </div>
{loading && !isSearching && ( {loading && !isSearching && (
<div className="divide-y divide-neutral-800/80"> <div className="space-y-1">
<SkeletonRow /> <SkeletonRow />
<SkeletonRow /> <SkeletonRow />
<SkeletonRow /> <SkeletonRow />
</div> </div>
)} )}
{error && <p className="text-sm text-red-400">{error}</p>} {error && <p className="text-sm text-error">{error}</p>}
{!loading && !error && !isSearching && songs.length === 0 && ( {!loading && !error && !isSearching && songs.length === 0 && (
<EmptyState icon={Music2} message="No songs yet - tag something from Telegram to see it here." /> <EmptyState icon={Music2} message="No songs yet - tag something from Telegram to see it here." />
)} )}
...@@ -157,8 +159,8 @@ export function Library() { ...@@ -157,8 +159,8 @@ export function Library() {
)} )}
{!searching && searchResults.albums.length > 0 && ( {!searching && searchResults.albums.length > 0 && (
<div className="mb-6"> <div className="mb-6">
<h2 className="mb-2 text-xs font-medium uppercase tracking-wider text-neutral-500">Albums</h2> <h2 className="mb-2 text-xs font-semibold uppercase tracking-[0.1em] text-primary">Albums</h2>
<ul className="divide-y divide-neutral-800/80"> <ul className="space-y-1">
{searchResults.albums.map((album) => { {searchResults.albums.map((album) => {
const key = albumKey(album) const key = albumKey(album)
const expanded = expandedAlbum === key const expanded = expandedAlbum === key
...@@ -167,24 +169,24 @@ export function Library() { ...@@ -167,24 +169,24 @@ export function Library() {
<button <button
onClick={() => setExpandedAlbum(expanded ? null : key)} onClick={() => setExpandedAlbum(expanded ? null : key)}
aria-expanded={expanded} aria-expanded={expanded}
className="-mx-2 flex w-full items-center gap-4 rounded-lg px-2 py-3 text-left transition-colors hover:bg-white/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400" className="-mx-1 flex w-full items-center gap-4 rounded-xl border border-transparent px-2 py-3 text-left transition-colors hover:border-outline-variant hover:bg-surface-container focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"
> >
{album.coverart ? ( {album.coverart ? (
<img src={album.coverart} alt="" className="h-12 w-12 shrink-0 rounded-md object-cover" /> <img src={album.coverart} alt="" className="h-12 w-12 shrink-0 rounded-lg object-cover" />
) : ( ) : (
<div className="flex h-12 w-12 shrink-0 items-center justify-center rounded-md bg-neutral-800 text-neutral-600"> <div className="flex h-12 w-12 shrink-0 items-center justify-center rounded-lg bg-surface-container-high text-on-surface-variant">
<Music2 size={18} strokeWidth={1.75} /> <Music2 size={18} strokeWidth={1.75} />
</div> </div>
)} )}
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<p className="truncate font-medium text-white">{album.album}</p> <p className="truncate font-medium text-on-surface">{album.album}</p>
<p className="truncate text-sm text-neutral-400"> <p className="truncate text-sm 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'}
</p> </p>
</div> </div>
</button> </button>
{expanded && ( {expanded && (
<ul className="mb-2 divide-y divide-neutral-800/80 pl-4"> <ul className="mb-2 space-y-1 pl-4">
{album.songs.map((s) => ( {album.songs.map((s) => (
<SongRow key={s.id} song={s} queue={album.songs} onAddToPlaylist={setAddingSong} /> <SongRow key={s.id} song={s} queue={album.songs} onAddToPlaylist={setAddingSong} />
))} ))}
...@@ -198,8 +200,8 @@ export function Library() { ...@@ -198,8 +200,8 @@ export function Library() {
)} )}
{!searching && searchResults.songs.length > 0 && ( {!searching && searchResults.songs.length > 0 && (
<div> <div>
<h2 className="mb-2 text-xs font-medium uppercase tracking-wider text-neutral-500">Songs</h2> <h2 className="mb-2 text-xs font-semibold uppercase tracking-[0.1em] text-primary">Songs</h2>
<ul className="divide-y divide-neutral-800/80"> <ul className="space-y-1">
{searchResults.songs.map((song) => ( {searchResults.songs.map((song) => (
<SongRow key={song.id} song={song} queue={searchResults.songs} onAddToPlaylist={setAddingSong} /> <SongRow key={song.id} song={song} queue={searchResults.songs} onAddToPlaylist={setAddingSong} />
))} ))}
...@@ -208,7 +210,7 @@ export function Library() { ...@@ -208,7 +210,7 @@ export function Library() {
)} )}
</> </>
) : ( ) : (
<ul className="divide-y divide-neutral-800/80"> <ul className="space-y-1">
{songs.map((song) => ( {songs.map((song) => (
<SongRow key={song.id} song={song} queue={songs} onAddToPlaylist={setAddingSong} /> <SongRow key={song.id} song={song} queue={songs} onAddToPlaylist={setAddingSong} />
))} ))}
......
...@@ -50,12 +50,12 @@ export function Login() { ...@@ -50,12 +50,12 @@ export function Login() {
} }
return ( return (
<div className="flex min-h-screen items-center justify-center bg-neutral-950 px-4 text-white"> <div className="flex min-h-screen items-center justify-center bg-background px-4 text-on-surface">
<div className="w-full max-w-sm"> <div className="w-full max-w-sm">
<div className="mb-8 flex flex-col items-center gap-2 text-center"> <div className="mb-8 flex flex-col items-center gap-2 text-center">
<Headphones size={28} strokeWidth={2} className="text-emerald-400" /> <Headphones size={28} strokeWidth={2} className="text-primary" />
<h1 className="text-xl font-semibold tracking-tight">Stax</h1> <h1 className="text-xl font-semibold tracking-tight">Stax</h1>
<p className="text-sm text-neutral-400"> <p className="text-sm text-on-surface-variant">
{mode === 'login' ? 'Sign in to your account.' : 'Create an account.'} {mode === 'login' ? 'Sign in to your account.' : 'Create an account.'}
</p> </p>
</div> </div>
...@@ -78,14 +78,14 @@ export function Login() { ...@@ -78,14 +78,14 @@ export function Login() {
onChange={(e) => setPassword(e.target.value)} onChange={(e) => setPassword(e.target.value)}
aria-label="Password" aria-label="Password"
/> />
{error && <p className="text-sm text-red-400">{error}</p>} {error && <p className="text-sm text-error">{error}</p>}
<Button type="submit" disabled={busy || !username.trim() || !password} className="w-full"> <Button type="submit" disabled={busy || !username.trim() || !password} className="w-full">
{busy ? (mode === 'login' ? 'Signing in…' : 'Creating account…') : mode === 'login' ? 'Sign in' : 'Create account'} {busy ? (mode === 'login' ? 'Signing in…' : 'Creating account…') : mode === 'login' ? 'Sign in' : 'Create account'}
</Button> </Button>
<button <button
type="button" type="button"
onClick={toggleMode} onClick={toggleMode}
className="w-full text-center text-sm text-neutral-500 transition-colors hover:text-neutral-300" className="w-full text-center text-sm text-outline transition-colors hover:text-on-surface"
> >
{mode === 'login' ? "Don't have an account? Register" : 'Already have an account? Sign in'} {mode === 'login' ? "Don't have an account? Register" : 'Already have an account? Sign in'}
</button> </button>
......
import { useEffect, useRef, useState } from 'react' import { useEffect, useRef, useState } from 'react'
import { Check, ListMusic, MapPin, Music2, Pause, Play, Plus, ThumbsUp } from 'lucide-react' import { Check, ListMusic, MapPin, Music2, Pause, Play, Plus, ThumbsUp } from 'lucide-react'
import { Layout } from '../components/Layout'
import { Button } from '../components/ui/Button' import { Button } from '../components/ui/Button'
import { EmptyState } from '../components/ui/EmptyState' import { EmptyState } from '../components/ui/EmptyState'
import { SoundmarkMap } from '../components/SoundmarkMap' import { SoundmarkMap } from '../components/SoundmarkMap'
...@@ -178,24 +177,24 @@ export function Nearby() { ...@@ -178,24 +177,24 @@ export function Nearby() {
const topProposals = proposals.slice(0, 3) const topProposals = proposals.slice(0, 3)
return ( return (
<Layout title="Soundmarks"> <>
<p className="mb-6 text-sm leading-relaxed text-neutral-400"> <p className="mb-6 text-sm leading-relaxed text-on-surface-variant">
Find the anthem playing at this spot. Landmarks and businesses have a curated pick you can suggest Find the anthem playing at this spot. Landmarks and businesses have a curated pick you can suggest
changes to; community spots are fully driven by votes - whichever song has the most wins. changes to; community spots are fully driven by votes - whichever song has the most wins.
</p> </p>
{status === 'idle' && ( {status === 'idle' && (
<div className="flex flex-col items-center gap-4 rounded-xl border border-dashed border-neutral-700 p-10 text-center"> <div className="flex flex-col items-center gap-4 rounded-xl border border-dashed border-outline-variant p-10 text-center">
<MapPin size={28} strokeWidth={1.5} className="text-neutral-500" /> <MapPin size={28} strokeWidth={1.5} className="text-outline" />
<p className="text-sm text-neutral-400">Use your location to find soundmarks near you.</p> <p className="text-sm text-on-surface-variant">Use your location to find soundmarks near you.</p>
<Button onClick={start}>Find soundmarks near me</Button> <Button onClick={start}>Find soundmarks near me</Button>
</div> </div>
)} )}
{status === 'locating' && ( {status === 'locating' && (
<div className="flex flex-col items-center gap-3 py-16 text-neutral-500"> <div className="flex flex-col items-center gap-3 py-16 text-outline">
<span <span
className="h-6 w-6 animate-spin rounded-full border-2 border-neutral-700 border-t-emerald-400" className="h-6 w-6 animate-spin rounded-full border-2 border-outline-variant border-t-primary"
aria-hidden="true" aria-hidden="true"
/> />
<p className="text-sm">Getting your location…</p> <p className="text-sm">Getting your location…</p>
...@@ -203,8 +202,8 @@ export function Nearby() { ...@@ -203,8 +202,8 @@ export function Nearby() {
)} )}
{status === 'error' && ( {status === 'error' && (
<div className="rounded-xl border border-red-900/50 bg-neutral-900 p-4"> <div className="rounded-xl border border-error/30 bg-surface-container p-4">
<p className="text-sm text-red-400">{error}</p> <p className="text-sm text-error">{error}</p>
<Button variant="secondary" size="sm" onClick={start} className="mt-3"> <Button variant="secondary" size="sm" onClick={start} className="mt-3">
Try again Try again
</Button> </Button>
...@@ -222,11 +221,11 @@ export function Nearby() { ...@@ -222,11 +221,11 @@ export function Nearby() {
)} )}
{status === 'ready' && closest && ( {status === 'ready' && closest && (
<div className="rounded-xl border border-neutral-800 bg-neutral-900 p-3"> <div className="rounded-xl border border-outline-variant bg-surface-container p-3">
<p className="mb-2 flex items-center gap-1.5 px-1 text-xs font-medium uppercase tracking-wide text-emerald-400"> <p className="mb-2 flex items-center gap-1.5 px-1 text-xs font-medium uppercase tracking-wide text-primary">
<MapPin size={12} strokeWidth={2.5} /> <MapPin size={12} strokeWidth={2.5} />
{closest.name} {closest.name}
<span className="ml-auto rounded-full bg-neutral-800 px-2 py-0.5 text-[10px] font-medium normal-case tracking-normal text-neutral-400"> <span className="ml-auto rounded-full bg-surface-container-high px-2 py-0.5 text-[10px] font-medium normal-case tracking-normal text-on-surface-variant">
{TIER_LABEL[closest.tier]} {TIER_LABEL[closest.tier]}
</span> </span>
</p> </p>
...@@ -236,22 +235,22 @@ export function Nearby() { ...@@ -236,22 +235,22 @@ export function Nearby() {
onClick={() => toggle(active)} onClick={() => toggle(active)}
disabled={isCurrent && streamLoading} disabled={isCurrent && streamLoading}
aria-label={isCurrent && isPlaying ? 'Pause' : 'Play'} aria-label={isCurrent && isPlaying ? 'Pause' : 'Play'}
className="flex w-full items-center gap-4 rounded-lg p-1 text-left transition-colors hover:bg-white/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400 disabled:cursor-not-allowed" className="flex w-full items-center gap-4 rounded-lg p-1 text-left transition-colors hover:bg-surface-container focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary disabled:cursor-not-allowed"
> >
{active.coverart ? ( {active.coverart ? (
<img src={active.coverart} alt="" className="h-16 w-16 shrink-0 rounded-lg object-cover" /> <img src={active.coverart} alt="" className="h-16 w-16 shrink-0 rounded-lg object-cover" />
) : ( ) : (
<div className="flex h-16 w-16 shrink-0 items-center justify-center rounded-lg bg-neutral-800 text-neutral-600"> <div className="flex h-16 w-16 shrink-0 items-center justify-center rounded-lg bg-surface-container-high text-on-surface-variant">
<Music2 size={20} strokeWidth={1.75} /> <Music2 size={20} strokeWidth={1.75} />
</div> </div>
)} )}
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<p className="truncate font-semibold text-white">{active.title}</p> <p className="truncate font-semibold text-on-surface">{active.title}</p>
<p className="truncate text-sm text-neutral-400">{active.artist}</p> <p className="truncate text-sm text-on-surface-variant">{active.artist}</p>
</div> </div>
<span className="flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-neutral-800 text-white"> <span className="flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-surface-container-high text-on-surface">
{isCurrent && streamLoading ? ( {isCurrent && streamLoading ? (
<span className="h-3.5 w-3.5 animate-spin rounded-full border-2 border-neutral-600 border-t-white" /> <span className="h-3.5 w-3.5 animate-spin rounded-full border-2 border-on-surface-variant/30 border-t-on-surface" />
) : isCurrent && isPlaying ? ( ) : isCurrent && isPlaying ? (
<Pause size={16} strokeWidth={2} fill="currentColor" /> <Pause size={16} strokeWidth={2} fill="currentColor" />
) : ( ) : (
...@@ -261,28 +260,28 @@ export function Nearby() { ...@@ -261,28 +260,28 @@ export function Nearby() {
</button> </button>
) : ( ) : (
<div className="flex items-center gap-4 rounded-lg p-1"> <div className="flex items-center gap-4 rounded-lg p-1">
<div className="flex h-16 w-16 shrink-0 items-center justify-center rounded-lg bg-neutral-800 text-neutral-600"> <div className="flex h-16 w-16 shrink-0 items-center justify-center rounded-lg bg-surface-container-high text-on-surface-variant">
<Music2 size={20} strokeWidth={1.75} /> <Music2 size={20} strokeWidth={1.75} />
</div> </div>
<p className="text-sm text-neutral-400"> <p className="text-sm text-on-surface-variant">
{isCommunity ? 'No anthem here yet - propose one below.' : 'No anthem set here yet.'} {isCommunity ? 'No anthem here yet - propose one below.' : 'No anthem set here yet.'}
</p> </p>
</div> </div>
)} )}
{closest.description && <p className="mt-3 px-1 text-sm text-neutral-400">{closest.description}</p>} {closest.description && <p className="mt-3 px-1 text-sm text-on-surface-variant">{closest.description}</p>}
{closest.tier === 'business' && closest.playlist.length > 1 && ( {closest.tier === 'business' && closest.playlist.length > 1 && (
<div className="mt-4 border-t border-neutral-800 pt-3"> <div className="mt-4 border-t border-outline-variant pt-3">
<p className="mb-2 flex items-center gap-1.5 px-1 text-xs font-medium uppercase tracking-wide text-neutral-500"> <p className="mb-2 flex items-center gap-1.5 px-1 text-xs font-medium uppercase tracking-wide text-outline">
<ListMusic size={12} strokeWidth={2.5} /> <ListMusic size={12} strokeWidth={2.5} />
Playlist Playlist
</p> </p>
<ul className="divide-y divide-neutral-800/60"> <ul className="divide-y divide-outline-variant/60">
{closest.playlist.map((track) => ( {closest.playlist.map((track) => (
<li key={track.id} className="flex items-center gap-3 px-1 py-2"> <li key={track.id} className="flex items-center gap-3 px-1 py-2">
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<p className="truncate text-sm font-medium text-white">{track.title}</p> <p className="truncate text-sm font-medium text-on-surface">{track.title}</p>
<p className="truncate text-xs text-neutral-500">{track.artist}</p> <p className="truncate text-xs text-outline">{track.artist}</p>
</div> </div>
</li> </li>
))} ))}
...@@ -290,15 +289,15 @@ export function Nearby() { ...@@ -290,15 +289,15 @@ export function Nearby() {
</div> </div>
)} )}
<div className="mt-4 border-t border-neutral-800 pt-3"> <div className="mt-4 border-t border-outline-variant pt-3">
{isCommunity ? ( {isCommunity ? (
<> <>
<div className="mb-2 flex items-center justify-between px-1"> <div className="mb-2 flex items-center justify-between px-1">
<p className="text-xs font-medium uppercase tracking-wide text-neutral-500">Top proposals</p> <p className="text-xs font-medium uppercase tracking-wide text-outline">Top proposals</p>
<button <button
onClick={() => setShowSongPicker(true)} onClick={() => setShowSongPicker(true)}
disabled={votingKey === 'propose'} disabled={votingKey === 'propose'}
className="flex items-center gap-1 text-xs font-medium text-emerald-400 transition-colors hover:text-emerald-300 disabled:opacity-50" className="flex items-center gap-1 text-xs font-medium text-primary transition-colors hover:text-primary disabled:opacity-50"
> >
<Plus size={13} strokeWidth={2.5} /> <Plus size={13} strokeWidth={2.5} />
Propose a song Propose a song
...@@ -306,11 +305,11 @@ export function Nearby() { ...@@ -306,11 +305,11 @@ export function Nearby() {
</div> </div>
{topProposals.length === 0 ? ( {topProposals.length === 0 ? (
<p className="px-1 text-sm text-neutral-500"> <p className="px-1 text-sm text-outline">
No proposals yet - be the first to suggest a song for this spot. No proposals yet - be the first to suggest a song for this spot.
</p> </p>
) : ( ) : (
<ul className="divide-y divide-neutral-800/60"> <ul className="divide-y divide-outline-variant/60">
{topProposals.map((proposal) => ( {topProposals.map((proposal) => (
<li key={proposal.id} className="flex items-center gap-3 py-2"> <li key={proposal.id} className="flex items-center gap-3 py-2">
<button <button
...@@ -322,19 +321,19 @@ export function Nearby() { ...@@ -322,19 +321,19 @@ export function Nearby() {
? `Remove your vote for ${proposal.song?.title}` ? `Remove your vote for ${proposal.song?.title}`
: `Vote for ${proposal.song?.title}` : `Vote for ${proposal.song?.title}`
} }
className={`flex h-8 w-8 shrink-0 items-center justify-center rounded-full border transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400 disabled:opacity-50 ${ className={`flex h-8 w-8 shrink-0 items-center justify-center rounded-full border transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary disabled:opacity-50 ${
proposal.has_voted proposal.has_voted
? 'border-emerald-400 bg-emerald-400/10 text-emerald-400' ? 'border-primary bg-primary/10 text-primary'
: 'border-neutral-700 text-neutral-400 hover:text-white' : 'border-outline-variant text-on-surface-variant hover:text-on-surface'
}`} }`}
> >
<ThumbsUp size={13} strokeWidth={2} fill={proposal.has_voted ? 'currentColor' : 'none'} /> <ThumbsUp size={13} strokeWidth={2} fill={proposal.has_voted ? 'currentColor' : 'none'} />
</button> </button>
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<p className="truncate text-sm font-medium text-white">{proposal.song?.title}</p> <p className="truncate text-sm font-medium text-on-surface">{proposal.song?.title}</p>
<p className="truncate text-xs text-neutral-500">{proposal.song?.artist}</p> <p className="truncate text-xs text-outline">{proposal.song?.artist}</p>
</div> </div>
<span className="shrink-0 text-xs font-medium text-neutral-400"> <span className="shrink-0 text-xs font-medium text-on-surface-variant">
{proposal.vote_count} {proposal.vote_count === 1 ? 'vote' : 'votes'} {proposal.vote_count} {proposal.vote_count === 1 ? 'vote' : 'votes'}
</span> </span>
</li> </li>
...@@ -344,11 +343,11 @@ export function Nearby() { ...@@ -344,11 +343,11 @@ export function Nearby() {
</> </>
) : ( ) : (
<div className="flex items-center justify-between px-1"> <div className="flex items-center justify-between px-1">
<p className="text-xs text-neutral-500"> <p className="text-xs text-outline">
Suggestions here go to {closest.tier === 'major' ? "Stax's" : "the owner's"} review queue. Suggestions here go to {closest.tier === 'major' ? "Stax's" : "the owner's"} review queue.
</p> </p>
{suggestionSent ? ( {suggestionSent ? (
<span className="flex items-center gap-1 text-xs font-medium text-emerald-400"> <span className="flex items-center gap-1 text-xs font-medium text-primary">
<Check size={13} strokeWidth={2.5} /> <Check size={13} strokeWidth={2.5} />
Suggested Suggested
</span> </span>
...@@ -356,7 +355,7 @@ export function Nearby() { ...@@ -356,7 +355,7 @@ export function Nearby() {
<button <button
onClick={() => setShowSongPicker(true)} onClick={() => setShowSongPicker(true)}
disabled={votingKey === 'propose'} disabled={votingKey === 'propose'}
className="flex shrink-0 items-center gap-1 text-xs font-medium text-emerald-400 transition-colors hover:text-emerald-300 disabled:opacity-50" className="flex shrink-0 items-center gap-1 text-xs font-medium text-primary transition-colors hover:text-primary disabled:opacity-50"
> >
<Plus size={13} strokeWidth={2.5} /> <Plus size={13} strokeWidth={2.5} />
Suggest a song Suggest a song
...@@ -369,6 +368,6 @@ export function Nearby() { ...@@ -369,6 +368,6 @@ export function Nearby() {
)} )}
{showSongPicker && <SongPicker onClose={() => setShowSongPicker(false)} onSelect={handleSongPicked} />} {showSongPicker && <SongPicker onClose={() => setShowSongPicker(false)} onSelect={handleSongPicked} />}
</Layout> </>
) )
} }
...@@ -81,24 +81,24 @@ export function Playlists() { ...@@ -81,24 +81,24 @@ export function Playlists() {
<Layout title={selected.name}> <Layout title={selected.name}>
<button <button
onClick={() => setSelected(null)} onClick={() => setSelected(null)}
className="mb-4 flex items-center gap-1.5 text-sm text-neutral-400 transition-colors hover:text-white" className="mb-4 flex items-center gap-1.5 text-sm text-on-surface-variant transition-colors hover:text-on-surface"
> >
<ArrowLeft size={16} strokeWidth={2} /> <ArrowLeft size={16} strokeWidth={2} />
Playlists Playlists
</button> </button>
{detailLoading && ( {detailLoading && (
<div className="divide-y divide-neutral-800/80"> <div className="divide-y divide-outline-variant/80">
<SkeletonRow /> <SkeletonRow />
<SkeletonRow /> <SkeletonRow />
</div> </div>
)} )}
{detailError && <p className="text-sm text-red-400">{detailError}</p>} {detailError && <p className="text-sm text-error">{detailError}</p>}
{!detailLoading && !detailError && tracks.length === 0 && ( {!detailLoading && !detailError && tracks.length === 0 && (
<EmptyState icon={Music2} message="No songs in this playlist yet - add some from your Library." /> <EmptyState icon={Music2} message="No songs in this playlist yet - add some from your Library." />
)} )}
<ul className="divide-y divide-neutral-800/80"> <ul className="divide-y divide-outline-variant/80">
{tracks.map((song) => { {tracks.map((song) => {
const isCurrent = currentSong?.id === song.id const isCurrent = currentSong?.id === song.id
return ( return (
...@@ -107,25 +107,25 @@ export function Playlists() { ...@@ -107,25 +107,25 @@ export function Playlists() {
onClick={() => toggle(toPlayable(song), tracks.map(toPlayable))} onClick={() => toggle(toPlayable(song), tracks.map(toPlayable))}
disabled={isCurrent && streamLoading} disabled={isCurrent && streamLoading}
aria-label={isCurrent && isPlaying ? 'Pause' : 'Play'} aria-label={isCurrent && isPlaying ? 'Pause' : 'Play'}
className="-mx-2 flex w-full items-center gap-4 rounded-lg px-2 py-3 text-left transition-colors hover:bg-white/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400 disabled:cursor-not-allowed" className="-mx-2 flex w-full items-center gap-4 rounded-lg px-2 py-3 text-left transition-colors hover:bg-surface-container focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary disabled:cursor-not-allowed"
> >
{song.coverart ? ( {song.coverart ? (
<img src={song.coverart} alt="" className="h-12 w-12 shrink-0 rounded-md object-cover" /> <img src={song.coverart} alt="" className="h-12 w-12 shrink-0 rounded-md object-cover" />
) : ( ) : (
<div className="flex h-12 w-12 shrink-0 items-center justify-center rounded-md bg-neutral-800 text-neutral-600"> <div className="flex h-12 w-12 shrink-0 items-center justify-center rounded-md bg-surface-container-high text-on-surface-variant">
<Music2 size={18} strokeWidth={1.75} /> <Music2 size={18} strokeWidth={1.75} />
</div> </div>
)} )}
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<p className="truncate font-medium text-white">{song.title}</p> <p className="truncate font-medium text-on-surface">{song.title}</p>
<p className="truncate text-sm text-neutral-400"> <p className="truncate text-sm text-on-surface-variant">
{song.artist} {song.artist}
{song.album ? ` · ${song.album}` : ''} {song.album ? ` · ${song.album}` : ''}
</p> </p>
</div> </div>
<span className="flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-neutral-800 text-white"> <span className="flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-surface-container-high text-on-surface">
{isCurrent && streamLoading ? ( {isCurrent && streamLoading ? (
<span className="h-3.5 w-3.5 animate-spin rounded-full border-2 border-neutral-600 border-t-white" /> <span className="h-3.5 w-3.5 animate-spin rounded-full border-2 border-on-surface-variant/30 border-t-on-surface" />
) : isCurrent && isPlaying ? ( ) : isCurrent && isPlaying ? (
<Pause size={16} strokeWidth={2} fill="currentColor" /> <Pause size={16} strokeWidth={2} fill="currentColor" />
) : ( ) : (
...@@ -144,7 +144,7 @@ export function Playlists() { ...@@ -144,7 +144,7 @@ export function Playlists() {
return ( return (
<Layout title="Playlists"> <Layout title="Playlists">
<div className="mb-4 flex items-center justify-between gap-3"> <div className="mb-4 flex items-center justify-between gap-3">
<p className="text-sm text-neutral-500">Your own playlists, built from songs in your library.</p> <p className="text-sm text-outline">Your own playlists, built from songs in your library.</p>
{!creating && ( {!creating && (
<Button size="sm" onClick={() => setCreating(true)}> <Button size="sm" onClick={() => setCreating(true)}>
<Plus size={16} strokeWidth={2} /> <Plus size={16} strokeWidth={2} />
...@@ -163,7 +163,7 @@ export function Playlists() { ...@@ -163,7 +163,7 @@ export function Playlists() {
autoFocus autoFocus
aria-label="Playlist name" aria-label="Playlist name"
/> />
{createError && <p className="mt-1.5 text-sm text-red-400">{createError}</p>} {createError && <p className="mt-1.5 text-sm text-error">{createError}</p>}
</div> </div>
<Button type="submit" size="sm" disabled={createBusy || !newName.trim()}> <Button type="submit" size="sm" disabled={createBusy || !newName.trim()}>
{createBusy ? 'Creating…' : 'Create'} {createBusy ? 'Creating…' : 'Create'}
...@@ -184,29 +184,29 @@ export function Playlists() { ...@@ -184,29 +184,29 @@ export function Playlists() {
)} )}
{loading && ( {loading && (
<div className="divide-y divide-neutral-800/80"> <div className="divide-y divide-outline-variant/80">
<SkeletonRow /> <SkeletonRow />
<SkeletonRow /> <SkeletonRow />
</div> </div>
)} )}
{error && <p className="text-sm text-red-400">{error}</p>} {error && <p className="text-sm text-error">{error}</p>}
{!loading && !error && playlists.length === 0 && ( {!loading && !error && playlists.length === 0 && (
<EmptyState icon={ListMusic} message="No playlists yet - create one to start collecting songs." /> <EmptyState icon={ListMusic} message="No playlists yet - create one to start collecting songs." />
)} )}
<ul className="divide-y divide-neutral-800/80"> <ul className="divide-y divide-outline-variant/80">
{playlists.map((playlist) => ( {playlists.map((playlist) => (
<li key={playlist.id}> <li key={playlist.id}>
<button <button
onClick={() => openPlaylist(playlist)} onClick={() => openPlaylist(playlist)}
className="-mx-2 flex w-full items-center gap-4 rounded-lg px-2 py-3 text-left transition-colors hover:bg-white/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400" className="-mx-2 flex w-full items-center gap-4 rounded-lg px-2 py-3 text-left transition-colors hover:bg-surface-container focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"
> >
<div className="flex h-12 w-12 shrink-0 items-center justify-center rounded-md bg-neutral-800 text-neutral-600"> <div className="flex h-12 w-12 shrink-0 items-center justify-center rounded-md bg-surface-container-high text-on-surface-variant">
<ListMusic size={18} strokeWidth={1.75} /> <ListMusic size={18} strokeWidth={1.75} />
</div> </div>
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<p className="truncate font-medium text-white">{playlist.name}</p> <p className="truncate font-medium text-on-surface">{playlist.name}</p>
<p className="truncate text-sm text-neutral-400"> <p className="truncate text-sm text-on-surface-variant">
Created {new Date(playlist.created_at).toLocaleDateString()} Created {new Date(playlist.created_at).toLocaleDateString()}
</p> </p>
</div> </div>
......
import { useEffect, useState } from 'react' import { useEffect, useState } from 'react'
import { ArrowLeft, Disc3, Music2, Pause, Play, Plus, Shuffle } from 'lucide-react' import { ArrowLeft, Disc3, Music2, Pause, Play, Plus, Shuffle } from 'lucide-react'
import { Layout } from '../components/Layout'
import { Button } from '../components/ui/Button' import { Button } from '../components/ui/Button'
import { Input } from '../components/ui/Input' import { Input } from '../components/ui/Input'
import { EmptyState } from '../components/ui/EmptyState' import { EmptyState } from '../components/ui/EmptyState'
...@@ -33,10 +32,10 @@ function PlayButton({ post }: { post: Post }) { ...@@ -33,10 +32,10 @@ function PlayButton({ post }: { post: Post }) {
onClick={() => toggle(active)} onClick={() => toggle(active)}
disabled={isCurrent && streamLoading} disabled={isCurrent && streamLoading}
aria-label={isCurrent && isPlaying ? 'Pause' : 'Play'} aria-label={isCurrent && isPlaying ? 'Pause' : 'Play'}
className="flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-neutral-800 text-white transition-colors hover:bg-neutral-700 disabled:cursor-not-allowed" className="flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-surface-container-high text-on-surface transition-colors hover:bg-surface-bright disabled:cursor-not-allowed"
> >
{isCurrent && streamLoading ? ( {isCurrent && streamLoading ? (
<span className="h-3.5 w-3.5 animate-spin rounded-full border-2 border-neutral-600 border-t-white" /> <span className="h-3.5 w-3.5 animate-spin rounded-full border-2 border-on-surface-variant/30 border-t-on-surface" />
) : isCurrent && isPlaying ? ( ) : isCurrent && isPlaying ? (
<Pause size={15} strokeWidth={2} fill="currentColor" /> <Pause size={15} strokeWidth={2} fill="currentColor" />
) : ( ) : (
...@@ -52,15 +51,15 @@ function PostRow({ post, onOpen }: { post: Post; onOpen?: () => void }) { ...@@ -52,15 +51,15 @@ function PostRow({ post, onOpen }: { post: Post; onOpen?: () => void }) {
{post.song?.coverart ? ( {post.song?.coverart ? (
<img src={post.song.coverart} alt="" className="h-12 w-12 shrink-0 rounded-lg object-cover" /> <img src={post.song.coverart} alt="" className="h-12 w-12 shrink-0 rounded-lg object-cover" />
) : ( ) : (
<div className="flex h-12 w-12 shrink-0 items-center justify-center rounded-lg bg-neutral-800 text-neutral-600"> <div className="flex h-12 w-12 shrink-0 items-center justify-center rounded-lg bg-surface-container-high text-on-surface-variant">
<Music2 size={18} strokeWidth={1.75} /> <Music2 size={18} strokeWidth={1.75} />
</div> </div>
)} )}
<button onClick={onOpen} disabled={!onOpen} className="min-w-0 flex-1 text-left disabled:cursor-default"> <button onClick={onOpen} disabled={!onOpen} className="min-w-0 flex-1 text-left disabled:cursor-default">
<p className="truncate text-sm font-medium text-white">{post.song?.title ?? 'Unknown song'}</p> <p className="truncate text-sm font-medium text-on-surface">{post.song?.title ?? 'Unknown song'}</p>
<p className="truncate text-xs text-neutral-400">{post.song?.artist}</p> <p className="truncate text-xs text-on-surface-variant">{post.song?.artist}</p>
{post.caption && <p className="mt-0.5 truncate text-xs text-neutral-500">"{post.caption}"</p>} {post.caption && <p className="mt-0.5 truncate text-xs text-outline">"{post.caption}"</p>}
<p className="mt-0.5 text-xs text-neutral-600"> <p className="mt-0.5 text-xs text-on-surface-variant">
{post.username ?? `user #${post.user_id}`} {post.username ?? `user #${post.user_id}`}
{post.remix_count !== undefined && post.remix_count > 0 && ` · ${post.remix_count} remix${post.remix_count === 1 ? '' : 'es'}`} {post.remix_count !== undefined && post.remix_count > 0 && ` · ${post.remix_count} remix${post.remix_count === 1 ? '' : 'es'}`}
</p> </p>
...@@ -73,18 +72,18 @@ function PostRow({ post, onOpen }: { post: Post; onOpen?: () => void }) { ...@@ -73,18 +72,18 @@ function PostRow({ post, onOpen }: { post: Post; onOpen?: () => void }) {
function RemixTreeNode({ node, depth, onRemix }: { node: PostTree; depth: number; onRemix: (post: Post) => void }) { function RemixTreeNode({ node, depth, onRemix }: { node: PostTree; depth: number; onRemix: (post: Post) => void }) {
return ( return (
<li> <li>
<div className="rounded-xl border border-neutral-800 bg-neutral-900 p-2"> <div className="rounded-xl border border-outline-variant bg-surface-container p-2">
<PostRow post={node.post} /> <PostRow post={node.post} />
<button <button
onClick={() => onRemix(node.post)} onClick={() => onRemix(node.post)}
className="ml-1 flex items-center gap-1 text-xs font-medium text-emerald-400 transition-colors hover:text-emerald-300" className="ml-1 flex items-center gap-1 text-xs font-medium text-primary transition-colors hover:text-primary"
> >
<Shuffle size={12} strokeWidth={2.5} /> <Shuffle size={12} strokeWidth={2.5} />
Remix this Remix this
</button> </button>
</div> </div>
{node.children.length > 0 && ( {node.children.length > 0 && (
<ul className="mt-2 space-y-2 border-l border-neutral-800 pl-4" style={{ marginLeft: depth === 0 ? 8 : 0 }}> <ul className="mt-2 space-y-2 border-l border-outline-variant pl-4" style={{ marginLeft: depth === 0 ? 8 : 0 }}>
{node.children.map((child) => ( {node.children.map((child) => (
<RemixTreeNode key={child.post.id} node={child} depth={depth + 1} onRemix={onRemix} /> <RemixTreeNode key={child.post.id} node={child} depth={depth + 1} onRemix={onRemix} />
))} ))}
...@@ -161,13 +160,13 @@ export function Posts() { ...@@ -161,13 +160,13 @@ export function Posts() {
if (openPostId !== null) { if (openPostId !== null) {
return ( return (
<Layout title="Post"> <>
<button <button
onClick={() => { onClick={() => {
setOpenPostId(null) setOpenPostId(null)
setTree(null) setTree(null)
}} }}
className="mb-4 flex items-center gap-1.5 text-sm text-neutral-400 transition-colors hover:text-white" className="mb-4 flex items-center gap-1.5 text-sm text-on-surface-variant transition-colors hover:text-on-surface"
> >
<ArrowLeft size={16} strokeWidth={2} /> <ArrowLeft size={16} strokeWidth={2} />
Back to feed Back to feed
...@@ -179,7 +178,7 @@ export function Posts() { ...@@ -179,7 +178,7 @@ export function Posts() {
<SkeletonRow /> <SkeletonRow />
</div> </div>
)} )}
{error && <p className="mb-4 text-sm text-red-400">{error}</p>} {error && <p className="mb-4 text-sm text-error">{error}</p>}
{tree && ( {tree && (
<ul className="space-y-2"> <ul className="space-y-2">
<RemixTreeNode node={tree} depth={0} onRemix={setRemixTarget} /> <RemixTreeNode node={tree} depth={0} onRemix={setRemixTarget} />
...@@ -187,28 +186,28 @@ export function Posts() { ...@@ -187,28 +186,28 @@ export function Posts() {
)} )}
{remixTarget && <SongPicker onClose={() => setRemixTarget(null)} onSelect={handleRemixPick} />} {remixTarget && <SongPicker onClose={() => setRemixTarget(null)} onSelect={handleRemixPick} />}
</Layout> </>
) )
} }
return ( return (
<Layout title="Posts"> <>
<p className="mb-6 text-sm leading-relaxed text-neutral-400"> <p className="mb-6 text-sm leading-relaxed text-on-surface-variant">
Post a song, and let others remix it into their own pick - each reply forms a branch, so a post Post a song, and let others remix it into their own pick - each reply forms a branch, so a post
grows into a whole tree of takes on the same idea. grows into a whole tree of takes on the same idea.
</p> </p>
<div className="mb-6 rounded-xl border border-neutral-800 bg-neutral-900 p-3"> <div className="mb-6 rounded-xl border border-outline-variant bg-surface-container p-3">
{pendingSong ? ( {pendingSong ? (
<div className="mb-3 flex items-center gap-3 rounded-lg bg-neutral-800/60 p-2"> <div className="mb-3 flex items-center gap-3 rounded-lg bg-surface-container-high/60 p-2">
<Disc3 size={18} strokeWidth={1.75} className="shrink-0 text-neutral-500" /> <Disc3 size={18} strokeWidth={1.75} className="shrink-0 text-outline" />
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<p className="truncate text-sm font-medium text-white">{pendingSong.title}</p> <p className="truncate text-sm font-medium text-on-surface">{pendingSong.title}</p>
<p className="truncate text-xs text-neutral-400">{pendingSong.artist}</p> <p className="truncate text-xs text-on-surface-variant">{pendingSong.artist}</p>
</div> </div>
<button <button
onClick={() => setPendingSong(null)} onClick={() => setPendingSong(null)}
className="shrink-0 text-xs text-neutral-500 hover:text-white" className="shrink-0 text-xs text-outline hover:text-on-surface"
> >
Change Change
</button> </button>
...@@ -230,10 +229,10 @@ export function Posts() { ...@@ -230,10 +229,10 @@ export function Posts() {
</Button> </Button>
</div> </div>
{error && <p className="mb-4 text-sm text-red-400">{error}</p>} {error && <p className="mb-4 text-sm text-error">{error}</p>}
{loading && ( {loading && (
<div className="divide-y divide-neutral-800/80"> <div className="divide-y divide-outline-variant/80">
<SkeletonRow /> <SkeletonRow />
<SkeletonRow /> <SkeletonRow />
</div> </div>
...@@ -244,13 +243,13 @@ export function Posts() { ...@@ -244,13 +243,13 @@ export function Posts() {
<ul className="space-y-2"> <ul className="space-y-2">
{posts.map((post) => ( {posts.map((post) => (
<li key={post.id} className="rounded-xl border border-neutral-800 bg-neutral-900 p-2"> <li key={post.id} className="rounded-xl border border-outline-variant bg-surface-container p-2">
<PostRow post={post} onOpen={() => openTree(post.id)} /> <PostRow post={post} onOpen={() => openTree(post.id)} />
</li> </li>
))} ))}
</ul> </ul>
{showSongPicker && <SongPicker onClose={() => setShowSongPicker(false)} onSelect={handlePickSongForNewPost} />} {showSongPicker && <SongPicker onClose={() => setShowSongPicker(false)} onSelect={handlePickSongForNewPost} />}
</Layout> </>
) )
} }
...@@ -58,7 +58,7 @@ export function Remix() { ...@@ -58,7 +58,7 @@ export function Remix() {
return ( return (
<Layout title="AI Remix"> <Layout title="AI Remix">
<p className="mb-6 text-sm leading-relaxed text-neutral-400"> <p className="mb-6 text-sm leading-relaxed text-on-surface-variant">
Pick 1-5 songs from your library and describe the remix in plain language. Gemini directs the Pick 1-5 songs from your library and describe the remix in plain language. Gemini directs the
arrangement using each song's real audio and already-known title/artist/genre, Demucs does the arrangement using each song's real audio and already-known title/artist/genre, Demucs does the
stem separation. stem separation.
...@@ -68,10 +68,10 @@ export function Remix() { ...@@ -68,10 +68,10 @@ export function Remix() {
<button <button
type="button" type="button"
onClick={() => setPickerOpen(true)} onClick={() => setPickerOpen(true)}
className="flex w-full cursor-pointer flex-col items-center gap-2 rounded-xl border border-dashed border-neutral-700 p-6 text-center transition-colors duration-150 hover:border-neutral-600 hover:bg-neutral-900/50" className="flex w-full cursor-pointer flex-col items-center gap-2 rounded-xl border border-dashed border-outline-variant p-6 text-center transition-colors duration-150 hover:border-outline-variant hover:bg-surface-container/50"
> >
<ListMusic size={22} strokeWidth={1.5} className="text-neutral-500" /> <ListMusic size={22} strokeWidth={1.5} className="text-outline" />
<span className="text-sm text-neutral-400">Choose up to 5 songs from your library</span> <span className="text-sm text-on-surface-variant">Choose up to 5 songs from your library</span>
</button> </button>
{selectedSongs.length > 0 && ( {selectedSongs.length > 0 && (
...@@ -79,19 +79,19 @@ export function Remix() { ...@@ -79,19 +79,19 @@ export function Remix() {
{selectedSongs.map((song) => ( {selectedSongs.map((song) => (
<li <li
key={song.id} key={song.id}
className="flex items-center justify-between gap-2 rounded-lg bg-neutral-900 px-3 py-2 text-sm text-neutral-300" className="flex items-center justify-between gap-2 rounded-lg bg-surface-container px-3 py-2 text-sm text-on-surface"
> >
<span className="flex min-w-0 items-center gap-2"> <span className="flex min-w-0 items-center gap-2">
<Music2 size={14} strokeWidth={1.75} className="shrink-0 text-neutral-500" /> <Music2 size={14} strokeWidth={1.75} className="shrink-0 text-outline" />
<span className="truncate"> <span className="truncate">
{song.title} <span className="text-neutral-500">· {song.artist}</span> {song.title} <span className="text-outline">· {song.artist}</span>
</span> </span>
</span> </span>
<button <button
type="button" type="button"
onClick={() => removeSong(song.id)} onClick={() => removeSong(song.id)}
aria-label={`Remove ${song.title}`} aria-label={`Remove ${song.title}`}
className="ml-2 flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-neutral-500 hover:bg-neutral-800 hover:text-white" className="ml-2 flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-outline hover:bg-surface-container-high hover:text-on-surface"
> >
<X size={14} strokeWidth={2} /> <X size={14} strokeWidth={2} />
</button> </button>
...@@ -118,34 +118,34 @@ export function Remix() { ...@@ -118,34 +118,34 @@ export function Remix() {
)} )}
{submitting && !status && ( {submitting && !status && (
<p className="mt-4 flex items-center gap-2 text-sm text-neutral-400"> <p className="mt-4 flex items-center gap-2 text-sm text-on-surface-variant">
<span className="h-3.5 w-3.5 animate-spin rounded-full border-2 border-neutral-700 border-t-neutral-300" /> <span className="h-3.5 w-3.5 animate-spin rounded-full border-2 border-outline-variant border-t-on-surface" />
Starting… Starting…
</p> </p>
)} )}
{error && ( {error && (
<p className="mt-4 flex items-center gap-1.5 text-sm text-red-400"> <p className="mt-4 flex items-center gap-1.5 text-sm text-error">
<AlertCircle size={14} strokeWidth={2} /> <AlertCircle size={14} strokeWidth={2} />
{error} {error}
</p> </p>
)} )}
{status && ( {status && (
<div className="mt-6 rounded-xl border border-neutral-800 bg-neutral-900 p-4"> <div className="mt-6 rounded-xl border border-outline-variant bg-surface-container p-4">
<div className="mb-3 flex gap-1"> <div className="mb-3 flex gap-1">
{STAGES.slice(0, -1).map((stage, i) => ( {STAGES.slice(0, -1).map((stage, i) => (
<div <div
key={stage} key={stage}
className={`h-1.5 flex-1 rounded-full transition-colors duration-300 ${i <= stageIndex ? 'bg-emerald-500' : 'bg-neutral-800'}`} className={`h-1.5 flex-1 rounded-full transition-colors duration-300 ${i <= stageIndex ? 'bg-primary' : 'bg-surface-container-high'}`}
/> />
))} ))}
</div> </div>
<p className="text-sm text-neutral-300"> <p className="text-sm text-on-surface">
{status.status === 'error' ? `Error: ${status.error}` : status.stage_detail ?? status.status} {status.status === 'error' ? `Error: ${status.error}` : status.stage_detail ?? status.status}
</p> </p>
{status.status === 'done' && status.library_song_id && ( {status.status === 'done' && status.library_song_id && (
<p className="mt-2 flex items-center gap-1.5 text-sm text-emerald-400"> <p className="mt-2 flex items-center gap-1.5 text-sm text-primary">
<Check size={14} strokeWidth={2} /> <Check size={14} strokeWidth={2} />
"{status.remix_name}" added to your library -{' '} "{status.remix_name}" added to your library -{' '}
<Link to="/library" className="underline hover:no-underline"> <Link to="/library" className="underline hover:no-underline">
......
...@@ -141,6 +141,15 @@ const BACKEND_TODO: WorkItem[] = [ ...@@ -141,6 +141,15 @@ const BACKEND_TODO: WorkItem[] = [
// --- Frontend --- // --- Frontend ---
const FRONTEND_DONE: DoneGroup[] = [ const FRONTEND_DONE: DoneGroup[] = [
{
area: 'Design System',
items: [
'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',
'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',
'Every page rebuilt from its matching Stitch screen where one existed (Library, Discovery, Remix, Rooms, Channels, Upload, Business/Admin panels, Now Playing); Login, Playlists, and Telegram linking - which had no Stitch mockup - were designed from scratch to match the same system',
],
},
{ {
area: 'Auth', area: 'Auth',
items: [ items: [
...@@ -153,14 +162,21 @@ const FRONTEND_DONE: DoneGroup[] = [ ...@@ -153,14 +162,21 @@ const FRONTEND_DONE: DoneGroup[] = [
{ {
area: 'Soundmarks', area: 'Soundmarks',
items: [ items: [
'Nearby page: dark-themed map, tier-aware display, proposals + voting UI', 'Merged with Live Location under one nav destination (2026-08-23) - Map (curated/voted anthem tied to a fixed place) and Live (broadcast of wherever someone currently is) are related but distinct concepts, now reached via an in-page tab switcher instead of two separate top-level tabs',
'Map tab: dark-themed map, tier-aware display, proposals + voting UI',
'Live tab: share toggle, live nearby list, cross-account playback, geo-playlist shuffle-play',
"Admin location picker: locate-me button on the map itself - drops the pin at the browser's location and reverse-geocodes it into the address field, still fully correctable by search/click/drag afterward", "Admin location picker: locate-me button on the map itself - drops the pin at the browser's location and reverse-geocodes it into the address field, still fully correctable by search/click/drag afterward",
], ],
}, },
{ area: 'Rooms', items: ['RoomView: chat, reactions, DJ song picker, pass-the-aux controls, now-playing card'] }, {
{ area: 'Channels', items: ['List + follow/unfollow UI only - vibe sets/stories/showcase have no UI yet'] }, area: 'Social',
{ area: 'Posts', items: ['Feed, composer, recursive remix-tree view with "remix this" at every node'] }, items: [
{ area: 'Live Location', items: ['GeoDrops page: share toggle, live nearby list, cross-account playback, geo-playlist shuffle-play'] }, 'Rooms, Channels, and Posts merged under one nav destination (2026-08-23) with an in-page Rooms/Channels/Posts tab switcher, instead of three top-level tabs competing for the same "who\'s doing what" attention',
'Rooms: chat, reactions, DJ song picker, pass-the-aux controls, now-playing card (RoomView stays a genuinely full-screen experience, not wrapped in the app chrome)',
'Channels: list + follow/unfollow UI only - vibe sets/stories/showcase have no UI yet',
'Posts: feed, composer, recursive remix-tree view with "remix this" at every node',
],
},
{ {
area: 'Library & Playlists', area: 'Library & Playlists',
items: [ items: [
......
import { useEffect, useState } from 'react' import { useEffect, useState } from 'react'
import { ChevronRight, Radio } from 'lucide-react' import { ChevronRight, Radio } from 'lucide-react'
import { Layout } from '../components/Layout'
import { Button } from '../components/ui/Button' import { Button } from '../components/ui/Button'
import { Input } from '../components/ui/Input' import { Input } from '../components/ui/Input'
import { EmptyState } from '../components/ui/EmptyState' import { EmptyState } from '../components/ui/EmptyState'
...@@ -35,7 +34,7 @@ export function Rooms() { ...@@ -35,7 +34,7 @@ export function Rooms() {
} }
return ( return (
<Layout title="Pass-the-Aux Rooms"> <>
<form onSubmit={handleCreate} className="mb-6 flex gap-2"> <form onSubmit={handleCreate} className="mb-6 flex gap-2">
<Input <Input
value={newRoomName} value={newRoomName}
...@@ -54,23 +53,23 @@ export function Rooms() { ...@@ -54,23 +53,23 @@ export function Rooms() {
<li key={room.id}> <li key={room.id}>
<button <button
onClick={() => setActiveRoomId(room.id)} onClick={() => setActiveRoomId(room.id)}
className="flex min-h-[52px] w-full items-center justify-between gap-3 rounded-lg border border-neutral-800 bg-neutral-900 px-4 py-3 text-left transition-colors duration-150 hover:border-neutral-700 hover:bg-neutral-900/70" className="flex min-h-[52px] w-full items-center justify-between gap-3 rounded-lg border border-outline-variant bg-surface-container px-4 py-3 text-left transition-colors duration-150 hover:border-outline-variant hover:bg-surface-container/70"
> >
<div className="flex items-center gap-3"> <div className="flex items-center gap-3">
<span className="relative flex h-2 w-2"> <span className="relative flex h-2 w-2">
<span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-400 opacity-75" /> <span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-primary opacity-75" />
<span className="relative inline-flex h-2 w-2 rounded-full bg-emerald-500" /> <span className="relative inline-flex h-2 w-2 rounded-full bg-primary" />
</span> </span>
<div> <div>
<p className="font-medium text-white">{room.name}</p> <p className="font-medium text-on-surface">{room.name}</p>
<p className="text-xs text-neutral-500">DJ #{room.dj_id}</p> <p className="text-xs text-outline">DJ #{room.dj_id}</p>
</div> </div>
</div> </div>
<ChevronRight size={18} strokeWidth={2} className="shrink-0 text-neutral-600" /> <ChevronRight size={18} strokeWidth={2} className="shrink-0 text-on-surface-variant" />
</button> </button>
</li> </li>
))} ))}
</ul> </ul>
</Layout> </>
) )
} }
import { render, screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { MemoryRouter } from 'react-router-dom'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { Social } from './Social'
import { AuthProvider } from '../context/AuthContext'
import { PlayerProvider } from '../context/PlayerContext'
import * as socialApi from '../api/social'
import * as channelsApi from '../api/channels'
function renderSocial() {
return render(
<MemoryRouter>
<AuthProvider>
<PlayerProvider>
<Social />
</PlayerProvider>
</AuthProvider>
</MemoryRouter>,
)
}
describe('Social', () => {
beforeEach(() => {
vi.stubEnv('VITE_DEV_ACCESS_TOKEN', '')
vi.stubEnv('VITE_DEV_REFRESH_TOKEN', '')
vi.spyOn(socialApi, 'getActiveRooms').mockResolvedValue([])
vi.spyOn(socialApi, 'listPosts').mockResolvedValue([])
vi.spyOn(channelsApi, 'listChannels').mockResolvedValue([])
})
afterEach(() => {
vi.unstubAllEnvs()
vi.restoreAllMocks()
})
it('shows the Rooms panel by default', async () => {
renderSocial()
expect(await screen.findByPlaceholderText('Room name')).toBeInTheDocument()
})
it('switches to the Channels panel when tapped', async () => {
renderSocial()
await screen.findByPlaceholderText('Room name')
await userEvent.click(screen.getByRole('button', { name: 'Channels' }))
expect(await screen.findByPlaceholderText('New channel name')).toBeInTheDocument()
expect(screen.queryByPlaceholderText('Room name')).not.toBeInTheDocument()
})
it('switches to the Posts panel when tapped', async () => {
renderSocial()
await screen.findByPlaceholderText('Room name')
await userEvent.click(screen.getByRole('button', { name: 'Posts' }))
expect(await screen.findByText(/Post a song, and let others remix it/)).toBeInTheDocument()
})
})
import { useState } from 'react'
import { Disc3, Radio, Rss } from 'lucide-react'
import { Layout } from '../components/Layout'
import { Rooms } from './Rooms'
import { Channels } from './Channels'
import { Posts } from './Posts'
type Tab = 'rooms' | 'channels' | 'posts'
const TABS: { id: Tab; label: string; icon: typeof Radio }[] = [
{ id: 'rooms', label: 'Rooms', icon: Radio },
{ id: 'channels', label: 'Channels', icon: Rss },
{ id: 'posts', label: 'Posts', icon: Disc3 },
]
/** Every socially-driven feature (live listening rooms, creator channels, the post/remix
* feed) lives under one nav destination with an in-page switcher, instead of three separate
* top-level tabs competing for the same "who's doing what" attention. */
export function Social() {
const [tab, setTab] = useState<Tab>('rooms')
return (
<Layout title="Social">
<div className="mb-6 flex gap-2">
{TABS.map((t) => {
const active = tab === t.id
return (
<button
key={t.id}
onClick={() => setTab(t.id)}
className={`flex items-center gap-1.5 rounded-full px-4 py-1.5 text-sm font-medium transition-colors duration-150 ${
active
? 'bg-primary text-on-primary'
: 'border border-outline-variant bg-surface-container text-on-surface-variant hover:border-primary hover:text-on-surface'
}`}
>
<t.icon size={14} strokeWidth={2} />
{t.label}
</button>
)
})}
</div>
{tab === 'rooms' && <Rooms />}
{tab === 'channels' && <Channels />}
{tab === 'posts' && <Posts />}
</Layout>
)
}
import { render, screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { MemoryRouter } from 'react-router-dom'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { Soundmarks } from './Soundmarks'
import { AuthProvider } from '../context/AuthContext'
import { PlayerProvider } from '../context/PlayerContext'
function renderSoundmarks() {
return render(
<MemoryRouter>
<AuthProvider>
<PlayerProvider>
<Soundmarks />
</PlayerProvider>
</AuthProvider>
</MemoryRouter>,
)
}
describe('Soundmarks', () => {
beforeEach(() => {
vi.stubEnv('VITE_DEV_ACCESS_TOKEN', '')
vi.stubEnv('VITE_DEV_REFRESH_TOKEN', '')
})
afterEach(() => {
vi.unstubAllEnvs()
vi.restoreAllMocks()
})
it('shows the Map panel by default', () => {
renderSoundmarks()
expect(screen.getByRole('button', { name: 'Find soundmarks near me' })).toBeInTheDocument()
})
it('switches to the Live panel when tapped', async () => {
renderSoundmarks()
await userEvent.click(screen.getByRole('button', { name: 'Live' }))
expect(screen.queryByRole('button', { name: 'Find soundmarks near me' })).not.toBeInTheDocument()
expect(screen.getByText(/Share your live location/)).toBeInTheDocument()
})
})
import { useState } from 'react'
import { MapPin, Radio } from 'lucide-react'
import { Layout } from '../components/Layout'
import { Nearby } from './Nearby'
import { GeoDrops } from './GeoDrops'
type Tab = 'map' | 'live'
const TABS: { id: Tab; label: string; icon: typeof MapPin }[] = [
{ id: 'map', label: 'Map', icon: MapPin },
{ id: 'live', label: 'Live', icon: Radio },
]
/** Location-based features live under one tab: the curated/voted anthem tied to a fixed
* place (Nearby) and a live broadcast of wherever someone currently is (GeoDrops) - distinct
* concepts, but both "what's playing near me right now," so they share one nav destination
* with an in-page switcher rather than splitting rider attention across two top-level tabs. */
export function Soundmarks() {
const [tab, setTab] = useState<Tab>('map')
return (
<Layout title="Soundmarks">
<div className="mb-6 flex gap-2">
{TABS.map((t) => {
const active = tab === t.id
return (
<button
key={t.id}
onClick={() => setTab(t.id)}
className={`flex items-center gap-1.5 rounded-full px-4 py-1.5 text-sm font-medium transition-colors duration-150 ${
active
? 'bg-primary text-on-primary'
: 'border border-outline-variant bg-surface-container text-on-surface-variant hover:border-primary hover:text-on-surface'
}`}
>
<t.icon size={14} strokeWidth={2} />
{t.label}
</button>
)
})}
</div>
{tab === 'map' ? <Nearby /> : <GeoDrops />}
</Layout>
)
}
...@@ -185,12 +185,12 @@ export function TelegramLink() { ...@@ -185,12 +185,12 @@ export function TelegramLink() {
return ( return (
<Layout title="Link Telegram"> <Layout title="Link Telegram">
<div className="mx-auto w-full max-w-sm"> <div className="mx-auto w-full max-w-sm">
<p className="mb-6 text-sm text-neutral-400"> <p className="mb-6 text-sm text-on-surface-variant">
{step === 'phone' && 'Link your Telegram account to scan your chats for music.'} {step === 'phone' && 'Link your Telegram account to scan your chats for music.'}
{step === 'code' && `Enter the code sent to ${phoneNumber}.`} {step === 'code' && `Enter the code sent to ${phoneNumber}.`}
{step === 'password' && 'Two-step verification is on for this account. Enter your Telegram cloud password.'} {step === 'password' && 'Two-step verification is on for this account. Enter your Telegram cloud password.'}
</p> </p>
{chatsError && <p className="mb-4 text-sm text-red-400">{chatsError}</p>} {chatsError && <p className="mb-4 text-sm text-error">{chatsError}</p>}
{step === 'phone' && ( {step === 'phone' && (
<form onSubmit={handleSendCode} className="space-y-3"> <form onSubmit={handleSendCode} className="space-y-3">
...@@ -204,7 +204,7 @@ export function TelegramLink() { ...@@ -204,7 +204,7 @@ export function TelegramLink() {
onChange={(e) => setPhoneNumber(e.target.value)} onChange={(e) => setPhoneNumber(e.target.value)}
aria-label="Phone number" aria-label="Phone number"
/> />
{error && <p className="text-sm text-red-400">{error}</p>} {error && <p className="text-sm text-error">{error}</p>}
<Button type="submit" disabled={busy || !phoneNumber.trim()} className="w-full"> <Button type="submit" disabled={busy || !phoneNumber.trim()} className="w-full">
{busy ? 'Sending code…' : 'Send code'} {busy ? 'Sending code…' : 'Send code'}
</Button> </Button>
...@@ -223,14 +223,14 @@ export function TelegramLink() { ...@@ -223,14 +223,14 @@ export function TelegramLink() {
onChange={(e) => setCode(e.target.value)} onChange={(e) => setCode(e.target.value)}
aria-label="Verification code" aria-label="Verification code"
/> />
{error && <p className="text-sm text-red-400">{error}</p>} {error && <p className="text-sm text-error">{error}</p>}
<Button type="submit" disabled={busy || !code.trim()} className="w-full"> <Button type="submit" disabled={busy || !code.trim()} className="w-full">
{busy ? 'Verifying…' : 'Verify & link'} {busy ? 'Verifying…' : 'Verify & link'}
</Button> </Button>
<button <button
type="button" type="button"
onClick={handleChangeNumber} onClick={handleChangeNumber}
className="w-full text-center text-sm text-neutral-500 transition-colors hover:text-neutral-300" className="w-full text-center text-sm text-outline transition-colors hover:text-on-surface"
> >
Use a different number Use a different number
</button> </button>
...@@ -248,14 +248,14 @@ export function TelegramLink() { ...@@ -248,14 +248,14 @@ export function TelegramLink() {
onChange={(e) => setPassword(e.target.value)} onChange={(e) => setPassword(e.target.value)}
aria-label="Telegram password" aria-label="Telegram password"
/> />
{error && <p className="text-sm text-red-400">{error}</p>} {error && <p className="text-sm text-error">{error}</p>}
<Button type="submit" disabled={busy || !password.trim()} className="w-full"> <Button type="submit" disabled={busy || !password.trim()} className="w-full">
{busy ? 'Verifying…' : 'Verify & link'} {busy ? 'Verifying…' : 'Verify & link'}
</Button> </Button>
<button <button
type="button" type="button"
onClick={handleChangeNumber} onClick={handleChangeNumber}
className="w-full text-center text-sm text-neutral-500 transition-colors hover:text-neutral-300" className="w-full text-center text-sm text-outline transition-colors hover:text-on-surface"
> >
Use a different number Use a different number
</button> </button>
...@@ -271,7 +271,7 @@ export function TelegramLink() { ...@@ -271,7 +271,7 @@ export function TelegramLink() {
<Layout title={selectedChat.title}> <Layout title={selectedChat.title}>
<button <button
onClick={() => setSelectedChat(null)} onClick={() => setSelectedChat(null)}
className="mb-4 text-sm text-neutral-400 transition-colors hover:text-white" className="mb-4 text-sm text-on-surface-variant transition-colors hover:text-on-surface"
> >
← Chats ← Chats
</button> </button>
...@@ -281,11 +281,11 @@ export function TelegramLink() { ...@@ -281,11 +281,11 @@ export function TelegramLink() {
<SkeletonRow /> <SkeletonRow />
</div> </div>
)} )}
{musicError && <p className="text-sm text-red-400">{musicError}</p>} {musicError && <p className="text-sm text-error">{musicError}</p>}
{!musicLoading && !musicError && music?.length === 0 && ( {!musicLoading && !musicError && music?.length === 0 && (
<EmptyState icon={Music2} message="No music found in this chat." /> <EmptyState icon={Music2} message="No music found in this chat." />
)} )}
<ul className="divide-y divide-neutral-800/80"> <ul className="divide-y divide-outline-variant/80">
{music?.map((m) => { {music?.map((m) => {
const saved = savedMeta[m.message_id] const saved = savedMeta[m.message_id]
const saveError = saveErrors[m.message_id] const saveError = saveErrors[m.message_id]
...@@ -296,7 +296,7 @@ export function TelegramLink() { ...@@ -296,7 +296,7 @@ export function TelegramLink() {
<button <button
onClick={() => toggle(toPreviewPlayable(selectedChat.id, m))} onClick={() => toggle(toPreviewPlayable(selectedChat.id, m))}
aria-label={isCurrent && isPlaying ? `Pause ${m.title}` : `Play 30 second preview of ${m.title}`} aria-label={isCurrent && isPlaying ? `Pause ${m.title}` : `Play 30 second preview of ${m.title}`}
className="flex h-12 w-12 shrink-0 items-center justify-center rounded-md bg-neutral-800 text-neutral-300 transition-colors hover:bg-neutral-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400" className="flex h-12 w-12 shrink-0 items-center justify-center rounded-md bg-surface-container-high text-on-surface transition-colors hover:bg-surface-bright focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"
> >
{isCurrent && isPlaying ? ( {isCurrent && isPlaying ? (
<Pause size={18} strokeWidth={1.75} /> <Pause size={18} strokeWidth={1.75} />
...@@ -305,12 +305,12 @@ export function TelegramLink() { ...@@ -305,12 +305,12 @@ export function TelegramLink() {
)} )}
</button> </button>
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<p className="truncate font-medium text-white">{saved ? saved.title : m.title}</p> <p className="truncate font-medium text-on-surface">{saved ? saved.title : m.title}</p>
<p className="truncate text-sm text-neutral-400">{saved ? saved.artist : m.artist}</p> <p className="truncate text-sm text-on-surface-variant">{saved ? saved.artist : m.artist}</p>
{saveError && <p className="mt-1 text-xs text-red-400">{saveError}</p>} {saveError && <p className="mt-1 text-xs text-error">{saveError}</p>}
</div> </div>
{saved ? ( {saved ? (
<span className="flex shrink-0 items-center gap-1 text-sm text-emerald-400"> <span className="flex shrink-0 items-center gap-1 text-sm text-primary">
<Check size={16} strokeWidth={2} /> <Check size={16} strokeWidth={2} />
Saved Saved
</span> </span>
...@@ -336,21 +336,21 @@ export function TelegramLink() { ...@@ -336,21 +336,21 @@ export function TelegramLink() {
return ( return (
<Layout title="Telegram Chats"> <Layout title="Telegram Chats">
<p className="mb-4 text-sm text-neutral-400">Linked. Tap a chat to see the music found in it.</p> <p className="mb-4 text-sm text-on-surface-variant">Linked. Tap a chat to see the music found in it.</p>
{chats.length === 0 && <EmptyState icon={MessageCircle} message="No chats found." />} {chats.length === 0 && <EmptyState icon={MessageCircle} message="No chats found." />}
<ul className="divide-y divide-neutral-800/80"> <ul className="divide-y divide-outline-variant/80">
{chats.map((chat) => ( {chats.map((chat) => (
<li key={chat.id}> <li key={chat.id}>
<button <button
onClick={() => openChat(chat)} onClick={() => openChat(chat)}
className="-mx-2 flex w-full items-center gap-4 rounded-lg px-2 py-3 text-left transition-colors hover:bg-white/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400" className="-mx-2 flex w-full items-center gap-4 rounded-lg px-2 py-3 text-left transition-colors hover:bg-surface-container focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"
> >
<div className="flex h-12 w-12 shrink-0 items-center justify-center rounded-md bg-neutral-800 text-neutral-600"> <div className="flex h-12 w-12 shrink-0 items-center justify-center rounded-md bg-surface-container-high text-on-surface-variant">
<MessageCircle size={18} strokeWidth={1.75} /> <MessageCircle size={18} strokeWidth={1.75} />
</div> </div>
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<p className="truncate font-medium text-white">{chat.title}</p> <p className="truncate font-medium text-on-surface">{chat.title}</p>
<p className="truncate text-sm text-neutral-400">{chat.type}</p> <p className="truncate text-sm text-on-surface-variant">{chat.type}</p>
</div> </div>
</button> </button>
</li> </li>
......
...@@ -43,14 +43,14 @@ export function Upload() { ...@@ -43,14 +43,14 @@ export function Upload() {
return ( return (
<Layout title="Upload &amp; Tag"> <Layout title="Upload &amp; Tag">
<p className="mb-6 text-sm leading-relaxed text-neutral-400"> <p className="mb-6 text-sm leading-relaxed text-on-surface-variant">
Upload an untagged track - it's fingerprinted, tagged with title/artist/album/art/lyrics, and Upload an untagged track - it's fingerprinted, tagged with title/artist/album/art/lyrics, and
added to your library. added to your library.
</p> </p>
<label className="flex cursor-pointer flex-col items-center gap-3 rounded-xl border border-dashed border-neutral-700 p-10 text-center transition-colors duration-150 hover:border-neutral-600 hover:bg-neutral-900/50"> <label className="flex cursor-pointer flex-col items-center gap-3 rounded-xl border border-dashed border-outline-variant p-10 text-center transition-colors duration-150 hover:border-outline-variant hover:bg-surface-container/50">
<UploadCloud size={28} strokeWidth={1.5} className="text-neutral-500" /> <UploadCloud size={28} strokeWidth={1.5} className="text-outline" />
<span className="text-sm text-neutral-400"> <span className="text-sm text-on-surface-variant">
{file ? file.name : 'Choose an audio file, or drag one here'} {file ? file.name : 'Choose an audio file, or drag one here'}
</span> </span>
<input <input
...@@ -75,10 +75,10 @@ export function Upload() { ...@@ -75,10 +75,10 @@ export function Upload() {
{stage === 'uploading' ? 'Uploading…' : stage === 'processing' ? 'Processing…' : 'Upload'} {stage === 'uploading' ? 'Uploading…' : stage === 'processing' ? 'Processing…' : 'Upload'}
</Button> </Button>
{error && <p className="mt-4 text-sm text-red-400">{error}</p>} {error && <p className="mt-4 text-sm text-error">{error}</p>}
{result && ( {result && (
<div className="mt-6 rounded-xl border border-neutral-800 bg-neutral-900 p-3"> <div className="mt-6 rounded-xl border border-outline-variant bg-surface-container p-3">
{/* Tapping anywhere on the card plays it, not just a small button - the icon on the {/* Tapping anywhere on the card plays it, not just a small button - the icon on the
right is a status indicator rendered inside this same button. Download stays a right is a status indicator rendered inside this same button. Download stays a
separate control below since it's a genuinely different action. */} separate control below since it's a genuinely different action. */}
...@@ -95,24 +95,24 @@ export function Upload() { ...@@ -95,24 +95,24 @@ export function Upload() {
} }
disabled={isCurrent && streamLoading} disabled={isCurrent && streamLoading}
aria-label={isCurrent && isPlaying ? 'Pause' : 'Play'} aria-label={isCurrent && isPlaying ? 'Pause' : 'Play'}
className="flex w-full items-center gap-4 rounded-lg p-1 text-left transition-colors hover:bg-white/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400 disabled:cursor-not-allowed" className="flex w-full items-center gap-4 rounded-lg p-1 text-left transition-colors hover:bg-surface-container focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary disabled:cursor-not-allowed"
> >
{result.metadata.cover_art ? ( {result.metadata.cover_art ? (
<img src={result.metadata.cover_art} alt="" className="h-16 w-16 shrink-0 rounded-lg object-cover" /> <img src={result.metadata.cover_art} alt="" className="h-16 w-16 shrink-0 rounded-lg object-cover" />
) : ( ) : (
<div className="flex h-16 w-16 shrink-0 items-center justify-center rounded-lg bg-neutral-800 text-neutral-600"> <div className="flex h-16 w-16 shrink-0 items-center justify-center rounded-lg bg-surface-container-high text-on-surface-variant">
<Play size={20} strokeWidth={1.75} /> <Play size={20} strokeWidth={1.75} />
</div> </div>
)} )}
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<p className="truncate font-semibold text-white">{result.metadata.title}</p> <p className="truncate font-semibold text-on-surface">{result.metadata.title}</p>
<p className="truncate text-sm text-neutral-400"> <p className="truncate text-sm text-on-surface-variant">
{result.metadata.artist} · {result.metadata.album} · {result.metadata.genre} {result.metadata.artist} · {result.metadata.album} · {result.metadata.genre}
</p> </p>
</div> </div>
<span className="flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-neutral-800 text-white"> <span className="flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-surface-container-high text-on-surface">
{isCurrent && streamLoading ? ( {isCurrent && streamLoading ? (
<span className="h-3.5 w-3.5 animate-spin rounded-full border-2 border-neutral-600 border-t-white" /> <span className="h-3.5 w-3.5 animate-spin rounded-full border-2 border-outline-variant border-t-on-surface" />
) : isCurrent && isPlaying ? ( ) : isCurrent && isPlaying ? (
<Pause size={16} strokeWidth={2} fill="currentColor" /> <Pause size={16} strokeWidth={2} fill="currentColor" />
) : ( ) : (
...@@ -124,7 +124,7 @@ export function Upload() { ...@@ -124,7 +124,7 @@ export function Upload() {
href={result.download_url} href={result.download_url}
target="_blank" target="_blank"
rel="noreferrer" rel="noreferrer"
className="mt-1 block px-1 text-sm text-neutral-400 hover:text-white hover:underline" className="mt-1 block px-1 text-sm text-on-surface-variant hover:text-on-surface hover:underline"
> >
Download tagged file Download tagged file
</a> </a>
......
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