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 @@
<meta charset="UTF-8" />
<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="theme-color" content="#0a0a0a" />
<meta name="theme-color" content="#131313" />
<meta name="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" />
<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>
</head>
<body>
......
......@@ -4,12 +4,9 @@ import { Playlists } from './pages/Playlists'
import { TelegramLink } from './pages/TelegramLink'
import { Upload } from './pages/Upload'
import { Discovery } from './pages/Discovery'
import { Rooms } from './pages/Rooms'
import { Channels } from './pages/Channels'
import { GeoDrops } from './pages/GeoDrops'
import { Posts } from './pages/Posts'
import { Social } from './pages/Social'
import { Remix } from './pages/Remix'
import { Nearby } from './pages/Nearby'
import { Soundmarks } from './pages/Soundmarks'
import { BusinessPanel } from './pages/BusinessPanel'
import { AdminPanel } from './pages/AdminPanel'
import { Roadmap } from './pages/Roadmap'
......@@ -30,12 +27,15 @@ export function App() {
<Route path="/telegram-link" element={protect(<TelegramLink />)} />
<Route path="/upload" element={protect(<Upload />)} />
<Route path="/discovery" element={protect(<Discovery />)} />
<Route path="/rooms" element={protect(<Rooms />)} />
<Route path="/channels" element={protect(<Channels />)} />
<Route path="/drops" element={protect(<GeoDrops />)} />
<Route path="/posts" element={protect(<Posts />)} />
<Route path="/social" element={protect(<Social />)} />
<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
path="/business"
element={
......
......@@ -79,15 +79,15 @@ export function AddToPlaylistModal({ song, onClose }: AddToPlaylistModalProps) {
onClick={onClose}
>
<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()}
>
<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>
<button
onClick={onClose}
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} />
</button>
......@@ -105,11 +105,11 @@ export function AddToPlaylistModal({ song, onClose }: AddToPlaylistModalProps) {
</Button>
</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">
{!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) => {
const added = addedIds.has(playlist.id)
......@@ -118,18 +118,18 @@ export function AddToPlaylistModal({ song, onClose }: AddToPlaylistModalProps) {
<button
onClick={() => handleAdd(playlist)}
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} />
</div>
<p className="min-w-0 flex-1 truncate text-sm font-medium text-white">{playlist.name}</p>
{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 ? (
<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>
</li>
......
......@@ -134,7 +134,7 @@ export function FullPlayer() {
role="dialog"
aria-modal="true"
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'
}`}
>
......@@ -150,7 +150,7 @@ export function FullPlayer() {
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>
{/* Main screen: cover/lyrics (crossfaded in place), transport, and a lyrics toggle bar.
......@@ -170,17 +170,17 @@ export function FullPlayer() {
onClick={collapse}
tabIndex={queueOpen ? -1 : 0}
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} />
</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
ref={queueButtonRef}
onClick={openQueue}
tabIndex={queueOpen ? -1 : 0}
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} />
</button>
......@@ -205,7 +205,7 @@ export function FullPlayer() {
/>
) : (
<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' : ''
}`}
>
......@@ -218,7 +218,7 @@ export function FullPlayer() {
role="region"
aria-label="Lyrics"
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'
}`}
style={{
......@@ -228,7 +228,7 @@ export function FullPlayer() {
}}
>
{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." />
)}
......@@ -241,7 +241,7 @@ export function FullPlayer() {
>
<div className="mb-5">
<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.album ? ` · ${currentSong.album}` : ''}
</p>
......@@ -259,9 +259,11 @@ export function FullPlayer() {
aria-label="Seek"
aria-valuetext={`${formatTime(progress)} of ${formatTime(duration)}`}
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 ? (
<span className="mx-auto">Loading…</span>
) : (
......@@ -278,8 +280,8 @@ export function FullPlayer() {
tabIndex={queueOpen ? -1 : 0}
aria-label="Shuffle"
aria-pressed={isShuffled}
className={`rounded-full p-2 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400 ${
isShuffled ? 'text-emerald-400' : 'text-neutral-400 hover:text-white'
className={`rounded-full p-2 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary ${
isShuffled ? 'text-primary' : 'text-on-surface-variant hover:text-on-surface'
}`}
>
<Shuffle size={18} strokeWidth={2} />
......@@ -290,7 +292,7 @@ export function FullPlayer() {
onClick={previous}
tabIndex={queueOpen ? -1 : 0}
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" />
</button>
......@@ -299,10 +301,10 @@ export function FullPlayer() {
disabled={isLoading}
tabIndex={queueOpen ? -1 : 0}
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 ? (
<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 ? (
<Pause size={24} strokeWidth={2} fill="currentColor" />
) : (
......@@ -314,7 +316,7 @@ export function FullPlayer() {
disabled={!hasNext}
tabIndex={queueOpen ? -1 : 0}
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" />
</button>
......@@ -325,8 +327,8 @@ export function FullPlayer() {
tabIndex={queueOpen ? -1 : 0}
aria-label={`Repeat: ${repeatMode}`}
aria-pressed={repeatMode !== 'off'}
className={`rounded-full p-2 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400 ${
repeatMode !== 'off' ? 'text-emerald-400' : 'text-neutral-400 hover:text-white'
className={`rounded-full p-2 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary ${
repeatMode !== 'off' ? 'text-primary' : 'text-on-surface-variant hover:text-on-surface'
}`}
>
<RepeatIcon size={18} strokeWidth={2} />
......@@ -343,20 +345,20 @@ export function FullPlayer() {
tabIndex={queueOpen ? -1 : 0}
aria-label={showLyrics ? 'Show cover art' : 'Show lyrics'}
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 ? (
<>
<Disc3 size={15} strokeWidth={2} className="shrink-0 text-neutral-400" />
<span className="min-w-0 flex-1 truncate text-sm text-neutral-300">Cover art</span>
<Disc3 size={15} strokeWidth={2} className="shrink-0 text-on-surface-variant" />
<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" />
<span className="min-w-0 flex-1 truncate text-sm text-neutral-300">{lyricsPreview}</span>
<ScrollText size={15} strokeWidth={2} className="shrink-0 text-on-surface-variant" />
<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>
)}
</div>
......@@ -380,7 +382,7 @@ export function FullPlayer() {
onClick={closeQueue}
tabIndex={queueOpen ? 0 : -1}
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} />
</button>
......@@ -400,23 +402,23 @@ export function FullPlayer() {
onClick={() => jumpTo(song)}
tabIndex={queueOpen ? 0 : -1}
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 ${
isCurrent ? 'text-emerald-400' : 'text-neutral-300 hover:bg-white/5 hover:text-white'
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-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}
</span>
{song.coverart ? (
<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} />
</div>
)}
<div className="min-w-0 flex-1">
<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>
</button>
</li>
......
import type { ReactNode } from 'react'
import { useState, type ReactNode } from 'react'
import { Link, useLocation } from 'react-router-dom'
import {
Compass,
Disc3,
Headphones,
Library,
Link2,
......@@ -10,13 +9,13 @@ import {
LogOut,
Map,
MapPin,
MapPinned,
MoreHorizontal,
Radio,
Rss,
ShieldCheck,
Store,
Upload,
Wand2,
X,
type LucideIcon,
} from 'lucide-react'
import { useAuth } from '../context/AuthContext'
......@@ -26,24 +25,32 @@ import { NowPlayingBar } from './NowPlayingBar'
import { FullPlayer } from './FullPlayer'
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 }[] = [
{ to: '/library', label: 'Library', icon: Library },
{ to: '/playlists', label: 'Playlists', icon: ListMusic },
{ to: '/upload', label: 'Upload', icon: Upload },
{ to: '/discovery', label: 'Discover', icon: Compass },
{ to: '/rooms', label: 'Rooms', icon: Radio },
{ to: '/channels', label: 'Channels', icon: Rss },
{ to: '/posts', label: 'Posts', icon: Disc3 },
{ to: '/social', label: 'Social', icon: Radio },
{ to: '/remix', label: 'Remix', icon: Wand2 },
{ to: '/nearby', label: 'Soundmarks', icon: MapPin },
{ to: '/drops', label: 'Drops', icon: MapPinned },
{ to: '/soundmarks', label: 'Soundmarks', icon: MapPin },
{ 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 }) {
const { logout, isBusinessAdmin, isSuperAdmin } = useAuth()
const { currentSong } = usePlayer()
const location = useLocation()
const [moreOpen, setMoreOpen] = useState(false)
async function handleLogout() {
// No reload needed: once isAuthenticated flips false, the ProtectedRoute/RequireRole
......@@ -53,99 +60,101 @@ export function Layout({ title, children }: { title: string; children: ReactNode
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 (
<div className="min-h-screen bg-neutral-950 text-white">
{/* Top bar: branding + logout everywhere; the nav links move down here only on
screens wide enough to show all six comfortably without scrolling. */}
<header
className="sticky top-0 z-10 border-b border-neutral-800/80 bg-neutral-950/95 px-4 backdrop-blur sm:px-6"
<div className="min-h-screen bg-background text-on-background">
{/* Desktop: 256px fixed sidebar, full nav list (there's room, unlike the mobile tab bar) */}
<aside
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"
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 text-[15px] font-semibold tracking-tight">
<Headphones size={20} strokeWidth={2} className="text-emerald-400" />
Stax
</Link>
<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">
<Link to="/library" className="flex items-center gap-2 px-6 py-6 text-lg font-bold tracking-tight text-primary">
<Headphones size={22} strokeWidth={2} />
Stax
</Link>
<nav className="flex-1 space-y-0.5 overflow-y-auto px-3">
{NAV_ITEMS.map((item) => {
const active = location.pathname === item.to
return (
<Link
key={item.to}
to={item.to}
className={`flex items-center gap-1.5 rounded-full px-3 py-1.5 transition-colors duration-150 ${
active ? 'bg-neutral-900 text-white' : 'text-neutral-400 hover:text-white'
className={`flex items-center gap-3 rounded-lg border-l-2 px-3 py-2.5 text-sm transition-colors duration-150 ${
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}
</Link>
)
})}
</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>
<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>
{children}
<div className="mx-auto max-w-2xl sm:max-w-3xl">
<h1 className="mb-6 text-xl font-semibold tracking-tight sm:text-2xl">{title}</h1>
{children}
</div>
</main>
<NowPlayingBar />
<FullPlayer />
<PlaybackErrorToast />
{/* Bottom tab bar: mobile only, fixed, thumb-reachable. Hidden entirely at sm+ where
the top nav takes over instead. */}
{/* Bottom tab bar: mobile only, fixed, thumb-reachable - 5 core destinations + More. */}
<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)' }}
>
{NAV_ITEMS.map((item) => {
{mobileTabs.map((item) => {
const active = location.pathname === item.to
return (
<Link
......@@ -156,13 +165,71 @@ export function Layout({ title, children }: { title: string; children: ReactNode
<item.icon
size={20}
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>
)
})}
<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>
{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>
)
}
......@@ -127,7 +127,7 @@ export function LocationPicker({ latitude, longitude, onChange }: LocationPicker
<Search
size={16}
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
placeholder="Search for an address or place"
......@@ -137,15 +137,15 @@ export function LocationPicker({ latitude, longitude, onChange }: LocationPicker
className="pl-9"
/>
{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) => (
<li key={i}>
<button
type="button"
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>
</button>
</li>
......@@ -154,7 +154,7 @@ export function LocationPicker({ latitude, longitude, onChange }: LocationPicker
)}
</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>
<TileLayer attribution={DARK_TILE_ATTRIBUTION} url={DARK_TILE_URL} />
<FlyToOnJump jumpTo={jumpTo} />
......@@ -179,13 +179,13 @@ export function LocationPicker({ latitude, longitude, onChange }: LocationPicker
disabled={locating}
aria-label="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' : ''} />
</button>
</div>
{locateError && <p className="mt-1 text-xs text-red-400">{locateError}</p>}
<p className="mt-1 text-xs text-neutral-500">
{locateError && <p className="mt-1 text-xs text-error">{locateError}</p>}
<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.
{hasPin && ` ${latitude.toFixed(5)}, ${longitude.toFixed(5)}`}
</p>
......
......@@ -25,40 +25,40 @@ export function NowPlayingBar() {
return (
<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'
}`}
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
than nesting one inside the other, which isn't valid HTML. */}
<button
ref={openButtonRef}
onClick={expand}
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 ? (
<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} />
</div>
)}
<div className="min-w-0 flex-1">
<p className="truncate text-sm font-medium text-white">{currentSong.title}</p>
<p className="truncate text-xs text-neutral-400">{currentSong.artist}</p>
<p className="truncate text-sm font-medium text-on-surface">{currentSong.title}</p>
<p className="truncate text-xs text-on-surface-variant">{currentSong.artist}</p>
</div>
</button>
<button
onClick={() => toggle(currentSong)}
disabled={isLoading}
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 ? (
<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 ? (
<Pause size={16} strokeWidth={2} fill="currentColor" />
) : (
......
......@@ -31,16 +31,16 @@ export function PlaybackErrorToast() {
style={{ top: 'calc(env(safe-area-inset-top) + 3.75rem)' }}
>
<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'
}`}
>
<AlertCircle size={18} strokeWidth={2} className="mt-0.5 shrink-0 text-red-400" />
<p className="flex-1 text-sm text-neutral-200">{playbackError}</p>
<AlertCircle size={18} strokeWidth={2} className="mt-0.5 shrink-0 text-error" />
<p className="flex-1 text-sm text-on-surface">{playbackError}</p>
<button
onClick={dismissError}
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} />
</button>
......
......@@ -59,15 +59,15 @@ export function RemixSongPicker({ selected, onChange, onClose }: RemixSongPicker
onClick={onClose}
>
<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()}
>
<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>
<button
onClick={onClose}
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} />
</button>
......@@ -79,7 +79,7 @@ export function RemixSongPicker({ selected, onChange, onClose }: RemixSongPicker
<ul className="mt-2 flex-1 overflow-y-auto px-2 pb-3">
{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.'}
</p>
)}
......@@ -92,20 +92,20 @@ export function RemixSongPicker({ selected, onChange, onClose }: RemixSongPicker
onClick={() => toggle(song)}
disabled={disabled}
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 ${
isSelected ? 'bg-emerald-500/10' : 'hover:bg-white/5'
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-primary/10' : 'hover:bg-surface-container-high/60'
}`}
>
<div
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} />}
</div>
<div className="min-w-0 flex-1">
<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>
</button>
</li>
......@@ -113,7 +113,7 @@ export function RemixSongPicker({ selected, onChange, onClose }: RemixSongPicker
})}
</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">
Done ({selected.length}/{MAX_REMIX_SONGS})
</Button>
......
......@@ -17,7 +17,7 @@ export function RequireRole({ role, children }: { role: 'business_admin' | 'supe
const allowed = role === 'super_admin' ? isSuperAdmin : isBusinessAdmin
if (!allowed) {
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>
</div>
)
......
......@@ -115,19 +115,19 @@ export function RoomView({ roomId, onLeave }: { roomId: number; onLeave: () => v
const isCurrent = !!active && playerSong?.id === active.id
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
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)' }}
>
<button
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} />
Leave
</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}
{fireCount > 0 && (
<span className="flex items-center gap-1 text-orange-400">
......@@ -138,28 +138,28 @@ export function RoomView({ roomId, onLeave }: { roomId: number; onLeave: () => v
</div>
</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 ? (
<button
onClick={() => toggle(active)}
disabled={isCurrent && streamLoading}
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 ? (
<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} />
</div>
)}
<div className="min-w-0 flex-1">
<p className="truncate text-sm font-medium text-white">{currentSong.title}</p>
<p className="truncate text-xs text-neutral-400">{currentSong.artist}</p>
<p className="truncate text-sm font-medium text-on-surface">{currentSong.title}</p>
<p className="truncate text-xs text-on-surface-variant">{currentSong.artist}</p>
</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 ? (
<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 ? (
<Pause size={16} strokeWidth={2} fill="currentColor" />
) : (
......@@ -168,7 +168,7 @@ export function RoomView({ roomId, onLeave }: { roomId: number; onLeave: () => v
</span>
</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."}
</p>
)}
......@@ -191,14 +191,14 @@ export function RoomView({ roomId, onLeave }: { roomId: number; onLeave: () => v
</div>
{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">
<ul className="space-y-2">
{messages.map((m, i) => (
<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>
))}
</ul>
......@@ -206,7 +206,7 @@ export function RoomView({ roomId, onLeave }: { roomId: number; onLeave: () => v
</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)' }}
>
<div className="mb-3 flex gap-2">
......
......@@ -63,15 +63,15 @@ export function SongPicker({ onSelect, onClose }: SongPickerProps) {
onClick={onClose}
>
<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()}
>
<div className="flex items-center justify-between border-b border-neutral-800 px-4 py-3">
<p className="text-sm font-semibold text-white">Choose an anthem</p>
<div className="flex items-center justify-between border-b border-outline-variant px-4 py-3">
<p className="text-sm font-semibold text-on-surface">Choose an anthem</p>
<button
onClick={onClose}
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} />
</button>
......@@ -83,7 +83,7 @@ export function SongPicker({ onSelect, onClose }: SongPickerProps) {
key={t}
onClick={() => setTab(t)}
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'}
......@@ -104,7 +104,7 @@ export function SongPicker({ onSelect, onClose }: SongPickerProps) {
<ul className="mt-2 flex-1 overflow-y-auto px-2 pb-3">
{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.'}
</p>
)}
......@@ -112,14 +112,14 @@ export function SongPicker({ onSelect, onClose }: SongPickerProps) {
<li key={song.id}>
<button
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} />
</div>
<div className="min-w-0 flex-1">
<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-sm font-medium text-on-surface">{song.title}</p>
<p className="truncate text-xs text-outline">{song.artist}</p>
</div>
</button>
</li>
......
......@@ -36,7 +36,7 @@ export function SoundmarkMap({ userLocation, soundmarks }: SoundmarkMapProps) {
}
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
ref={setMap}
center={[userLocation.lat, userLocation.lon]}
......@@ -49,7 +49,7 @@ export function SoundmarkMap({ userLocation, soundmarks }: SoundmarkMapProps) {
<CircleMarker
center={[userLocation.lat, userLocation.lon]}
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>
</CircleMarker>
......@@ -70,7 +70,7 @@ export function SoundmarkMap({ userLocation, soundmarks }: SoundmarkMapProps) {
<button
onClick={centerOnMe}
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} />
</button>
......
......@@ -29,7 +29,7 @@ describe('Button', () => {
it('applies variant-specific styling', () => {
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', () => {
......
......@@ -4,9 +4,9 @@ type Variant = 'primary' | 'secondary' | 'ghost'
type Size = 'default' | 'sm' | 'icon'
const VARIANT_CLASSES: Record<Variant, string> = {
primary: 'bg-emerald-500 text-neutral-950 hover:bg-emerald-400 disabled:hover:bg-emerald-500',
secondary: 'bg-neutral-800 text-white hover:bg-neutral-700 disabled:hover:bg-neutral-800',
ghost: 'bg-transparent text-neutral-400 hover:bg-neutral-900 hover:text-white',
primary: 'bg-primary text-on-primary hover:bg-primary-fixed disabled:hover:bg-primary',
secondary: 'bg-surface-container-high text-on-surface hover:bg-surface-bright disabled:hover:bg-surface-container-high',
ghost: 'bg-transparent text-on-surface-variant hover:bg-surface-container hover:text-on-surface',
}
const SIZE_CLASSES: Record<Size, string> = {
......@@ -27,7 +27,7 @@ export const Button = forwardRef<HTMLButtonElement, Props>(function Button(
return (
<button
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}
/>
)
......
......@@ -2,7 +2,7 @@ import type { LucideIcon } from 'lucide-react'
export function EmptyState({ icon: Icon, message }: { icon: LucideIcon; message: string }) {
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} />
<p className="max-w-xs text-sm">{message}</p>
</div>
......
......@@ -2,7 +2,7 @@ import { forwardRef, type InputHTMLAttributes, type TextareaHTMLAttributes } fro
const FIELD_CLASSES =
// 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(
{ className = '', ...props },
......
......@@ -4,18 +4,18 @@
export function ProgressBar({ percent, label }: { percent: number | null; label: string }) {
return (
<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>
{percent !== null && <span className="tabular-nums text-neutral-500">{percent}%</span>}
{percent !== null && <span className="tabular-nums text-outline">{percent}%</span>}
</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 ? (
<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}%` }}
/>
) : (
<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>
......
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
......
@import "tailwindcss";
@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 {
from {
opacity: 0;
......@@ -75,7 +131,7 @@
opacity: 1;
}
.seek-range:focus-visible {
outline: 2px solid #34d399;
outline: 2px solid var(--color-primary);
outline-offset: 4px;
border-radius: 9999px;
}
......
......@@ -12,7 +12,7 @@ export type MarkerTier = 'major' | 'business' | 'community' | 'generic'
const TIER_COLOR: Record<MarkerTier, string> = {
major: '#fbbf24', // amber - curated landmark
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)
}
......
......@@ -66,7 +66,7 @@ function formFromSoundmark(sm: Soundmark): SoundmarkFormValues {
}
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({
initial,
......@@ -96,10 +96,10 @@ function SoundmarkFormModal({
onClick={onClose}
>
<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()}
>
<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
onSubmit={(e) => {
e.preventDefault()
......@@ -115,7 +115,7 @@ function SoundmarkFormModal({
rows={2}
/>
<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
</label>
<select
......@@ -146,7 +146,7 @@ function SoundmarkFormModal({
/>
{values.tier === 'business' && (
<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
</label>
<select
......@@ -200,12 +200,12 @@ function PlaylistModal({
onClick={onClose}
>
<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()}
>
<div className="mb-3 flex items-center justify-between">
<p className="text-sm font-semibold text-white">{soundmark.name} — playlist</p>
<button onClick={onClose} aria-label="Close" className="rounded-full p-1 text-neutral-500 hover:text-white">
<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-outline hover:text-on-surface">
<X size={18} strokeWidth={1.75} />
</button>
</div>
......@@ -214,21 +214,21 @@ function PlaylistModal({
Add track
</Button>
{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) => (
<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">
<p className="truncate text-sm font-medium text-white">{track.title}</p>
<p className="truncate text-xs text-neutral-500">{track.artist}</p>
<p className="truncate text-sm font-medium text-on-surface">{track.title}</p>
<p className="truncate text-xs text-outline">{track.artist}</p>
</div>
<button
onClick={() => onRemove(track.id)}
disabled={savingSongId === track.id}
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} />
</button>
......@@ -406,18 +406,18 @@ export function AdminPanel() {
return (
<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) => (
<button
key={s}
onClick={() => setSection(s)}
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 === '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}
</span>
)}
......@@ -425,7 +425,7 @@ export function AdminPanel() {
))}
</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' && (
<>
......@@ -435,7 +435,7 @@ export function AdminPanel() {
</Button>
{loading && (
<div className="divide-y divide-neutral-800/80">
<div className="divide-y divide-outline-variant/80">
<SkeletonRow />
<SkeletonRow />
</div>
......@@ -446,16 +446,16 @@ export function AdminPanel() {
<ul className="space-y-3">
{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="min-w-0">
<div className="flex items-center gap-2">
<p className="truncate font-medium text-white">{sm.name}</p>
<span className="shrink-0 rounded-full bg-neutral-800 px-2 py-0.5 text-[10px] font-medium text-neutral-400">
<p className="truncate font-medium text-on-surface">{sm.name}</p>
<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]}
</span>
</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.business_owner_username ? ` · Owned by ${sm.business_owner_username}` : ''}
{sm.tier === 'community' ? ` · ${sm.proposal_count} proposal(s)` : ''}
......@@ -465,7 +465,7 @@ export function AdminPanel() {
onClick={() => handleDelete(sm)}
disabled={savingKey === `delete-${sm.id}`}
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} />
</button>
......@@ -475,18 +475,18 @@ export function AdminPanel() {
{sm.song?.coverart ? (
<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} />
</div>
)}
<div className="min-w-0 flex-1">
{sm.song ? (
<>
<p className="truncate text-sm font-medium text-white">{sm.song.title}</p>
<p className="truncate text-xs text-neutral-400">{sm.song.artist}</p>
<p className="truncate text-sm font-medium text-on-surface">{sm.song.title}</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>
......@@ -521,7 +521,7 @@ export function AdminPanel() {
</Button>
)}
{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
</p>
)}
......@@ -538,7 +538,7 @@ export function AdminPanel() {
{section === 'review queue' && (
<>
{loading && (
<div className="divide-y divide-neutral-800/80">
<div className="divide-y divide-outline-variant/80">
<SkeletonRow />
<SkeletonRow />
</div>
......@@ -548,11 +548,11 @@ export function AdminPanel() {
)}
<ul className="space-y-3">
{queue.map((s) => (
<li key={s.id} className="rounded-xl border border-neutral-800 bg-neutral-900 p-3">
<p className="mb-2 flex items-center gap-1.5 text-xs text-neutral-500">
<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-outline">
<MapPin size={12} strokeWidth={2.5} />
{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] : ''}
</span>
</p>
......@@ -560,13 +560,13 @@ export function AdminPanel() {
{s.song?.coverart ? (
<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} />
</div>
)}
<div className="min-w-0 flex-1">
<p className="truncate text-sm font-medium text-white">{s.song?.title}</p>
<p className="truncate text-xs text-neutral-400">
<p className="truncate text-sm font-medium text-on-surface">{s.song?.title}</p>
<p className="truncate text-xs text-on-surface-variant">
{s.song?.artist} · suggested by {s.suggested_by_username ?? 'someone'}
</p>
</div>
......@@ -601,25 +601,25 @@ export function AdminPanel() {
{section === 'users' && (
<>
{loading && (
<div className="divide-y divide-neutral-800/80">
<div className="divide-y divide-outline-variant/80">
<SkeletonRow />
<SkeletonRow />
</div>
)}
{!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) => (
<li key={u.id} className="flex items-center justify-between gap-3 py-3">
<div className="min-w-0">
<p className="truncate font-medium text-white">{u.username ?? `User #${u.id}`}</p>
<p className="truncate text-xs text-neutral-500">{u.phone_number ?? '—'}</p>
<p className="truncate font-medium text-on-surface">{u.username ?? `User #${u.id}`}</p>
<p className="truncate text-xs text-outline">{u.phone_number ?? '—'}</p>
</div>
<select
value={u.role}
onChange={(e) => handleRoleChange(u.id, e.target.value)}
disabled={savingKey === `role-${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="business_admin">business_admin</option>
......
......@@ -85,18 +85,18 @@ export function BusinessPanel() {
return (
<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) => (
<button
key={s}
onClick={() => setSection(s)}
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 === '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}
</span>
)}
......@@ -104,17 +104,17 @@ export function BusinessPanel() {
))}
</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' && (
<>
<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
tagged song on Stax. The first track is what's currently playing.
</p>
{loading && (
<div className="divide-y divide-neutral-800/80">
<div className="divide-y divide-outline-variant/80">
<SkeletonRow />
<SkeletonRow />
</div>
......@@ -125,46 +125,46 @@ export function BusinessPanel() {
<ul className="space-y-3">
{soundmarks.map((sm) => (
<li key={sm.id} className="rounded-xl border border-neutral-800 bg-neutral-900 p-3">
<div className="mb-2 flex items-center gap-1.5 px-1 text-xs font-medium uppercase tracking-wide text-neutral-500">
<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-outline">
<MapPin size={12} strokeWidth={2.5} />
{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 className="flex items-center gap-4 p-1">
{sm.song?.coverart ? (
<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} />
</div>
)}
<div className="min-w-0 flex-1">
{sm.song ? (
<>
<p className="truncate font-medium text-white">{sm.song.title}</p>
<p className="truncate text-sm text-neutral-400">{sm.song.artist}</p>
<p className="truncate font-medium text-on-surface">{sm.song.title}</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>
{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) => (
<li key={track.id} className="flex items-center gap-3 py-2">
<div className="min-w-0 flex-1">
<p className="truncate text-sm text-neutral-300">{track.title}</p>
<p className="truncate text-xs text-neutral-500">{track.artist}</p>
<p className="truncate text-sm text-on-surface">{track.title}</p>
<p className="truncate text-xs text-outline">{track.artist}</p>
</div>
<button
onClick={() => handleRemoveTrack(sm.id, track.id)}
disabled={savingKey === `track-${track.id}`}
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} />
</button>
......@@ -190,7 +190,7 @@ export function BusinessPanel() {
)}
</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>
))}
</ul>
......@@ -199,12 +199,12 @@ export function BusinessPanel() {
{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
reject to dismiss.
</p>
{loading && (
<div className="divide-y divide-neutral-800/80">
<div className="divide-y divide-outline-variant/80">
<SkeletonRow />
<SkeletonRow />
</div>
......@@ -214,8 +214,8 @@ export function BusinessPanel() {
)}
<ul className="space-y-3">
{queue.map((s) => (
<li key={s.id} className="rounded-xl border border-neutral-800 bg-neutral-900 p-3">
<p className="mb-2 flex items-center gap-1.5 text-xs text-neutral-500">
<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-outline">
<MapPin size={12} strokeWidth={2.5} />
{s.soundmark_name}
</p>
......@@ -223,13 +223,13 @@ export function BusinessPanel() {
{s.song?.coverart ? (
<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} />
</div>
)}
<div className="min-w-0 flex-1">
<p className="truncate text-sm font-medium text-white">{s.song?.title}</p>
<p className="truncate text-xs text-neutral-400">
<p className="truncate text-sm font-medium text-on-surface">{s.song?.title}</p>
<p className="truncate text-xs text-on-surface-variant">
{s.song?.artist} · suggested by {s.suggested_by_username ?? 'someone'}
</p>
</div>
......
import { useEffect, useState } from 'react'
import { Rss } from 'lucide-react'
import { Layout } from '../components/Layout'
import { Button } from '../components/ui/Button'
import { Input } from '../components/ui/Input'
import { EmptyState } from '../components/ui/EmptyState'
......@@ -55,7 +54,7 @@ export function Channels() {
}
return (
<Layout title="Channels">
<>
<form onSubmit={handleCreate} className="mb-6 flex gap-2">
<Input value={newName} onChange={(e) => setNewName(e.target.value)} placeholder="New channel name" />
<Button type="submit">Create</Button>
......@@ -75,11 +74,11 @@ export function Channels() {
{channels.map((channel) => (
<li
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">
<p className="truncate font-medium text-white">{channel.name}</p>
<p className="text-xs text-neutral-500">
<p className="truncate font-medium text-on-surface">{channel.name}</p>
<p className="text-xs text-outline">
{followerCounts[channel.id] ?? 0} followers · owner #{channel.owner_id}
</p>
</div>
......@@ -96,6 +95,6 @@ export function Channels() {
</li>
))}
</ul>
</Layout>
</>
)
}
......@@ -143,7 +143,7 @@ export function Discovery() {
return (
<Layout title="Discovery">
{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
type="button"
onClick={startListening}
......@@ -153,28 +153,28 @@ export function Discovery() {
>
{listening && (
<>
<span className="absolute inset-0 animate-ping rounded-full bg-emerald-500/30" />
<span className="absolute inset-0 rounded-full bg-emerald-500/10" />
<span className="absolute inset-0 animate-ping rounded-full bg-primary/30" />
<span className="absolute inset-0 rounded-full bg-primary/10" />
</>
)}
<span
className={`relative flex h-20 w-20 items-center justify-center rounded-full border transition-colors duration-150 ${
listening
? 'border-emerald-500 bg-emerald-500/15 text-emerald-400'
: 'border-neutral-700 bg-neutral-900 text-neutral-400 hover:border-neutral-600 hover:text-neutral-200'
? 'border-primary bg-primary/15 text-primary'
: '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} />}
</span>
</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"}
</span>
</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">
<Ear size={26} strokeWidth={1.5} className="text-neutral-500" />
<span className="text-sm text-neutral-400">Drop a short clip of what's playing to identify it</span>
<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-outline" />
<span className="text-sm text-on-surface-variant">Drop a short clip of what's playing to identify it</span>
<input
type="file"
accept="audio/*"
......@@ -182,15 +182,15 @@ export function Discovery() {
onChange={(e) => e.target.files?.[0] && handleListen(e.target.files[0])}
className="hidden"
/>
{busy && <span className="text-xs text-neutral-500">Identifying…</span>}
{busy && <span className="text-xs text-outline">Identifying…</span>}
</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 && (
<div className="divide-y divide-neutral-800/80">
<div className="divide-y divide-outline-variant/80">
<SkeletonRow />
<SkeletonRow />
</div>
......@@ -199,31 +199,31 @@ export function Discovery() {
<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) => {
const isCurrent = song.library_song_id !== null && currentSong?.id === song.library_song_id
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 ? (
<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} />
</div>
)}
<div className="min-w-0 flex-1">
<p className="truncate font-medium text-white">{song.title}</p>
<p className="truncate text-sm text-neutral-400">{song.artist}</p>
<p className="truncate font-medium text-on-surface">{song.title}</p>
<p className="truncate text-sm text-on-surface-variant">{song.artist}</p>
</div>
{song.library_song_id !== null && (
<button
onClick={() => toggle(toPlayable(song), history.filter((s) => s.library_song_id !== null).map(toPlayable))}
disabled={isCurrent && streamLoading}
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 ? (
<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 ? (
<Pause size={18} strokeWidth={2} fill="currentColor" />
) : (
......@@ -235,7 +235,7 @@ export function Discovery() {
onClick={() => handleSwipe(song.id, true)}
aria-label="Like"
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'} />
......@@ -244,7 +244,7 @@ export function Discovery() {
onClick={() => handleSwipe(song.id, false)}
aria-label="Dismiss"
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} />
......
import { useEffect, useRef, useState } from 'react'
import { MapPinned, Music2, Pause, Play, Radio, Shuffle } from 'lucide-react'
import { Layout } from '../components/Layout'
import { Button } from '../components/ui/Button'
import { EmptyState } from '../components/ui/EmptyState'
import { ApiError } from '../api/client'
......@@ -174,25 +173,25 @@ export function GeoDrops() {
const canPlayPlaylist = nearby.some((n) => n.listener.song)
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
people nearby see. Or just browse: play a shuffled mix of what everyone around you is listening to
right now.
</p>
{status === 'idle' && (
<div className="flex flex-col items-center gap-4 rounded-xl border border-dashed border-neutral-700 p-10 text-center">
<MapPinned size={28} strokeWidth={1.5} className="text-neutral-500" />
<p className="text-sm text-neutral-400">Use your location to find live listeners near you.</p>
<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-outline" />
<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>
</div>
)}
{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
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"
/>
<p className="text-sm">Getting your location…</p>
......@@ -200,8 +199,8 @@ export function GeoDrops() {
)}
{status === 'error' && (
<div className="rounded-xl border border-red-900/50 bg-neutral-900 p-4">
<p className="text-sm text-red-400">{error}</p>
<div className="rounded-xl border border-error/30 bg-surface-container p-4">
<p className="text-sm text-error">{error}</p>
<Button variant="secondary" size="sm" onClick={start} className="mt-3">
Try again
</Button>
......@@ -217,7 +216,7 @@ export function GeoDrops() {
className="gap-1.5"
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'}
</Button>
<Button variant="secondary" onClick={playGeoPlaylist} disabled={!canPlayPlaylist} className="gap-1.5">
......@@ -226,13 +225,13 @@ export function GeoDrops() {
</Button>
</div>
{sharing && (
<p className="mb-4 text-xs text-neutral-500">
<p className="mb-4 text-xs text-outline">
Sharing live · broadcasting{' '}
{currentSong && currentSong.id > 0 ? `"${currentSong.title}"` : 'no song right now'}
</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 && (
<EmptyState icon={MapPinned} message="No one nearby is sharing their location right now." />
......@@ -243,31 +242,31 @@ export function GeoDrops() {
const active = listener.song ? toPlayable(listener) : null
const isCurrent = !!active && currentSong?.id === active.id
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 ? (
<button
onClick={() => toggle(active)}
disabled={isCurrent && streamLoading}
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 ? (
<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} />
</div>
)}
<div className="min-w-0 flex-1">
<p className="truncate text-sm font-medium text-white">{listener.song!.title}</p>
<p className="truncate text-xs text-neutral-400">{listener.song!.artist}</p>
<p className="mt-0.5 text-xs text-neutral-500">
<p className="truncate text-sm font-medium text-on-surface">{listener.song!.title}</p>
<p className="truncate text-xs text-on-surface-variant">{listener.song!.artist}</p>
<p className="mt-0.5 text-xs text-outline">
{formatDistance(distance_km)} · {listener.username ?? `user #${listener.user_id}`}
</p>
</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 ? (
<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 ? (
<Pause size={16} strokeWidth={2} fill="currentColor" />
) : (
......@@ -277,12 +276,12 @@ export function GeoDrops() {
</button>
) : (
<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} />
</div>
<div className="min-w-0 flex-1">
<p className="text-sm text-neutral-400">{listener.username ?? `user #${listener.user_id}`}</p>
<p className="text-xs text-neutral-500">{formatDistance(distance_km)} · not playing anything</p>
<p className="text-sm text-on-surface-variant">{listener.username ?? `user #${listener.user_id}`}</p>
<p className="text-xs text-outline">{formatDistance(distance_km)} · not playing anything</p>
</div>
</div>
)}
......@@ -292,6 +291,6 @@ export function GeoDrops() {
</ul>
</>
)}
</Layout>
</>
)
}
......@@ -35,7 +35,7 @@ function SongRow({
const { currentSong, isPlaying, isLoading: streamLoading, toggle } = usePlayer()
const isCurrent = currentSong?.id === song.id
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
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
......@@ -44,25 +44,27 @@ function SongRow({
onClick={() => toggle(toPlayable(song), queue.map(toPlayable))}
disabled={isCurrent && streamLoading}
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 ? (
<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} />
</div>
)}
<div className="min-w-0 flex-1">
<p className="truncate font-medium text-white">{song.title}</p>
<p className="truncate text-sm text-neutral-400">
<p className="truncate font-medium text-on-surface group-hover:text-primary">{song.title}</p>
<p className="truncate text-sm text-on-surface-variant">
{song.artist}
{song.album ? ` · ${song.album}` : ''}
</p>
</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 ? (
<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 ? (
<Pause size={16} strokeWidth={2} fill="currentColor" />
) : (
......@@ -73,7 +75,7 @@ function SongRow({
<button
onClick={() => onAddToPlaylist(song)}
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} />
</button>
......@@ -123,7 +125,7 @@ export function Library() {
return (
<Layout title="Library">
<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
placeholder="Search songs and albums"
value={query}
......@@ -133,13 +135,13 @@ export function Library() {
</div>
{loading && !isSearching && (
<div className="divide-y divide-neutral-800/80">
<div className="space-y-1">
<SkeletonRow />
<SkeletonRow />
<SkeletonRow />
</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 && (
<EmptyState icon={Music2} message="No songs yet - tag something from Telegram to see it here." />
)}
......@@ -157,8 +159,8 @@ export function Library() {
)}
{!searching && searchResults.albums.length > 0 && (
<div className="mb-6">
<h2 className="mb-2 text-xs font-medium uppercase tracking-wider text-neutral-500">Albums</h2>
<ul className="divide-y divide-neutral-800/80">
<h2 className="mb-2 text-xs font-semibold uppercase tracking-[0.1em] text-primary">Albums</h2>
<ul className="space-y-1">
{searchResults.albums.map((album) => {
const key = albumKey(album)
const expanded = expandedAlbum === key
......@@ -167,24 +169,24 @@ export function Library() {
<button
onClick={() => setExpandedAlbum(expanded ? null : key)}
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 ? (
<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} />
</div>
)}
<div className="min-w-0 flex-1">
<p className="truncate font-medium text-white">{album.album}</p>
<p className="truncate text-sm text-neutral-400">
<p className="truncate font-medium text-on-surface">{album.album}</p>
<p className="truncate text-sm text-on-surface-variant">
{album.artist} · {album.track_count} track{album.track_count === 1 ? '' : 's'}
</p>
</div>
</button>
{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) => (
<SongRow key={s.id} song={s} queue={album.songs} onAddToPlaylist={setAddingSong} />
))}
......@@ -198,8 +200,8 @@ export function Library() {
)}
{!searching && searchResults.songs.length > 0 && (
<div>
<h2 className="mb-2 text-xs font-medium uppercase tracking-wider text-neutral-500">Songs</h2>
<ul className="divide-y divide-neutral-800/80">
<h2 className="mb-2 text-xs font-semibold uppercase tracking-[0.1em] text-primary">Songs</h2>
<ul className="space-y-1">
{searchResults.songs.map((song) => (
<SongRow key={song.id} song={song} queue={searchResults.songs} onAddToPlaylist={setAddingSong} />
))}
......@@ -208,7 +210,7 @@ export function Library() {
)}
</>
) : (
<ul className="divide-y divide-neutral-800/80">
<ul className="space-y-1">
{songs.map((song) => (
<SongRow key={song.id} song={song} queue={songs} onAddToPlaylist={setAddingSong} />
))}
......
......@@ -50,12 +50,12 @@ export function Login() {
}
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="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>
<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.'}
</p>
</div>
......@@ -78,14 +78,14 @@ export function Login() {
onChange={(e) => setPassword(e.target.value)}
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">
{busy ? (mode === 'login' ? 'Signing in…' : 'Creating account…') : mode === 'login' ? 'Sign in' : 'Create account'}
</Button>
<button
type="button"
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'}
</button>
......
import { useEffect, useRef, useState } from '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 { EmptyState } from '../components/ui/EmptyState'
import { SoundmarkMap } from '../components/SoundmarkMap'
......@@ -178,24 +177,24 @@ export function Nearby() {
const topProposals = proposals.slice(0, 3)
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
changes to; community spots are fully driven by votes - whichever song has the most wins.
</p>
{status === 'idle' && (
<div className="flex flex-col items-center gap-4 rounded-xl border border-dashed border-neutral-700 p-10 text-center">
<MapPin size={28} strokeWidth={1.5} className="text-neutral-500" />
<p className="text-sm text-neutral-400">Use your location to find soundmarks near you.</p>
<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-outline" />
<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>
</div>
)}
{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
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"
/>
<p className="text-sm">Getting your location…</p>
......@@ -203,8 +202,8 @@ export function Nearby() {
)}
{status === 'error' && (
<div className="rounded-xl border border-red-900/50 bg-neutral-900 p-4">
<p className="text-sm text-red-400">{error}</p>
<div className="rounded-xl border border-error/30 bg-surface-container p-4">
<p className="text-sm text-error">{error}</p>
<Button variant="secondary" size="sm" onClick={start} className="mt-3">
Try again
</Button>
......@@ -222,11 +221,11 @@ export function Nearby() {
)}
{status === 'ready' && closest && (
<div className="rounded-xl border border-neutral-800 bg-neutral-900 p-3">
<p className="mb-2 flex items-center gap-1.5 px-1 text-xs font-medium uppercase tracking-wide text-emerald-400">
<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-primary">
<MapPin size={12} strokeWidth={2.5} />
{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]}
</span>
</p>
......@@ -236,22 +235,22 @@ export function Nearby() {
onClick={() => toggle(active)}
disabled={isCurrent && streamLoading}
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 ? (
<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} />
</div>
)}
<div className="min-w-0 flex-1">
<p className="truncate font-semibold text-white">{active.title}</p>
<p className="truncate text-sm text-neutral-400">{active.artist}</p>
<p className="truncate font-semibold text-on-surface">{active.title}</p>
<p className="truncate text-sm text-on-surface-variant">{active.artist}</p>
</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 ? (
<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 ? (
<Pause size={16} strokeWidth={2} fill="currentColor" />
) : (
......@@ -261,28 +260,28 @@ export function Nearby() {
</button>
) : (
<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} />
</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.'}
</p>
</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 && (
<div className="mt-4 border-t border-neutral-800 pt-3">
<p className="mb-2 flex items-center gap-1.5 px-1 text-xs font-medium uppercase tracking-wide text-neutral-500">
<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-outline">
<ListMusic size={12} strokeWidth={2.5} />
Playlist
</p>
<ul className="divide-y divide-neutral-800/60">
<ul className="divide-y divide-outline-variant/60">
{closest.playlist.map((track) => (
<li key={track.id} className="flex items-center gap-3 px-1 py-2">
<div className="min-w-0 flex-1">
<p className="truncate text-sm font-medium text-white">{track.title}</p>
<p className="truncate text-xs text-neutral-500">{track.artist}</p>
<p className="truncate text-sm font-medium text-on-surface">{track.title}</p>
<p className="truncate text-xs text-outline">{track.artist}</p>
</div>
</li>
))}
......@@ -290,15 +289,15 @@ export function Nearby() {
</div>
)}
<div className="mt-4 border-t border-neutral-800 pt-3">
<div className="mt-4 border-t border-outline-variant pt-3">
{isCommunity ? (
<>
<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
onClick={() => setShowSongPicker(true)}
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} />
Propose a song
......@@ -306,11 +305,11 @@ export function Nearby() {
</div>
{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.
</p>
) : (
<ul className="divide-y divide-neutral-800/60">
<ul className="divide-y divide-outline-variant/60">
{topProposals.map((proposal) => (
<li key={proposal.id} className="flex items-center gap-3 py-2">
<button
......@@ -322,19 +321,19 @@ export function Nearby() {
? `Remove your 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
? 'border-emerald-400 bg-emerald-400/10 text-emerald-400'
: 'border-neutral-700 text-neutral-400 hover:text-white'
? 'border-primary bg-primary/10 text-primary'
: 'border-outline-variant text-on-surface-variant hover:text-on-surface'
}`}
>
<ThumbsUp size={13} strokeWidth={2} fill={proposal.has_voted ? 'currentColor' : 'none'} />
</button>
<div className="min-w-0 flex-1">
<p className="truncate text-sm font-medium text-white">{proposal.song?.title}</p>
<p className="truncate text-xs text-neutral-500">{proposal.song?.artist}</p>
<p className="truncate text-sm font-medium text-on-surface">{proposal.song?.title}</p>
<p className="truncate text-xs text-outline">{proposal.song?.artist}</p>
</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'}
</span>
</li>
......@@ -344,11 +343,11 @@ export function Nearby() {
</>
) : (
<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.
</p>
{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} />
Suggested
</span>
......@@ -356,7 +355,7 @@ export function Nearby() {
<button
onClick={() => setShowSongPicker(true)}
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} />
Suggest a song
......@@ -369,6 +368,6 @@ export function Nearby() {
)}
{showSongPicker && <SongPicker onClose={() => setShowSongPicker(false)} onSelect={handleSongPicked} />}
</Layout>
</>
)
}
......@@ -81,24 +81,24 @@ export function Playlists() {
<Layout title={selected.name}>
<button
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} />
Playlists
</button>
{detailLoading && (
<div className="divide-y divide-neutral-800/80">
<div className="divide-y divide-outline-variant/80">
<SkeletonRow />
<SkeletonRow />
</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 && (
<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) => {
const isCurrent = currentSong?.id === song.id
return (
......@@ -107,25 +107,25 @@ export function Playlists() {
onClick={() => toggle(toPlayable(song), tracks.map(toPlayable))}
disabled={isCurrent && streamLoading}
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 ? (
<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} />
</div>
)}
<div className="min-w-0 flex-1">
<p className="truncate font-medium text-white">{song.title}</p>
<p className="truncate text-sm text-neutral-400">
<p className="truncate font-medium text-on-surface">{song.title}</p>
<p className="truncate text-sm text-on-surface-variant">
{song.artist}
{song.album ? ` · ${song.album}` : ''}
</p>
</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 ? (
<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 ? (
<Pause size={16} strokeWidth={2} fill="currentColor" />
) : (
......@@ -144,7 +144,7 @@ export function Playlists() {
return (
<Layout title="Playlists">
<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 && (
<Button size="sm" onClick={() => setCreating(true)}>
<Plus size={16} strokeWidth={2} />
......@@ -163,7 +163,7 @@ export function Playlists() {
autoFocus
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>
<Button type="submit" size="sm" disabled={createBusy || !newName.trim()}>
{createBusy ? 'Creating…' : 'Create'}
......@@ -184,29 +184,29 @@ export function Playlists() {
)}
{loading && (
<div className="divide-y divide-neutral-800/80">
<div className="divide-y divide-outline-variant/80">
<SkeletonRow />
<SkeletonRow />
</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 && (
<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) => (
<li key={playlist.id}>
<button
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} />
</div>
<div className="min-w-0 flex-1">
<p className="truncate font-medium text-white">{playlist.name}</p>
<p className="truncate text-sm text-neutral-400">
<p className="truncate font-medium text-on-surface">{playlist.name}</p>
<p className="truncate text-sm text-on-surface-variant">
Created {new Date(playlist.created_at).toLocaleDateString()}
</p>
</div>
......
import { useEffect, useState } from 'react'
import { ArrowLeft, Disc3, Music2, Pause, Play, Plus, Shuffle } from 'lucide-react'
import { Layout } from '../components/Layout'
import { Button } from '../components/ui/Button'
import { Input } from '../components/ui/Input'
import { EmptyState } from '../components/ui/EmptyState'
......@@ -33,10 +32,10 @@ function PlayButton({ post }: { post: Post }) {
onClick={() => toggle(active)}
disabled={isCurrent && streamLoading}
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 ? (
<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 ? (
<Pause size={15} strokeWidth={2} fill="currentColor" />
) : (
......@@ -52,15 +51,15 @@ function PostRow({ post, onOpen }: { post: Post; onOpen?: () => void }) {
{post.song?.coverart ? (
<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} />
</div>
)}
<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-xs text-neutral-400">{post.song?.artist}</p>
{post.caption && <p className="mt-0.5 truncate text-xs text-neutral-500">"{post.caption}"</p>}
<p className="mt-0.5 text-xs text-neutral-600">
<p className="truncate text-sm font-medium text-on-surface">{post.song?.title ?? 'Unknown song'}</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-outline">"{post.caption}"</p>}
<p className="mt-0.5 text-xs text-on-surface-variant">
{post.username ?? `user #${post.user_id}`}
{post.remix_count !== undefined && post.remix_count > 0 && ` · ${post.remix_count} remix${post.remix_count === 1 ? '' : 'es'}`}
</p>
......@@ -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 }) {
return (
<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} />
<button
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} />
Remix this
</button>
</div>
{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) => (
<RemixTreeNode key={child.post.id} node={child} depth={depth + 1} onRemix={onRemix} />
))}
......@@ -161,13 +160,13 @@ export function Posts() {
if (openPostId !== null) {
return (
<Layout title="Post">
<>
<button
onClick={() => {
setOpenPostId(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} />
Back to feed
......@@ -179,7 +178,7 @@ export function Posts() {
<SkeletonRow />
</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 && (
<ul className="space-y-2">
<RemixTreeNode node={tree} depth={0} onRemix={setRemixTarget} />
......@@ -187,28 +186,28 @@ export function Posts() {
)}
{remixTarget && <SongPicker onClose={() => setRemixTarget(null)} onSelect={handleRemixPick} />}
</Layout>
</>
)
}
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
grows into a whole tree of takes on the same idea.
</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 ? (
<div className="mb-3 flex items-center gap-3 rounded-lg bg-neutral-800/60 p-2">
<Disc3 size={18} strokeWidth={1.75} className="shrink-0 text-neutral-500" />
<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-outline" />
<div className="min-w-0 flex-1">
<p className="truncate text-sm font-medium text-white">{pendingSong.title}</p>
<p className="truncate text-xs text-neutral-400">{pendingSong.artist}</p>
<p className="truncate text-sm font-medium text-on-surface">{pendingSong.title}</p>
<p className="truncate text-xs text-on-surface-variant">{pendingSong.artist}</p>
</div>
<button
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
</button>
......@@ -230,10 +229,10 @@ export function Posts() {
</Button>
</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 && (
<div className="divide-y divide-neutral-800/80">
<div className="divide-y divide-outline-variant/80">
<SkeletonRow />
<SkeletonRow />
</div>
......@@ -244,13 +243,13 @@ export function Posts() {
<ul className="space-y-2">
{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)} />
</li>
))}
</ul>
{showSongPicker && <SongPicker onClose={() => setShowSongPicker(false)} onSelect={handlePickSongForNewPost} />}
</Layout>
</>
)
}
......@@ -58,7 +58,7 @@ export function Remix() {
return (
<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
arrangement using each song's real audio and already-known title/artist/genre, Demucs does the
stem separation.
......@@ -68,10 +68,10 @@ export function Remix() {
<button
type="button"
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" />
<span className="text-sm text-neutral-400">Choose up to 5 songs from your library</span>
<ListMusic size={22} strokeWidth={1.5} className="text-outline" />
<span className="text-sm text-on-surface-variant">Choose up to 5 songs from your library</span>
</button>
{selectedSongs.length > 0 && (
......@@ -79,19 +79,19 @@ export function Remix() {
{selectedSongs.map((song) => (
<li
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">
<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">
{song.title} <span className="text-neutral-500">· {song.artist}</span>
{song.title} <span className="text-outline">· {song.artist}</span>
</span>
</span>
<button
type="button"
onClick={() => removeSong(song.id)}
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} />
</button>
......@@ -118,34 +118,34 @@ export function Remix() {
)}
{submitting && !status && (
<p className="mt-4 flex items-center gap-2 text-sm text-neutral-400">
<span className="h-3.5 w-3.5 animate-spin rounded-full border-2 border-neutral-700 border-t-neutral-300" />
<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-outline-variant border-t-on-surface" />
Starting…
</p>
)}
{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} />
{error}
</p>
)}
{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">
{STAGES.slice(0, -1).map((stage, i) => (
<div
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>
<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}
</p>
{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} />
"{status.remix_name}" added to your library -{' '}
<Link to="/library" className="underline hover:no-underline">
......
......@@ -141,6 +141,15 @@ const BACKEND_TODO: WorkItem[] = [
// --- Frontend ---
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',
items: [
......@@ -153,14 +162,21 @@ const FRONTEND_DONE: DoneGroup[] = [
{
area: 'Soundmarks',
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",
],
},
{ 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: 'Posts', items: ['Feed, composer, recursive remix-tree view with "remix this" at every node'] },
{ area: 'Live Location', items: ['GeoDrops page: share toggle, live nearby list, cross-account playback, geo-playlist shuffle-play'] },
{
area: 'Social',
items: [
'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',
items: [
......
import { useEffect, useState } from 'react'
import { ChevronRight, Radio } from 'lucide-react'
import { Layout } from '../components/Layout'
import { Button } from '../components/ui/Button'
import { Input } from '../components/ui/Input'
import { EmptyState } from '../components/ui/EmptyState'
......@@ -35,7 +34,7 @@ export function Rooms() {
}
return (
<Layout title="Pass-the-Aux Rooms">
<>
<form onSubmit={handleCreate} className="mb-6 flex gap-2">
<Input
value={newRoomName}
......@@ -54,23 +53,23 @@ export function Rooms() {
<li key={room.id}>
<button
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">
<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="relative inline-flex h-2 w-2 rounded-full bg-emerald-500" />
<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-primary" />
</span>
<div>
<p className="font-medium text-white">{room.name}</p>
<p className="text-xs text-neutral-500">DJ #{room.dj_id}</p>
<p className="font-medium text-on-surface">{room.name}</p>
<p className="text-xs text-outline">DJ #{room.dj_id}</p>
</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>
</li>
))}
</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() {
return (
<Layout title="Link Telegram">
<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 === 'code' && `Enter the code sent to ${phoneNumber}.`}
{step === 'password' && 'Two-step verification is on for this account. Enter your Telegram cloud password.'}
</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' && (
<form onSubmit={handleSendCode} className="space-y-3">
......@@ -204,7 +204,7 @@ export function TelegramLink() {
onChange={(e) => setPhoneNumber(e.target.value)}
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">
{busy ? 'Sending code…' : 'Send code'}
</Button>
......@@ -223,14 +223,14 @@ export function TelegramLink() {
onChange={(e) => setCode(e.target.value)}
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">
{busy ? 'Verifying…' : 'Verify & link'}
</Button>
<button
type="button"
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
</button>
......@@ -248,14 +248,14 @@ export function TelegramLink() {
onChange={(e) => setPassword(e.target.value)}
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">
{busy ? 'Verifying…' : 'Verify & link'}
</Button>
<button
type="button"
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
</button>
......@@ -271,7 +271,7 @@ export function TelegramLink() {
<Layout title={selectedChat.title}>
<button
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
</button>
......@@ -281,11 +281,11 @@ export function TelegramLink() {
<SkeletonRow />
</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 && (
<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) => {
const saved = savedMeta[m.message_id]
const saveError = saveErrors[m.message_id]
......@@ -296,7 +296,7 @@ export function TelegramLink() {
<button
onClick={() => toggle(toPreviewPlayable(selectedChat.id, m))}
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 ? (
<Pause size={18} strokeWidth={1.75} />
......@@ -305,12 +305,12 @@ export function TelegramLink() {
)}
</button>
<div className="min-w-0 flex-1">
<p className="truncate font-medium text-white">{saved ? saved.title : m.title}</p>
<p className="truncate text-sm text-neutral-400">{saved ? saved.artist : m.artist}</p>
{saveError && <p className="mt-1 text-xs text-red-400">{saveError}</p>}
<p className="truncate font-medium text-on-surface">{saved ? saved.title : m.title}</p>
<p className="truncate text-sm text-on-surface-variant">{saved ? saved.artist : m.artist}</p>
{saveError && <p className="mt-1 text-xs text-error">{saveError}</p>}
</div>
{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} />
Saved
</span>
......@@ -336,21 +336,21 @@ export function TelegramLink() {
return (
<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." />}
<ul className="divide-y divide-neutral-800/80">
<ul className="divide-y divide-outline-variant/80">
{chats.map((chat) => (
<li key={chat.id}>
<button
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} />
</div>
<div className="min-w-0 flex-1">
<p className="truncate font-medium text-white">{chat.title}</p>
<p className="truncate text-sm text-neutral-400">{chat.type}</p>
<p className="truncate font-medium text-on-surface">{chat.title}</p>
<p className="truncate text-sm text-on-surface-variant">{chat.type}</p>
</div>
</button>
</li>
......
......@@ -43,14 +43,14 @@ export function Upload() {
return (
<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
added to your library.
</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">
<UploadCloud size={28} strokeWidth={1.5} className="text-neutral-500" />
<span className="text-sm text-neutral-400">
<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-outline" />
<span className="text-sm text-on-surface-variant">
{file ? file.name : 'Choose an audio file, or drag one here'}
</span>
<input
......@@ -75,10 +75,10 @@ export function Upload() {
{stage === 'uploading' ? 'Uploading…' : stage === 'processing' ? 'Processing…' : 'Upload'}
</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 && (
<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
right is a status indicator rendered inside this same button. Download stays a
separate control below since it's a genuinely different action. */}
......@@ -95,24 +95,24 @@ export function Upload() {
}
disabled={isCurrent && streamLoading}
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 ? (
<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} />
</div>
)}
<div className="min-w-0 flex-1">
<p className="truncate font-semibold text-white">{result.metadata.title}</p>
<p className="truncate text-sm text-neutral-400">
<p className="truncate font-semibold text-on-surface">{result.metadata.title}</p>
<p className="truncate text-sm text-on-surface-variant">
{result.metadata.artist} · {result.metadata.album} · {result.metadata.genre}
</p>
</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 ? (
<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 ? (
<Pause size={16} strokeWidth={2} fill="currentColor" />
) : (
......@@ -124,7 +124,7 @@ export function Upload() {
href={result.download_url}
target="_blank"
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
</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