Skip to content

armgit / nota

Public Imported from GitHub
0

Nota — a free DAW for macOS, Windows and Linux. No subscription, no account — just open it and make music.

(feat) Track header buttons stay right-aligned at every height (#387) (#390)

Chris Laupamac92bed1e829e
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ebe97fc5..bc6c6677 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -32,6 +32,10 @@ Entry categories: `Added`, `Changed`, `Fixed`, `Removed`.
it on the next launch.
### Changed
+- **Track header buttons stay in one place at every track height** (#387): M / S / arm — and,
+ on audio tracks, the headphone monitor button — now sit on the right of the header in
+ compact, standard and large rows alike. The input selector moves to their left on a
+ standard row, and a compact audio track keeps its monitor button.
- **Mixer strips fit the height they get**, docked or in the window: as it shrinks, the I/O
rows hide first, then the sends, then the fader gets shorter; name, meter, fader, pan and
M / S / Arm always stay. A hidden section's **Sends** / **I/O** footer toggle shows an
diff --git a/specs/015-track-list-sizing/spec.md b/specs/015-track-list-sizing/spec.md
index 042c93de..e30ac4a2 100644
--- a/specs/015-track-list-sizing/spec.md
+++ b/specs/015-track-list-sizing/spec.md
@@ -119,10 +119,11 @@ control ever cut off or overlapping.
**Acceptance Scenarios**:
-1. **Given** a track resized below 56 px (compact tier), **Then** its header shows the colour spine, name, type tag (if it fits), mute, solo and (where applicable) record-arm, on one line; the volume/pan row and input selector are hidden; the level meter remains visible.
+1. **Given** a track resized below 56 px (compact tier), **Then** its header shows the colour spine, name, type tag (if it fits), mute, solo and (where applicable) record-arm and input monitor, on one line; the volume/pan row and input selector are hidden; the level meter remains visible.
2. **Given** a track in the standard tier (56–111 px, e.g. 64 px), **Then** its header shows exactly today's controls.
3. **Given** a track resized to 112 px or more (large tier), **Then** its header additionally shows controls that do not fit in the standard layout (see FR-011), and existing controls (fader, meter) may use the extra space.
4. **Given** a hidden control in the compact layout, **When** the user needs it, **Then** it is still reachable from the track's context menu or the mixer (nothing becomes unreachable).
+5. **Given** a track resized across tiers, **Then** its mute / solo / record-arm / monitor buttons stay right-aligned against the meter in every tier, with the input selector to their left (standard) or on its own row (large) (#387).
---
@@ -154,8 +155,8 @@ control ever cut off or overlapping.
- **FR-007**: Clips, waveforms, MIDI note previews and automation drawn in a track's lane MUST scale to the row's height.
- **FR-008**: Users MUST be able to change the track-list width by dragging the vertical seam between headers and lanes, with a horizontal-resize cursor; the width applies to every header column (tracks, groups, returns, master, and the toolbar strip above the headers).
- **FR-009**: Track-list width MUST be limited to a minimum (enough for the compact header: spine, a short name, M/S/arm and the meter, ~160 px) and a maximum (~480 px); the default stays 228 px; double-clicking the seam resets it.
-- **FR-010**: Track headers MUST choose their layout by height: **compact** below 56 px (name + M/S/arm on one line, meter kept), **standard** from 56 px to below 112 px (today's layout), **large** from 112 px (standard plus more); no control may be clipped or overlap at any height or width within the limits. (Thresholds may be tuned in planning if a layout needs a few more pixels, keeping each preset height inside its own tier.)
-- **FR-011**: The large layout MUST add at least a labelled, taller volume fader and dB readout and a wider pan control, and for audio tracks keep the input selector and monitor on their own row rather than squeezed beside M/S/arm. Controls that need new engine capabilities are out of scope.
+- **FR-010**: Track headers MUST choose their layout by height: **compact** below 56 px (name + M/S/arm and, on audio tracks, monitor on one line, meter kept), **standard** from 56 px to below 112 px (today's layout), **large** from 112 px (standard plus more); no control may be clipped or overlap at any height or width within the limits. (Thresholds may be tuned in planning if a layout needs a few more pixels, keeping each preset height inside its own tier.)
+- **FR-011**: The large layout MUST add at least a labelled, taller volume fader and dB readout and a wider pan control, and for audio tracks keep the input selector on its own row rather than squeezed beside M/S/arm. In every tier the M/S/arm/monitor buttons sit right-aligned in the same order (#387). Controls that need new engine capabilities are out of scope.
- **FR-012**: Each track's height and the track-list width MUST be saved with the project and restored when it is opened; projects without this data MUST open at the defaults.
- **FR-013**: Resizing MUST NOT be recorded in undo history and MUST NOT mark audio/engine state as changed (it may mark the project as having unsaved changes).
- **FR-014**: Existing header and lane gestures (reorder drag, select, context menu, clip move/trim, automation editing, drag-and-drop of files/devices onto tracks) MUST keep working; the resize zone is limited to a thin band at the row seam.
diff --git a/src/managed/Nota.App/ArrangementView.cs b/src/managed/Nota.App/ArrangementView.cs
index 1660e5f3..bc3ba207 100644
--- a/src/managed/Nota.App/ArrangementView.cs
+++ b/src/managed/Nota.App/ArrangementView.cs
@@ -2202,8 +2202,13 @@ public sealed partial class ArrangementView : UserControl
nameRow.Children.Add(name);
nameRow.Children.Add(typeTag);
- // Row 2: M / S / ● (record-arm) — 18×16 chips.
- var btnRow = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 3, Margin = new Thickness(0, 5, 0, 0) };
+ // M / S / ● (record-arm) and, on audio tracks, the monitor chip — 18×16 chips held
+ // against the meter at every height, so they stay put as the row is resized (#387).
+ var btnRow = new StackPanel
+ {
+ Orientation = Orientation.Horizontal, Spacing = 3, Margin = new Thickness(0, 5, 0, 0),
+ HorizontalAlignment = HorizontalAlignment.Right,
+ };
// Each toggle also writes the TrackVM: resizing a row rebuilds its card from the VM
// without re-reading the engine, and a stale VM put the old state back (#255).
btnRow.Children.Add(ChipToggle("M", t.Muted, NotaPalette.Mute, v => { t.Muted = v; _engine?.SetTrackMute(t.Id, v); }));
@@ -2217,37 +2222,39 @@ public sealed partial class ArrangementView : UserControl
if (_engine is not null) TrackArming.Set(_engine, t.Id, v, additive);
}));
- // A compact routing selector sits with the arm button (the standard row leaves no
- // room for a 4th row): audio tracks get record-input, instrument tracks get "MIDI To".
- // A large row gives it a row of its own; a compact one leaves it to the context menu.
bool isAudioTrack = !t.IsInstrument && !t.IsReturn && !t.IsGroup;
+ // Audio tracks: the monitor chip hears the selected input live. A compact row has no
+ // input selector to tell it the source, so it reads it from the engine.
+ var monitor = isAudioTrack ? MonitorToggle(t.Id) : null;
+ if (monitor is not null)
+ {
+ btnRow.Children.Add(monitor.Chip);
+ if (tier == HeaderTier.Compact && _engine is not null) monitor.SetSource(RecordInputPick.Of(_engine, t.Id).Source);
+ }
+
+ // The routing selector — record-input on audio tracks, "MIDI In" on instrument tracks —
+ // sits left of the buttons (the standard row leaves no room for a 4th row). A large
+ // row gives it a row of its own; a compact one leaves it to the context menu.
Control row2 = btnRow;
Control? routingRow = null;
if (tier != HeaderTier.Compact && (isAudioTrack || t.IsInstrument))
{
- // Audio tracks: a monitor chip right of the input selector hears that input live.
- var monitor = isAudioTrack ? MonitorToggle(t.Id) : null;
var combo = isAudioTrack ? BuildInputCombo(t.Id, monitor) : BuildMidiSourceCombo(t.Id);
- bool ownRow = tier == HeaderTier.Large;
- var g = new Grid { ColumnDefinitions = new ColumnDefinitions(ownRow ? "*,Auto" : "Auto,*,Auto"), Margin = new Thickness(0, 5, 0, 0), ColumnSpacing = 3};
- int col = 0;
- if (!ownRow)
+ if (tier == HeaderTier.Large)
{
- btnRow.Margin = new Thickness(0);
- Grid.SetColumn(btnRow, col);
- g.Children.Add(btnRow);
- col++;
+ combo.Margin = new Thickness(0, 5, 0, 0);
+ routingRow = combo;
}
- Grid.SetColumn(combo, col);
- g.Children.Add(combo);
- if (monitor is not null)
+ else
{
- combo.Margin = new Thickness(0);
- monitor.Chip.Margin = new Thickness(0, 0, 12, 0); // the row's right inset moves to the chip
- Grid.SetColumn(monitor.Chip, col + 1);
- g.Children.Add(monitor.Chip);
+ var g = new Grid { ColumnDefinitions = new ColumnDefinitions("*,Auto"), Margin = new Thickness(0, 5, 0, 0), ColumnSpacing = 3 };
+ btnRow.Margin = new Thickness(0);
+ Grid.SetColumn(combo, 0);
+ Grid.SetColumn(btnRow, 1);
+ g.Children.Add(combo);
+ g.Children.Add(btnRow);
+ row2 = g;
}
- if (ownRow) routingRow = g; else row2 = g;
}
// Row 3: volume (mini fader + dB readout) and a bipolar pan bar in one row —
@@ -2302,7 +2309,7 @@ public sealed partial class ArrangementView : UserControl
switch (tier)
{
case HeaderTier.Compact:
- // One line: name · tag · M S ●. Volume, pan and routing stay in the mixer and
+ // One line: name · tag · M S ● (monitor). Volume, pan and routing stay in the mixer and
// the track's context menu. A narrow column drops the tag before the name.
nameRow.ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto,Auto");
if (HeaderW < 200) typeTag.IsVisible = false;
@@ -2521,7 +2528,8 @@ public sealed partial class ArrangementView : UserControl
{
bool on = pick.Matches(cur);
var mi = new MenuItem { Header = label, ToggleType = MenuItemToggleType.Radio, IsChecked = on };
- mi.Click += (_, _) => pick.ApplyTo(_engine, trackId);
+ // Rebuild so the header's input selector and monitor chip show the new source.
+ mi.Click += (_, _) => { pick.ApplyTo(_engine, trackId); RebuildHeaders(); };
choices.Add(mi);
if (on) curName = shortName;
}
@@ -2597,7 +2605,6 @@ public sealed partial class ArrangementView : UserControl
FontSize = 9, Height = 16, MinHeight = 0, Padding = new Thickness(6, 0),
HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Center,
HorizontalContentAlignment = HorizontalAlignment.Stretch, // let the item span the box (In left / name right)
- Margin = new Thickness(0, 0, 12, 0), // a touch shorter than the row
};
var sources = new List<RecordInputPick>();
// "In" pinned left (faded), the source name pinned right, so the name stands out.
@@ -2686,7 +2693,6 @@ public sealed partial class ArrangementView : UserControl
FontSize = 9, Height = 16, MinHeight = 0, Padding = new Thickness(6, 0),
HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Center,
HorizontalContentAlignment = HorizontalAlignment.Stretch,
- Margin = new Thickness(0, 0, 12, 0),
};
var sources = new List<int>();
// "In" pinned left (faded), the source name pinned right.