mirror of
https://github.com/MrPatben8/konduktor.git
synced 2026-11-27 10:22:51 +01:00
Improve performance mode symmetry
This commit is contained in:
1 parent
1b1ed7e2b3
commit
352aa3e956
6 files changed
+46
-26
No files matched your search
@@ -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
|
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)
|
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.
|
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)):
|
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
|
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
|
letter, lit when focused), the two main waveforms STACKED at the one zoom
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import { PathMappingDialog } from './components/PathMappingDialog'
|
|||||||
import { RelocateDialog } from './components/RelocateDialog'
|
import { RelocateDialog } from './components/RelocateDialog'
|
||||||
import { HistoryPanel } from './components/HistoryPanel'
|
import { HistoryPanel } from './components/HistoryPanel'
|
||||||
import { EMPTY_SLOT, PrepStrip, type DeckDrop, type DeckId, type DeckSlot } from './components/PrepStrip'
|
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 { ImportDialog } from './components/ImportDialog'
|
||||||
import { AddFilesDialog, type AddTarget, type ForeignOrigin } from './components/AddFilesDialog'
|
import { AddFilesDialog, type AddTarget, type ForeignOrigin } from './components/AddFilesDialog'
|
||||||
import { ConvertStemsDialog } from './components/ConvertStemsDialog'
|
import { ConvertStemsDialog } from './components/ConvertStemsDialog'
|
||||||
@@ -1787,6 +1788,7 @@ export default function App() {
|
|||||||
<Toolbar
|
<Toolbar
|
||||||
filters={filters}
|
filters={filters}
|
||||||
onChange={setFilters}
|
onChange={setFilters}
|
||||||
|
trailing={<PerformanceButton on={performance} onToggle={togglePerformance} />}
|
||||||
/>
|
/>
|
||||||
{(!isAll || viewForeign) && (
|
{(!isAll || viewForeign) && (
|
||||||
<div className="flex items-center gap-3 border-b border-line px-4 py-2">
|
<div className="flex items-center gap-3 border-b border-line px-4 py-2">
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { useQuery } from '@tanstack/react-query'
|
|||||||
import { api, type Capabilities, type Track, type TrackOrigin } from '../api'
|
import { api, type Capabilities, type Track, type TrackOrigin } from '../api'
|
||||||
import { useDeckKeys, type DeckKeyTargets } from '../lib/deckKeys'
|
import { useDeckKeys, type DeckKeyTargets } from '../lib/deckKeys'
|
||||||
import { useDropTarget, type DragPayload } from '../lib/drag'
|
import { useDropTarget, type DragPayload } from '../lib/drag'
|
||||||
import { Icon } from '../lib/icons'
|
|
||||||
import { usePrefsWriter } from '../lib/prefs'
|
import { usePrefsWriter } from '../lib/prefs'
|
||||||
import { mixer } from '../lib/audio/mixer'
|
import { mixer } from '../lib/audio/mixer'
|
||||||
import { setMixer } from '../lib/audio/mixerState'
|
import { setMixer } from '../lib/audio/mixerState'
|
||||||
@@ -48,6 +47,7 @@ interface Props {
|
|||||||
caps: Record<DeckId, Capabilities>
|
caps: Record<DeckId, Capabilities>
|
||||||
/** Performance mode: deck B, stacked waveforms (decided 2026-11-02). */
|
/** Performance mode: deck B, stacked waveforms (decided 2026-11-02). */
|
||||||
performance: boolean
|
performance: boolean
|
||||||
|
/** P (the button is the track list toolbar's). */
|
||||||
onTogglePerformance: () => void
|
onTogglePerformance: () => void
|
||||||
/** The deck keys and loads go to (in performance mode). */
|
/** The deck keys and loads go to (in performance mode). */
|
||||||
focused: DeckId
|
focused: DeckId
|
||||||
@@ -97,7 +97,8 @@ function useDeckView(): DeckView {
|
|||||||
* state, audio, every action — are `useDeck` (components/deck/); this lays
|
* state, audio, every action — are `useDeck` (components/deck/); this lays
|
||||||
* them out and routes the keyboard to them.
|
* 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
|
* 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
|
* 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
|
* deck's controls with the mixer between them. Keys go to the FOCUSED deck
|
||||||
@@ -281,24 +282,10 @@ export function PrepStrip({
|
|||||||
}
|
}
|
||||||
useDeckKeys(keys)
|
useDeckKeys(keys)
|
||||||
|
|
||||||
const toggle = (
|
|
||||||
<button
|
|
||||||
onClick={onTogglePerformance}
|
|
||||||
aria-pressed={performance}
|
|
||||||
aria-label="Performance mode"
|
|
||||||
title={performance ? 'Leave performance mode (P)' : 'Performance mode — a second deck to try transitions (P)'}
|
|
||||||
className={`flex h-9 w-9 shrink-0 items-center justify-center rounded-full ${
|
|
||||||
performance ? 'is-selected text-text' : 'btn-glass text-muted'
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
<Icon name="decks" size={18} />
|
|
||||||
</button>
|
|
||||||
)
|
|
||||||
|
|
||||||
if (!performance) {
|
if (!performance) {
|
||||||
return (
|
return (
|
||||||
<div className="glass flex h-[19.75rem] shrink-0 flex-col gap-2 p-4">
|
<div className="glass flex h-[19.75rem] shrink-0 flex-col gap-2 p-4">
|
||||||
<DeckHeader deck={a} actions={toggle} />
|
<DeckHeader deck={a} />
|
||||||
<DeckMainWave deck={a} view={view} />
|
<DeckMainWave deck={a} view={view} />
|
||||||
<DeckOverview deck={a} view={view} />
|
<DeckOverview deck={a} view={view} />
|
||||||
<DeckControls deck={a} />
|
<DeckControls deck={a} />
|
||||||
@@ -328,7 +315,8 @@ export function PrepStrip({
|
|||||||
<div className="glass flex h-[32rem] shrink-0 flex-col gap-2 p-4">
|
<div className="glass flex h-[32rem] shrink-0 flex-col gap-2 p-4">
|
||||||
<div className="flex shrink-0 items-center gap-3">
|
<div className="flex shrink-0 items-center gap-3">
|
||||||
{pane('A', <DeckHeader deck={a} compact badge={badge('A')} />)}
|
{pane('A', <DeckHeader deck={a} compact badge={badge('A')} />)}
|
||||||
{toggle}
|
{/* Where deck A's header ends and B's begins: a wider gap and a rule. */}
|
||||||
|
<span aria-hidden className="mx-3 h-9 w-px shrink-0 bg-line" />
|
||||||
{pane('B', <DeckHeader deck={b} compact badge={badge('B')} />)}
|
{pane('B', <DeckHeader deck={b} compact badge={badge('B')} />)}
|
||||||
</div>
|
</div>
|
||||||
{DECK_IDS.map((id) => (
|
{DECK_IDS.map((id) => (
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useRef } from 'react'
|
import { useRef, type ReactNode } from 'react'
|
||||||
import { useQuery } from '@tanstack/react-query'
|
import { useQuery } from '@tanstack/react-query'
|
||||||
import { api } from '../api'
|
import { api } from '../api'
|
||||||
import { useCaps } from '../lib/capabilities'
|
import { useCaps } from '../lib/capabilities'
|
||||||
@@ -27,6 +27,8 @@ export const emptyFilters: Filters = {
|
|||||||
interface Props {
|
interface Props {
|
||||||
filters: Filters
|
filters: Filters
|
||||||
onChange: (f: Filters) => void
|
onChange: (f: Filters) => void
|
||||||
|
/** At the far right, after Clear filters (the Performance button). */
|
||||||
|
trailing?: ReactNode
|
||||||
}
|
}
|
||||||
|
|
||||||
const selectCls =
|
const selectCls =
|
||||||
@@ -35,6 +37,7 @@ const selectCls =
|
|||||||
export function Toolbar({
|
export function Toolbar({
|
||||||
filters,
|
filters,
|
||||||
onChange,
|
onChange,
|
||||||
|
trailing,
|
||||||
}: Props) {
|
}: Props) {
|
||||||
const caps = useCaps()
|
const caps = useCaps()
|
||||||
const { data: facets } = useQuery({ queryKey: ['facets'], queryFn: api.facets })
|
const { data: facets } = useQuery({ queryKey: ['facets'], queryFn: api.facets })
|
||||||
@@ -60,7 +63,7 @@ export function Toolbar({
|
|||||||
onChange={(e) => set({ search: e.target.value })}
|
onChange={(e) => set({ search: e.target.value })}
|
||||||
ref={searchRef}
|
ref={searchRef}
|
||||||
placeholder="Artist, title, album, comment…"
|
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 && (
|
{filters.search && (
|
||||||
<button
|
<button
|
||||||
@@ -81,7 +84,10 @@ export function Toolbar({
|
|||||||
<select
|
<select
|
||||||
value={filters.genre}
|
value={filters.genre}
|
||||||
onChange={(e) => set({ genre: e.target.value })}
|
onChange={(e) => set({ genre: e.target.value })}
|
||||||
className={selectCls}
|
// A select is as wide as its longest option — one long genre name
|
||||||
|
// made it ~300 px and wrapped the toolbar. The chosen one shows in full
|
||||||
|
// in the open list.
|
||||||
|
className={`${selectCls} max-w-44`}
|
||||||
>
|
>
|
||||||
<option value="">All genres</option>
|
<option value="">All genres</option>
|
||||||
{facets?.genres.map((g) => (
|
{facets?.genres.map((g) => (
|
||||||
@@ -152,6 +158,7 @@ export function Toolbar({
|
|||||||
Clear filters
|
Clear filters
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
|
{trailing}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -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 (
|
||||||
|
<button
|
||||||
|
onClick={onToggle}
|
||||||
|
aria-pressed={on}
|
||||||
|
aria-label="Performance mode"
|
||||||
|
title={on ? 'Leave performance mode (P)' : 'Performance mode — a second deck and a mixer, to try transitions (P)'}
|
||||||
|
className={`flex shrink-0 items-center gap-2 rounded-full px-3.5 py-1.5 text-sm font-medium ${
|
||||||
|
on ? 'is-selected text-text' : 'btn-glass text-text'
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
<Icon name="decks" size={16} />
|
||||||
|
Performance
|
||||||
|
</button>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -99,12 +99,13 @@ const PATHS = {
|
|||||||
fadeOut: <path d="M3 5l18 14H3z" strokeLinejoin="round" />,
|
fadeOut: <path d="M3 5l18 14H3z" strokeLinejoin="round" />,
|
||||||
eject: <path d="M12 4l8 9H4zM4 18h16" strokeLinejoin="round" />,
|
eject: <path d="M12 4l8 9H4zM4 18h16" strokeLinejoin="round" />,
|
||||||
grid: <path d="M5 3v18M10 3v18M15 3v18M20 3v18" />,
|
grid: <path d="M5 3v18M10 3v18M15 3v18M20 3v18" />,
|
||||||
// Two platters and a crossfader: performance mode.
|
// Two decks side by side, each with its platter: performance mode.
|
||||||
decks: (
|
decks: (
|
||||||
<>
|
<>
|
||||||
<circle cx="6.5" cy="10" r="4" />
|
<rect x="2" y="5" width="9" height="14" rx="2" />
|
||||||
<circle cx="17.5" cy="10" r="4" />
|
<rect x="13" y="5" width="9" height="14" rx="2" />
|
||||||
<path d="M9 19h6M12 17.5v3" />
|
<circle cx="6.5" cy="12" r="2.5" />
|
||||||
|
<circle cx="17.5" cy="12" r="2.5" />
|
||||||
</>
|
</>
|
||||||
),
|
),
|
||||||
mouse: (
|
mouse: (
|
||||||
|
|||||||
Reference in new issue
Block a user