diff --git a/CLAUDE.md b/CLAUDE.md index a5f5b55..7772e3c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1333,13 +1333,14 @@ Two independent apps that talk over HTTP: `OverviewWaveform`, which frames the main view's visible range around the playhead (it takes `secPerView` for exactly that). **Controls**: play, CUE, `LoopControls`, then (where `cues.memory_cues`) the **Hot / Mem** switch (`ModeSwitch`, the same component as BEAT / MAN), then - `HotcueBar`, `MemoryCueStrip` (Mem) OR — in **Grid mode** — `GridEditStrip`, then `TempoControls` - (±0.01 / ±0.25, ÷2 ×2, tap, lock) and the Grid toggle. The row is a + `HotcueBar`, `MemoryCueStrip` (Mem) OR — in **Grid mode** — `GridEditStrip`, then the + **CUES / GRID** switch (also a `ModeSwitch`) and `TempoControls` + (±0.01 / ±0.25, ÷2 ×2, tap, lock). A two-option `ModeSwitch` flips on a + click anywhere on it. The row is a **container** and gives way in stages instead of overlapping: each pad queries its own width and drops its name below 4rem (the bank never goes below `PAD_MIN` per pad), then the tempo group folds into `TempoFold`'s - portalled popover, then Grid keeps only its icon. The two row breakpoints - are measured widths — move them if controls are added to the row. Every grid control acts + portalled popover. That breakpoint is a measured width — move them if controls are added to the row. Every grid control acts on the marker **governing the playhead**, since a beatgrid is a marker list and there is no separate marker selection; see "Beatgrid" below. - **One size for loops AND beat jump** (`beatSize`, 1/32–32, persisted as diff --git a/frontend/src/components/ModeSwitch.tsx b/frontend/src/components/ModeSwitch.tsx index de1601d..5ad4b9b 100644 --- a/frontend/src/components/ModeSwitch.tsx +++ b/frontend/src/components/ModeSwitch.tsx @@ -8,27 +8,31 @@ export function ModeSwitch({ label, value, options, + disabled = false, onChange, }: { /** Names the group for assistive tech ("Loop mode", "Cue bank"). */ label: string value: T options: { value: T; text: string; title: string }[] + disabled?: boolean onChange: (value: T) => void }) { - const other = options.length === 2 ? options.find((o) => o.value !== value) : undefined + const other = + options.length === 2 && !disabled ? options.find((o) => o.value !== value) : undefined return (
onChange(other.value) : undefined} - className={`well ${other ? 'cursor-pointer ' : ''}flex h-10 shrink-0 flex-col justify-center gap-0.5 rounded-[10px] p-0.5`} + className={`well ${other ? 'cursor-pointer ' : ''}${disabled ? 'opacity-40 ' : ''}flex h-10 shrink-0 flex-col justify-center gap-0.5 rounded-[10px] p-0.5`} > {options.map((o) => ( + /> + + + +
{memoryMenu && (