From 352aa3e9565540c897561e60614987e72c9466a7 Mon Sep 17 00:00:00 2001 From: Benjamin Hardy Date: Tue, 3 Nov 2026 09:43:18 +0100 Subject: [PATCH] Improve performance mode symmetry --- CLAUDE.md | 4 +++- frontend/src/App.tsx | 2 ++ frontend/src/components/PrepStrip.tsx | 24 +++++-------------- frontend/src/components/Toolbar.tsx | 13 +++++++--- .../src/components/deck/PerformanceButton.tsx | 20 ++++++++++++++++ frontend/src/lib/icons.tsx | 9 +++---- 6 files changed, 46 insertions(+), 26 deletions(-) create mode 100644 frontend/src/components/deck/PerformanceButton.tsx diff --git a/CLAUDE.md b/CLAUDE.md index f550bae..719d4fb 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1364,7 +1364,9 @@ Two independent apps that talk over HTTP: deck (Alt/Option = the other deck, in performance mode; a key-up goes to the deck its key-down went to). A deck's `persist` (loop size, cue bank) is deck A's; `leadsAmbient` (cover colours) the focused deck's. - **Performance mode** (P, or the decks button beside Auto hotcues; decided + **Performance mode** (P, or the Performance button at the RIGHT of the + track list's toolbar — `deck/PerformanceButton`, the toolbar's `trailing`; + decided 2026-11-02, [the discussion](.claude/discussions/discuss-performance-mode-2026-11-02.md)): deck B appears — the two headers side by side (`compact`, each led by its letter, lit when focused), the two main waveforms STACKED at the one zoom diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 93d62e2..6fdc9d0 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -33,6 +33,7 @@ import { PathMappingDialog } from './components/PathMappingDialog' import { RelocateDialog } from './components/RelocateDialog' import { HistoryPanel } from './components/HistoryPanel' import { EMPTY_SLOT, PrepStrip, type DeckDrop, type DeckId, type DeckSlot } from './components/PrepStrip' +import { PerformanceButton } from './components/deck/PerformanceButton' import { ImportDialog } from './components/ImportDialog' import { AddFilesDialog, type AddTarget, type ForeignOrigin } from './components/AddFilesDialog' import { ConvertStemsDialog } from './components/ConvertStemsDialog' @@ -1787,6 +1788,7 @@ export default function App() { } /> {(!isAll || viewForeign) && (
diff --git a/frontend/src/components/PrepStrip.tsx b/frontend/src/components/PrepStrip.tsx index 19288fe..96f95dc 100644 --- a/frontend/src/components/PrepStrip.tsx +++ b/frontend/src/components/PrepStrip.tsx @@ -3,7 +3,6 @@ import { useQuery } from '@tanstack/react-query' import { api, type Capabilities, type Track, type TrackOrigin } from '../api' import { useDeckKeys, type DeckKeyTargets } from '../lib/deckKeys' import { useDropTarget, type DragPayload } from '../lib/drag' -import { Icon } from '../lib/icons' import { usePrefsWriter } from '../lib/prefs' import { mixer } from '../lib/audio/mixer' import { setMixer } from '../lib/audio/mixerState' @@ -48,6 +47,7 @@ interface Props { caps: Record /** Performance mode: deck B, stacked waveforms (decided 2026-11-02). */ performance: boolean + /** P (the button is the track list toolbar's). */ onTogglePerformance: () => void /** The deck keys and loads go to (in performance mode). */ focused: DeckId @@ -97,7 +97,8 @@ function useDeckView(): DeckView { * state, audio, every action — are `useDeck` (components/deck/); this lays * them out and routes the keyboard to them. * - * One deck normally. PERFORMANCE MODE (P, or the button beside Auto hotcues) + * One deck normally. PERFORMANCE MODE (P, or the Performance button at the + * right of the track list's toolbar) * adds deck B: the two headers side by side, the two main waveforms stacked at * one zoom past one playhead line, the overviews side by side, then each * deck's controls with the mixer between them. Keys go to the FOCUSED deck @@ -281,24 +282,10 @@ export function PrepStrip({ } useDeckKeys(keys) - const toggle = ( - - ) - if (!performance) { return (
- + @@ -328,7 +315,8 @@ export function PrepStrip({
{pane('A', )} - {toggle} + {/* Where deck A's header ends and B's begins: a wider gap and a rule. */} + {pane('B', )}
{DECK_IDS.map((id) => ( diff --git a/frontend/src/components/Toolbar.tsx b/frontend/src/components/Toolbar.tsx index abc1c8c..f47de4f 100644 --- a/frontend/src/components/Toolbar.tsx +++ b/frontend/src/components/Toolbar.tsx @@ -1,4 +1,4 @@ -import { useRef } from 'react' +import { useRef, type ReactNode } from 'react' import { useQuery } from '@tanstack/react-query' import { api } from '../api' import { useCaps } from '../lib/capabilities' @@ -27,6 +27,8 @@ export const emptyFilters: Filters = { interface Props { filters: Filters onChange: (f: Filters) => void + /** At the far right, after Clear filters (the Performance button). */ + trailing?: ReactNode } const selectCls = @@ -35,6 +37,7 @@ const selectCls = export function Toolbar({ filters, onChange, + trailing, }: Props) { const caps = useCaps() const { data: facets } = useQuery({ queryKey: ['facets'], queryFn: api.facets }) @@ -60,7 +63,7 @@ export function Toolbar({ onChange={(e) => set({ search: e.target.value })} ref={searchRef} placeholder="Artist, title, album, comment…" - className="well w-72 rounded-full py-1.5 pl-9 pr-8 text-sm text-text outline-none placeholder:text-faint focus:ring-1 focus:ring-accent" + className="well w-64 rounded-full py-1.5 pl-9 pr-8 text-sm text-text outline-none placeholder:text-faint focus:ring-1 focus:ring-accent" /> {filters.search && ( )} + {trailing}
) diff --git a/frontend/src/components/deck/PerformanceButton.tsx b/frontend/src/components/deck/PerformanceButton.tsx new file mode 100644 index 0000000..91b39de --- /dev/null +++ b/frontend/src/components/deck/PerformanceButton.tsx @@ -0,0 +1,20 @@ +import { Icon } from '../../lib/icons' + +/** Performance mode on / off — at the right of the track list's toolbar + * (decided 2026-11-03), lit while on. P does the same. */ +export function PerformanceButton({ on, onToggle }: { on: boolean; onToggle: () => void }) { + return ( + + ) +} diff --git a/frontend/src/lib/icons.tsx b/frontend/src/lib/icons.tsx index 3f12d52..d37a97c 100644 --- a/frontend/src/lib/icons.tsx +++ b/frontend/src/lib/icons.tsx @@ -99,12 +99,13 @@ const PATHS = { fadeOut: , eject: , grid: , - // Two platters and a crossfader: performance mode. + // Two decks side by side, each with its platter: performance mode. decks: ( <> - - - + + + + ), mouse: (