diff --git a/CLAUDE.md b/CLAUDE.md index db0667f..cae6573 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -427,7 +427,8 @@ Two independent apps that talk over HTTP: - Data flow: the whole library is fetched once (`/api/tracks?limit=20000`); filtering and sorting happen **client-side** for instant interaction. Edits apply in-memory (server holds them) and the sidebar **Save to Traktor** - button flushes to disk. Styling is Tailwind v4 with tokens in `src/index.css`. + button flushes to disk. Styling is Tailwind v4 with tokens in `src/index.css` + — see "Theme" below. Library column layout (visibility/order/width) persists to `userprefs.json` via `GET`/`PATCH /api/prefs` (debounced; hydrated on launch, merged against defaults so newly-added columns still appear). The prep deck's main-waveform @@ -648,8 +649,48 @@ frontend at `http://localhost:5173`. - Backend: type hints, Pydantic models for all responses, keep query logic in `collection_service.py` (routes stay thin). - Frontend: functional components, TanStack Query for fetching, Tailwind - utility classes with the `ink-*`/`accent`/`gold`/`mint`/`pink` tokens from - `index.css`. Keep `api.ts` types aligned with `schemas.py`. + utility classes with the `ink-*`/`well`/`accent`/`gold`/`mint`/`pink` tokens + and the material classes from `index.css` (see "Theme"). Icons come from + `lib/icons.tsx`, never emoji. Keep `api.ts` types aligned with `schemas.py`. + +## Theme — "dark liquid glass" + +Floating frosted panels (12 px gutters) over a drifting wash of colour sampled +from the loaded track's cover art. Colour is reserved for MEANING — cue types, +key, playhead, the one primary action; chrome stays neutral. The rules that are +easy to break: + +- **`ink-900`…`ink-600` are translucent WHITE overlays, not greys**, so they + read on any panel. Only `ink-950` is opaque: it is the dark text on light + buttons and the page base. Recessed things (inputs, waveforms, readouts, + progress tracks) use `well` / the `.well` class — never `bg-ink-950`. +- **Materials are classes in `index.css`**: `.glass` (panel), `.glass-overlay` + (menus, dialogs, toasts — denser), `.well`, `.btn-glass`, `.btn-primary` + (white→accent pill, one per view), `.is-selected`. The rim light is a + `::before`, so these set `position: relative`; Tailwind's `fixed`/`absolute` + utilities win because utilities outrank the components layer. +- **Never put `backdrop-filter` (or `filter`/`transform`) on an element that can + contain a popup.** It makes that element the containing block for every + `position: fixed` descendant, so a context menu or dialog opened inside it is + placed relative to the panel, not the window — the sidebar's playlist menu + opened far from the cursor. `.glass`'s blur and tint therefore live on its + `::after` (z-index -1 under `isolation: isolate`), not on the panel. +- **The accent is `oklch(0.8 0.11 var(--accent-hue))`** — the cover's hue at a + FIXED lightness and chroma, so dark text on it keeps its contrast whatever is + loaded. `lib/ambient.ts` sets `--accent-hue` and `--amb-1..4` on ``; + they are `@property`-registered so a track change glides, and nothing in React + state depends on them (no re-render on a track change). The art is fetched as + a blob → `createImageBitmap`, because a cross-origin `` (the API under + Tauri) taints the canvas. A device track, or greyscale art, gets the default. +- `AmbientBackdrop` is mounted in `main.tsx`, behind the picker too; so no root + container may set an opaque background, or the glass has nothing behind it. +- **Canvas drawing glows instead of outlining** (`cues.ts`): a black outline on + glass reads as a gap in the waveform. The playhead is `drawPlayhead`, shared + by both waveforms. +- The table's Cues column draws one dot per occupied slot from + `Track.hotcues` (`HotcueChip`: slot, type, colour), which every adapter + projects with the SAME slot test its `track_cues()` uses, so the dots cannot + disagree with the pads. OneLibrary fills it lazily, like `hotcue_count`. - Python 3.14 note: pin dependencies loosely enough to get prebuilt wheels (older `pydantic-core` pins force a from-source Rust build that fails). @@ -929,9 +970,14 @@ The prep strip plays every track through the **Web Audio API** (a plain playback buffer's views). Playback and scratch also run on **separate `AudioContext`s** — sharing one goes silent after a source has played. - `waveform.ts` — decodes once (buffer reused by both engines, no re-decode), - splits into 3 bands via `OfflineAudioContext` biquads, and colors each column - by blending three palette targets (bass→orange, mids→violet, highs→cyan — no - green, matching Traktor's Spectrum). Height = amplitude. + splits into 3 bands via `OfflineAudioContext` biquads, and paints them as + **three layers**, not one blended colour per column: bass (orange) first and + tallest, then mids (violet) and highs (cyan) with a `screen` blend — no green, + matching Traktor's Spectrum. Each band is normalised to its own 99.5th + percentile and then EXPANDED (bass steepest): dance music holds its bass near + full scale for whole sections, so a linear map draws a solid orange wall + instead of the kick pulse. The main view draws 2 px bars with a 1 px gap, + **binned in track space** so bars scroll rather than flicker. - `cues.ts` — canvas drawers for cue markers (type-colored), the active loop band, the beatgrid (per-segment white beats/brighter downbeats, plus marker lines — gold for the one governing the playhead, accent otherwise, with the diff --git a/backend/konduktor/adapters/onelibrary/adapter.py b/backend/konduktor/adapters/onelibrary/adapter.py index 511c3e8..d66fb1a 100644 --- a/backend/konduktor/adapters/onelibrary/adapter.py +++ b/backend/konduktor/adapters/onelibrary/adapter.py @@ -24,7 +24,7 @@ from pathlib import Path from ...core.adapter import Unsupported from ...core.capabilities import Capabilities -from ...core.model import PlaylistNode, Track, TrackCues +from ...core.model import HotcueChip, PlaylistNode, Track, TrackCues from ...core.pathmap import PathMapping, common_dir_prefix from ...core.query import TrackIndex from . import capabilities as caps @@ -125,7 +125,15 @@ class OneLibraryAdapter: if track is not None: track.grid_marker_count = len(result.grid_markers) track.cue_count = len(result.cues) - track.hotcue_count = sum(1 for c in result.cues if c.role == "hotcue") + track.hotcues = sorted( + ( + HotcueChip(slot=c.slot, type=c.type, color=c.color) + for c in result.cues + if c.role == "hotcue" and c.slot is not None + ), + key=lambda chip: chip.slot, + ) + track.hotcue_count = len(track.hotcues) return result # ---- playlists ------------------------------------------------------- diff --git a/backend/konduktor/adapters/rekordbox/adapter.py b/backend/konduktor/adapters/rekordbox/adapter.py index 5f04a79..aaf97a8 100644 --- a/backend/konduktor/adapters/rekordbox/adapter.py +++ b/backend/konduktor/adapters/rekordbox/adapter.py @@ -43,10 +43,10 @@ class RekordboxAdapter: # ---- projection maintenance ----------------------------------------- def _rebuild(self) -> None: - counts = self._store.cue_counts() + kinds = self._store.cue_kinds() self._index.rebuild( [ - projection.to_track(row, counts.get(str(row.ID), (0, 0))) + projection.to_track(row, kinds.get(str(row.ID), ())) for row in self._store.iter_content() ] ) @@ -66,9 +66,9 @@ class RekordboxAdapter: Every mutating command must end in this — a forgotten refresh is a silently stale projection that no byte- or row-level test would catch. """ - counts = self._store.cue_counts() + kinds = self._store.cue_kinds() row = self._store.content(track_id) - self._index.replace(projection.to_track(row, counts.get(str(row.ID), (0, 0)))) + self._index.replace(projection.to_track(row, kinds.get(str(row.ID), ()))) def close(self) -> None: """Release the database connection. diff --git a/backend/konduktor/adapters/rekordbox/projection.py b/backend/konduktor/adapters/rekordbox/projection.py index af019f2..27cd735 100644 --- a/backend/konduktor/adapters/rekordbox/projection.py +++ b/backend/konduktor/adapters/rekordbox/projection.py @@ -7,7 +7,7 @@ from __future__ import annotations import re -from ...core.model import CuePoint, GridMarker, Track, TrackCues +from ...core.model import CuePoint, GridMarker, HotcueChip, Track, TrackCues from . import beatgrid from .cue_types import cue_type, role_and_slot @@ -97,12 +97,14 @@ def _name_of(related) -> str | None: return None -def to_track(row, cue_counts: tuple[int, int] = (0, 0)) -> Track: +def to_track(row, cue_kinds=()) -> Track: """Project one ``DjmdContent`` row. - `cue_counts` is ``(total, hotcues)`` from the store's single aggregate + `cue_kinds` is this track's ``(Kind, OutMsec)`` pairs from the store's single query — passed in rather than read off the row, which would be a per-track - round trip. + round trip. "Is this a hot cue, and on which pad?" is `role_and_slot`, the + same definition `to_track_cues` uses, so the table's count and dots agree + with the pads shown in the deck (it also rules out the reserved Kind). **`grid_marker_count` is an approximation here**: the real count needs the track's ANLZ file, which is far too slow to read for every track at open @@ -115,7 +117,14 @@ def to_track(row, cue_counts: tuple[int, int] = (0, 0)) -> Track: On the reference library the two sets agree exactly: all 22 tracks with no BPM are precisely the 22 with no grid. """ - total_cues, hotcues = cue_counts + chips: list[HotcueChip] = [] + for kind, out_msec in cue_kinds: + role, slot = role_and_slot(kind) + if role == "hotcue" and slot is not None: + # Rekordbox's colour is a palette index nobody has decoded yet (see + # `_cue_color`), so no colour is claimed and the UI uses the type's. + chips.append(HotcueChip(slot=slot, type=cue_type(out_msec), color=None)) + chips.sort(key=lambda chip: chip.slot) key_name = _name_of(getattr(row, "Key", None)) wheel, mode = parse_key(key_name) return Track( @@ -142,8 +151,9 @@ def to_track(row, cue_counts: tuple[int, int] = (0, 0)) -> Track: last_played=None, # not modelled as a date in master.db release_date=_iso_date(getattr(row, "ReleaseDate", None)), filepath=str(getattr(row, "FolderPath", "") or "") or None, - cue_count=total_cues, - hotcue_count=hotcues, + cue_count=len(cue_kinds), + hotcue_count=len(chips), + hotcues=chips, grid_marker_count=1 if (_bpm(row) and getattr(row, "AnalysisDataPath", None)) else 0, grid_locked=False, # Rekordbox has no per-track grid lock media_kind="audio", diff --git a/backend/konduktor/adapters/rekordbox/store.py b/backend/konduktor/adapters/rekordbox/store.py index 1c67ed8..7738fe2 100644 --- a/backend/konduktor/adapters/rekordbox/store.py +++ b/backend/konduktor/adapters/rekordbox/store.py @@ -171,23 +171,22 @@ class RekordboxStore: raise NotFound(f"No track {track_id!r}") return row - def cue_counts(self) -> dict[str, tuple[int, int]]: - """``{track_id: (total_cues, hotcue_count)}`` in one aggregate query.""" + def cue_kinds(self) -> dict[str, list[tuple[int | None, int | None]]]: + """``{track_id: [(Kind, OutMsec), ...]}`` for every live cue, in one query. + + Just enough per cue for the library table's count and hotcue dots, + without a per-track round trip. What a ``Kind`` means is decided in the + projection, by the same `role_and_slot` the deck's cues use, so the + table and the pads cannot disagree. + """ t = self._tables rows = self._db.session.execute( - select(t.DjmdCue.ContentID, t.DjmdCue.Kind, func.count()) + select(t.DjmdCue.ContentID, t.DjmdCue.Kind, t.DjmdCue.OutMsec) .where(t.DjmdCue.rb_local_deleted == 0) - .group_by(t.DjmdCue.ContentID, t.DjmdCue.Kind) ).all() - out: dict[str, tuple[int, int]] = {} - for content_id, kind, n in rows: - total, hot = out.get(str(content_id), (0, 0)) - # "Is this a hot cue?" must mean the same here as in the projection, - # or the count in the library table disagrees with the pads shown in - # the deck. `role_and_slot` is the single definition — it also rules - # out the reserved Kind, which occupies no pad. - is_hotcue = role_and_slot(kind)[0] == "hotcue" - out[str(content_id)] = (total + n, hot + (n if is_hotcue else 0)) + out: dict[str, list[tuple[int | None, int | None]]] = {} + for content_id, kind, out_msec in rows: + out.setdefault(str(content_id), []).append((kind, out_msec)) return out def cues(self, track_id: str) -> list: diff --git a/backend/konduktor/adapters/traktor/projection.py b/backend/konduktor/adapters/traktor/projection.py index bd5bf4f..df9124e 100644 --- a/backend/konduktor/adapters/traktor/projection.py +++ b/backend/konduktor/adapters/traktor/projection.py @@ -7,7 +7,7 @@ from __future__ import annotations import re -from ...core.model import CuePoint, GridMarker, Track, TrackCues +from ...core.model import CuePoint, GridMarker, HotcueChip, Track, TrackCues from . import beatgrid from .cue_types import NATIVE_TO_CUE_TYPE @@ -83,8 +83,19 @@ def to_track(e) -> Track: # question, two answers. markers = beatgrid.grid_markers(e) cues = [c for c in (e.cue_v2 or []) if getattr(c, "grid", None) is None] - hotcues = sum( - 1 for c in cues if c.hotcue is not None and c.hotcue >= 0 + # The same "is this in the bank" test as `to_track_cues`' slot, so the + # table's dots and the deck's pads cannot disagree. + chips = sorted( + ( + HotcueChip( + slot=c.hotcue, + type=NATIVE_TO_CUE_TYPE.get(c.type, "cue"), + color=c.color or None, + ) + for c in cues + if c.hotcue is not None and c.hotcue >= 0 + ), + key=lambda chip: chip.slot, ) wheel, mode = parse_key(info.key if info else None) return Track( @@ -111,7 +122,8 @@ def to_track(e) -> Track: release_date=iso_date(info.release_date if info else None), filepath=_display_path(loc) if loc else None, cue_count=len(cues), - hotcue_count=hotcues, + hotcue_count=len(chips), + hotcues=chips, grid_marker_count=len(markers), grid_locked=bool(e.lock), media_kind="stem" if getattr(e, "stems", None) is not None else "audio", diff --git a/backend/konduktor/core/model.py b/backend/konduktor/core/model.py index 6ab7c00..b000713 100644 --- a/backend/konduktor/core/model.py +++ b/backend/konduktor/core/model.py @@ -16,6 +16,18 @@ from pydantic import BaseModel, ConfigDict, Field from .capabilities import CueRole, CueType, MediaKind, PlaylistKind +class HotcueChip(BaseModel): + """One occupied hotcue slot, as the library table previews it. + + Deliberately far smaller than a `CuePoint`: it rides on every `Track` in the + whole-library fetch, and a row only needs enough to draw a coloured dot. + """ + + slot: int + type: CueType = "cue" + color: str | None = None # "#RRGGBB" as the platform stored it + + class Track(BaseModel): """A single track in the library, as the app sees it.""" @@ -47,6 +59,10 @@ class Track(BaseModel): filepath: str | None = None # human-readable OS path cue_count: int = 0 hotcue_count: int = 0 + # The occupied hotcue slots, ordered by slot. Where cues are parsed lazily + # (OneLibrary) this is empty until `track_cues()` corrects it, exactly like + # `hotcue_count` — the two must always agree. + hotcues: list[HotcueChip] = Field(default_factory=list) # 0 = no beatgrid, 1 = constant tempo, >1 = a flexible (multi-tempo) grid. grid_marker_count: int = 0 grid_locked: bool = False diff --git a/backend/konduktor/schemas.py b/backend/konduktor/schemas.py index 4a419db..7e4ccc0 100644 --- a/backend/konduktor/schemas.py +++ b/backend/konduktor/schemas.py @@ -314,6 +314,7 @@ from .core.model import ( # noqa: E402,F401 Facets, GenreCount, GridMarker, + HotcueChip, PlaylistNode, PrefixGroup, PrefixSuggestions, diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 33f0aff..891de0c 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -12,6 +12,8 @@ "@dnd-kit/modifiers": "^9.0.0", "@dnd-kit/sortable": "^10.0.0", "@dnd-kit/utilities": "^3.2.2", + "@fontsource-variable/geist": "^5.3.0", + "@fontsource-variable/geist-mono": "^5.3.0", "@tanstack/react-query": "^5.101.2", "@tanstack/react-table": "^8.21.3", "@tanstack/react-virtual": "^3.14.5", @@ -150,6 +152,24 @@ "tslib": "^2.4.0" } }, + "node_modules/@fontsource-variable/geist": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@fontsource-variable/geist/-/geist-5.3.0.tgz", + "integrity": "sha512-j0m+vLQuG5XAYoHtGCVu0spvlGreR3EzpECUVzkFmI1mTVnAO38l/NEPDCFgZ177JxzYJCLSmTQibIiYPilGrA==", + "license": "OFL-1.1", + "funding": { + "url": "https://github.com/sponsors/ayuhito" + } + }, + "node_modules/@fontsource-variable/geist-mono": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@fontsource-variable/geist-mono/-/geist-mono-5.3.0.tgz", + "integrity": "sha512-vBbuwDEo9AkrqADMXOrlAR3DFcJi4/JxeuU43FoiQERnNwsfXNnvxvReZG02cQKmyk4DZkZdBZX3oTDvy2zBAw==", + "license": "OFL-1.1", + "funding": { + "url": "https://github.com/sponsors/ayuhito" + } + }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.13", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", diff --git a/frontend/package.json b/frontend/package.json index d867ac5..4ff1372 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -15,6 +15,8 @@ "@dnd-kit/modifiers": "^9.0.0", "@dnd-kit/sortable": "^10.0.0", "@dnd-kit/utilities": "^3.2.2", + "@fontsource-variable/geist": "^5.3.0", + "@fontsource-variable/geist-mono": "^5.3.0", "@tanstack/react-query": "^5.101.2", "@tanstack/react-table": "^8.21.3", "@tanstack/react-virtual": "^3.14.5", diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index fc923df..8347ecd 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -24,6 +24,7 @@ import { PathMappingDialog } from './components/PathMappingDialog' import { HistoryPanel } from './components/HistoryPanel' import { PrepStrip } from './components/PrepStrip' import { ImportDialog } from './components/ImportDialog' +import { Icon } from './lib/icons' function applyFilters(tracks: Track[], f: Filters): Track[] { const q = f.search.trim().toLowerCase() @@ -506,7 +507,7 @@ export default function App() { if (collection.isLoading || (loaded && !capabilities.data)) { return ( -
+
Loading…
) @@ -759,7 +760,7 @@ export default function App() { { heading: 'Exports', empty: exportSets.data?.length ? undefined : 'No exports yet' }, ...(exportSets.data ?? []).map((set) => ({ label: set.name, - icon: '◈', + icon: , onClick: () => addToExport(set.id, ids), })), ] @@ -767,7 +768,9 @@ export default function App() { return ( -
+ {/* Floating glass panels with gaps between them: the ambient backdrop + (main.tsx) shows through the gutters as well as through the glass. */} +
setToast(null)} /> {menu && ( -
+
-
+
{/* Search / filters — always visible. Columns are chosen by right-clicking the header. */} {(!isAll || viewingDevice) && ( -
+
- {viewingDevice ? '⬒' : viewingExport ? (source.kind === 'export' ? '◈' : '♫') : '♫'} + {viewName} {viewingExport ? ( @@ -949,7 +955,7 @@ export default function App() { : ' · live — what ships is whatever this playlist holds at export time'} - + Export @@ -962,12 +968,12 @@ export default function App() { : `${tracks.length} tracks`} - + Device · read-only @@ -1122,33 +1128,35 @@ export default function App() {
- { - setBatchCancelling(true) - api.cancelJob(batchJob.id).catch((e) => onError((e as Error).message)) - }, - } - : null - } - loading={loading} - collectionName={capabilities.data ? libraryName : null} - onChangeCollection={() => setForcePicker(true)} - />
+ + {/* A slim capsule of its own under both columns, as on the deck above. */} + { + setBatchCancelling(true) + api.cancelJob(batchJob.id).catch((e) => onError((e as Error).message)) + }, + } + : null + } + loading={loading} + collectionName={capabilities.data ? libraryName : null} + onChangeCollection={() => setForcePicker(true)} + />
) diff --git a/frontend/src/api.ts b/frontend/src/api.ts index f99181e..1bdf31a 100644 --- a/frontend/src/api.ts +++ b/frontend/src/api.ts @@ -29,12 +29,23 @@ export interface Track { filepath: string | null cue_count: number hotcue_count: number + /** The occupied hotcue slots, ordered by slot — what the table's Cues column + * draws as dots. Empty until corrected where cues load lazily (OneLibrary), + * exactly like `hotcue_count`. */ + hotcues: HotcueChip[] /** 0 = no beatgrid, 1 = constant tempo, >1 = a flexible (multi-tempo) grid. */ grid_marker_count: number grid_locked: boolean media_kind: MediaKind } +/** One occupied hotcue slot, as the library table previews it. */ +export interface HotcueChip { + slot: number + type: CueType + color: string | null // "#RRGGBB" as the platform stored it +} + export interface TrackPage { total: number offset: number diff --git a/frontend/src/components/AmbientBackdrop.tsx b/frontend/src/components/AmbientBackdrop.tsx new file mode 100644 index 0000000..4935706 --- /dev/null +++ b/frontend/src/components/AmbientBackdrop.tsx @@ -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 ( +
+
+
+
+
+ {/* Vignette: keeps the edges and the table's lower rows calm. */} +
+
+ ) +} diff --git a/frontend/src/components/AnalyzeGridDialog.tsx b/frontend/src/components/AnalyzeGridDialog.tsx index 8e18872..8687132 100644 --- a/frontend/src/components/AnalyzeGridDialog.tsx +++ b/frontend/src/components/AnalyzeGridDialog.tsx @@ -26,11 +26,11 @@ export function AnalyzeGridDialog({ total, existing, locked, onChoose, onClose } return (
e.stopPropagation()} >
@@ -71,7 +71,7 @@ export function AnalyzeGridDialog({ total, existing, locked, onChoose, onClose } {canSkip && ( diff --git a/frontend/src/components/AutoCueDialog.tsx b/frontend/src/components/AutoCueDialog.tsx index a83dd51..7b66392 100644 --- a/frontend/src/components/AutoCueDialog.tsx +++ b/frontend/src/components/AutoCueDialog.tsx @@ -152,9 +152,9 @@ export function AutoCueDialog(props: Props) { } return ( -
!busy && onClose()}> +
!busy && onClose()}>
e.stopPropagation()} >
@@ -281,7 +281,7 @@ export function AutoCueDialog(props: Props) { - + {sizeLabel(beats)}
) diff --git a/frontend/src/components/CollectionPicker.tsx b/frontend/src/components/CollectionPicker.tsx index 2c55b5d..d0a5e04 100644 --- a/frontend/src/components/CollectionPicker.tsx +++ b/frontend/src/components/CollectionPicker.tsx @@ -120,8 +120,8 @@ export function CollectionPicker({ onOpened, onCancel }: Props) { const openError = open.isError ? (open.error as Error).message : null return ( -
-
+
+
{/* Header */}
@@ -274,7 +274,7 @@ export function CollectionPicker({ onOpened, onCancel }: Props) { @@ -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" /> diff --git a/frontend/src/components/ConfirmDialog.tsx b/frontend/src/components/ConfirmDialog.tsx index c664b7e..32c0e9d 100644 --- a/frontend/src/components/ConfirmDialog.tsx +++ b/frontend/src/components/ConfirmDialog.tsx @@ -46,11 +46,11 @@ export function ConfirmDialog({ title, body, confirmLabel, onConfirm, onClose }: return (
!busy && onClose()} >
e.stopPropagation()} >
@@ -68,7 +68,7 @@ export function ConfirmDialog({ title, body, confirmLabel, onConfirm, onClose }: diff --git a/frontend/src/components/ContextMenu.tsx b/frontend/src/components/ContextMenu.tsx index 5878331..3ac7cff 100644 --- a/frontend/src/components/ContextMenu.tsx +++ b/frontend/src/components/ContextMenu.tsx @@ -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 ( -
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. +
e.stopPropagation()}>
{items.map((item, i) => { if ('separator' in item) { - return
+ return
} 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" > - {item.checked ? '✓' : ''} + {item.checked && } {item.label} @@ -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' }`} > {item.label} - ▸ + ) } @@ -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 && {item.icon}} + {item.icon && {item.icon}} {item.label} {item.hint && ( - {item.hint} + {item.hint} )} ) diff --git a/frontend/src/components/DevicesSection.tsx b/frontend/src/components/DevicesSection.tsx index ceb301d..0a9f9e0 100644 --- a/frontend/src/components/DevicesSection.tsx +++ b/frontend/src/components/DevicesSection.tsx @@ -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' }`} > - ⬒ + {d.label} @@ -140,7 +141,7 @@ export function DevicesSection({ source, onSelect, onError, onImport }: Props) { {viewingDevice && openPath && ( @@ -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' }`} > - - {isFolder ? '▸' : '♫'} + + {node.name} {!isFolder && {node.count}} diff --git a/frontend/src/components/EditTagsDialog.tsx b/frontend/src/components/EditTagsDialog.tsx index 46dead9..74e7dce 100644 --- a/frontend/src/components/EditTagsDialog.tsx +++ b/frontend/src/components/EditTagsDialog.tsx @@ -97,11 +97,11 @@ export function EditTagsDialog({ track, onClose, onApplied, onError }: Props) { return (
e.stopPropagation()} >
@@ -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" /> ) : ( 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" /> )} @@ -241,7 +241,7 @@ export function EditTagsDialog({ track, onClose, onApplied, onError }: Props) { diff --git a/frontend/src/components/ExportDialog.tsx b/frontend/src/components/ExportDialog.tsx index dc4978c..3f9e05f 100644 --- a/frontend/src/components/ExportDialog.tsx +++ b/frontend/src/components/ExportDialog.tsx @@ -67,8 +67,8 @@ export function ExportDialog({ editing, onClose, onSaved, onError }: Props) { onClose={() => setBrowsing(false)} /> )} -
-
+
+

{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" />

@@ -124,13 +124,13 @@ export function ExportDialog({ editing, onClose, onSaved, onError }: Props) { {destination || 'Choose a folder…'} @@ -140,7 +140,7 @@ export function ExportDialog({ editing, onClose, onSaved, onError }: Props) { every track, in your own folder structure.
{conflict && ( -
+
“{conflict}” already exports here. Exporting replaces whatever the other one wrote.
@@ -151,14 +151,14 @@ export function ExportDialog({ editing, onClose, onSaved, onError }: Props) {
diff --git a/frontend/src/components/ExportRunDialog.tsx b/frontend/src/components/ExportRunDialog.tsx index 8c81e0d..ac351a8 100644 --- a/frontend/src/components/ExportRunDialog.tsx +++ b/frontend/src/components/ExportRunDialog.tsx @@ -101,8 +101,8 @@ export function ExportRunDialog({ set, onClose, onDone, onError }: Props) { const blocked = p?.blocked ?? null return ( -
-
+
+

Export “{set.name}”

@@ -115,7 +115,7 @@ export function ExportRunDialog({ set, onClose, onDone, onError }: Props) {
{set.destination}
@@ -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 && ( -
+
{p.missing.length} track{p.missing.length === 1 ? '' : 's'} will be skipped — the audio file is not on this disk:
{p.missing.slice(0, 4).join(', ')}
)} {p.replacing && ( -
+
This folder already holds an export. Its files will be replaced.
)} @@ -162,19 +162,19 @@ export function ExportRunDialog({ set, onClose, onDone, onError }: Props) { )} {blocked === 'destination_not_empty' && ( -
+
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.
)} {blocked === 'nothing_to_export' && ( -
+
There’s nothing to export yet — add some tracks or a playlist.
)} {blocked === 'unsupported_target' && ( -
+
Konduktor can’t write that kind of library yet.
)} @@ -184,7 +184,7 @@ export function ExportRunDialog({ set, onClose, onDone, onError }: Props) { {job && (
{job.message || 'Working…'}
-
+
@@ -241,7 +241,7 @@ export function ExportRunDialog({ set, onClose, onDone, onError }: Props) { <> @@ -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()} diff --git a/frontend/src/components/ExportsSection.tsx b/frontend/src/components/ExportsSection.tsx index fedbf37..ae92ff1 100644 --- a/frontend/src/components/ExportsSection.tsx +++ b/frontend/src/components/ExportsSection.tsx @@ -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({
@@ -212,7 +213,7 @@ function ExportRow({
) @@ -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' }`} > - ◇ + Other {data.loose} @@ -287,7 +288,7 @@ function ExportRow({ diff --git a/frontend/src/components/FileBrowser.tsx b/frontend/src/components/FileBrowser.tsx index d348d70..0bc8466 100644 --- a/frontend/src/components/FileBrowser.tsx +++ b/frontend/src/components/FileBrowser.tsx @@ -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 = { - home: '⌂', - music: '♫', - desktop: '🖥', - documents: '🗎', - downloads: '⬇', - volume: '⬒', - library: '◈', +const ICONS: Record = { + 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. ---- */} -
+
{groups.map((g) => (
@@ -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' }`} > - {ICONS[p.kind]} + {p.name} ) @@ -115,13 +116,13 @@ export function FileBrowser({ mode, platform, path, onNavigate, onPickFile, foot {/* ---- Path bar + listing ---- */}
-
+
))} @@ -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" > - ♫ + {f.name} open diff --git a/frontend/src/components/FolderPicker.tsx b/frontend/src/components/FolderPicker.tsx index 5b1e21b..e4b4149 100644 --- a/frontend/src/components/FolderPicker.tsx +++ b/frontend/src/components/FolderPicker.tsx @@ -31,8 +31,8 @@ export function FolderPicker({ value, onChange, onClose }: Props) { } return ( -
-
+
+

Choose a folder

@@ -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" />
} @@ -67,14 +67,14 @@ export function FolderPicker({ value, onChange, onClose }: Props) { diff --git a/frontend/src/components/GridControls.tsx b/frontend/src/components/GridControls.tsx index 084cc54..12016fc 100644 --- a/frontend/src/components/GridControls.tsx +++ b/frontend/src/components/GridControls.tsx @@ -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 (
{/* BPM readout / editor */} -
+
{editing ? ( ) : ( {/* 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 + Mrk
@@ -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'} + + {analyzing ? 'Analyzing…' : 'Analyze'}
diff --git a/frontend/src/components/HistoryPanel.tsx b/frontend/src/components/HistoryPanel.tsx index 821f602..4902a2b 100644 --- a/frontend/src/components/HistoryPanel.tsx +++ b/frontend/src/components/HistoryPanel.tsx @@ -80,11 +80,11 @@ export function HistoryPanel({ onClose, onNotify, onError }: Props) { return (
e.stopPropagation()} >
@@ -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 diff --git a/frontend/src/components/HotcueBar.tsx b/frontend/src/components/HotcueBar.tsx index e29f3c0..b9f61d4 100644 --- a/frontend/src/components/HotcueBar.tsx +++ b/frontend/src/components/HotcueBar.tsx @@ -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 ( -
+
{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)} + + {locked ? : slotLabel(slot)} + + + {cue ? (cue.name && cue.name !== 'n.n.' ? cue.name : ' ') : ''} + {glyph && ( - + {glyph} )} @@ -87,3 +102,22 @@ export function HotcueBar({
) } + +/** + * 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(', '), + } +} diff --git a/frontend/src/components/ImportDialog.tsx b/frontend/src/components/ImportDialog.tsx index ce8d500..40473ac 100644 --- a/frontend/src/components/ImportDialog.tsx +++ b/frontend/src/components/ImportDialog.tsx @@ -153,8 +153,8 @@ export function ImportDialog({ playlistId, deviceLabel, onClose, onDone, onError onClose={() => setBrowsing(false)} /> )} -
-
+
+

Import from {deviceLabel} @@ -170,14 +170,14 @@ export function ImportDialog({ playlistId, deviceLabel, onClose, onDone, onError
{baseFolder || 'Loading…'} @@ -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 && ( -
+
{p.missing.length} track{p.missing.length === 1 ? '' : 's'} will be skipped — the audio file is not on the drive:
{p.missing.slice(0, 4).join(', ')}
@@ -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 && ( -
+
{p.duplicates.length} of these look like tracks your collection already has. They will be added again as new entries.
@@ -255,7 +255,7 @@ export function ImportDialog({ playlistId, deviceLabel, onClose, onDone, onError {job && (
{job.message || 'Working…'}
-
+
@@ -302,7 +302,7 @@ export function ImportDialog({ playlistId, deviceLabel, onClose, onDone, onError <> @@ -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()} diff --git a/frontend/src/components/LoopControls.tsx b/frontend/src/components/LoopControls.tsx index a461f74..fbf52fd 100644 --- a/frontend/src/components/LoopControls.tsx +++ b/frontend/src/components/LoopControls.tsx @@ -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 ( -
- +
+ Loop +
{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)} ) })} +
- - @@ -239,7 +240,7 @@ export function PathMappingDialog({ onClose, onNotify, onError }: Props) { @@ -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" > - 📁 + {d.name} )) diff --git a/frontend/src/components/PrepStrip.tsx b/frontend/src/components/PrepStrip.tsx index c03170c..ece0fae 100644 --- a/frontend/src/components/PrepStrip.tsx +++ b/frontend/src/components/PrepStrip.tsx @@ -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 ( -
+
{/* Controls */} -
-
+
+
+ +
{track ? ( <> -
+
{track.title ?? 'Untitled'}
@@ -987,7 +997,7 @@ export function PrepStrip({ live. The controls themselves report the reason when pressed. */} {readOnlyShort(caps) && (
{readOnlyShort(caps)} @@ -997,6 +1007,7 @@ export function PrepStrip({ ) : (
No track loaded
)} +
{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 ? ( - - - - - ) : ( - - - - )} + -
+
{fmt(current)} / {fmt(duration)}
@@ -1079,18 +1081,18 @@ export function PrepStrip({
{/* Waveforms + loop/hotcue controls. */} -
+
{!track ? ( -
+
Load a track to prep it
) : waveStatus === 'error' ? ( -
+
Could not load audio — file may be missing or an unsupported format.
) : ( <> -
+
{showWaves ? ( )}
-
+
{showWaves && ( {/* Hotcue row: label · 8 slots · type of selected cue · delete. */} -
- +
+ Cues -
+
{selectedCue && selectedCue.type === 'loop' ? ( Loop ) : 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 + + Auto
@@ -1217,3 +1221,29 @@ export function PrepStrip({
) } + +/** + * 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(null) + const showArt = trackId != null && failed !== trackId + return ( +
+ {showArt && ( + setFailed(trackId)} + /> + )} +
+ ) +} diff --git a/frontend/src/components/RatingStars.tsx b/frontend/src/components/RatingStars.tsx index cdee86d..88c3414 100644 --- a/frontend/src/components/RatingStars.tsx +++ b/frontend/src/components/RatingStars.tsx @@ -8,6 +8,21 @@ interface Props { onChange?: (value: number) => void } +function Star({ className }: { className?: string }) { + return ( + + + + ) +} + // 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 — return ( - + {stars.map((i) => ( - - {i <= value ? '★' : '☆'} - + ))} ) @@ -31,7 +44,7 @@ export function RatingStars({ value, max = 5, onChange }: Props) { const shown = hover || value return ( - + {stars.map((i) => ( ))} diff --git a/frontend/src/components/SaveBar.tsx b/frontend/src/components/SaveBar.tsx index 8db3ad6..50ed99a 100644 --- a/frontend/src/components/SaveBar.tsx +++ b/frontend/src/components/SaveBar.tsx @@ -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 ( -
-
- Read-only +
+
+ Read-only
{readOnly}
{trailing} @@ -50,27 +51,26 @@ export function SaveBar({ onError, trailing }: Props) { } return ( -
+
{dirty && warning && ( -
- ⚠ {warning} +
+ + {warning}
)}
{open && (
diff --git a/frontend/src/components/ShortcutsDialog.tsx b/frontend/src/components/ShortcutsDialog.tsx index 199816b..b6cd15a 100644 --- a/frontend/src/components/ShortcutsDialog.tsx +++ b/frontend/src/components/ShortcutsDialog.tsx @@ -97,11 +97,11 @@ export function ShortcutsDialog({ onClose }: Props) { return (
e.stopPropagation()} >
diff --git a/frontend/src/components/Sidebar.tsx b/frontend/src/components/Sidebar.tsx index 21039b4..a343845 100644 --- a/frontend/src/components/Sidebar.tsx +++ b/frontend/src/components/Sidebar.tsx @@ -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 = { - folder: '▸', - playlist: '♫', - smart: '✦', +const icons: Record = { + 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` }} > - {icons[draft.kind]} + 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" />
) @@ -184,8 +185,8 @@ function NodeRow({
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' }`} > {adding && ( -
+
{exportSets.map((set) => ( ))} @@ -266,23 +276,23 @@ function NodeRow({ )} {!renaming && node.can_delete && ( )} {!renaming && !isFolder && ( @@ -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: , onClick: () => startDraft('playlist', parentId) }, ...(foldersSupported - ? [{ label: 'New Folder', icon: '▸', onClick: () => startDraft('folder', parentId) }] + ? [{ label: 'New Folder', icon: , onClick: () => startDraft('folder', parentId) }] : []), ] : [] @@ -439,7 +449,7 @@ export function Sidebar({ label: 'Add to export', submenu: exportSets.map((set) => ({ label: set.name, - icon: '◈', + icon: , onClick: () => addToExport.mutate({ node, setId: set.id }), })), }, @@ -484,7 +494,7 @@ export function Sidebar({ } return ( -