Changed theme to liquid glass

This commit is contained in:
patben8 committed 2026-09-25 14:57:27 +02:00
1 parent 950352f7ec
commit 2810f24563
52 files changed
+1353 -529

No files matched your search

@@ -0,0 +1,20 @@
/**
* The drifting wash of colour every glass surface sits on. Its colours are CSS
* custom properties set by `lib/ambient.ts` from the loaded track's cover art,
* so this renders once and never re-renders on a track change.
*
* Fixed behind the whole app (and pointer-transparent). The drift is transform
* only, so it stays on the compositor; reduced motion stops it.
*/
export function AmbientBackdrop() {
return (
<div aria-hidden className="ambient pointer-events-none fixed inset-0 -z-10 overflow-hidden bg-ink-950">
<div className="ambient-wash" style={{ left: '-12%', top: '-30%', width: '58vw', height: '58vw', background: 'radial-gradient(circle, var(--amb-1) 0%, transparent 64%)', opacity: 0.75, animation: 'drift-a 28s ease-in-out infinite alternate' }} />
<div className="ambient-wash" style={{ left: '42%', top: '-38%', width: '64vw', height: '54vw', background: 'radial-gradient(circle, var(--amb-2) 0%, transparent 62%)', opacity: 0.55, animation: 'drift-b 34s ease-in-out infinite alternate' }} />
<div className="ambient-wash" style={{ left: '66%', top: '40%', width: '54vw', height: '54vw', background: 'radial-gradient(circle, var(--amb-3) 0%, transparent 62%)', opacity: 0.5, animation: 'drift-c 30s ease-in-out infinite alternate' }} />
<div className="ambient-wash" style={{ left: '8%', top: '56%', width: '50vw', height: '44vw', background: 'radial-gradient(circle, var(--amb-4) 0%, transparent 64%)', opacity: 0.45, animation: 'drift-b 40s ease-in-out infinite alternate' }} />
{/* Vignette: keeps the edges and the table's lower rows calm. */}
<div className="absolute inset-0" style={{ background: 'radial-gradient(120% 90% at 50% 0%, rgb(5 6 10 / 0) 0%, rgb(5 6 10 / 0.55) 70%, rgb(5 6 10 / 0.85) 100%)' }} />
</div>
)
}
@@ -26,11 +26,11 @@ export function AnalyzeGridDialog({ total, existing, locked, onChoose, onClose }
return (
<div
aria-modal="true"
className="fixed inset-0 z-40 flex items-center justify-center bg-black/60 p-6"
className="fixed inset-0 z-40 flex items-center justify-center bg-black/40 backdrop-blur-[3px] p-6"
onClick={onClose}
>
<div
className="w-full max-w-sm overflow-hidden rounded-xl border border-line bg-ink-900 shadow-2xl"
className="w-full max-w-sm overflow-hidden glass-overlay"
onClick={(e) => e.stopPropagation()}
>
<div className="border-b border-line px-5 py-4">
@@ -71,7 +71,7 @@ export function AnalyzeGridDialog({ total, existing, locked, onChoose, onClose }
{canSkip && (
<button
onClick={() => onChoose(false)}
className="rounded-md bg-accent px-4 py-1.5 text-sm font-medium text-ink-950 hover:brightness-110"
className="rounded-full btn-primary px-4 py-1.5 text-sm font-semibold"
>
Skip {existing === 1 ? 'it' : 'them'}
</button>
+3 -3
View File
@@ -152,9 +152,9 @@ export function AutoCueDialog(props: Props) {
}
return (
<div aria-modal="true" className="fixed inset-0 z-40 flex items-center justify-center bg-black/60 p-6" onClick={() => !busy && onClose()}>
<div aria-modal="true" className="fixed inset-0 z-40 flex items-center justify-center bg-black/40 backdrop-blur-[3px] p-6" onClick={() => !busy && onClose()}>
<div
className="flex max-h-[85vh] w-full max-w-xl flex-col overflow-hidden rounded-xl border border-line bg-ink-900 shadow-2xl"
className="flex max-h-[85vh] w-full max-w-xl flex-col overflow-hidden glass-overlay"
onClick={(e) => e.stopPropagation()}
>
<div className="border-b border-line px-5 py-4">
@@ -281,7 +281,7 @@ export function AutoCueDialog(props: Props) {
<button
onClick={confirm}
disabled={busy || rows === null || active === 0}
className="rounded-md bg-accent px-4 py-1.5 text-sm font-semibold text-ink-950 hover:brightness-110 disabled:opacity-40"
className="rounded-full btn-primary px-4 py-1.5 text-sm font-semibold disabled:opacity-40"
>
{busy
? props.batch
+7 -6
View File
@@ -1,3 +1,5 @@
import { Icon } from '../lib/icons'
/** Jump-size cycle, in beats. Fractional sizes allow fine micro-nudging. */
export const BEAT_JUMP_SIZES = [0.25, 0.5, 1, 2, 4, 8, 16, 32]
@@ -13,9 +15,8 @@ interface Props {
}
const BTN =
'flex h-7 w-7 shrink-0 items-center justify-center rounded border border-line bg-ink-850 ' +
'text-xs font-semibold text-text transition-colors hover:border-accent disabled:opacity-30 ' +
'disabled:hover:border-line'
'btn-glass flex h-7 w-7 shrink-0 items-center justify-center rounded-lg ' +
'font-mono text-xs font-semibold text-text disabled:opacity-30'
/** Beats-only readout: 0.25 → "1/4", 0.5 → "1/2", else the integer. */
function sizeLabel(beats: number): string {
@@ -46,7 +47,7 @@ export function BeatJumpControls({ beats, onStep, onJump, disabled }: Props) {
>
−
</button>
<span className="w-9 text-center text-xs font-semibold tabular-nums text-text">
<span className="w-9 text-center font-mono text-xs font-semibold text-text">
{sizeLabel(beats)}
</span>
<button
@@ -64,7 +65,7 @@ export function BeatJumpControls({ beats, onStep, onJump, disabled }: Props) {
disabled={disabled}
title="Jump back (←)"
>
◀
<Icon name="chevronLeft" size={14} strokeWidth={2.2} />
</button>
<button
className={BTN}
@@ -72,7 +73,7 @@ export function BeatJumpControls({ beats, onStep, onJump, disabled }: Props) {
disabled={disabled}
title="Jump forward (→)"
>
▶
<Icon name="chevronRight" size={14} strokeWidth={2.2} />
</button>
</div>
)
+5 -5
View File
@@ -120,8 +120,8 @@ export function CollectionPicker({ onOpened, onCancel }: Props) {
const openError = open.isError ? (open.error as Error).message : null
return (
<div className="flex h-screen w-screen items-center justify-center bg-ink-950 p-6">
<div className="flex h-[600px] w-full max-w-2xl flex-col overflow-hidden rounded-xl border border-line bg-ink-900 shadow-2xl">
<div className="flex h-screen w-screen items-center justify-center p-6">
<div className="glass flex h-[600px] w-full max-w-2xl flex-col overflow-hidden">
{/* Header */}
<div className="flex items-center gap-3 border-b border-line px-5 py-4">
<div className="min-w-0 flex-1">
@@ -274,7 +274,7 @@ export function CollectionPicker({ onOpened, onCancel }: Props) {
<button
disabled={!here || open.isPending}
onClick={() => here && open.mutate(here)}
className="shrink-0 rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-ink-950 hover:brightness-110 disabled:cursor-not-allowed disabled:opacity-40"
className="shrink-0 rounded-full btn-primary px-3 py-1.5 text-sm font-semibold disabled:cursor-not-allowed disabled:opacity-40"
>
{open.isPending ? 'Opening…' : 'Open this folder'}
</button>
@@ -302,12 +302,12 @@ export function CollectionPicker({ onOpened, onCancel }: Props) {
? '…or paste a full path to the drive'
: `…or paste a full path to ${platform!.library_label}`
}
className="min-w-0 flex-1 rounded-md border border-line bg-ink-850 px-3 py-2 font-mono text-xs text-text outline-none placeholder:text-faint focus:border-accent"
className="min-w-0 flex-1 rounded-lg well px-3 py-2 font-mono text-xs text-text outline-none placeholder:text-faint focus:ring-1 focus:ring-accent"
/>
<button
disabled={!manual.trim() || open.isPending}
onClick={() => open.mutate(manual.trim())}
className="rounded-md bg-accent px-4 py-2 text-sm font-medium text-ink-950 hover:brightness-110 disabled:cursor-not-allowed disabled:opacity-40"
className="rounded-full btn-primary px-4 py-2 text-sm font-semibold disabled:cursor-not-allowed disabled:opacity-40"
>
{open.isPending ? 'Opening…' : 'Open'}
</button>
+3 -3
View File
@@ -46,11 +46,11 @@ export function ConfirmDialog({ title, body, confirmLabel, onConfirm, onClose }:
return (
<div
aria-modal="true"
className="fixed inset-0 z-40 flex items-center justify-center bg-black/60 p-6"
className="fixed inset-0 z-40 flex items-center justify-center bg-black/40 backdrop-blur-[3px] p-6"
onClick={() => !busy && onClose()}
>
<div
className="w-full max-w-sm overflow-hidden rounded-xl border border-line bg-ink-900 shadow-2xl"
className="w-full max-w-sm overflow-hidden glass-overlay"
onClick={(e) => e.stopPropagation()}
>
<div className="border-b border-line px-5 py-4 text-[15px] font-semibold tracking-tight">
@@ -68,7 +68,7 @@ export function ConfirmDialog({ title, body, confirmLabel, onConfirm, onClose }:
<button
onClick={() => void confirm()}
disabled={busy}
className="rounded-md bg-pink px-4 py-1.5 text-sm font-medium text-ink-950 hover:brightness-110 disabled:opacity-50"
className="rounded-full bg-pink/15 shadow-[inset_0_1px_0_rgb(255_255_255/0.12),inset_0_0_0_1px_rgb(255_122_154/0.55)] hover:bg-pink/25 px-4 py-1.5 text-sm font-semibold text-[#ffd0da] disabled:opacity-50"
>
{confirmLabel}
</button>
+18 -13
View File
@@ -1,8 +1,10 @@
import type { ReactNode } from 'react'
import { useEffect, useRef, useState } from 'react'
import { Icon } from '../lib/icons'
/** One row of a menu: an action, a submenu (`label ▸`), or a section heading. */
export type MenuItem =
| { label: string; onClick: () => void; danger?: boolean; hint?: string; icon?: string; disabled?: boolean }
| { label: string; onClick: () => void; danger?: boolean; hint?: string; icon?: ReactNode; disabled?: boolean }
| { label: string; submenu: MenuItem[] }
// Toggles in place and leaves the menu open, so several can be flipped in one go.
| { label: string; checked: boolean; onToggle: () => void }
@@ -54,7 +56,10 @@ export function ContextMenu({ x, y, items, onClose }: Props) {
}, [])
return (
<div ref={rootRef} role="menu" onClick={(e) => e.stopPropagation()}>
// `contents`: the panels are fixed-positioned, so this wrapper must take no
// part in layout. As an ordinary empty block it became one more item in
// the app's gapped flex column and pushed every panel down by a gap.
<div ref={rootRef} role="menu" className="contents" onClick={(e) => e.stopPropagation()}>
<MenuPanel
items={items}
onClose={onClose}
@@ -96,12 +101,12 @@ function MenuPanel({
return (
<>
<div
className={`fixed z-50 overflow-y-auto rounded-lg border border-line bg-ink-850 py-1 shadow-2xl ${className}`}
className={`glass-overlay fixed z-50 overflow-y-auto rounded-2xl p-1.5 ${className}`}
style={style}
>
{items.map((item, i) => {
if ('separator' in item) {
return <div key={i} className="my-1 border-t border-line" />
return <div key={i} className="mx-2 my-1 border-t border-line" />
}
if ('checked' in item) {
return (
@@ -111,14 +116,14 @@ function MenuPanel({
aria-checked={item.checked}
onMouseEnter={() => setOpen(null)}
onClick={item.onToggle}
className="flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm text-muted hover:bg-ink-800 hover:text-text"
className="flex w-full items-center gap-2 rounded-[10px] px-3 py-1.5 text-left text-sm text-muted hover:bg-ink-800 hover:text-text"
>
<span
className={`flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-sm border text-[10px] leading-none ${
item.checked ? 'border-accent bg-accent text-ink-950' : 'border-ink-600'
className={`flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded border leading-none ${
item.checked ? 'border-accent btn-primary' : 'border-ink-600'
}`}
>
{item.checked ? '✓' : ''}
{item.checked && <Icon name="check" size={10} strokeWidth={3.2} />}
</span>
<span className="min-w-0 flex-1 truncate">{item.label}</span>
</button>
@@ -140,12 +145,12 @@ function MenuPanel({
key={i}
onMouseEnter={(e) => openSubmenu(i, e.currentTarget)}
onClick={(e) => openSubmenu(i, e.currentTarget)}
className={`flex w-full items-center justify-between gap-4 px-3 py-1.5 text-left text-sm hover:bg-ink-800 hover:text-text ${
className={`flex w-full items-center justify-between gap-4 rounded-[10px] px-3 py-1.5 text-left text-sm hover:bg-ink-800 hover:text-text ${
open?.index === i ? 'bg-ink-800 text-text' : 'text-muted'
}`}
>
<span>{item.label}</span>
<span className="text-[10px] text-faint">▸</span>
<Icon name="chevronRight" size={12} strokeWidth={2.4} className="text-faint" />
</button>
)
}
@@ -158,7 +163,7 @@ function MenuPanel({
item.onClick()
onClose()
}}
className={`flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm ${
className={`flex w-full items-center gap-2 rounded-[10px] px-3 py-1.5 text-left text-sm ${
item.disabled
? 'cursor-default text-faint'
: item.danger
@@ -166,10 +171,10 @@ function MenuPanel({
: 'text-muted hover:bg-ink-800 hover:text-text'
}`}
>
{item.icon && <span className="shrink-0 text-[11px] text-gold">{item.icon}</span>}
{item.icon && <span className="flex shrink-0 text-gold">{item.icon}</span>}
<span className="min-w-0 flex-1 truncate">{item.label}</span>
{item.hint && (
<span className="shrink-0 text-[10px] tabular-nums text-faint">{item.hint}</span>
<span className="shrink-0 font-mono text-[10px] text-faint">{item.hint}</span>
)}
</button>
)
+7 -6
View File
@@ -2,6 +2,7 @@ import { useEffect } from 'react'
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
import { api, type PlaylistNode } from '../api'
import type { Source } from './Sidebar'
import { Icon } from '../lib/icons'
/**
* Plugged-in libraries, in the sidebar, the way rekordbox and Traktor show them.
@@ -107,11 +108,11 @@ export function DevicesSection({ source, onSelect, onError, onImport }: Props) {
}
className={`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm transition-colors ${
isOpen && source.kind === 'device'
? 'bg-accent-soft text-text'
? 'is-selected text-text'
: 'text-muted hover:bg-ink-800 hover:text-text'
}`}
>
<span className="w-3 text-center text-[11px] text-gold">⬒</span>
<span className="flex w-4 justify-center text-gold"><Icon name="drive" size={15} /></span>
<span className="flex-1 truncate" title={d.path}>
{d.label}
</span>
@@ -140,7 +141,7 @@ export function DevicesSection({ source, onSelect, onError, onImport }: Props) {
{viewingDevice && openPath && (
<button
onClick={onImport}
className="mt-2 mb-1 w-full rounded-md bg-accent px-2 py-1.5 text-sm font-medium text-ink-950 hover:brightness-110"
className="mt-2 mb-1 w-full rounded-full btn-primary px-2 py-1.5 text-sm font-semibold"
>
Import to collection…
</button>
@@ -178,14 +179,14 @@ function DevicePlaylistRow({
style={{ paddingLeft: 8 + depth * 12 }}
className={`flex w-full items-center gap-2 rounded-md py-1 pr-2 text-left text-sm transition-colors ${
selected
? 'bg-accent-soft text-text'
? 'is-selected text-text'
: node.selectable
? 'text-muted hover:bg-ink-800 hover:text-text'
: 'text-faint'
}`}
>
<span className="w-3 text-center text-[11px] text-faint">
{isFolder ? '▸' : '♫'}
<span className="flex w-4 justify-center text-faint">
<Icon name={isFolder ? 'folder' : 'playlist'} size={14} />
</span>
<span className="flex-1 truncate">{node.name}</span>
{!isFolder && <span className="text-[10px] text-faint">{node.count}</span>}
+5 -5
View File
@@ -97,11 +97,11 @@ export function EditTagsDialog({ track, onClose, onApplied, onError }: Props) {
return (
<div
aria-modal="true" className="fixed inset-0 z-40 flex items-center justify-center bg-black/60 p-6"
aria-modal="true" className="fixed inset-0 z-40 flex items-center justify-center bg-black/40 backdrop-blur-[3px] p-6"
onClick={onClose}
>
<div
className="flex max-h-[85vh] w-full max-w-lg flex-col overflow-hidden rounded-xl border border-line bg-ink-900 shadow-2xl"
className="flex max-h-[85vh] w-full max-w-lg flex-col overflow-hidden glass-overlay"
onClick={(e) => e.stopPropagation()}
>
<div className="border-b border-line px-5 py-4">
@@ -173,14 +173,14 @@ export function EditTagsDialog({ track, onClose, onApplied, onError }: Props) {
value={form[key]}
onChange={(e) => setForm({ ...form, [key]: e.target.value })}
rows={2}
className="w-full resize-y rounded-md border border-line bg-ink-850 px-2.5 py-1.5 text-sm text-text outline-none focus:border-accent"
className="w-full resize-y rounded-lg well px-2.5 py-1.5 text-sm text-text outline-none focus:ring-1 focus:ring-accent"
/>
) : (
<input
value={form[key]}
onChange={(e) => setForm({ ...form, [key]: e.target.value })}
list={key === 'genre' ? 'genre-suggestions' : undefined}
className="w-full rounded-md border border-line bg-ink-850 px-2.5 py-1.5 text-sm text-text outline-none focus:border-accent"
className="w-full rounded-lg well px-2.5 py-1.5 text-sm text-text outline-none focus:ring-1 focus:ring-accent"
/>
)}
</label>
@@ -241,7 +241,7 @@ export function EditTagsDialog({ track, onClose, onApplied, onError }: Props) {
<button
onClick={submit}
disabled={apply.isPending}
className="rounded-md bg-accent px-4 py-1.5 text-sm font-medium text-ink-950 hover:brightness-110 disabled:opacity-50"
className="rounded-full btn-primary px-4 py-1.5 text-sm font-semibold disabled:opacity-50"
>
{apply.isPending ? 'Applying…' : 'Apply'}
</button>
+8 -8
View File
@@ -67,8 +67,8 @@ export function ExportDialog({ editing, onClose, onSaved, onError }: Props) {
onClose={() => setBrowsing(false)}
/>
)}
<div aria-modal="true" className="fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4">
<div className="w-full max-w-lg rounded-lg border border-line bg-ink-900 shadow-xl">
<div aria-modal="true" className="fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-[3px] p-4">
<div className="w-full max-w-lg glass-overlay">
<div className="border-b border-line px-5 py-3">
<h2 className="text-sm font-semibold text-text">
{editing ? `Edit “${editing.name}”` : 'New export'}
@@ -86,7 +86,7 @@ export function ExportDialog({ editing, onClose, onSaved, onError }: Props) {
onKeyDown={(e) => {
if (e.key === 'Enter' && valid && !busy) save()
}}
className="w-full rounded-md border border-line bg-ink-950 px-2 py-1.5 text-sm text-text outline-none focus:border-accent"
className="w-full rounded-md well px-2 py-1.5 text-sm text-text outline-none focus:ring-1 focus:ring-accent"
/>
</div>
@@ -124,13 +124,13 @@ export function ExportDialog({ editing, onClose, onSaved, onError }: Props) {
<span
title={destination}
dir="rtl"
className="min-w-0 flex-1 truncate rounded-md border border-line bg-ink-950 px-2 py-1.5 font-mono text-xs text-text"
className="min-w-0 flex-1 truncate rounded-md well px-2 py-1.5 font-mono text-xs text-text"
>
{destination || 'Choose a folder…'}
</span>
<button
onClick={() => setBrowsing(true)}
className="shrink-0 rounded-md border border-line px-3 py-1.5 text-sm text-muted hover:text-text"
className="shrink-0 btn-glass rounded-full px-3 py-1.5 text-sm text-muted hover:text-text"
>
Browse…
</button>
@@ -140,7 +140,7 @@ export function ExportDialog({ editing, onClose, onSaved, onError }: Props) {
every track, in your own folder structure.
</div>
{conflict && (
<div className="mt-2 rounded border border-line bg-ink-950 px-3 py-2 text-xs text-gold">
<div className="mt-2 rounded well px-3 py-2 text-xs text-gold">
“{conflict}” already exports here. Exporting replaces whatever the other one
wrote.
</div>
@@ -151,14 +151,14 @@ export function ExportDialog({ editing, onClose, onSaved, onError }: Props) {
<div className="flex justify-end gap-2 border-t border-line px-5 py-3">
<button
onClick={onClose}
className="rounded-md border border-line px-3 py-1.5 text-sm text-muted hover:text-text"
className="btn-glass rounded-full px-3 py-1.5 text-sm text-muted hover:text-text"
>
Cancel
</button>
<button
disabled={!valid || busy}
onClick={save}
className="rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-ink-950 hover:brightness-110 disabled:opacity-40"
className="rounded-full btn-primary px-3 py-1.5 text-sm font-semibold disabled:opacity-40"
>
{busy ? 'Saving…' : editing ? 'Save' : 'Create'}
</button>
+12 -12
View File
@@ -101,8 +101,8 @@ export function ExportRunDialog({ set, onClose, onDone, onError }: Props) {
const blocked = p?.blocked ?? null
return (
<div aria-modal="true" className="fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4">
<div className="w-full max-w-lg rounded-lg border border-line bg-ink-900 shadow-xl">
<div aria-modal="true" className="fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-[3px] p-4">
<div className="w-full max-w-lg glass-overlay">
<div className="border-b border-line px-5 py-3">
<h2 className="text-sm font-semibold text-text">Export “{set.name}”</h2>
</div>
@@ -115,7 +115,7 @@ export function ExportRunDialog({ set, onClose, onDone, onError }: Props) {
<div
dir="rtl"
title={set.destination}
className="truncate rounded-md border border-line bg-ink-950 px-2 py-1.5 font-mono text-xs text-text"
className="truncate rounded-md well px-2 py-1.5 font-mono text-xs text-text"
>
{set.destination}
</div>
@@ -143,14 +143,14 @@ export function ExportRunDialog({ set, onClose, onDone, onError }: Props) {
{/* Reported and skipped, not a failure halfway through a long
copy. A gig stick short four tracks must never be silent. */}
{p.missing.length > 0 && (
<div className="rounded border border-line bg-ink-950 px-3 py-2 text-xs text-pink">
<div className="rounded well px-3 py-2 text-xs text-pink">
{p.missing.length} track{p.missing.length === 1 ? '' : 's'} will be skipped —
the audio file is not on this disk:
<div className="mt-1 text-faint">{p.missing.slice(0, 4).join(', ')}</div>
</div>
)}
{p.replacing && (
<div className="rounded border border-line bg-ink-950 px-3 py-2 text-xs text-gold">
<div className="rounded well px-3 py-2 text-xs text-gold">
This folder already holds an export. Its files will be replaced.
</div>
)}
@@ -162,19 +162,19 @@ export function ExportRunDialog({ set, onClose, onDone, onError }: Props) {
)}
{blocked === 'destination_not_empty' && (
<div className="rounded border border-pink/40 bg-ink-950 px-3 py-2 text-xs text-pink">
<div className="rounded border border-pink/40 bg-well px-3 py-2 text-xs text-pink">
That folder already has files in it that Konduktor didn’t put there. An export
replaces what it wrote last time, so it will only write into an empty folder or
one of its own. Edit the export and choose somewhere else.
</div>
)}
{blocked === 'nothing_to_export' && (
<div className="rounded border border-line bg-ink-950 px-3 py-2 text-xs text-muted">
<div className="rounded well px-3 py-2 text-xs text-muted">
There’s nothing to export yet — add some tracks or a playlist.
</div>
)}
{blocked === 'unsupported_target' && (
<div className="rounded border border-pink/40 bg-ink-950 px-3 py-2 text-xs text-pink">
<div className="rounded border border-pink/40 bg-well px-3 py-2 text-xs text-pink">
Konduktor can’t write that kind of library yet.
</div>
)}
@@ -184,7 +184,7 @@ export function ExportRunDialog({ set, onClose, onDone, onError }: Props) {
{job && (
<div className="space-y-3">
<div className="text-text">{job.message || 'Working…'}</div>
<div className="h-2 overflow-hidden rounded-full bg-ink-950">
<div className="h-2 overflow-hidden rounded-full bg-well">
<div
className={`h-full transition-[width] duration-200 ${
job.state === 'failed' ? 'bg-pink' : 'bg-accent'
@@ -225,7 +225,7 @@ export function ExportRunDialog({ set, onClose, onDone, onError }: Props) {
<>
<button
onClick={cancel}
className="rounded-md border border-line px-3 py-1.5 text-sm text-muted hover:text-text"
className="btn-glass rounded-full px-3 py-1.5 text-sm text-muted hover:text-text"
>
Cancel export
</button>
@@ -241,7 +241,7 @@ export function ExportRunDialog({ set, onClose, onDone, onError }: Props) {
<>
<button
onClick={onClose}
className="rounded-md border border-line px-3 py-1.5 text-sm text-muted hover:text-text"
className="btn-glass rounded-full px-3 py-1.5 text-sm text-muted hover:text-text"
>
{finished ? 'Close' : 'Cancel'}
</button>
@@ -251,7 +251,7 @@ export function ExportRunDialog({ set, onClose, onDone, onError }: Props) {
starting || !p || !!blocked || p.exportable === 0 || p.enough_space === false
}
onClick={start}
className="rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-ink-950 hover:brightness-110 disabled:opacity-40"
className="rounded-full btn-primary px-3 py-1.5 text-sm font-semibold disabled:opacity-40"
>
{starting ? 'Starting…' : `Export ${p && !blocked ? p.exportable : ''}`.trim()}
</button>
+13 -12
View File
@@ -4,6 +4,7 @@ import { api, type ExportSet } from '../api'
import { ExportDialog } from './ExportDialog'
import { ExportRunDialog } from './ExportRunDialog'
import type { Source } from './Sidebar'
import { Icon } from '../lib/icons'
/**
* Exports in the sidebar: each one a named, persisted slice of the library
@@ -166,21 +167,21 @@ function ExportRow({
<div>
<div
className={`group flex w-full items-center gap-1 rounded-md pr-1 transition-colors ${
selected ? 'bg-accent-soft text-text' : 'text-muted hover:bg-ink-800 hover:text-text'
selected ? 'is-selected text-text' : 'text-muted hover:bg-ink-800 hover:text-text'
}`}
>
<button
title={expanded ? 'Collapse' : 'Expand'}
onClick={() => setOpen((o) => !o)}
className="w-4 shrink-0 py-1.5 text-center text-[10px] text-faint hover:text-text"
className="flex w-4 shrink-0 justify-center py-1.5 text-faint hover:text-text"
>
{expanded ? '▾' : '▸'}
<Icon name={expanded ? 'chevronDown' : 'chevronRight'} size={12} strokeWidth={2.4} />
</button>
<button
onClick={() => onSelect({ kind: 'export', id: set.id, name: set.name })}
className="flex min-w-0 flex-1 items-center gap-2 py-1.5 text-left text-sm"
>
<span className="w-3 shrink-0 text-center text-[11px] text-gold">◈</span>
<span className="flex w-4 shrink-0 justify-center text-gold"><Icon name="export" size={14} /></span>
<span className="flex-1 truncate" title={set.destination}>
{set.name}
</span>
@@ -193,14 +194,14 @@ function ExportRow({
onClick={onEdit}
className="shrink-0 px-1 text-xs text-faint opacity-0 hover:text-text group-hover:opacity-100"
>
⚙
<Icon name="settings" size={13} />
</button>
<button
title="Delete this export"
onClick={onDelete}
className="shrink-0 px-1 text-xs text-faint opacity-0 hover:text-pink group-hover:opacity-100"
>
✕
<Icon name="close" size={13} />
</button>
</div>
@@ -212,7 +213,7 @@ function ExportRow({
<div
key={p.id}
className={`group flex items-center gap-1 rounded-md pr-1 ${
chosen ? 'bg-accent-soft text-text' : 'text-muted hover:bg-ink-800 hover:text-text'
chosen ? 'is-selected text-text' : 'text-muted hover:bg-ink-800 hover:text-text'
}`}
>
<button
@@ -228,7 +229,7 @@ function ExportRow({
style={{ paddingLeft: 24 }}
className="flex min-w-0 flex-1 items-center gap-2 py-1 text-left text-sm disabled:cursor-not-allowed"
>
<span className="w-3 shrink-0 text-center text-[11px] text-faint">♫</span>
<span className="flex w-4 shrink-0 justify-center text-faint"><Icon name="playlist" size={14} /></span>
{/* A playlist deleted since curation is SHOWN, not dropped:
the set records the user's intent, and losing part of it
silently is worse than showing something broken. */}
@@ -244,7 +245,7 @@ function ExportRow({
onClick={() => dropPlaylist.mutate(p.id)}
className="shrink-0 px-1 text-xs text-faint opacity-0 hover:text-pink group-hover:opacity-100"
>
✕
<Icon name="close" size={13} />
</button>
</div>
)
@@ -256,11 +257,11 @@ function ExportRow({
style={{ paddingLeft: 24 }}
className={`flex w-full items-center gap-2 rounded-md py-1 pr-2 text-left text-sm transition-colors ${
source.kind === 'export-other' && source.exportId === set.id
? 'bg-accent-soft text-text'
? 'is-selected text-text'
: 'text-muted hover:bg-ink-800 hover:text-text'
}`}
>
<span className="w-3 shrink-0 text-center text-[11px] text-faint">◇</span>
<span className="flex w-4 shrink-0 justify-center text-faint"><Icon name="music" size={14} /></span>
<span className="flex-1 truncate">Other</span>
<span className="shrink-0 text-[10px] tabular-nums text-faint">{data.loose}</span>
</button>
@@ -287,7 +288,7 @@ function ExportRow({
<button
onClick={onRun}
style={{ marginLeft: 24 }}
className="mb-1 mt-1 rounded-md bg-accent px-2 py-1 text-xs font-medium text-ink-950 hover:brightness-110"
className="mb-1 mt-1 rounded-full btn-primary px-2 py-1 text-xs font-semibold"
>
Export {data.tracks} track{data.tracks === 1 ? '' : 's'}…
</button>
+18 -17
View File
@@ -1,6 +1,7 @@
import type { ReactNode } from 'react'
import { useQuery } from '@tanstack/react-query'
import { api, type FsListing, type FsPlace } from '../api'
import { Icon, type IconName } from '../lib/icons'
/**
* The one file browser. A places rail, a path bar, a listing.
@@ -36,14 +37,14 @@ export function useFsListing(path: string | undefined, platform?: string) {
// the sidebar's device poll: this is a shortcut list, not the thing you came for.
const PLACES_POLL_MS = 5000
const ICONS: Record<FsPlace['kind'], string> = {
home: '⌂',
music: '♫',
desktop: '🖥',
documents: '🗎',
downloads: '⬇',
volume: '⬒',
library: '◈',
const ICONS: Record<FsPlace['kind'], IconName> = {
home: 'home',
music: 'music',
desktop: 'desktop',
documents: 'file',
downloads: 'download',
volume: 'drive',
library: 'playlist',
}
interface Props {
@@ -85,7 +86,7 @@ export function FileBrowser({ mode, platform, path, onNavigate, onPickFile, foot
{/* ---- Places rail. Navigates, never selects: one click here must not be
able to open a library or commit an import destination, because a
sidebar does not look like something that does that. ---- */}
<div className="w-44 shrink-0 overflow-y-auto border-r border-line bg-ink-950/40 py-2">
<div className="w-44 shrink-0 overflow-y-auto border-r border-line bg-well py-2">
{groups.map((g) => (
<div key={g.label} className="mb-2">
<div className="px-3 pb-1 text-[10px] font-semibold uppercase tracking-wider text-faint">
@@ -98,13 +99,13 @@ export function FileBrowser({ mode, platform, path, onNavigate, onPickFile, foot
key={p.path}
onClick={() => onNavigate(p.path)}
title={p.path}
className={`flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs transition-colors ${
className={`mx-1.5 flex w-[calc(100%-0.75rem)] items-center gap-2 rounded-[10px] px-2.5 py-1.5 text-left text-xs transition-colors ${
active
? 'bg-accent-soft text-text'
? 'is-selected text-text'
: 'text-muted hover:bg-ink-800 hover:text-text'
}`}
>
<span className="w-3 shrink-0 text-center text-faint">{ICONS[p.kind]}</span>
<span className="flex shrink-0 text-faint"><Icon name={ICONS[p.kind]} size={14} /></span>
<span className="truncate">{p.name}</span>
</button>
)
@@ -115,13 +116,13 @@ export function FileBrowser({ mode, platform, path, onNavigate, onPickFile, foot
{/* ---- Path bar + listing ---- */}
<div className="flex min-w-0 flex-1 flex-col">
<div className="flex items-center gap-2 border-b border-line bg-ink-850 px-4 py-2">
<div className="flex items-center gap-2 border-b border-line px-4 py-2">
<button
title="Home"
onClick={() => data?.home && onNavigate(data.home)}
className="rounded px-2 py-1 text-sm text-muted hover:bg-ink-800 hover:text-text"
className="rounded-lg px-2 py-1 text-sm text-muted hover:bg-ink-800 hover:text-text"
>
⌂
<Icon name="home" size={15} />
</button>
<button
title="Up one level"
@@ -149,7 +150,7 @@ export function FileBrowser({ mode, platform, path, onNavigate, onPickFile, foot
onClick={() => onNavigate(d.path)}
className="flex w-full items-center gap-2 rounded-md px-3 py-2 text-left text-sm text-muted hover:bg-ink-800 hover:text-text"
>
<span className="text-faint">📁</span>
<span className="flex text-faint"><Icon name="folder" size={15} /></span>
<span className="truncate">{d.name}</span>
</button>
))}
@@ -163,7 +164,7 @@ export function FileBrowser({ mode, platform, path, onNavigate, onPickFile, foot
onClick={() => onPickFile?.(f.path)}
className="flex w-full items-center gap-2 rounded-md px-3 py-2 text-left text-sm text-text hover:bg-accent-soft"
>
<span className="text-accent">♫</span>
<span className="flex text-accent"><Icon name="music" size={15} /></span>
<span className="truncate">{f.name}</span>
<span className="ml-auto text-[10px] uppercase tracking-wider text-faint">
open
+5 -5
View File
@@ -31,8 +31,8 @@ export function FolderPicker({ value, onChange, onClose }: Props) {
}
return (
<div aria-modal="true" className="fixed inset-0 z-[60] flex items-center justify-center bg-black/60 p-4">
<div className="flex h-[70vh] w-full max-w-2xl flex-col overflow-hidden rounded-lg border border-line bg-ink-900 shadow-xl">
<div aria-modal="true" className="fixed inset-0 z-[60] flex items-center justify-center bg-black/40 backdrop-blur-[3px] p-4">
<div className="flex h-[70vh] w-full max-w-2xl flex-col overflow-hidden glass-overlay">
<div className="border-b border-line px-5 py-3">
<h2 className="text-sm font-semibold text-text">Choose a folder</h2>
</div>
@@ -53,7 +53,7 @@ export function FolderPicker({ value, onChange, onClose }: Props) {
onKeyDown={(e) => {
if (e.key === 'Enter' && newFolder.trim() && here) confirm()
}}
className="min-w-0 flex-1 rounded-md border border-line bg-ink-950 px-2 py-1 text-xs text-text outline-none focus:border-accent"
className="min-w-0 flex-1 rounded-md well px-2 py-1 text-xs text-text outline-none focus:ring-1 focus:ring-accent"
/>
</div>
}
@@ -67,14 +67,14 @@ export function FolderPicker({ value, onChange, onClose }: Props) {
</span>
<button
onClick={onClose}
className="shrink-0 rounded-md border border-line px-3 py-1.5 text-sm text-muted hover:text-text"
className="shrink-0 btn-glass rounded-full px-3 py-1.5 text-sm text-muted hover:text-text"
>
Cancel
</button>
<button
disabled={!here}
onClick={confirm}
className="shrink-0 rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-ink-950 hover:brightness-110 disabled:opacity-40"
className="shrink-0 rounded-full btn-primary px-3 py-1.5 text-sm font-semibold disabled:opacity-40"
>
Use this folder
</button>
+15 -13
View File
@@ -1,4 +1,5 @@
import { memo, useRef, useState } from 'react'
import { Icon } from '../lib/icons'
interface Props {
/** Tempo of the marker governing the playhead — what the tempo controls act
@@ -48,9 +49,8 @@ function markerTime(t: number): string {
}
const BTN =
'flex flex-1 items-center justify-center rounded border border-line bg-ink-850 py-1 text-xs ' +
'font-semibold text-text transition-colors hover:border-accent disabled:opacity-30 ' +
'disabled:hover:border-line'
'btn-glass flex flex-1 items-center justify-center gap-1 rounded-lg py-1 font-mono text-[11px] ' +
'font-semibold text-text disabled:opacity-30'
/**
* Beatgrid / tempo panel (Traktor grid-control equivalent): editable BPM, BPM
@@ -114,7 +114,7 @@ export const GridControls = memo(function GridControls({
return (
<div className="flex flex-col gap-2">
{/* BPM readout / editor */}
<div className="text-center">
<div className="well rounded-2xl px-3 py-2 text-center">
{editing ? (
<input
autoFocus
@@ -125,7 +125,7 @@ export const GridControls = memo(function GridControls({
if (e.key === 'Enter') commit()
if (e.key === 'Escape') setEditing(false)
}}
className="w-28 rounded bg-ink-850 py-0.5 text-center text-2xl font-semibold tabular-nums text-text outline-none"
className="w-32 rounded-lg bg-ink-800 py-0.5 text-center font-mono text-[26px] font-semibold text-accent outline-none"
/>
) : (
<button
@@ -133,7 +133,7 @@ export const GridControls = memo(function GridControls({
setVal(bpm != null ? bpm.toFixed(3) : '')
setEditing(true)
}}
className="text-2xl font-semibold tabular-nums text-text hover:text-accent"
className="font-mono text-[26px] font-semibold leading-tight text-accent [text-shadow:0_0_18px_color-mix(in_oklab,var(--color-accent)_55%,transparent)] hover:brightness-110"
title="Click to type an exact BPM"
>
{bpm != null ? bpm.toFixed(2) : '––'}
@@ -302,13 +302,14 @@ export const GridControls = memo(function GridControls({
onClick={onToggleLock}
title={locked ? 'Unlock track' : 'Lock track'}
className={
'flex flex-1 items-center justify-center gap-1 rounded border py-1 text-xs font-semibold transition-colors ' +
'flex flex-1 items-center justify-center gap-1.5 rounded-lg py-1 text-xs font-semibold transition-colors ' +
(locked
? 'border-gold bg-gold/15 text-gold'
: 'border-line bg-ink-850 text-text hover:border-accent')
? 'bg-gold/15 text-gold shadow-[inset_0_0_0_1px_rgb(255_200_97/0.45),0_0_16px_-4px_rgb(255_200_97/0.6)]'
: 'btn-glass text-text')
}
>
{locked ? '🔒 Locked' : '🔓 Lock'}
<Icon name={locked ? 'lock' : 'unlock'} size={13} />
{locked ? 'Locked' : 'Lock'}
</button>
{/* Only a marker you are standing on can be deleted, so one that is
scrolled off-screen can never go by accident. Deleting the last
@@ -325,7 +326,7 @@ export const GridControls = memo(function GridControls({
: 'Park the playhead on a marker to delete it (‹ › to step)'
}
>
🗑 Mrk
<Icon name="trash" size={12} /> Mrk
</button>
<button
className={BTN}
@@ -343,7 +344,7 @@ export const GridControls = memo(function GridControls({
disabled={!hasGrid}
title="Delete beatgrid"
>
🗑 Grid
<Icon name="trash" size={12} /> Grid
</button>
</div>
@@ -355,7 +356,8 @@ export const GridControls = memo(function GridControls({
disabled={analyzing}
title="Detect BPM and first beat, then set the grid + hotcue 1 (fix octave with ÷2 / ×2)"
>
{analyzing ? '…' : 'Analyze'}
<Icon name="wave" size={13} />
{analyzing ? 'Analyzing…' : 'Analyze'}
</button>
</div>
</div>
+3 -3
View File
@@ -80,11 +80,11 @@ export function HistoryPanel({ onClose, onNotify, onError }: Props) {
return (
<div
aria-modal="true" className="fixed inset-0 z-40 flex items-center justify-center bg-black/60 p-6"
aria-modal="true" className="fixed inset-0 z-40 flex items-center justify-center bg-black/40 backdrop-blur-[3px] p-6"
onClick={onClose}
>
<div
className="flex max-h-[85vh] w-full max-w-xl flex-col overflow-hidden rounded-xl border border-line bg-ink-900 shadow-2xl"
className="flex max-h-[85vh] w-full max-w-xl flex-col overflow-hidden glass-overlay"
onClick={(e) => e.stopPropagation()}
>
<div className="border-b border-line px-5 py-4">
@@ -152,7 +152,7 @@ export function HistoryPanel({ onClose, onNotify, onError }: Props) {
onClick={() => setConfirmingId(e.id)}
disabled={isCurrent}
title={isCurrent ? 'This is the current version' : 'Restore this version'}
className="mt-0.5 shrink-0 rounded-md border border-line px-2.5 py-1 text-xs text-muted opacity-0 transition-opacity hover:bg-ink-800 hover:text-text group-hover:opacity-100 disabled:cursor-not-allowed disabled:opacity-0"
className="mt-0.5 shrink-0 btn-glass rounded-full px-2.5 py-1 text-xs text-muted opacity-0 transition-opacity hover:text-text group-hover:opacity-100 disabled:cursor-not-allowed disabled:opacity-0"
>
Restore
</button>
+42 -8
View File
@@ -1,5 +1,7 @@
import type { CSSProperties } from 'react'
import type { CuePoint } from '../api'
import { contrastText, cueColor, cueGlyph } from '../lib/cues'
import { cueColor, cueGlyph, withAlpha } from '../lib/cues'
import { Icon } from '../lib/icons'
interface Props {
cues: CuePoint[]
@@ -37,7 +39,7 @@ export function HotcueBar({
onSlotRelease,
}: Props) {
return (
<div className="flex flex-1 items-stretch gap-px">
<div className="flex min-w-0 flex-1 items-stretch gap-1.5">
{Array.from({ length: slotCount }, (_, i) => i).map((slot) => {
const cue = cues.find((c) => c.role === 'hotcue' && c.slot === slot) ?? null
// Gate on `editable`, never on why: a platform-owned cue is a read-only
@@ -68,16 +70,29 @@ export function HotcueBar({
: `Hotcue ${slotLabel(slot)}`
: `Hotcue ${slotLabel(slot)} — click to set at playhead`
}
style={color ? { backgroundColor: color, color: contrastText(color) } : undefined}
style={color ? padStyle(color, selected) : undefined}
className={
'relative flex flex-1 items-center justify-center text-sm font-semibold transition-colors ' +
(color ? 'hover:brightness-110' : 'bg-ink-900 text-faint hover:bg-ink-800') +
(selected ? ' ring-2 ring-inset ring-white/80' : '')
'relative flex min-w-0 flex-1 flex-col items-start justify-center rounded-[11px] px-2 text-left transition-[filter,background-color] ' +
(color
? 'hover:brightness-115'
: 'bg-white/[0.035] text-faint shadow-[inset_0_0_0_1px_rgb(255_255_255/0.07)] hover:bg-ink-800') +
(selected && !color ? ' ring-2 ring-inset ring-white/70' : '')
}
>
{locked ? '🔒' : slotLabel(slot)}
<span
className="font-mono text-[11px] font-bold leading-none"
style={color ? { color: color } : undefined}
>
{locked ? <Icon name="lock" size={11} strokeWidth={2.2} /> : slotLabel(slot)}
</span>
<span className="mt-1 w-full truncate text-[11px] leading-none text-text/85">
{cue ? (cue.name && cue.name !== 'n.n.' ? cue.name : ' ') : ''}
</span>
{glyph && (
<span className="absolute right-0.5 top-0 text-[9px] leading-none opacity-80">
<span
className="absolute right-1.5 top-1 text-[9px] leading-none opacity-90"
style={{ color: color ?? undefined }}
>
{glyph}
</span>
)}
@@ -87,3 +102,22 @@ export function HotcueBar({
</div>
)
}
/**
* A lit pad: tinted glass in the cue's colour with a soft glow of it, the way a
* backlit controller pad reads. Selection brightens the tint and rings it in
* the colour itself, so it stays legible whichever colour the cue is.
*/
function padStyle(color: string, selected: boolean): CSSProperties {
return {
background: `linear-gradient(180deg, ${withAlpha(color, selected ? 0.5 : 0.3)}, ${withAlpha(
color,
selected ? 0.24 : 0.1,
)})`,
boxShadow: [
'inset 0 1px 0 rgba(255,255,255,0.22)',
`inset 0 0 0 ${selected ? 2 : 1}px ${withAlpha(color, selected ? 0.95 : 0.55)}`,
`0 0 ${selected ? 24 : 18}px -4px ${withAlpha(color, selected ? 0.8 : 0.55)}`,
].join(', '),
}
}
+10 -10
View File
@@ -153,8 +153,8 @@ export function ImportDialog({ playlistId, deviceLabel, onClose, onDone, onError
onClose={() => setBrowsing(false)}
/>
)}
<div aria-modal="true" className="fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4">
<div className="w-full max-w-lg rounded-lg border border-line bg-ink-900 shadow-xl">
<div aria-modal="true" className="fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-[3px] p-4">
<div className="w-full max-w-lg glass-overlay">
<div className="border-b border-line px-5 py-3">
<h2 className="text-sm font-semibold text-text">
Import from {deviceLabel}
@@ -170,14 +170,14 @@ export function ImportDialog({ playlistId, deviceLabel, onClose, onDone, onError
<div className="flex items-center gap-2">
<span
title={baseFolder}
className="min-w-0 flex-1 truncate rounded-md border border-line bg-ink-950 px-2 py-1.5 font-mono text-xs text-text"
className="min-w-0 flex-1 truncate rounded-md well px-2 py-1.5 font-mono text-xs text-text"
dir="rtl"
>
{baseFolder || 'Loading…'}
</span>
<button
onClick={() => setBrowsing(true)}
className="shrink-0 rounded-md border border-line px-3 py-1.5 text-sm text-muted hover:text-text"
className="shrink-0 btn-glass rounded-full px-3 py-1.5 text-sm text-muted hover:text-text"
>
Browse…
</button>
@@ -228,7 +228,7 @@ export function ImportDialog({ playlistId, deviceLabel, onClose, onDone, onError
{/* Reported and then skipped, rather than failing the whole
import halfway through a multi-minute copy. */}
{p.missing.length > 0 && (
<div className="rounded border border-line bg-ink-950 px-3 py-2 text-xs text-pink">
<div className="rounded well px-3 py-2 text-xs text-pink">
{p.missing.length} track{p.missing.length === 1 ? '' : 's'} will be skipped —
the audio file is not on the drive:
<div className="mt-1 text-faint">{p.missing.slice(0, 4).join(', ')}</div>
@@ -238,7 +238,7 @@ export function ImportDialog({ playlistId, deviceLabel, onClose, onDone, onError
{/* A warning, not a block: everything is imported as a new
entry, so a re-import legitimately duplicates. */}
{p.duplicates.length > 0 && (
<div className="rounded border border-line bg-ink-950 px-3 py-2 text-xs text-gold">
<div className="rounded well px-3 py-2 text-xs text-gold">
{p.duplicates.length} of these look like tracks your collection already has.
They will be added again as new entries.
</div>
@@ -255,7 +255,7 @@ export function ImportDialog({ playlistId, deviceLabel, onClose, onDone, onError
{job && (
<div className="space-y-3">
<div className="text-text">{job.message || 'Working…'}</div>
<div className="h-2 overflow-hidden rounded-full bg-ink-950">
<div className="h-2 overflow-hidden rounded-full bg-well">
<div
className={`h-full transition-[width] duration-200 ${
job.state === 'failed' ? 'bg-pink' : 'bg-accent'
@@ -286,7 +286,7 @@ export function ImportDialog({ playlistId, deviceLabel, onClose, onDone, onError
<>
<button
onClick={cancel}
className="rounded-md border border-line px-3 py-1.5 text-sm text-muted hover:text-text"
className="btn-glass rounded-full px-3 py-1.5 text-sm text-muted hover:text-text"
>
Cancel import
</button>
@@ -302,7 +302,7 @@ export function ImportDialog({ playlistId, deviceLabel, onClose, onDone, onError
<>
<button
onClick={onClose}
className="rounded-md border border-line px-3 py-1.5 text-sm text-muted hover:text-text"
className="btn-glass rounded-full px-3 py-1.5 text-sm text-muted hover:text-text"
>
{finished ? 'Close' : 'Cancel'}
</button>
@@ -312,7 +312,7 @@ export function ImportDialog({ playlistId, deviceLabel, onClose, onDone, onError
starting || !p || p.importable === 0 || p.enough_space === false
}
onClick={start}
className="rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-ink-950 hover:brightness-110 disabled:opacity-40"
className="rounded-full btn-primary px-3 py-1.5 text-sm font-semibold disabled:opacity-40"
>
{starting ? 'Starting…' : `Import ${p?.importable ?? ''}`.trim()}
</button>
+22 -12
View File
@@ -1,3 +1,5 @@
import { Icon } from '../lib/icons'
interface Props {
hasGrid: boolean // beat-loops need a beatgrid; buttons disable without one
active: boolean // a loop is currently engaged
@@ -18,9 +20,13 @@ function label(size: number): string {
return size < 1 ? `1/${Math.round(1 / size)}` : String(size)
}
const CELL = 'flex items-center justify-center text-sm font-semibold transition-colors select-none'
const IDLE = 'bg-ink-900 text-text hover:bg-ink-800'
const OFF = 'disabled:opacity-30 disabled:hover:bg-ink-900'
const CELL =
'flex items-center justify-center rounded-lg font-mono text-xs font-semibold transition-colors select-none'
const IDLE = 'btn-glass text-text'
const OFF = 'disabled:opacity-30'
// A lit green key: an engaged loop should read as ON from across the room.
const LIT =
'bg-gradient-to-b from-[#7bf0ad] to-mint text-ink-950 shadow-[inset_0_1px_0_rgb(255_255_255/0.6),0_0_14px_rgb(61_220_132/0.55)]'
export function LoopControls({
hasGrid,
@@ -36,11 +42,12 @@ export function LoopControls({
}: Props) {
return (
<div className="flex h-10 shrink-0 items-stretch gap-px border-t border-line bg-ink-950">
<span className="flex w-16 items-center justify-center bg-ink-900 text-[10px] font-semibold uppercase tracking-wider text-faint">
<div className="flex h-10 shrink-0 items-center gap-1.5 pt-2">
<span className="flex w-12 shrink-0 items-center text-[10px] font-semibold uppercase tracking-wider text-faint">
Loop
</span>
<div className="well flex h-full min-w-0 flex-1 items-stretch gap-0.5 rounded-xl p-[3px]">
{SIZES.map((size) => {
const isActive = active && activeBeats === size
return (
@@ -49,32 +56,35 @@ export function LoopControls({
onClick={() => onSetLoop(size)}
disabled={!hasGrid}
title={hasGrid ? `${label(size)}-beat loop` : 'No beatgrid'}
className={`${CELL} ${OFF} flex-1 ${isActive ? 'bg-mint text-ink-950' : IDLE}`}
className={`${CELL} ${OFF} flex-1 ${
isActive ? LIT : 'text-muted hover:bg-ink-800 hover:text-text'
}`}
>
{label(size)}
</button>
)
})}
</div>
<button onClick={onLoopIn} className={`${CELL} ${IDLE} w-12`} title="Loop in at playhead">
<button onClick={onLoopIn} className={`${CELL} ${IDLE} h-full w-11`} title="Loop in at playhead">
IN
</button>
<button onClick={onLoopOut} className={`${CELL} ${IDLE} w-12`} title="Loop out at playhead">
<button onClick={onLoopOut} className={`${CELL} ${IDLE} h-full w-11`} title="Loop out at playhead">
OUT
</button>
<button
onClick={onToggleActive}
disabled={!canToggle}
title={active ? 'Disable loop' : 'Enable loop'}
className={`${CELL} ${OFF} w-12 text-base ${active ? 'bg-mint text-ink-950' : IDLE}`}
className={`${CELL} ${OFF} h-full w-11 ${active ? LIT : IDLE}`}
>
⟳
<Icon name="loop" size={15} />
</button>
<button
onClick={onToggleSnap}
title="Snap to the nearest beat"
className={`${CELL} w-16 text-[11px] uppercase tracking-wider ${
snap ? 'bg-accent text-ink-950' : `${IDLE} text-muted`
className={`${CELL} h-full w-14 font-sans text-[11px] uppercase tracking-wider ${
snap ? 'is-selected text-text' : `${IDLE} text-muted`
}`}
>
Snap
+10 -30
View File
@@ -1,7 +1,7 @@
import { useEffect, useRef } from 'react'
import type { CuePoint } from '../api'
import type { BeatGrid } from '../lib/beatgrid'
import { drawBeatgrid, drawCuePoint, drawCues, drawLoop } from '../lib/cues'
import { drawBeatgrid, drawCuePoint, drawCues, drawLoop, drawPlayhead } from '../lib/cues'
import { paintWave, type WaveColumn } from '../lib/waveform'
interface Props {
@@ -79,7 +79,12 @@ export function MainWaveform({
const half = secPerView / 2
const startSec = currentTime - half
const endSec = currentTime + half
paintWave(ctx, cols, w, h, startSec / duration, endSec / duration)
// 2 px bars with a 1 px gap: the texture that makes the scrolling view
// read as discrete energy rather than a smear.
paintWave(ctx, cols, w, h, startSec / duration, endSec / duration, {
bar: Math.max(1, Math.round(2 * dpr)),
gap: Math.max(1, Math.round(dpr)),
})
const timeToX = (t: number) => ((t - startSec) / secPerView) * w
// Loop band (under the grid/cues), then beatgrid, then cue markers.
@@ -97,32 +102,7 @@ export function MainWaveform({
}
}
// Fixed centre playhead — red core with a translucent black outline so it
// separates from the waveform, plus inward-pointing triangle caps top and
// bottom that anchor the eye in the quiet margins.
const core = Math.max(2, Math.round(2 * dpr))
const edge = Math.max(1, Math.round(dpr))
const cx = Math.floor(w / 2)
const px = cx - Math.floor(core / 2)
ctx.fillStyle = 'rgba(0,0,0,0.5)'
ctx.fillRect(px - edge, 0, core + edge * 2, h)
ctx.fillStyle = '#ff3b30'
ctx.fillRect(px, 0, core, h)
const cap = Math.round(6 * dpr)
ctx.fillStyle = '#ff3b30'
ctx.beginPath()
ctx.moveTo(cx - cap, 0)
ctx.lineTo(cx + cap, 0)
ctx.lineTo(cx, cap)
ctx.closePath()
ctx.fill()
ctx.beginPath()
ctx.moveTo(cx - cap, h)
ctx.lineTo(cx + cap, h)
ctx.lineTo(cx, h - cap)
ctx.closePath()
ctx.fill()
drawPlayhead(ctx, Math.floor(w / 2), h, dpr, true)
}
const drawRef = useRef(draw)
@@ -199,7 +179,7 @@ export function MainWaveform({
onPointerDown={(e) => e.stopPropagation()}
onClick={zoomIn}
disabled={secPerView <= MIN_SEC}
className="flex h-6 w-6 items-center justify-center rounded border border-line bg-ink-950/70 text-sm text-text hover:border-accent disabled:opacity-30"
className="btn-glass flex h-6 w-6 items-center justify-center rounded-lg text-sm text-text backdrop-blur-md disabled:opacity-30"
title="Zoom in"
>
+
@@ -208,7 +188,7 @@ export function MainWaveform({
onPointerDown={(e) => e.stopPropagation()}
onClick={zoomOut}
disabled={secPerView >= MAX_SEC}
className="flex h-6 w-6 items-center justify-center rounded border border-line bg-ink-950/70 text-sm text-text hover:border-accent disabled:opacity-30"
className="btn-glass flex h-6 w-6 items-center justify-center rounded-lg text-sm text-text backdrop-blur-md disabled:opacity-30"
title="Zoom out"
>
−
+3 -9
View File
@@ -1,6 +1,6 @@
import { useCallback, useEffect, useRef } from 'react'
import type { CuePoint } from '../api'
import { drawCuePoint, drawCues, drawLoop } from '../lib/cues'
import { drawCuePoint, drawCues, drawLoop, drawPlayhead } from '../lib/cues'
import { paintWave, type WaveColumn } from '../lib/waveform'
interface Props {
@@ -63,7 +63,7 @@ export function OverviewWaveform({
const dur = durRef.current
if (dur > 0) {
const px = Math.round((timeRef.current / dur) * w)
ctx.fillStyle = 'rgba(10,11,15,0.55)'
ctx.fillStyle = 'rgba(5,6,10,0.5)'
ctx.fillRect(0, 0, px, h)
const dpr = window.devicePixelRatio || 1
const lp = loopRef.current
@@ -72,13 +72,7 @@ export function OverviewWaveform({
drawCues(ctx, cuesRef.current, w, h, dpr, (t) => (t / dur) * w, false)
const cp = cuePointRef.current
if (cp != null) drawCuePoint(ctx, Math.round((cp / dur) * w), h, dpr)
const pw = Math.max(2, Math.round(2 * dpr))
const px0 = px - Math.floor(pw / 2)
const po = Math.max(1, Math.round(dpr))
ctx.fillStyle = 'rgba(0,0,0,0.6)'
ctx.fillRect(px0 - po, 0, pw + po * 2, h)
ctx.fillStyle = '#ff3b30'
ctx.fillRect(px0, 0, pw, h)
drawPlayhead(ctx, px, h, dpr, false)
}
}, [])
@@ -2,6 +2,7 @@ import { useEffect, useRef, useState } from 'react'
import { useQuery, useQueryClient } from '@tanstack/react-query'
import { api, type RemapPreview } from '../api'
import type { ToastMsg } from './Toast'
import { Icon } from '../lib/icons'
interface Props {
onClose: () => void
@@ -103,11 +104,11 @@ export function PathMappingDialog({ onClose, onNotify, onError }: Props) {
return (
<div
aria-modal="true" className="fixed inset-0 z-40 flex items-center justify-center bg-black/60 p-6"
aria-modal="true" className="fixed inset-0 z-40 flex items-center justify-center bg-black/40 backdrop-blur-[3px] p-6"
onClick={onClose}
>
<div
className="flex max-h-[85vh] w-full max-w-xl flex-col overflow-hidden rounded-xl border border-line bg-ink-900 shadow-2xl"
className="flex max-h-[85vh] w-full max-w-xl flex-col overflow-hidden glass-overlay"
onClick={(e) => e.stopPropagation()}
>
<div className="border-b border-line px-5 py-4">
@@ -159,7 +160,7 @@ export function PathMappingDialog({ onClose, onNotify, onError }: Props) {
/>
<button
onClick={() => setBrowsing((b) => !b)}
className="shrink-0 rounded-md border border-line px-3 py-1.5 text-sm text-muted hover:bg-ink-800 hover:text-text"
className="shrink-0 btn-glass rounded-full px-3 py-1.5 text-sm text-muted hover:text-text"
>
{browsing ? 'Close' : 'Browse…'}
</button>
@@ -239,7 +240,7 @@ export function PathMappingDialog({ onClose, onNotify, onError }: Props) {
<button
onClick={saveMapping}
disabled={saving}
className="rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-ink-950 hover:brightness-110 disabled:opacity-50"
className="rounded-full btn-primary px-3 py-1.5 text-sm font-semibold disabled:opacity-50"
>
{saving ? 'Saving…' : 'Save mapping'}
</button>
@@ -289,7 +290,7 @@ function FolderBrowser({
onClick={() => setDir(d.path)}
className="flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm text-text hover:bg-ink-800"
>
<span className="text-faint">📁</span>
<span className="flex text-faint"><Icon name="folder" size={15} /></span>
<span className="truncate">{d.name}</span>
</button>
))
+63 -33
View File
@@ -14,6 +14,8 @@ import { slotLabeller, useCaps } from '../lib/capabilities'
import { CUE_TYPE_LABELS } from '../lib/cues'
import { readOnlyShort, readOnlyNotice } from '../lib/platformCopy'
import { analyzeWaveform, type WaveColumn } from '../lib/waveform'
import { setAmbientFromArt } from '../lib/ambient'
import { Icon } from '../lib/icons'
import { ScratchEngine } from '../lib/scratchEngine'
import { PlaybackEngine } from '../lib/playbackEngine'
import { AutoCueDialog, eventLabel } from './AutoCueDialog'
@@ -226,6 +228,12 @@ export function PrepStrip({
setPreviewing(false)
}, [trackId])
// Recolour the whole app from this track's cover art. A device's art is not
// served (only its audio is), so a device track keeps the default look.
useEffect(() => {
void setAmbientFromArt(trackId && !fromDevice ? api.artUrl(trackId) : null)
}, [trackId, fromDevice])
// Analyse once per track; the decoded buffer feeds both the playback and
// scratch engines (no re-decode) and both waveform views share the columns.
useEffect(() => {
@@ -970,13 +978,15 @@ export function PrepStrip({
const activeLoop = loopActive && loopRegion ? loopRegion : null
return (
<div className="flex h-[25.5rem] shrink-0 items-stretch gap-px border-b border-line bg-ink-950">
<div className="glass flex h-[25.5rem] shrink-0 items-stretch gap-3 p-3">
{/* Controls */}
<div className="flex w-72 shrink-0 flex-col gap-3 bg-ink-900 px-4 py-3">
<div className="min-w-0">
<div className="flex w-72 shrink-0 flex-col gap-3 px-1 py-1">
<div className="flex min-w-0 items-center gap-3">
<CoverThumb trackId={track && !fromDevice ? track.id : null} />
<div className="min-w-0 flex-1">
{track ? (
<>
<div className="truncate text-sm font-semibold text-text" title={track.title ?? ''}>
<div className="truncate text-[15px] font-semibold tracking-tight text-text" title={track.title ?? ''}>
{track.title ?? 'Untitled'}
</div>
<div className="truncate text-xs text-muted" title={track.artist ?? ''}>
@@ -987,7 +997,7 @@ export function PrepStrip({
live. The controls themselves report the reason when pressed. */}
{readOnlyShort(caps) && (
<div
className="mt-1 inline-block rounded bg-ink-800 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-faint"
className="mt-1 inline-block rounded-md bg-ink-800 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-muted"
title={readOnlyNotice(caps) ?? ''}
>
{readOnlyShort(caps)}
@@ -997,6 +1007,7 @@ export function PrepStrip({
) : (
<div className="text-xs uppercase tracking-wider text-faint">No track loaded</div>
)}
</div>
</div>
{track && (
@@ -1036,7 +1047,7 @@ export function PrepStrip({
onPointerUp={onCueRelease}
onPointerCancel={onCueRelease}
disabled={!ready}
className="flex h-11 items-center justify-center rounded-xl border border-line bg-ink-850 px-4 text-sm font-bold tracking-wide text-gold transition-colors hover:border-gold disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:border-line"
className="flex h-11 items-center justify-center rounded-xl bg-gold/10 px-4 font-mono text-sm font-semibold tracking-wider text-gold shadow-[inset_0_1px_0_rgb(255_255_255/0.12),inset_0_0_0_1px_rgb(255_200_97/0.4)] transition-colors hover:bg-gold/15 disabled:cursor-not-allowed disabled:opacity-40"
title="Cue — set the cue point (paused), hold to preview from it, or jump back to it (playing)"
>
CUE
@@ -1045,27 +1056,18 @@ export function PrepStrip({
onClick={toggle}
disabled={!ready}
className={
'flex h-11 w-11 items-center justify-center rounded-xl transition-all active:scale-95 disabled:cursor-not-allowed disabled:opacity-40 ' +
'flex h-11 w-11 shrink-0 items-center justify-center rounded-full transition-all active:scale-95 disabled:cursor-not-allowed disabled:opacity-40 ' +
(previewing
? 'bg-gold text-ink-950 shadow-lg shadow-gold/20 hover:brightness-110'
? 'bg-gradient-to-b from-white to-gold text-ink-950 shadow-[0_0_0_4px_rgb(255_200_97/0.22),0_8px_24px_-4px_var(--color-gold)]'
: playing
? 'bg-mint text-ink-950 shadow-lg shadow-mint/20 hover:brightness-110'
: 'border border-line bg-ink-850 text-text hover:border-accent disabled:hover:border-line')
? 'btn-primary shadow-[0_0_0_4px_color-mix(in_oklab,var(--color-accent)_22%,transparent),0_8px_24px_-4px_var(--color-accent)]'
: 'btn-glass text-text')
}
title={playing ? 'Pause' : 'Play'}
>
{playing ? (
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden>
<rect x="6" y="5" width="4" height="14" rx="1" />
<rect x="14" y="5" width="4" height="14" rx="1" />
</svg>
) : (
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden>
<path d="M8 5.14v13.72a1 1 0 0 0 1.54.84l10.29-6.86a1 1 0 0 0 0-1.68L9.54 4.3A1 1 0 0 0 8 5.14z" />
</svg>
)}
<Icon name={playing ? 'pause' : 'play'} size={18} />
</button>
<div className="tabular-nums text-lg font-medium text-muted">
<div className="font-mono text-[15px] font-medium text-muted">
{fmt(current)} / {fmt(duration)}
</div>
</div>
@@ -1079,18 +1081,18 @@ export function PrepStrip({
</div>
{/* Waveforms + loop/hotcue controls. */}
<div className="relative flex min-w-0 flex-1 flex-col bg-ink-900">
<div className="relative flex min-w-0 flex-1 flex-col">
{!track ? (
<div className="flex flex-1 items-center justify-center text-xs text-faint">
<div className="well flex flex-1 items-center justify-center rounded-2xl text-xs text-faint">
Load a track to prep it
</div>
) : waveStatus === 'error' ? (
<div className="flex flex-1 items-center justify-center text-xs text-pink">
<div className="well flex flex-1 items-center justify-center rounded-2xl text-xs text-pink">
Could not load audio — file may be missing or an unsupported format.
</div>
) : (
<>
<div className="relative min-h-0 flex-1">
<div className="well relative min-h-0 flex-1 overflow-hidden rounded-2xl">
{showWaves ? (
<MainWaveform
cols={cols}
@@ -1114,7 +1116,7 @@ export function PrepStrip({
</div>
)}
</div>
<div className="h-10 shrink-0 border-t border-line">
<div className="well mt-2 h-10 shrink-0 overflow-hidden rounded-xl">
{showWaves && (
<OverviewWaveform
cols={cols}
@@ -1142,8 +1144,8 @@ export function PrepStrip({
/>
{/* Hotcue row: label · 8 slots · type of selected cue · delete. */}
<div className="flex h-10 shrink-0 items-stretch gap-px border-t border-line bg-ink-950">
<span className="flex w-16 items-center justify-center bg-ink-900 text-[10px] font-semibold uppercase tracking-wider text-faint">
<div className="flex h-12 shrink-0 items-stretch gap-1.5 pt-2">
<span className="flex w-12 shrink-0 items-center text-[10px] font-semibold uppercase tracking-wider text-faint">
Cues
</span>
<HotcueBar
@@ -1154,7 +1156,7 @@ export function PrepStrip({
onSlotPress={onSlotPress}
onSlotRelease={onSlotRelease}
/>
<div className="flex w-28 items-center justify-center bg-ink-900 px-1">
<div className="btn-glass flex w-28 shrink-0 items-center justify-center rounded-lg px-1">
{selectedCue && selectedCue.type === 'loop' ? (
<span className="text-sm font-semibold text-mint">Loop</span>
) : pointCueTypes.length < 2 ? (
@@ -1187,17 +1189,19 @@ export function PrepStrip({
? 'Place hotcues on the track\'s drops, breakdowns and other sections'
: 'Set a beatgrid first'
}
className="flex w-16 items-center justify-center gap-1 bg-ink-900 text-[11px] font-semibold uppercase tracking-wider text-muted transition-colors hover:bg-ink-800 hover:text-accent disabled:opacity-30 disabled:hover:bg-ink-900 disabled:hover:text-muted"
className="btn-glass flex w-[4.5rem] shrink-0 items-center justify-center gap-1.5 rounded-lg text-[11px] font-semibold uppercase tracking-wider text-muted hover:text-accent disabled:opacity-30 disabled:hover:text-muted"
>
✨ Auto
<Icon name="sparkle" size={14} />
Auto
</button>
<button
onClick={deleteSelected}
disabled={!selectedCue}
title="Delete selected hotcue"
className="flex w-12 items-center justify-center bg-ink-900 text-muted transition-colors hover:bg-ink-800 hover:text-pink disabled:opacity-30 disabled:hover:bg-ink-900 disabled:hover:text-muted"
aria-label="Delete selected hotcue"
className="btn-glass flex w-11 shrink-0 items-center justify-center rounded-lg text-muted hover:text-pink disabled:opacity-30 disabled:hover:text-muted"
>
🗑
<Icon name="trash" size={15} />
</button>
</div>
</>
@@ -1217,3 +1221,29 @@ export function PrepStrip({
</div>
)
}
/**
* The loaded track's sleeve. Until it loads — and for a track with no art — a
* swatch of the ambient colours stands in, so the header never has a hole in it.
*/
function CoverThumb({ trackId }: { trackId: string | null }) {
const [failed, setFailed] = useState<string | null>(null)
const showArt = trackId != null && failed !== trackId
return (
<div
aria-hidden
className="relative h-11 w-11 shrink-0 overflow-hidden rounded-xl shadow-[inset_0_1px_0_rgb(255_255_255/0.35),0_8px_24px_-6px_var(--amb-2)]"
style={{ background: 'linear-gradient(135deg, var(--amb-1), var(--amb-2) 55%, var(--amb-3))' }}
>
{showArt && (
<img
key={trackId}
src={api.artUrl(trackId)}
alt=""
className="absolute inset-0 h-full w-full object-cover"
onError={() => setFailed(trackId)}
/>
)}
</div>
)
}
+20 -7
View File
@@ -8,6 +8,21 @@ interface Props {
onChange?: (value: number) => void
}
function Star({ className }: { className?: string }) {
return (
<svg
width="13"
height="13"
viewBox="0 0 24 24"
aria-hidden
className={className}
fill="currentColor"
>
<path d="M12 3.5l2.6 5.3 5.9.9-4.3 4.1 1 5.8-5.2-2.7-5.2 2.7 1-5.8-4.3-4.1 5.9-.9z" />
</svg>
)
}
// Compact star rating. Read-only by default (shows a dash when unrated). When
// `onChange` is given it's interactive: hollow (☆) above the rating, solid gold
// (★) up to it, with hover preview. Clicking a star sets that rating; clicking
@@ -19,11 +34,9 @@ export function RatingStars({ value, max = 5, onChange }: Props) {
if (!onChange) {
if (!value) return <span className="text-faint">—</span>
return (
<span className="whitespace-nowrap tracking-tight" title={`${value} / ${max}`}>
<span className="flex items-center gap-0.5" title={`${value} / ${max}`}>
{stars.map((i) => (
<span key={i} className={i <= value ? 'text-gold' : 'text-ink-600'}>
{i <= value ? '★' : '☆'}
</span>
<Star key={i} className={i <= value ? 'text-gold' : 'text-white/15'} />
))}
</span>
)
@@ -31,7 +44,7 @@ export function RatingStars({ value, max = 5, onChange }: Props) {
const shown = hover || value
return (
<span className="whitespace-nowrap tracking-tight" title={`${value} / ${max}`}>
<span className="flex items-center gap-0.5" title={`${value} / ${max}`}>
{stars.map((i) => (
<button
key={i}
@@ -41,10 +54,10 @@ export function RatingStars({ value, max = 5, onChange }: Props) {
}}
onMouseEnter={() => setHover(i)}
onMouseLeave={() => setHover(0)}
className={`transition-colors ${i <= shown ? 'text-gold' : 'text-ink-600 hover:text-gold/60'}`}
className={`transition-colors ${i <= shown ? 'text-gold' : 'text-white/15 hover:text-gold/60'}`}
title={i === value ? 'Clear rating' : `Set ${i} star${i > 1 ? 's' : ''}`}
>
{i <= shown ? '★' : '☆'}
<Star />
</button>
))}
</span>
+11 -11
View File
@@ -3,6 +3,7 @@ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
import { api } from '../api'
import { useCaps } from '../lib/capabilities'
import { overwriteWarning, readOnlyNotice, saveLabel } from '../lib/platformCopy'
import { Icon } from '../lib/icons'
interface Props {
onError: (msg: string) => void
@@ -39,9 +40,9 @@ export function SaveBar({ onError, trailing }: Props) {
// point: a greyed-out button with no explanation reads as a bug.
if (readOnly) {
return (
<div className="flex items-stretch gap-2 border-t border-line bg-ink-900 px-3 py-3">
<div className="min-w-0 flex-1 rounded-md bg-ink-800 px-2 py-2 text-[11px] leading-snug text-faint">
<span className="font-medium text-ink-200">Read-only</span>
<div className="flex items-stretch gap-2 border-t border-line px-3 py-3">
<div className="min-w-0 flex-1 rounded-xl bg-ink-800 px-2.5 py-2 text-[11px] leading-snug text-faint">
<span className="font-medium text-text">Read-only</span>
<div className="mt-1">{readOnly}</div>
</div>
{trailing}
@@ -50,27 +51,26 @@ export function SaveBar({ onError, trailing }: Props) {
}
return (
<div className="border-t border-line bg-ink-900 px-3 py-3">
<div className="border-t border-line px-3 py-3">
{dirty && warning && (
<div className="mb-2 rounded-md bg-gold/10 px-2 py-1.5 text-[11px] leading-snug text-gold">
⚠ {warning}
<div className="mb-2 flex gap-1.5 rounded-xl bg-gold/10 px-2.5 py-1.5 text-[11px] leading-snug text-gold">
<Icon name="warning" size={13} className="mt-px shrink-0" />
<span>{warning}</span>
</div>
)}
<div className="flex items-stretch gap-2">
<button
disabled={!dirty || save.isPending}
onClick={() => save.mutate()}
className={`flex min-w-0 flex-1 items-center justify-center gap-2 rounded-md px-3 py-2 text-sm font-medium transition-colors ${
dirty
? 'bg-accent text-ink-950 hover:brightness-110'
: 'cursor-not-allowed bg-ink-800 text-faint'
className={`flex h-10 min-w-0 flex-1 items-center justify-center gap-2 rounded-full px-3 text-sm font-semibold transition-colors ${
dirty ? 'btn-primary' : 'cursor-not-allowed bg-ink-800 font-medium text-faint'
}`}
>
{save.isPending ? (
'Saving…'
) : dirty ? (
<>
<span className="h-1.5 w-1.5 rounded-full bg-ink-950/60" />
<span className="h-1.5 w-1.5 rounded-full bg-well" />
{saveLabel(caps.save)}
</>
) : (
+5 -5
View File
@@ -25,13 +25,13 @@ export function SettingsMenu({ onOpenPathMapping, up = false }: Props) {
}, [open])
const item =
'flex w-full flex-col items-start rounded px-2 py-1.5 text-left hover:bg-ink-800'
'flex w-full flex-col items-start rounded-[10px] px-2.5 py-1.5 text-left hover:bg-ink-800'
return (
<div ref={ref} className="relative">
<button
onClick={() => setOpen((o) => !o)}
className="flex h-full items-center justify-center rounded-md border border-line bg-ink-850 px-2 py-1.5 text-muted transition-colors hover:border-ink-600 hover:text-text"
className="btn-glass flex h-10 w-10 items-center justify-center rounded-full text-muted hover:text-text"
title="Settings"
aria-label="Settings"
>
@@ -39,10 +39,10 @@ export function SettingsMenu({ onOpenPathMapping, up = false }: Props) {
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeWidth="1.8"
strokeLinecap="round"
strokeLinejoin="round"
className="h-5 w-5"
className="h-[18px] w-[18px]"
>
<circle cx="12" cy="12" r="3" />
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z" />
@@ -50,7 +50,7 @@ export function SettingsMenu({ onOpenPathMapping, up = false }: Props) {
</button>
{open && (
<div
className={`absolute right-0 z-30 w-56 rounded-md border border-line bg-ink-850 p-1 shadow-2xl ${
className={`glass-overlay absolute right-0 z-30 w-60 !rounded-2xl p-1.5 ${
up ? 'bottom-full mb-1' : 'mt-1'
}`}
>
+2 -2
View File
@@ -97,11 +97,11 @@ export function ShortcutsDialog({ onClose }: Props) {
return (
<div
aria-modal="true"
className="fixed inset-0 z-40 flex items-center justify-center bg-black/60 p-6"
className="fixed inset-0 z-40 flex items-center justify-center bg-black/40 backdrop-blur-[3px] p-6"
onClick={onClose}
>
<div
className="flex max-h-full w-full max-w-lg flex-col overflow-hidden rounded-xl border border-line bg-ink-900 shadow-2xl"
className="flex max-h-full w-full max-w-lg flex-col overflow-hidden glass-overlay"
onClick={(e) => e.stopPropagation()}
>
<div className="flex items-center justify-between border-b border-line px-5 py-4">
+54 -34
View File
@@ -8,6 +8,7 @@ import { DevicesSection } from './DevicesSection'
import { ExportsSection } from './ExportsSection'
import { ConfirmDialog, type ConfirmRequest } from './ConfirmDialog'
import { ContextMenu, type MenuItem } from './ContextMenu'
import { Icon, type IconName } from '../lib/icons'
/**
* Which view the main table is showing.
@@ -74,10 +75,10 @@ function deleteRequest(node: PlaylistNode) {
}
}
const icons: Record<PlaylistKind, string> = {
folder: '▸',
playlist: '♫',
smart: '✦',
const icons: Record<PlaylistKind, IconName> = {
folder: 'chevronRight',
playlist: 'playlist',
smart: 'smart',
}
/** What the sidebar is naming in place: a new node, and the folder it goes in
@@ -120,11 +121,11 @@ function DraftRow({
style={{ paddingLeft: `${8 + depth * 14}px` }}
>
<span
className={`w-3 shrink-0 text-center text-[11px] ${
className={`flex w-4 shrink-0 justify-center ${
draft.kind === 'folder' ? 'text-faint' : 'text-accent'
}`}
>
{icons[draft.kind]}
<Icon name={icons[draft.kind]} size={draft.kind === 'folder' ? 12 : 15} />
</span>
<input
autoFocus
@@ -136,7 +137,7 @@ function DraftRow({
else if (e.key === 'Escape') finish(false)
}}
onBlur={() => finish(true)}
className="min-w-0 flex-1 rounded border border-accent bg-ink-950 px-1 py-0 text-sm text-text outline-none"
className="min-w-0 flex-1 rounded-md bg-well px-1 py-0 text-sm text-text outline-none ring-1 ring-accent"
/>
</div>
)
@@ -184,8 +185,8 @@ function NodeRow({
<div>
<div
onContextMenu={(e) => actions.onContextMenu(e, node)}
className={`group flex items-center gap-1 rounded-md pr-1 text-sm transition-colors ${
selected ? 'bg-accent-soft text-text' : 'text-muted hover:bg-ink-800 hover:text-text'
className={`group flex items-center gap-1 rounded-[10px] pr-1 text-sm transition-colors ${
selected ? 'is-selected font-medium text-text' : 'text-muted hover:bg-ink-800 hover:text-text'
}`}
>
<button
@@ -199,12 +200,21 @@ function NodeRow({
style={{ paddingLeft: `${8 + depth * 14}px` }}
>
<span
className={`w-3 shrink-0 text-center text-[11px] ${
isFolder ? 'text-faint' : node.kind === 'smart' ? 'text-pink' : 'text-accent'
className={`flex w-4 shrink-0 justify-center ${
isFolder ? 'text-faint' : node.kind === 'smart' ? 'text-pink' : selected ? 'text-accent' : 'text-muted'
} ${expanded ? 'rotate-90' : ''} transition-transform`}
>
{icons[node.kind]}
<Icon
name={icons[node.kind]}
size={isFolder ? 12 : 15}
strokeWidth={isFolder ? 2.4 : 1.8}
/>
</span>
{isFolder && (
<span className="-ml-1 flex shrink-0 text-muted">
<Icon name={expanded ? 'folderOpen' : 'folder'} size={15} />
</span>
)}
{renaming ? (
<input
autoFocus
@@ -221,7 +231,7 @@ function NodeRow({
}
}}
onBlur={() => setRenamingId(null)}
className="min-w-0 flex-1 rounded border border-accent bg-ink-950 px-1 py-0 text-sm text-text outline-none"
className="min-w-0 flex-1 rounded-md bg-well px-1 py-0 text-sm text-text outline-none ring-1 ring-accent"
/>
) : (
<span className="flex-1 truncate">{node.name}</span>
@@ -239,12 +249,12 @@ function NodeRow({
<button
title="Add to an export"
onClick={() => setAdding((a) => !a)}
className="hidden rounded px-1 text-xs text-faint hover:text-gold group-hover:block"
className="hidden rounded px-1 text-faint hover:text-gold group-hover:block"
>
◈
<Icon name="export" size={13} />
</button>
{adding && (
<div className="absolute right-0 top-full z-30 mt-1 w-48 rounded-md border border-line bg-ink-850 p-1 shadow-2xl">
<div className="glass-overlay absolute right-0 top-full z-30 mt-1 w-48 !rounded-2xl p-1.5">
{exportSets.map((set) => (
<button
key={set.id}
@@ -252,9 +262,9 @@ function NodeRow({
setAdding(false)
actions.onAddToExport(node, set.id)
}}
className="flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm text-muted hover:bg-ink-800 hover:text-text"
className="flex w-full items-center gap-2 rounded-[10px] px-2 py-1.5 text-left text-sm text-muted hover:bg-ink-800 hover:text-text"
>
<span className="shrink-0 text-[11px] text-gold">◈</span>
<span className="shrink-0 text-gold"><Icon name="export" size={13} /></span>
<span className="truncate">{set.name}</span>
</button>
))}
@@ -266,23 +276,23 @@ function NodeRow({
<button
title="Rename"
onClick={startRename}
className="hidden shrink-0 rounded px-1 text-xs text-faint hover:text-text group-hover:block"
className="hidden shrink-0 rounded px-1 text-faint hover:text-text group-hover:block"
>
✎
<Icon name="pencil" size={13} />
</button>
)}
{!renaming && node.can_delete && (
<button
title={isFolder ? 'Delete folder' : 'Delete playlist'}
onClick={() => actions.onDelete(node)}
className="hidden shrink-0 rounded px-1 text-xs text-faint hover:text-pink group-hover:block"
className="hidden shrink-0 rounded px-1 text-faint hover:text-pink group-hover:block"
>
×
<Icon name="close" size={13} />
</button>
)}
{!renaming && !isFolder && (
<span
className={`shrink-0 rounded bg-ink-800 px-1.5 py-0.5 text-[10px] tabular-nums text-faint ${
className={`shrink-0 px-1.5 font-mono text-[11px] text-faint ${
node.can_rename || node.can_delete ? 'group-hover:hidden' : ''
}`}
>
@@ -420,9 +430,9 @@ export function Sidebar({
const createItems = (parentId: string | null): MenuItem[] =>
canCreate
? [
{ label: 'New Playlist', icon: '♫', onClick: () => startDraft('playlist', parentId) },
{ label: 'New Playlist', icon: <Icon name="playlist" size={13} />, onClick: () => startDraft('playlist', parentId) },
...(foldersSupported
? [{ label: 'New Folder', icon: '▸', onClick: () => startDraft('folder', parentId) }]
? [{ label: 'New Folder', icon: <Icon name="folder" size={13} />, onClick: () => startDraft('folder', parentId) }]
: []),
]
: []
@@ -439,7 +449,7 @@ export function Sidebar({
label: 'Add to export',
submenu: exportSets.map((set) => ({
label: set.name,
icon: '◈',
icon: <Icon name="export" size={13} />,
onClick: () => addToExport.mutate({ node, setId: set.id }),
})),
},
@@ -484,7 +494,7 @@ export function Sidebar({
}
return (
<aside className="flex h-full w-64 shrink-0 flex-col border-r border-line bg-ink-900">
<aside className="glass flex h-full w-64 shrink-0 flex-col overflow-hidden">
{/* Which library is open — and the way to open a different one. Until
this existed the picker was a one-way door: it ran once at startup and
nothing could summon it again, so changing library meant restarting.
@@ -492,8 +502,15 @@ export function Sidebar({
<button
onClick={switchLibrary}
title={library ? `${library.path} — click to open a different library` : undefined}
className="group flex items-center gap-2 border-b border-line px-3 py-2.5 text-left hover:bg-ink-800"
className="btn-glass group m-2.5 mb-0 flex items-center gap-2.5 rounded-[14px] px-2.5 py-2 text-left"
>
<span
aria-hidden
className="flex h-7 w-7 shrink-0 items-center justify-center rounded-lg text-[13px] font-bold text-white shadow-[inset_0_1px_0_rgb(255_255_255/0.4)]"
style={{ background: 'linear-gradient(135deg, var(--amb-1), var(--amb-3))' }}
>
{(library?.name ?? 'K').slice(0, 1).toUpperCase()}
</span>
<div className="min-w-0 flex-1">
<div className="truncate text-sm font-medium text-text">
{library?.display_name ?? 'No library'}
@@ -504,27 +521,29 @@ export function Sidebar({
: 'Choose one'}
</div>
</div>
<span className="shrink-0 text-xs text-faint transition-colors group-hover:text-accent">
⇄
<span className="shrink-0 text-faint transition-colors group-hover:text-accent">
<Icon name="switch" size={14} strokeWidth={2} />
</span>
</button>
<div className="px-2 pt-3">
<button
onClick={() => onSelect({ kind: 'all' })}
className={`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm transition-colors ${
className={`flex w-full items-center gap-2 rounded-[10px] px-2 py-1.5 text-left text-sm transition-colors ${
source.kind === 'all'
? 'bg-accent-soft text-text'
? 'is-selected font-medium text-text'
: 'text-muted hover:bg-ink-800 hover:text-text'
}`}
>
<span className="w-3 text-center text-[11px] text-mint">◈</span>
<span className={`flex w-4 justify-center ${source.kind === 'all' ? 'text-accent' : ''}`}>
<Icon name="music" size={15} />
</span>
<span className="flex-1">All Tracks</span>
</button>
</div>
<div className="mt-3 px-4">
<span className="text-[10px] font-semibold uppercase tracking-wider text-faint">
<span className="text-[11px] font-semibold uppercase tracking-wider text-faint">
Playlists
</span>
</div>
@@ -569,6 +588,7 @@ export function Sidebar({
onClick={onOpenHistory}
className="flex items-center justify-center gap-2 border-t border-line px-4 py-2 text-center text-xs text-muted hover:bg-ink-800 hover:text-text"
>
<Icon name="history" size={13} />
Collection Version History
</button>
+5 -4
View File
@@ -1,3 +1,4 @@
import { Icon } from '../lib/icons'
/** A background job's progress, shown at the right of the bar. */
export interface StatusJob {
label: string
@@ -33,7 +34,7 @@ export function StatusBar({
onChangeCollection,
}: Props) {
return (
<div className="flex items-center gap-3 border-t border-line bg-ink-900 px-4 py-2 text-xs text-muted">
<div className="glass flex h-7 shrink-0 items-center gap-3 !rounded-full px-4 text-[11px] text-muted">
<span className="font-medium text-text">{sourceName}</span>
<span className="text-faint">·</span>
{loading ? (
@@ -61,9 +62,9 @@ export function StatusBar({
{job.cancelling ? 'Cancelling…' : job.label}
{job.total > 0 && ` ${Math.min(job.done + 1, job.total)}/${job.total}`}
</span>
<span className="h-1.5 w-32 shrink-0 overflow-hidden rounded-full bg-ink-800">
<span className="well h-1.5 w-32 shrink-0 overflow-hidden rounded-full">
<span
className={`block h-full rounded-full bg-accent transition-[width] duration-300 ${
className={`block h-full rounded-full bg-gradient-to-r from-[var(--amb-1)] to-accent shadow-[0_0_8px_var(--color-accent)] transition-[width] duration-300 ${
job.total > 0 ? '' : 'w-1/3 animate-pulse'
}`}
style={job.total > 0 ? { width: `${(job.done / job.total) * 100}%` } : undefined}
@@ -86,7 +87,7 @@ export function StatusBar({
className={`${job ? '' : 'ml-auto '}flex items-center gap-1.5 rounded px-2 py-0.5 text-faint hover:bg-ink-800 hover:text-text`}
title="Change collection"
>
<span className="text-[11px]">⎘</span>
<Icon name="link" size={12} />
<span className="max-w-[220px] truncate font-mono text-[11px]">{collectionName}</span>
</button>
)}
+6 -4
View File
@@ -7,9 +7,9 @@ export interface ToastMsg {
}
const KIND_CLS: Record<ToastMsg['kind'], string> = {
error: 'border-pink/40 bg-ink-800 text-pink',
warning: 'border-gold/40 bg-ink-800 text-gold',
success: 'border-mint/40 bg-ink-800 text-mint',
error: 'bg-pink shadow-[0_0_14px_rgb(255_122_154/0.6)]',
warning: 'bg-gold shadow-[0_0_14px_rgb(255_200_97/0.6)]',
success: 'bg-mint shadow-[0_0_14px_rgb(61_220_132/0.6)]',
}
export function Toast({ toast, onClose }: { toast: ToastMsg | null; onClose: () => void }) {
@@ -23,8 +23,10 @@ export function Toast({ toast, onClose }: { toast: ToastMsg | null; onClose: ()
return (
<div className="pointer-events-none fixed inset-x-0 top-4 z-50 flex justify-center">
<div
className={`pointer-events-auto max-w-lg rounded-lg border px-4 py-2.5 text-sm shadow-xl ${KIND_CLS[toast.kind]}`}
className="glass-overlay pointer-events-auto flex max-w-lg items-center gap-3 !rounded-full px-5 py-2.5 text-sm text-text"
>
{/* The glass carries no colour; a lit dot says which kind this is. */}
<span className={`h-2 w-2 shrink-0 rounded-full ${KIND_CLS[toast.kind]}`} />
{toast.text}
</div>
</div>
+9 -8
View File
@@ -1,6 +1,7 @@
import { useQuery } from '@tanstack/react-query'
import { api } from '../api'
import { useCaps } from '../lib/capabilities'
import { Icon } from '../lib/icons'
export interface Filters {
search: string
@@ -28,7 +29,7 @@ interface Props {
}
const selectCls =
'rounded-md border border-line bg-ink-850 px-2.5 py-1.5 text-sm text-text outline-none focus:border-accent hover:border-ink-600 transition-colors'
'btn-glass rounded-full px-3 py-1.5 text-sm text-text outline-none focus:ring-1 focus:ring-accent'
export function Toolbar({
filters,
@@ -47,16 +48,16 @@ export function Toolbar({
filters.hasCues !== 'any'
return (
<div className="flex flex-wrap items-center gap-2 border-b border-line bg-ink-900 px-4 py-3">
<div className="flex flex-wrap items-center gap-2 border-b border-line px-4 py-3">
<div className="relative">
<span className="pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-faint">
⌕
<span className="pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-faint">
<Icon name="search" size={15} />
</span>
<input
value={filters.search}
onChange={(e) => set({ search: e.target.value })}
placeholder="Search artist, title, album…"
className="w-64 rounded-md border border-line bg-ink-850 py-1.5 pl-8 pr-3 text-sm text-text outline-none placeholder:text-faint focus:border-accent"
className="well w-72 rounded-full py-1.5 pl-9 pr-3 text-sm text-text outline-none placeholder:text-faint focus:ring-1 focus:ring-accent"
/>
</div>
@@ -91,14 +92,14 @@ export function Toolbar({
value={filters.bpmMin}
onChange={(e) => set({ bpmMin: e.target.value.replace(/[^\d.]/g, '') })}
placeholder="min"
className="w-14 rounded-md border border-line bg-ink-850 px-2 py-1.5 text-center text-sm tabular-nums outline-none focus:border-accent placeholder:text-faint"
className="well w-14 rounded-full px-2 py-1.5 text-center font-mono text-sm outline-none focus:ring-1 focus:ring-accent placeholder:text-faint"
/>
<span className="text-xs text-faint">BPM</span>
<input
value={filters.bpmMax}
onChange={(e) => set({ bpmMax: e.target.value.replace(/[^\d.]/g, '') })}
placeholder="max"
className="w-14 rounded-md border border-line bg-ink-850 px-2 py-1.5 text-center text-sm tabular-nums outline-none focus:border-accent placeholder:text-faint"
className="well w-14 rounded-full px-2 py-1.5 text-center font-mono text-sm outline-none focus:ring-1 focus:ring-accent placeholder:text-faint"
/>
</div>
@@ -129,7 +130,7 @@ export function Toolbar({
{active && (
<button
onClick={() => onChange(emptyFilters)}
className="rounded-md px-2.5 py-1.5 text-sm text-muted hover:bg-ink-800 hover:text-text"
className="rounded-full px-3 py-1.5 text-sm text-muted hover:bg-ink-800 hover:text-text"
>
Clear filters
</button>
+3 -3
View File
@@ -148,11 +148,11 @@ export function UpdateCheck() {
return (
<div
aria-modal="true" className="fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-6"
aria-modal="true" className="fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-[3px] p-6"
onClick={close}
>
<div
className="flex max-h-[80vh] w-full max-w-md flex-col overflow-hidden rounded-xl border border-line bg-ink-900 shadow-2xl"
className="flex max-h-[80vh] w-full max-w-md flex-col overflow-hidden glass-overlay"
onClick={(e) => e.stopPropagation()}
>
<div className="border-b border-line px-5 py-4">
@@ -200,7 +200,7 @@ export function UpdateCheck() {
</button>
<button
onClick={download}
className="rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-ink-950 hover:brightness-110"
className="rounded-full btn-primary px-3 py-1.5 text-sm font-semibold"
>
Download
</button>