Nota — a free DAW for macOS, Windows and Linux. No subscription, no account — just open it and make music.
C# audioaudio-unitavaloniacpp20cross-platformdawdigital-audio-workstationdspjucelinux-audiomcp-servermidimusicmusic-productionpiano-rollplugin-hostsequencersynthesizervstvst3
(feat) Arrangement: resizable track heights and track-list width (#52) (#81)
Egor Khindikaynen91c062e63994
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 481b0558..97560c3b 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -23,6 +23,19 @@ Entry categories: `Added`, `Changed`, `Fixed`, `Removed`.## [Unreleased]### Added+- **Resizable tracks in the arrangement** (nota-daw/nota#52): drag the bottom edge of a+ track — in its header or its lane — to make it taller or shorter (30 to 256 px; it+ snaps lightly to the Compact, Standard and Large sizes). Drag with several tracks+ selected to resize them all together, hold **Alt** (**Option** on macOS) to resize every+ track at once, and double-click the edge to go back to the standard height. The track's+ context menu has **Track height** with the three sizes for the selection or for all+ tracks. Clips, waveforms and automation grow with the row.+- **Track headers that fit their height:** a short track shows its name and mute, solo+ and record-arm on one line; a standard one looks as before; a tall one gives the input+ or MIDI source, the volume fader and the pan a row each.+- **Resizable track list:** drag the seam between the track headers and the lanes to+ widen or narrow the header column (160 to 480 px); double-click it to reset. Track+ heights and the column width are saved with the project.- **Colour themes:** Preferences → Appearance now offers colour themes — Studio Dark,Studio Light, and **Ember Graphite** / **Ember Paper**, the warm browns and brass ofNota's earlier look, on the new layout. Choose **Dark**, **Light** or **Follow system**,diff --git a/FEATURES.md b/FEATURES.mdindex b9ddc170..05a2c87b 100644--- a/FEATURES.md+++ b/FEATURES.md@@ -102,6 +102,13 @@ floating window (**View → Mixer**, ⌘M).there, double-click to rename, drag its body or edges to move and resize it (always onwhole bars). Its menu loops the section, selects it as a time range across every track,duplicates it or deletes it. Saved with the project; View ▸ Toggle sections hides it.+ - **Resizable tracks and track list** — drag a track's bottom edge (header or lane) to+ set its height, 30–256 px, with a light snap to Compact / Standard / Large; a+ multi-selection resizes together, ⌥-drag resizes every track, double-click resets.+ The track menu's **Track height** sets a size for the selection or all tracks. Headers+ fit their height: one line (name, M / S / arm) when short, input, fader and pan on rows+ of their own when tall. Drag the seam between headers and lanes to set the header+ width (160–480 px). Both are saved with the project.- **Group rows are slim** — a group collapses to a titled bar with its disclosure,mute/solo and level, and opens to the full control set when selected, so groups read asfamilies rather than as more tracks. A track without a colour of its own takes itsdiff --git a/specs/015-track-list-sizing/checklists/requirements.md b/specs/015-track-list-sizing/checklists/requirements.mdnew file mode 100644index 00000000..b7364810--- /dev/null+++ b/specs/015-track-list-sizing/checklists/requirements.md@@ -0,0 +1,36 @@+# Specification Quality Checklist: Resizable track height and track-list width++**Purpose**: Validate specification completeness and quality before proceeding to planning+**Created**: 2026-10-15+**Feature**: [spec.md](../spec.md)++## Content Quality++- [x] No implementation details (languages, frameworks, APIs)+- [x] Focused on user value and business needs+- [x] Written for non-technical stakeholders+- [x] All mandatory sections completed++## Requirement Completeness++- [x] No [NEEDS CLARIFICATION] markers remain+- [x] Requirements are testable and unambiguous+- [x] Success criteria are measurable+- [x] Success criteria are technology-agnostic (no implementation details)+- [x] All acceptance scenarios are defined+- [x] Edge cases are identified+- [x] Scope is clearly bounded+- [x] Dependencies and assumptions identified++## Feature Readiness++- [x] All functional requirements have clear acceptance criteria+- [x] User scenarios cover primary flows+- [x] Feature meets measurable outcomes defined in Success Criteria+- [x] No implementation details leak into specification++## Notes++- The Nota Context section names the arrangement view source file, as the project's spec template requires; the requirements themselves stay implementation-free.+- Height presets and limits pinned in Clarifications (30 / 64 / 128 px, range 30–256 px); track-list width limits (~160–480 px) remain approximate for the plan to pin.+- Per-control visibility toggles confirmed out of scope (Clarifications 2026-10-15).diff --git a/specs/015-track-list-sizing/contracts/track-view-sidecar.md b/specs/015-track-list-sizing/contracts/track-view-sidecar.mdnew file mode 100644index 00000000..7ef39715--- /dev/null+++ b/specs/015-track-list-sizing/contracts/track-view-sidecar.md@@ -0,0 +1,32 @@+# Contract: `track-view.json` bundle sidecar++Lives in the `.nota` bundle root next to `sections.json`. It is written on every save+and read on open. It is cosmetic: a write failure never fails the save, and a missing or+corrupt file means defaults.++```json+{+ "version": 1,+ "headerWidth": 260,+ "trackHeights": [+ { "index": 0, "height": 128 },+ { "index": 5, "height": 30 }+ ]+}+```++| Key | Type | Meaning |+|-----|------|---------|+| `version` | int | format version; readers ignore files with a higher major version |+| `headerWidth` | number | track-list width in px; omitted → 228 |+| `trackHeights[].index` | int | track index in engine order (`Engine.TryGetTrackInfo(i)`), as `freeze-links.json` uses |+| `trackHeights[].height` | number | row height in px, clamped to [30, 256] on read |++Rules:++- Only tracks that are not at the default height are listed; if every value is at its+ default, the file is deleted (as `sections.json` is when empty).+- Unknown keys are ignored (forward compatibility); out-of-range indices are skipped.+- Older Nota builds don't know the file and ignore it, so the project still opens.+- `ProjectHistory` snapshots it with the other `*.json` sidecars, so restoring a version+ restores the layout.diff --git a/specs/015-track-list-sizing/contracts/ui-gestures.md b/specs/015-track-list-sizing/contracts/ui-gestures.mdnew file mode 100644index 00000000..c7540f0f--- /dev/null+++ b/specs/015-track-list-sizing/contracts/ui-gestures.md@@ -0,0 +1,21 @@+# Contract: arrangement sizing gestures and menu++The user-facing interface for this feature. The Preferences → Shortcuts list+(`nota-shortcuts`) must show every row below.++| Where | Gesture | Result |+|-------|---------|--------|+| Bottom edge of a track row (header or lane, ±3 px band) | hover | vertical-resize cursor |+| same | drag | that track's height follows; snaps to 30 / 64 / 128 within 4 px; clamped 30–256 |+| same, the track is in a multi-selection | drag | every selected track takes the height |+| same | Alt/Option + drag | every track row takes the height |+| same | double-click | reset to 64 (the track, or the selection it is in) |+| Seam between headers and lanes (±3 px) | hover | horizontal-resize cursor |+| same | drag | header column width follows; clamped 160–480 (and lanes ≥ 240 px) |+| same | double-click | reset to 228 |+| Track context menu | Track height ▸ Compact / Standard / Large | applies to the clicked track or the selection |+| same | Track height ▸ All tracks: Compact / Standard / Large | applies to every track row |++Not resizable: slim group bars (26 px), return and master rows (40 px). A selected group+opens to its stored height (default 64). Resizing is not undoable and is saved with the+project.diff --git a/specs/015-track-list-sizing/data-model.md b/specs/015-track-list-sizing/data-model.mdnew file mode 100644index 00000000..af1fa2c0--- /dev/null+++ b/specs/015-track-list-sizing/data-model.md@@ -0,0 +1,49 @@+# Data Model: Resizable track height and track-list width++All state is view-side (in `ArrangementView`), and none of it reaches the engine.++## TrackRowHeight (per track)++| Field | Type | Rules |+|-------|------|-------|+| trackId | int | session id of a track row (not a return, not master) |+| height | double (px) | clamp to [30, 256]; absent means the default 64 |++- Held in `_trackHeights: Dictionary<int, double>`; it survives `Refresh`. Entries for+ deleted tracks are pruned on `Refresh`.+- **Effective row height** = `GroupRowHeight` (26) for a slim group bar (group not+ selected); otherwise the stored height, or 64.+- **Lifecycle**: created by a resize/preset; copied by duplicate/paste; the+ default-height entry is dropped (absent = 64); the whole map is reset on New/Open+ before the sidecar loads.++## HeaderWidth (per project)++| Field | Type | Rules |+|-------|------|-------|+| headerWidth | double (px) | clamp to [160, 480] and to `viewWidth − 240`; default 228 |++## HeaderTier (derived, never stored)++| Tier | Height range | Content |+|------|--------------|---------|+| Compact | < 62 px | one line: name, (type tag), M, S, ●, meter |+| Standard | 62–111 px | today's header |+| Large | ≥ 112 px | name/tag · M/S/● · input or MIDI-from (and monitor) · fader + dB · pan · tall meter |++## Presets++| Preset | Height |+|--------|--------|+| Compact | 30 px |+| Standard | 64 px (default) |+| Large | 128 px |++Snap: while dragging, a height within 4 px of a preset becomes that preset.++## Persistence mapping++The sidecar format (keyed by track index in engine order) is in+[contracts/track-view-sidecar.md](contracts/track-view-sidecar.md). The index ↔ id+mapping uses the same engine track enumeration as `freeze-links.json`+(`Engine.TryGetTrackInfo(i, …)`).diff --git a/specs/015-track-list-sizing/plan.md b/specs/015-track-list-sizing/plan.mdnew file mode 100644index 00000000..60ca5015--- /dev/null+++ b/specs/015-track-list-sizing/plan.md@@ -0,0 +1,128 @@+# Implementation Plan: Resizable track height and track-list width++**Branch**: `015-track-list-sizing` | **Date**: 2026-10-15 | **Spec**: [spec.md](spec.md)++**Input**: Feature specification from `specs/015-track-list-sizing/spec.md`++## Summary++Make the arrangement's track rows resizable per track (edge drag with a light snap to+30 / 64 / 128 px, range 30–256; Alt-drag or a context-menu preset for all tracks;+multi-selection resizes together) and the header column resizable (seam drag,+160–480 px). Headers pick a compact / standard / large layout from their height. All+of this is view-only: per-track heights replace the `RowHeight` constant in the+existing row-geometry table that the lanes already use, the `HeaderW` constant becomes a+property pushed to the header-column parts, and both values persist in a new bundle+sidecar, `track-view.json`, keyed by track index. No engine or C ABI changes.+Details and alternatives: [research.md](research.md).++## Nota: Read Before Planning++- **UI work** → [`DESIGN.md`](../../DESIGN.md) (Studio design language) and the `nota-design` skill — seams stay neutral, no new accent use.+- **Anything** → [`CONTRIBUTING.md`](../../CONTRIBUTING.md): licensing, dependency policy, PR expectations.+- Engine rules ([`ARCHITECTURE.md`](../../ARCHITECTURE.md)) are untouched: no engine work.++## Technical Context++**Language/Version**: C# / .NET 10 (managed app only)++**Primary Dependencies**: Avalonia (existing); `System.Text.Json` (existing, as other sidecars use). No new dependency.++**Storage**: `.nota` bundle sidecar `track-view.json` (see [contracts/track-view-sidecar.md](contracts/track-view-sidecar.md)); versioned automatically by `ProjectHistory` (all `*.json`).++**Audio-Thread Impact**: None — UI-only change; no engine calls are added.++**Testing**: `scripts/build.sh` (smoke test unchanged and must pass); UI verification by headless Avalonia / in-app screenshot recipe ([quickstart.md](quickstart.md)); manual gesture checks.++**Target Platform**: macOS, Linux, Windows (desktop app).++**Project Type**: desktop app (Avalonia).++**Performance Goals**: a resize drag follows the pointer at frame rate on a 40-track project (no full header rebuild per pointer move — research R4).++**Constraints**: existing arrangement gestures keep working (FR-014); no clipped/overlapping header controls at any size within limits (SC-003).++**Scale/Scope**: ~5 files in `src/managed/Nota.App` (`ArrangementView.cs`, `ArrangementView.Tracks.cs`, `ArrangementView.LaneControl.cs`, `MainWindow.Files.cs`, one new `ArrangementView.Sizing.cs`).++## Constitution Check++*GATE: Must pass before Phase 0 research. Re-check after Phase 1 design.*++| Principle | Status | Notes |+|-----------|--------|-------|+| I. Real-time audio safety | ✅ Pass | No engine/audio code touched. |+| II. Boundary discipline | ✅ Pass | No C ABI change; no JUCE. |+| III. Licensing hygiene | ✅ Pass | New `ArrangementView.Sizing.cs` gets the two-line SPDX header; no new dependency. |+| IV. Verification gate | ✅ Pass | No engine behaviour change → smoke test unchanged, still run via `scripts/build.sh`. |+| V. One logical change per PR | ✅ Pass | One feature: arrangement sizing. Visibility toggles deferred (Clarifications). |+| VI. Docs in sync | ✅ Planned | `CHANGELOG.md` [Unreleased] entry; `nota-features`, `nota-docs` (arrangement page EN+RU, screenshots), `nota-shortcuts` (new mouse gestures: edge drag, Alt-drag, double-click reset, seam drag). |+| VII. Spec-first | ✅ Pass | spec → clarify → this plan. |+| VIII. Rules not weakened | ✅ Pass | — |++**Post-design re-check (after Phase 1)**: still all pass — the design adds a sidecar and+view code only.++## Project Structure++### Documentation (this feature)++```text+specs/015-track-list-sizing/+├── plan.md # this file+├── research.md # Phase 0+├── data-model.md # Phase 1+├── quickstart.md # Phase 1+├── contracts/+│ ├── track-view-sidecar.md # persisted JSON format+│ └── ui-gestures.md # user-facing gesture/menu contract+└── tasks.md # Phase 2 (/speckit-tasks)+```++### Source Code (repository root)++```text+src/managed/Nota.App/+├── ArrangementView.cs # RowHeight const → per-track lookup; HeaderW const → property;+│ # BuildTrackCard split by tier (compact / standard / large);+│ # header-column parts registered for width updates; seam grips+├── ArrangementView.Sizing.cs # NEW: sizes state, snap/clamp, drag controllers (row + column),+│ # live relayout, presets, sidecar Save/LoadTrackView+├── ArrangementView.Tracks.cs # duplicate/copy/paste carry heights; "Track height" submenu+├── ArrangementView.LaneControl.cs# seam band hit-test + cursor + start of a row resize in lanes+└── MainWindow.Files.cs # call Save/LoadTrackView beside Save/LoadSections; reset on New++CHANGELOG.md, FEATURES.md # docs (via skills)+../nota-docs # user manual EN + RU (via nota-docs)+Preferences → Shortcuts list # via nota-shortcuts+```++**Structure Decision**: all code in `Nota.App` beside the existing `ArrangementView`+partials; the new `ArrangementView.Sizing.cs` partial keeps the sizing logic in one+place, in the same way `ArrangementView.Sections.cs` and `ArrangementView.Groups.cs` do.++## Implementation Outline (for /speckit-tasks)++1. **Geometry**: `DefaultRowHeight = 64`, `MinRowHeight = 30`, `MaxRowHeight = 256`,+ presets; `_trackHeights` dictionary; `TrackRowHeight(TrackVM)`; `RebuildRowGeometry`,+ `RowHeightAt` and every `RowHeight` use (`_lanes.Height`, `_headers.Height`, card+ `Height`) read it.+2. **Width**: `HeaderW` property backed by `_headerW`; register parts; `SetHeaderWidth`.+3. **Header tiers**: `HeaderTier` enum plus `Tier(h)`; `BuildTrackCard` dispatches to+ compact / standard (today's) / large builders that share the control factories+ (chips, fader, pan, meter, combos) so the wiring (undo gestures, automation write,+ `_volFaders`/`_meters` registries) is written once.+4. **Row drag**: header seam grips plus the lane seam band → `BeginRowResize(trackId, mods)`,+ `UpdateRowResize(y)` (snap, clamp, target set: Alt → all, in multi-selection →+ selection, else the one track), `EndRowResize()`; double-click → reset; live relayout+ per R4.+5. **Column drag**: a seam grip on the outer grid; live `SetHeaderWidth`; double-click resets.+6. **Menu**: "Track height" submenu (selection plus all tracks).+7. **Carry-over**: duplicate/paste heights (R9); new tracks use the default.+8. **Persistence**: `SaveTrackView(dir)` / `LoadTrackView(dir)` sidecar; call sites in+ `MainWindow.Files.cs` (open, save); reset on New (beside `ClearSections`).+9. **Verify and docs**: quickstart scenarios; CHANGELOG; nota-features / nota-docs /+ nota-shortcuts.++## Complexity Tracking++No constitution violations — nothing to justify.diff --git a/specs/015-track-list-sizing/quickstart.md b/specs/015-track-list-sizing/quickstart.mdnew file mode 100644index 00000000..a9970f05--- /dev/null+++ b/specs/015-track-list-sizing/quickstart.md@@ -0,0 +1,36 @@+# Quickstart: validating track-list sizing++## Prerequisites++- `scripts/build.sh` passes (it builds the app and runs the smoke test, which is+ unchanged by this feature).+- Isolate app data with `NOTA_DATA_DIR=<tmp dir>` when running UI checks. `HOME` does+ not isolate JUCE.+- A test project with at least 40 tracks (instrument + audio), one group with children,+ and two returns.++## Scenarios++| # | Steps | Expected |+|---|-------|----------|+| 1 | Drag a track's bottom edge (in the header) down by about 60 px | Only that row grows; clips/waveform/automation scale; rows below move ([ui-gestures](contracts/ui-gestures.md)) |+| 2 | Same from the lane edge | Same result; a clip touching the edge is not moved or trimmed |+| 3 | Drag past 256 and below 30 | Stops at the limits; passes 64/128 with a felt snap |+| 4 | Multi-select 3 tracks, drag one edge | All three take the height |+| 5 | Alt-drag any edge | Every track row takes the height; group bars, returns and master unchanged |+| 6 | Context menu ▸ Track height ▸ All tracks: Compact | ≥ 2× tracks visible vs. default (SC-001) |+| 7 | Double-click an edge / the column seam | Reset to 64 / 228 |+| 8 | Drag the header/lane seam to 160 and 480 | All header parts (zoom bar, overview, sections, tracks, footer) follow; no overlapping controls |+| 9 | Screenshot headers at 30 / 61 / 62 / 64 / 111 / 112 / 256 px × widths 160 / 228 / 480 | Compact, standard and large layouts; nothing clipped (SC-003) |+| 10 | Reorder a track by its title strip; trim and move clips; draw automation; drop a sample on a track | All work as before (SC-006) |+| 11 | Duplicate a 128 px track; copy and paste a 30 px track | The new tracks carry the heights |+| 12 | Save, close, reopen | Heights and width restored; `track-view.json` in the bundle matches [the contract](contracts/track-view-sidecar.md) |+| 13 | Open a project saved before this feature | Default layout, no errors |+| 14 | Restore an older version from History | Layout of that version restored |+| 15 | Alt-drag on a 40-track project | Row follows the pointer without visible lag (SC-005) |++## Screenshot harness++Use the recipe in agent memory (`nota-ui-verify`): an env-guarded in-app hook that+sets sizes, then `screencapture`, or an Avalonia.Headless offscreen render of+`ArrangementView` with a seeded project.diff --git a/specs/015-track-list-sizing/research.md b/specs/015-track-list-sizing/research.mdnew file mode 100644index 00000000..68a79859--- /dev/null+++ b/specs/015-track-list-sizing/research.md@@ -0,0 +1,144 @@+# Research: Resizable track height and track-list width++Feature: [spec.md](spec.md) · Plan: [plan.md](plan.md)++## R1 — Where the sizes are stored++- **Decision**: a new bundle sidecar, `track-view.json`, written by `ArrangementView`+ next to `sections.json` and called from `MainWindow.Files.cs` beside+ `Timeline.SaveSections` / `LoadSections`. Tracks are keyed by **track index** in engine+ order, as `freeze-links.json` does.+- **Rationale**: the project already keeps view-only state in sidecars (sections,+ modular layout, MIDI-learn, freeze links). The history in+ `Nota.Infrastructure/Persistence/ProjectHistory.cs` versions every `*.json` in the+ bundle, so restoring a version restores the sizes too. Old builds ignore the unknown+ file, which meets the backward-compatibility edge case. Track ids are only stable+ within a session (see the comment in `MainWindow.LiveFreeze.cs`), so the index is the+ persistent key.+- **Alternatives considered**: (a) a field in the engine's project manifest — needs a C+ ABI change for pure UI state, which is against AR-7 minimalism, so rejected;+ (b) app settings (`SettingsService`) — rejected in Clarifications (sizes belong to+ the project).++## R2 — Dirty state++- **Decision**: resizing does not mark the project as having unsaved changes; the sizes+ are written on the next save. This matches the sections and collapse state today.+- **Rationale**: "unsaved changes" is a fingerprint of the engine project+ (`MainWindow.Files.cs` → `_projects.Fingerprint`), and view sidecars are not part of+ it. Adding sidecars to the fingerprint would be a separate change. FR-013 allows+ either behaviour ("may mark").+- **Alternatives considered**: hashing `track-view.json` into the fingerprint — rejected+ because it would make the sections and modular layout inconsistent unless they were+ changed too; it is better as a follow-up that covers every sidecar.++## R3 — Row geometry with per-track heights++- **Decision**: replace the `RowHeight` constant with a per-track lookup+ `_trackHeights: Dictionary<int trackId, double>`, plus `DefaultRowHeight = 64`.+ `RebuildRowGeometry()` reads `TrackRowHeight(t)`; slim group rows keep+ `GroupRowHeight`. A selected group opens to its own stored height (default 64).+- **Rationale**: every y↔row conversion already goes through `_rowTops`,+ `RowHeightAt()` and `RowTop()`, and `LaneControl` reads `RowHeightAt` (`RowH(i)`), so+ clips, waveforms, notes and automation scale with no lane changes beyond the+ resize gesture itself. `RowTop()` extrapolation past the end keeps using the default.+- **Alternatives considered**: storing the height on `TrackVM` — rejected because+ `TrackVM`s are rebuilt on every `Refresh`; the dictionary survives, like+ `_autoTargets` does.++## R4 — Live resizing without lag (FR-015)++- **Decision**: while a drag runs, update the dictionary, call `RebuildRowGeometry()`,+ reposition the existing header cards (`Canvas.SetTop` plus `card.Height`), resize the+ `_headers` and `_lanes` heights, and invalidate the lanes and overlay. Rebuild a card+ (`BuildHeaderCard`) only when its **layout tier** changes. Do a full+ `RebuildHeaders()` once on release.+- **Rationale**: a full header rebuild creates dozens of controls per track (faders,+ combos); doing that per pointer move on 40 tracks would visibly stutter.+ `_headerCards` already gives the card per track id.+- **Alternatives considered**: rebuild on every move — simple but slow; scale transform+ — distorts text.++## R5 — Hit-testing the row seam vs. existing gestures (FR-014)++- **Decision**: a 6 px band centred on each track row's bottom edge (±3 px) is the+ resize zone. **Headers**: on `_headers` (a Canvas), add a transparent 6 px+ `Border` "seam grip" per track row at `RowTop(i+1) - 3`, above the cards, with+ `Cursor = SizeNorthSouth`. **Lanes**: `LaneControl` checks the zone first in+ `PointerMoved` (cursor) and `PointerPressed` (start a resize) before clip, trim or+ automation hit tests. Slim group bars and the gap past the last row get no seam.+ The reorder drag stays on the title strip (top 24 px), which never overlaps the+ bottom band at heights ≥ 30 px.+- **Rationale**: Avalonia's `GridSplitter` doesn't fit a canvas of variable rows, and+ separate grips keep the header code readable. Lanes are custom-drawn, so the check+ belongs in their pointer handlers.+- **Alternatives considered**: a resize zone only in headers — users expect the lane+ edge too (spec FR-001); overlay grips across the lanes — would block clip hit-testing+ along the whole edge.++## R6 — Snapping (FR-001a)++- **Decision**: during a drag, if `|h − preset| ≤ 4 px` for a preset in {30, 64, 128},+ use the preset. Clamp to [30, 256]. Alt/Option-drag applies the height to all track+ rows; a drag on a member of the multi-selection applies it to the selection.+- **Rationale**: 4 px is easy to hit but doesn't feel sticky; it matches the light snap+ agreed in Clarifications.++## R7 — Header layout tiers (FR-010, FR-011)++- **Decision**: `HeaderTier Tier(double h) => h < 62 ? Compact : h < 112 ? Standard : Large` (tuned from 56 after converge measured the standard layout at ~61 px of visible content).+ - **Compact**: one line — spine, name (ellipsised), type tag (dropped if the name+ would fall under ~40 px), M / S / ● chips, meter on the right; no input/MIDI combo,+ no fader/pan.+ - **Standard**: today's `BuildTrackCard`, unchanged.+ - **Large**: row 1 name + tag; row 2 M / S / ●; row 3 input / MIDI-from combo (and the+ monitor chip) full width; row 4 volume fader with a dB readout; row 5 a full-width pan+ bar; the meter takes the full height. Uses existing controls only (`MiniFader`,+ `PanBar`, `MeterBar`, combos) — no engine changes.+- **Rationale**: compact needs ≈ 22 px of content plus 4 px padding, so it fits in 30 px.+ Standard needs ~61 px of visible content, so it starts at 62 px. Large+ at 128 px fits five rows of about 18 px plus gaps.+- **Reachability** (FR-010 scenario 4): mute, solo and arm stay; volume, pan and+ input are in the mixer and the track context menu ("Record input", "MIDI from")+ already.++## R8 — Track-list width (FR-008, FR-009)++- **Decision**: replace `const HeaderW` with a property backed by `_headerW` (default+ 228, clamp [160, 480]; also clamp so the lanes keep ≥ 240 px). Every fixed-width+ header-column part registers in `_headerColumnParts` when it is built (`_headers`, the+ `zoomBar`, `leftBackdrop`, `_footerHeaders`, `footerHeaderPanel`, every+ `HeaderPanel(...)` used by the overview and sections rows, and both drop rings);+ `SetHeaderWidth(w)` sets their `Width` and each live card's `Width` (via+ `_headerCards`), and the footer row cards are rebuilt on release. The resize grip is+ a 6 px transparent `Border` with `Cursor = SizeWestEast`, laid over the whole view+ height at `x = HeaderW - 3` on the outer grid. Double-click resets to 228.+- **Rationale**: the column widths are already `Auto,*`, so the lanes take the rest by+ themselves; only explicit `Width = HeaderW` assignments need updating.+ `IsInTrackHeaders` reads the property, so it stays correct.++## R9 — Duplicate / paste carry the height++- **Decision**: `DuplicateTracks(ids)` maps `ids[i] → newIds[i]` and copies the+ heights. `CopyTracks` stores the selection's heights in a view-side list (in order),+ and `PasteTracksAfter` applies them to `newIds` in order. When the counts don't match+ (a group copy expands to its children), only tracks whose source is known get a+ height; the rest stay at the default.+- **Rationale**: the track clipboard lives in the engine and knows nothing about view+ sizes; a parallel list in the view is enough.++## R10 — Context-menu presets (FR-006)++- **Decision**: a "Track height" submenu in `ShowTrackMenu` and `ShowTracksMenu`+ (Compact / Standard / Large for the selected tracks, a separator, then+ "All tracks: Compact / Standard / Large"), with radio ticks on the current preset.+- **Rationale**: it sits beside "Color" in the existing menu style (`MenuKit`); no new+ shortcut needed.++## R11 — Verification approach++- **Decision**: no engine behaviour changes, so the smoke test is unchanged (it must+ still pass). UI verification uses the memory recipe (headless Avalonia render, or the+ env-guarded in-app hook plus a screenshot, with `NOTA_DATA_DIR` isolation): screenshots+ at heights 30 / 56 / 64 / 128 / 256 and widths 160 / 228 / 480; sidecar round-trip+ checked by save → reopen.diff --git a/specs/015-track-list-sizing/spec.md b/specs/015-track-list-sizing/spec.mdnew file mode 100644index 00000000..042c93de--- /dev/null+++ b/specs/015-track-list-sizing/spec.md@@ -0,0 +1,199 @@+# Feature Specification: Resizable track height and track-list width++**Feature Branch**: `015-track-list-sizing`++**Created**: 2026-10-15++**Status**: Draft++**Input**: User description: "Arrangement: resizable track height and track-list width (GitHub issue nota-daw/nota#52). Users want to fit the track list to the project: see many tracks at once on a big song, or more controls per track on a small one. Requested: (1) Track height — resize individual tracks by dragging the bottom edge of a track, and resize all tracks at once. (2) Track list width — drag the edge between the track headers and the lanes. (3) Track headers that show more or less depending on size: compact when small (name, mute, solo, arm), more controls when large; and/or toggles for which controls are visible. Today both are fixed: RowHeight = 64 and HeaderW = 228 in ArrangementView.cs. Reported by a user."++## Nota Context *(fill in — drives plan and tasks)*++**Feature area** *(pick the main one)*:++- [ ] Engine (C++, `src/native/nota.engine`) — real-time audio rules apply, see `ARCHITECTURE.md` AR table+- [ ] Managed app (C#, `src/managed/*`) — domain, application, infrastructure, presentation+- [x] UI (Avalonia, `src/managed/Nota.Presentation`) — follow `DESIGN.md` (Studio)+- [ ] Plugin hosting (`pluginhost/`) — the only place JUCE is allowed+- [ ] Build / packaging / CI (`scripts/`, `.github/`) — see `BUILD.md`+- [ ] Docs only++The arrangement view lives in `src/managed/Nota.App/ArrangementView.cs`. Saving the+sizes with the project may touch the project file (wherever per-track view state such+as colour or group collapse is stored today) — the plan decides where.++**Nota docs to keep in mind** *(links relative to `specs/<slug>/`, where this file lands)*:+[`ARCHITECTURE.md`](../../ARCHITECTURE.md) (AR rules),+[`CONTRIBUTING.md`](../../CONTRIBUTING.md) (licensing, dependency policy, PR+expectations), [`BUILD.md`](../../BUILD.md), [`DESIGN.md`](../../DESIGN.md),+[`FEATURES.md`](../../FEATURES.md).++## Clarifications++### Session 2026-10-15++- Q: Does this feature include toggles for which header controls are visible, or only headers that adapt to their height? → A: Only size-adaptive headers; visibility toggles are a separate, later issue.+- Q: Where are track heights and the track-list width stored — in the project file or in app preferences? → A: Both in the project file.+- Q: Does a dragged track height change continuously or jump between fixed sizes? → A: Continuously, with a light snap to the compact / standard / large preset heights.++## User Scenarios & Testing *(mandatory)*++### User Story 1 - Resize a track's height (Priority: P1)++A producer working on a dense song wants to see the vocal track's waveform big while+keeping the twenty drum and FX tracks short. They hover the bottom edge of the vocal+track's row (header or lane), the cursor changes to a vertical-resize cursor, and they+drag down; the row grows, its clips grow with it, and every row below moves down. They+then shrink the hi-hat track by dragging its bottom edge up.++**Why this priority**: This is the core of the request and delivers value alone — the+user can fit many tracks on screen or enlarge the one they are editing.++**Independent Test**: Open a project with several tracks, drag one track's bottom edge+up and down, and confirm only that row changes height, clips and automation in its lane+follow the new height, and rows below shift accordingly.++**Acceptance Scenarios**:++1. **Given** a project with tracks at the default height, **When** the user drags the bottom edge of one track's row down by 40 px, **Then** that row is 40 px taller, the rows below move down by 40 px, and no other row changes height.+2. **Given** a track row, **When** the user drags its bottom edge past the minimum or maximum height, **Then** the row stops at the limit and does not grow or shrink further.+3. **Given** a resized track, **When** the user double-clicks its bottom edge, **Then** the row returns to the default height.+4. **Given** several tracks are multi-selected, **When** the user drags the bottom edge of one of them, **Then** every selected track takes the same new height.+5. **Given** a resized track, **When** the user saves, closes and reopens the project, **Then** the track has the height it had when saved.++---++### User Story 2 - Resize all tracks at once (Priority: P1)++A user with a 40-track project wants an overview of the whole song. With one gesture they+make every track short; later they make them all tall again to mix.++**Why this priority**: The issue asks for it explicitly, and resizing forty tracks one by+one is not a viable alternative.++**Independent Test**: In a project with mixed track heights, apply the "all tracks"+resize and confirm every track row ends up at the same height.++**Acceptance Scenarios**:++1. **Given** tracks of various heights, **When** the user holds Alt (Option on macOS) while dragging any track's bottom edge, **Then** every track row takes the new height together, live during the drag.+2. **Given** any project, **When** the user picks a size preset (compact / standard / large) for all tracks from the arrangement's track context menu, **Then** every track row takes that preset's height.+3. **Given** the "all tracks" resize was applied, **When** it finishes, **Then** group rows keep their slim title-bar look and the return/master rows are unchanged.++---++### User Story 3 - Resize the track-list width (Priority: P2)++A user with long track names, or one who wants more room for the lanes on a small laptop+screen, drags the vertical seam between the track headers and the lanes left or right.++**Why this priority**: Requested in the issue and independent of height, but less+impactful than height: the default width already fits all current controls.++**Independent Test**: Drag the header/lane seam and confirm all headers (including group,+return and master rows) widen or narrow together, and the lane area takes the remaining space.++**Acceptance Scenarios**:++1. **Given** the default layout, **When** the user hovers the seam between the headers and the lanes, **Then** a horizontal-resize cursor appears; **When** they drag it, **Then** every header column (tracks, groups, returns, master, and the toolbar strip above them) takes the new width and the lanes area adjusts.+2. **Given** the seam is dragged past the minimum or maximum width, **Then** the width stops at the limit.+3. **Given** a narrowed track list, **When** a track name no longer fits, **Then** it is ellipsised as today, and controls that do not fit are dropped rather than overlapping.+4. **Given** the user double-clicks the seam, **Then** the width returns to the default.+5. **Given** a changed width, **When** the project is saved and reopened, **Then** the width is restored.++---++### User Story 4 - Headers that adapt to their size (Priority: P2)++When a track is short, its header shows only what fits on one line — the name and the+mute, solo and record-arm buttons. At the default height it looks as it does today. When+a track is tall, the header has room for more and uses it.++**Why this priority**: Without it, short rows would clip controls into an unusable state;+height resizing (US1/US2) depends on it to look right at small sizes.++**Independent Test**: Resize a track through the size range and confirm the header switches+between the compact, standard and large layouts at the documented thresholds, with no+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.+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).++---++### Edge Cases++- **Group rows** are slim title bars (and open to a full row only while selected). Their slim bar is not resizable; a selected group opens to the height the group would have as a track (default, or its own stored height).+- **Collapsed groups**: hidden child rows keep their stored heights and show them again on expand.+- **Return and master rows** (the footer) keep their fixed slim height; only the track-list width applies to them.+- **Drag targets overlap**: the bottom-edge resize zone (a few pixels around the row seam) must not steal the existing track reorder drag (title strip), clip moves, or clip edge trims in the lane; resize wins only in the thin seam band.+- **Scrolling during a resize**: growing a row near the bottom of the view keeps the dragged edge under the pointer (the view scrolls or the content extends), and shrinking never leaves blank space above the last row.+- **New tracks** are created at the default height (not the height of the selected track).+- **Duplicated / pasted tracks** carry the source track's height.+- **Undo**: resizing is a view change and is not part of the undo history (consistent with zoom and scroll).+- **Old projects** without stored sizes open at today's defaults; projects saved with sizes open in older Nota builds without error (the extra data is ignored).+- **Window too narrow**: the track-list width never leaves the lanes area narrower than a usable minimum; if the window shrinks, the lanes area shrinks first, then the headers clamp.+- **Nota Remote and other views** (session view, mixer) are not affected.++## Requirements *(mandatory)*++### Functional Requirements++- **FR-001**: Users MUST be able to change a single track's height by dragging the bottom edge of its row, from either the header or the lane, with a vertical-resize cursor shown over the edge.+- **FR-001a**: The dragged height MUST change continuously (any value within the limits) but snap to a preset height (compact / standard / large) when the pointer comes within a few pixels of it.+- **FR-002**: Track height MUST be limited to 30–256 px; the presets are compact 30 px, standard 64 px (the default, today's height) and large 128 px.+- **FR-003**: Double-clicking a track's bottom edge MUST reset that track (or the multi-selection it belongs to) to the default height.+- **FR-004**: Dragging the bottom edge of a track that is part of a multi-selection MUST resize every selected track to the same height.+- **FR-005**: Holding Alt/Option while dragging any track's bottom edge MUST resize all tracks together.+- **FR-006**: The arrangement's track context menu MUST offer a "Track height" choice with compact / standard / large presets, applying to the selected tracks, plus an "all tracks" variant.+- **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-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.+- **FR-015**: Resizing MUST stay smooth during the drag on a 40-track project (no full rebuild of every header per pointer move if that causes visible lag).+- **FR-016**: The resize handles and layouts MUST follow the Studio design language (`DESIGN.md`): neutral seams, no new accent use; the seam highlights subtly on hover.++### Key Entities++- **Track view size**: per track, its row height (default when absent). Belongs to the project, travels with duplicate/paste.+- **Track-list width**: one value per project for the header column width.+- **Header layout tier**: compact / standard / large, derived from the row height (not stored).++## Success Criteria *(mandatory)*++### Measurable Outcomes++- **SC-001**: With all tracks set to compact, at least twice as many tracks are visible at once as at the default height in the same window.+- **SC-002**: A user can resize all tracks of a 40-track project with a single gesture (one drag or one menu pick).+- **SC-003**: At every height and width within the limits, no header control is clipped or overlaps another (verified by screenshots at the minimum, default and maximum of each).+- **SC-004**: Sizes survive save/reopen in 100% of cases; projects from previous versions open with unchanged layout.+- **SC-005**: Resizing feels immediate — the row follows the pointer with no visible lag on a 40-track project.+- **SC-006**: All existing arrangement interactions (reorder, clip edit, automation, drag-and-drop) still pass their current manual / automated checks.++## Assumptions++- Per-control visibility toggles ("show/hide which controls") are **out of scope** for this feature (confirmed in Clarifications); the size-adaptive header covers the request. Toggles follow as a separate issue if users still ask for them.+- Sizes (per-track heights and the track-list width) are stored in the project file (confirmed in Clarifications), not as an app-wide preference; a new project starts at the defaults.+- Group slim bars, return and master rows keep their fixed heights; only track rows resize.+- No keyboard shortcuts are added; the new mouse gestures (edge drag, Alt-drag, double-click reset) are listed in Preferences → Shortcuts.+- The session view, mixer and Nota Remote are unchanged.+- The engine needs no change unless the project file is written by the engine, in which case the plan adds an opaque view-state field without touching the audio path.++## Nota Compliance Checklist *(review before implementation; re-check in tasks.md)*++- [ ] Every new source file will carry the AGPL-3.0-only SPDX header (two lines, see CONTRIBUTING.md)+- [x] No new dependency — or: license checked, AGPL-compatible, `LICENSES/third-party.md` row planned+- [x] Audio-thread impact considered: no alloc / lock / I/O on the audio thread (AR-6), command queue for data in (AR-4), immutable snapshots for structural edits (AR-5) — view-only change, no audio-thread impact+- [ ] Managed/native crossings go through the pure C ABI in `nota_engine.h` only (AR-7); no JUCE outside `pluginhost/` — only relevant if persistence goes through the engine+- [ ] Smoke-test impact assessed: engine behaviour change → extend `tests/Nota.SmokeTest`+- [ ] User-visible change → `CHANGELOG.md` `[Unreleased]` entry planned (and FEATURES.md / user docs via the nota-features / nota-docs skills when working with an agent that has them)+- [ ] UI change → follows `DESIGN.md` (Studio design language)diff --git a/specs/015-track-list-sizing/tasks.md b/specs/015-track-list-sizing/tasks.mdnew file mode 100644index 00000000..4482984f--- /dev/null+++ b/specs/015-track-list-sizing/tasks.md@@ -0,0 +1,169 @@+---++description: "Tasks for 015-track-list-sizing — resizable track height and track-list width"+---++# Tasks: Resizable track height and track-list width++**Input**: Design documents from `specs/015-track-list-sizing/`++**Prerequisites**: [plan.md](plan.md), [spec.md](spec.md), [research.md](research.md), [data-model.md](data-model.md), [contracts/](contracts/), [quickstart.md](quickstart.md)++**Tests**: The spec does not request automated tests. Verification is by the+[quickstart.md](quickstart.md) scenarios and screenshots. The smoke test is unchanged and+must stay green.++**Organization**: Tasks are grouped by user story. US4's compact layout moves forward+into Foundational, because US1 and US2 reach 30 px rows and would clip controls without it.++## Format: `[ID] [P?] [Story] Description`++- **[P]**: Can run in parallel (different files, no dependencies)+- **[Story]**: User story from spec.md (US1–US4)++All paths are relative to the repository root. `AV` = `src/managed/Nota.App/ArrangementView`.++---++## Phase 1: Setup++- [X] T001 Create the partial `src/managed/Nota.App/ArrangementView.Sizing.cs` with the two-line AGPL-3.0-only SPDX header plus a comment header explaining *why* it exists (arrangement row/column sizing: state, snap/clamp, drag controllers, sidecar), `namespace Nota.App; public sealed partial class ArrangementView { }`++---++## Phase 2: Foundational (blocks all stories)++**Purpose**: per-track row geometry, a variable header width, and header tiers, so every story can change sizes safely.++- [X] T002 In `src/managed/Nota.App/ArrangementView.Sizing.cs` add the constants `DefaultRowHeight = 64`, `MinRowHeight = 30`, `MaxRowHeight = 256`, presets `CompactRowHeight = 30`, `StandardRowHeight = 64`, `LargeRowHeight = 128`, `SnapPx = 4`; `DefaultHeaderW = 228`, `MinHeaderW = 160`, `MaxHeaderW = 480`, `MinLanesW = 240`; the state `private readonly Dictionary<int, double> _trackHeights` (trackId → px; an absent key means 64) and `private double _headerW = DefaultHeaderW`; the helpers `ClampRowHeight`, `SnapRowHeight(h)` (within 4 px of 30/64/128 → that preset, then clamp to [30, 256]) and `TrackRowHeight(TrackVM t)` (the stored height or 64)+- [X] T003 In `src/managed/Nota.App/ArrangementView.cs` remove `const double RowHeight = 64`: `RebuildRowGeometry()` and `RowHeightAt(i)` use `IsSlimRow(t) ? GroupRowHeight : TrackRowHeight(t)`; `RowTop(i)` extrapolates past the end with `DefaultRowHeight`; `_lanes.Height` / `_headers.Height` (`Math.Max(RowHeight, RowsHeight)` at the three sites) use `DefaultRowHeight`; `BuildTrackCard`'s `Height = RowHeight` becomes `Height = RowHeightAt(index)` (pass the effective height in)+- [X] T004 In `src/managed/Nota.App/ArrangementView.cs` turn `const double HeaderW = 228` into `private double HeaderW => _headerW;`. Keep every `Width = HeaderW` working, and register each fixed-width header-column part in a new `private readonly List<Control> _headerColumnParts` as it is built: `_headers`, `zoomBar`, `leftBackdrop`, `_footerHeaders`, `footerHeaderPanel`, `_trackDropLine`, `_headerDropRing`, and every `HeaderPanel(...)` result (overview and sections rows)+- [X] T005 In `src/managed/Nota.App/ArrangementView.Sizing.cs` add `PruneTrackHeights()` (drop ids no longer in `_tracks`, keep collapsed-group children: prune only against engine track ids) and call it from `Refresh` in `src/managed/Nota.App/ArrangementView.cs` before `RebuildRowGeometry()`+- [X] T006 In `src/managed/Nota.App/ArrangementView.Sizing.cs` add `enum HeaderTier { Compact, Standard, Large }` and `static HeaderTier TierFor(double h) => h < 56 ? Compact : h < 112 ? Standard : Large`+- [X] T007 In `src/managed/Nota.App/ArrangementView.cs` refactor `BuildTrackCard(TrackVM t)` so the control factories (name/type-tag row, M/S/● chips, input/MIDI combo + monitor, fader + dB with `MixGesture` undo and automation-write wiring, pan bar, meter, spine, card shell plus `AttachHeaderGestures`, `_headerCards` / `_volFaders` / `_volDb` / `_panBars` / `_meters` registration) are shared helpers. `BuildTrackCard` then dispatches on `TierFor(height)` to `BuildStandardCard` (today's layout, pixel-identical at 64 px) and the tier builders below+- [X] T008 In `src/managed/Nota.App/ArrangementView.cs` add `BuildCompactCard`: one line — spine, name (ellipsised), type tag (omitted when the card width leaves the name under ~40 px), M / S / ● chips (● only on instrument/audio tracks, as today), meter on the right; no combo, fader or pan; vertically centred; it must fit 30 px with no clipping. A group selected at compact height uses the same layout plus its disclosure triangle++**Checkpoint**: The app builds; at the default sizes the arrangement looks and behaves exactly as before (quickstart #10).++---++## Phase 3: User Story 1 — Resize a track's height (P1) 🎯 MVP++**Goal**: drag a track's bottom edge (header or lane) to resize it; snap, clamp, double-click reset, multi-selection, persistence.++**Independent Test**: quickstart #1–#4, #7 (row part), #11, #12 (heights), #13.++- [X] T009 [US1] In `src/managed/Nota.App/ArrangementView.Sizing.cs` add the row-resize controller: `BeginRowResize(int trackId, double pointerY, KeyModifiers mods)` (target set = all track rows when Alt/Option is held — wired in US2 — the multi-selection when `trackId` is in `SelectedTrackIds()` with Count > 1, otherwise `{trackId}`; remember the start height and pointer Y), `UpdateRowResize(double pointerY)` (h = `SnapRowHeight(start + dy)`, write to `_trackHeights` for the target set, store none at 64), and `EndRowResize()`; plus `ResetRowHeight(int trackId)` (the track or its multi-selection → 64)+- [X] T010 [US1] In `src/managed/Nota.App/ArrangementView.Sizing.cs` add `RelayoutRowsLive()` per research R4: `RebuildRowGeometry()`; for each card in `_headerCards` set `Canvas.SetTop` and `Height` from `RowTop`/`RowHeightAt`; rebuild only the cards whose `TierFor` changed (via `BuildHeaderCard`, replacing the child in `_headers`); update `_headers.Height` and `_lanes.Height`; move the seam grips; `InvalidateVisual` on `_lanes` and `_overlay`. `EndRowResize` calls the full `RebuildHeaders()` once+- [X] T011 [US1] In `src/managed/Nota.App/ArrangementView.cs` (inside `RebuildHeaders`) add one transparent 6 px seam grip `Border` per non-slim track row at `Canvas.Top = RowTop(i+1) - 3`, `Width = HeaderW`, `Cursor = SizeNorthSouth`, added after the cards (on top). PointerPressed with the left button → capture, `BeginRowResize` (double-click, `ClickCount == 2` → `ResetRowHeight`); PointerMoved → `UpdateRowResize(e.GetPosition(_headers).Y)`; PointerReleased / CaptureLost → `EndRowResize`. Mark the events Handled so `AttachHeaderGestures` (select/reorder) does not fire. Keep the grips in a list so `RelayoutRowsLive` can move them+- [X] T012 [US1] In `src/managed/Nota.App/ArrangementView.LaneControl.cs` add a seam-band hit test `int SeamRowAt(double y)` (row i whose `RowTop(i+1)` is within ±3 px of y, skipping slim group rows; −1 otherwise). In PointerMoved (no button) show `SizeNorthSouth` over the band. In PointerPressed check it **before** clip / trim / automation / selection hit tests and start `BeginRowResize` (double-click → reset); route move/release to `UpdateRowResize` / `EndRowResize` while a resize is active+- [X] T013 [US1] In `src/managed/Nota.App/ArrangementView.Sizing.cs` keep the dragged edge under the pointer near the bottom of the viewport: during `UpdateRowResize`, if the pointer is within 16 px of the scroller's bottom while growing, raise `_scroller.Offset.Y` by the delta; after shrinking, clamp the offset to the new extent+- [X] T014 [US1] In `src/managed/Nota.App/ArrangementView.Tracks.cs` carry heights over: in `DuplicateTracks`, after `newIds`, copy `_trackHeights[ids[i]]` → `newIds[i]` for `i < min(count)`; in `CopyTracks` (and cut) store the selection's heights in order in a new `private List<double?> _clipboardHeights`; in `PasteTracksAfter` apply them to `newIds` in order (counts may differ — apply only matching positions). New tracks get no entry (default 64)+- [X] T015 [US1] In `src/managed/Nota.App/ArrangementView.Sizing.cs` add the sidecar per [contracts/track-view-sidecar.md](contracts/track-view-sidecar.md): `public void SaveTrackView(string bundleDir)` writes `track-view.json` `{ "version": 1, "headerWidth": …, "trackHeights": [{ "index", "height" }] }` (track index in engine order via `_engine.TryGetTrackInfo(i, out ti)`; list only non-default heights; omit `headerWidth` when 228; delete the file when everything is at its default; never throw — wrap in try/catch like `SaveSections`). Add `public void LoadTrackView(string bundleDir)`: clear the state; when the file is absent or corrupt use defaults; clamp heights to [30, 256] and width to [160, 480]; skip out-of-range indices; ignore files with `version > 1` and unknown keys. Also add `public void ResetTrackView()`+- [X] T016 [US1] In `src/managed/Nota.App/MainWindow.Files.cs` call `Timeline.SaveTrackView(dir)` after `Timeline.SaveSections(dir)` in `DoSaveAsync` (before `RecordVersion`), `Timeline.LoadTrackView(dir)` after `Timeline.LoadSections(dir)` on open (before `RefreshAfterLoad()`), and `Timeline.ResetTrackView()` next to `Timeline.ClearSections()` on New. Check that the History restore path reopens through the same load (quickstart #14)++**Checkpoint**: US1 is fully usable — single and multi-track resizing, saved with the project.++---++## Phase 4: User Story 2 — Resize all tracks at once (P1)++**Goal**: Alt/Option-drag resizes every track; a "Track height" context submenu offers presets for the selection or all tracks.++**Independent Test**: quickstart #5, #6, #15.++- [X] T017 [US2] In `src/managed/Nota.App/ArrangementView.Sizing.cs` complete the Alt/Option branch of `BeginRowResize`: the target set = every non-return track id in the engine (including collapsed children, so they match on expand) while group slim bars stay 26 px. Add `SetTrackHeights(IEnumerable<int> ids, double h)` and `SetAllTrackHeights(double h)`, each followed by `Refresh`/`RebuildHeaders`+- [X] T018 [US2] In `src/managed/Nota.App/ArrangementView.cs` (`ShowTrackMenu`) and `src/managed/Nota.App/ArrangementView.Tracks.cs` (`ShowTracksMenu`) add a "Track height" `MenuItem` beside the colour submenu with radio items Compact / Standard / Large (ticked when every target is at that preset) for the clicked track or the selection, a `Separator`, then "All tracks: Compact" / "All tracks: Standard" / "All tracks: Large"; use `MenuKit` styling as the neighbouring items do+- [X] T019 [US2] Performance pass in `src/managed/Nota.App/ArrangementView.Sizing.cs`: Alt-drag on a 40-track project must follow the pointer with no visible lag. Make sure `RelayoutRowsLive` rebuilds only cards whose tier changed, and coalesce pointer moves to one relayout per frame (`Dispatcher.UIThread.Post(…, DispatcherPriority.Render)` with a pending flag) if needed++**Checkpoint**: US1 and US2 together cover the issue's height requests.++---++## Phase 5: User Story 3 — Resize the track-list width (P2)++**Goal**: drag the seam between headers and lanes; every header-column part follows; double-click resets; saved with the project.++**Independent Test**: quickstart #7 (seam), #8, #12 (width).++- [X] T020 [US3] In `src/managed/Nota.App/ArrangementView.Sizing.cs` add `SetHeaderWidth(double w, bool final)`: clamp to [160, 480] and to `Bounds.Width − 240`; set `_headerW`; set `Width` on every `_headerColumnParts` entry and every live card in `_headerCards` plus the seam grips; `InvalidateVisual` the lanes and overlay; when `final`, call `RebuildHeaders()` and rebuild the footer rows (return/master) so their inner layouts re-measure+- [X] T021 [US3] In `src/managed/Nota.App/ArrangementView.cs` add the column seam grip: a transparent 6 px `Border` with `Cursor = SizeWestEast`, `HorizontalAlignment = Left`, `Margin.Left = HeaderW − 3`, spanning the arrangement's full height (from the overview row through the footer) on the outer layout grid, on top. Drag → `SetHeaderWidth(startW + dx, final: false)`, release → `final: true`, double-click → `SetHeaderWidth(228, true)`. Update its margin inside `SetHeaderWidth`. It must not block the lanes' left-edge clip gestures beyond its 3 px overlap+- [X] T022 [US3] In `src/managed/Nota.App/ArrangementView.cs` handle the window shrinking: on the view's `SizeChanged`, re-clamp `_headerW` so the lanes keep ≥ 240 px (the lanes shrink first, then the headers clamp), without overwriting the user's stored width unless it no longer fits+- [X] T023 [US3] Check narrow widths in `src/managed/Nota.App/ArrangementView.cs`: at 160 px the standard and large cards must not overlap — the input/MIDI combo shrinks (star column), the dB readout and type tag hide below a width threshold, and the name ellipsises; the group bar and footer rows likewise++**Checkpoint**: The width works independently of height.++---++## Phase 6: User Story 4 — Headers that adapt to their size (P2)++**Goal**: the large layout above 112 px (compact and standard were delivered in Foundational).++**Independent Test**: quickstart #9 (all heights × widths), FR-010 scenario 4 reachability.++- [X] T024 [US4] In `src/managed/Nota.App/ArrangementView.cs` add `BuildLargeCard` using the shared factories from T007: row 1 name + type tag; row 2 M / S / ●; row 3 the input combo + monitor chip (audio) or the MIDI-from combo (instrument) at full width; row 4 the volume fader with a dB readout (taller hit area); row 5 a full-width pan bar; the meter at full card height on the right. Lay rows out top-aligned with the Studio spacing from `DESIGN.md`; there must be no clipping at 112 px and the layout must look intentional at 256 px (extra space below, nothing stretched oddly)+- [X] T025 [US4] In `src/managed/Nota.App/ArrangementView.cs` make sure a selected group (which opens from a slim bar) uses `TierFor(TrackRowHeight(group))` and its builder keeps the disclosure triangle and drops record-arm/input as `BuildTrackCard` does today+- [X] T026 [US4] Confirm reachability (FR-010 scenario 4) in `src/managed/Nota.App/ArrangementView.cs`: in compact, volume/pan stay reachable from the mixer, and record input / MIDI from from the track context menu (already present). Document anything missing in the PR; add no new controls++**Checkpoint**: All four stories are complete.++---++## Phase 7: Polish & Cross-Cutting++- [X] T027 [P] Studio design review per `DESIGN.md` / the `nota-design` skill: the seams highlight subtly on hover (neutral `Brush.BorderStrong` or similar token, no accent), cursors are right, and compact, standard and large look consistent in all four colour themes+- [X] T028 Run every scenario in [quickstart.md](quickstart.md), with screenshots at heights 30/56/64/128/256 × widths 160/228/480 (headless Avalonia or the in-app hook, `NOTA_DATA_DIR` isolated); confirm SC-001…SC-006+- [X] T029 Run the `nota-shortcuts` skill: add the gestures from [contracts/ui-gestures.md](contracts/ui-gestures.md) (edge drag, Alt/Option-drag for all, double-click reset, column seam drag and reset) to Preferences → Shortcuts++### Nota closing tasks *(PR gates)*++- [X] T030 Run `scripts/build.sh` (or `scripts/build-linux.sh` / `scripts/build-win.ps1`) until native + managed + smoke test are green+- [X] T031 AGPL-3.0-only SPDX two-line header on the new `src/managed/Nota.App/ArrangementView.Sizing.cs` (see CONTRIBUTING.md)+- [X] T032 New dependency: N/A (none added)+- [X] T033 `CHANGELOG.md` `[Unreleased]` → Added: resizable track heights (edge drag, Alt-drag for all, presets), resizable track-list width, size-adaptive track headers; reference nota-daw/nota#52+- [X] T034 Run `nota-features` (FEATURES.md) and `nota-docs` (arrangement page EN + RU in `../nota-docs`, with re-shot screenshots)+- [X] T035 Engine behaviour change → smoke test: N/A (UI-only; no engine change)++---++## Dependencies & Execution Order++- **Setup (T001)** → **Foundational (T002–T008)** → the user stories.+- **US1 (T009–T016)**: after Foundational. MVP.+- **US2 (T017–T019)**: after US1 (reuses its controller and relayout).+- **US3 (T020–T023)**: after Foundational only (T004); independent of US1/US2, but T015's sidecar already carries `headerWidth` — if US3 ships first, move the width parts of T015/T016 here.+- **US4 (T024–T026)**: after Foundational (T007). Testable through the US2 presets or by seeding `_trackHeights`.+- **Polish (T027–T035)**: after the desired stories.++Within a story the tasks are sequential: most edit `ArrangementView.cs` / `ArrangementView.Sizing.cs`.++## Parallel Opportunities++Most tasks touch the same two files, so true parallelism is limited:++- T012 (`ArrangementView.LaneControl.cs`) can run alongside T011 (`ArrangementView.cs`) once T009/T010 exist.+- T014 (`ArrangementView.Tracks.cs`) and T016 (`MainWindow.Files.cs`) can run in parallel with each other after T015's signatures exist.+- US3 (T020–T023) and US4 (T024–T026) can run in parallel after Foundational if one person owns `ArrangementView.cs` merges.+- T027 and the docs tasks T033/T034 can run in parallel at the end.++```text+After T010: T011 (ArrangementView.cs) ‖ T012 (ArrangementView.LaneControl.cs)+After T015: T014 (ArrangementView.Tracks.cs) ‖ T016 (MainWindow.Files.cs)+```++## Implementation Strategy++1. **MVP**: Setup + Foundational + US1 → per-track resizing, saved with the project. Validate quickstart #1–#4, #10–#13.+2. **+US2**: resize all/presets → the issue's height request is complete.+3. **+US3**: width seam.+4. **+US4**: the large layout.+5. Polish, docs, build gate, `/speckit-converge`.++## Notes++- Resizing is never put into undo, and it does not mark the project as having unsaved changes (research R2); the sizes save with the next save.+- Don't commit: the user reviews and commits.++## Phase 8: Convergence++- [X] T036 Stop the standard header layout clipping between 56 and ~61 px: its content needs ~61 px of visible height (measured: 67 px including the 6 px top/bottom margins), so at 56–60 px the volume/pan row is cut in half. In `src/managed/Nota.App/ArrangementView.Sizing.cs` raise the Compact→Standard boundary in `TierFor` from 56 to the measured fit (≈62 px, keeping 64 px standard and 30 px compact inside their tiers), or tighten the standard card's vertical margins at low heights in `src/managed/Nota.App/ArrangementView.cs`. Then update the 56 px figures in `specs/015-track-list-sizing/data-model.md` / `research.md` R7 only if the plan's tuning clause is used, and re-run the headless probe (every height 30–256 fits) per FR-010 / SC-003 (partial)diff --git a/src/managed/Nota.App/ArrangementView.LaneControl.cs b/src/managed/Nota.App/ArrangementView.LaneControl.csindex 1081052a..c4e40c50 100644--- a/src/managed/Nota.App/ArrangementView.LaneControl.cs+++ b/src/managed/Nota.App/ArrangementView.LaneControl.cs@@ -181,8 +181,39 @@ public sealed partial class ArrangementViewreturn null;}+ // Row seams (specs/015): the thin band on a track row's bottom edge resizes the row —+ // checked before clips, trims and automation so the band always means "resize".+ private static readonly Cursor RowResizeCursor = new(StandardCursorType.SizeNorthSouth);+ private bool _rowSeamCursorOn;++ private bool RowSeamPressed(PointerPressedEventArgs e)+ {+ var pt = e.GetCurrentPoint(this);+ if (!pt.Properties.IsLeftButtonPressed) return false;+ int row = _o.RowSeamAtY(pt.Position.Y);+ if (row < 0) return false;+ int trackId = _o._tracks[row].Id;+ e.Handled = true;+ if (e.ClickCount == 2) { _o.ResetRowHeight(trackId); return true; }+ _o.BeginRowResize(trackId, pt.Position.Y, e.KeyModifiers);+ e.Pointer.Capture(this);+ return true;+ }++ // Hover over a row seam owns the cursor; leaving it hands the cursor back.+ private bool RowSeamHover(Point pos)+ {+ bool on = _o.RowSeamAtY(pos.Y) >= 0;+ if (on == _rowSeamCursorOn) return on;+ _rowSeamCursorOn = on;+ _resizeCursorOn = false; // the clip-edge cursor state restarts from Arrow+ Cursor = on ? RowResizeCursor : ArrowCursor;+ return on;+ }+protected override void OnPointerPressed(PointerPressedEventArgs e){+ if (RowSeamPressed(e)) return;if (_o._automationMode) { AutoPointerPressed(e); return; }var pt = e.GetCurrentPoint(this);var hit = HitTest(pt.Position, out double beat);@@ -330,6 +361,9 @@ public sealed partial class ArrangementViewprotected override void OnPointerMoved(PointerEventArgs e){+ if (_o.IsRowResizing) { _o.UpdateRowResize(e.GetPosition(this).Y); return; }+ if (e.GetCurrentPoint(this).Properties is { IsLeftButtonPressed: false, IsRightButtonPressed: false }+ && RowSeamHover(e.GetPosition(this))) return;if (_o._automationMode) { AutoPointerMoved(e); return; }var pos = e.GetPosition(this);_lastPos = pos;@@ -495,6 +529,7 @@ public sealed partial class ArrangementViewprotected override void OnPointerReleased(PointerReleasedEventArgs e){+ if (_o.IsRowResizing) { e.Pointer.Capture(null); _o.EndRowResize(); return; }if (_o._automationMode) { AutoPointerReleased(e); return; }var eng = _o._engine;diff --git a/src/managed/Nota.App/ArrangementView.Sizing.cs b/src/managed/Nota.App/ArrangementView.Sizing.csnew file mode 100644index 00000000..20c6898c--- /dev/null+++ b/src/managed/Nota.App/ArrangementView.Sizing.cs@@ -0,0 +1,506 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.+//+// Arrangement · track-list sizing (specs/015-track-list-sizing). Track rows can be resized+// one by one, as a multi-selection or all at once, and the header column can be widened or+// narrowed. Both are view state: they never reach the engine or the undo history, and they+// ride in the bundle as a sidecar (track-view.json) so a project reopens as it was laid out.+// This file holds the size state, the snap/clamp rules, the two drag controllers (row seam,+// column seam), the live relayout that keeps a drag smooth, and the sidecar.++using System;+using System.Collections.Generic;+using System.Linq;+using System.Text.Json;+using System.Text.Json.Serialization;+using Avalonia;+using Avalonia.Controls;+using Avalonia.Input;+using Avalonia.Layout;+using Avalonia.Media;+using Avalonia.Threading;++namespace Nota.App;++public sealed partial class ArrangementView+{+ // Row heights: a track row is 30–256 px; drags snap lightly to the three presets.+ internal const double DefaultRowHeight = 64;+ internal const double MinRowHeight = 30;+ internal const double MaxRowHeight = 256;+ internal const double CompactRowHeight = 30;+ internal const double StandardRowHeight = 64;+ internal const double LargeRowHeight = 128;+ private const double SnapPx = 4;+ private static readonly double[] RowPresets = { CompactRowHeight, StandardRowHeight, LargeRowHeight };++ // Header column: 160–480 px, and never so wide that the lanes drop under 240 px.+ internal const double DefaultHeaderW = 228;+ internal const double MinHeaderW = 160;+ internal const double MaxHeaderW = 480;+ private const double MinLanesW = 240;++ private const double SeamGrabPx = 6; // the band around a seam that grabs a resize++ // Track id → row height; absent = the default. Survives Refresh (TrackVMs don't).+ private readonly Dictionary<int, double> _trackHeights = new();+ // The width the user chose; the effective one (_headerW) may be clamped by a narrow window.+ private double _userHeaderW = DefaultHeaderW;+ private double _headerW = DefaultHeaderW;+ // Every fixed-width part of the header column (canvas, chrome strips, footer, markers).+ private readonly List<Control> _headerColumnParts = new();+ // Header-side row seam grips, one per resizable row, kept so a live drag can move them.+ private readonly List<(Border grip, int trackId)> _rowSeamGrips = new();+ // Layout tier each live card was built at, so a drag rebuilds a card only when it crosses one.+ private readonly Dictionary<int, HeaderTier> _cardTiers = new();+ // Heights of the tracks last copied/cut, in order — the engine's track clipboard knows no view sizes.+ private List<double?>? _clipboardHeights;+ private Border _columnSeam = null!;++ internal enum HeaderTier { Compact, Standard, Large }++ // The standard header needs ~61 px of visible content (three rows), the large one ~106,+ // so each tier starts where its layout fits — below 62 a row is compact.+ internal static HeaderTier TierFor(double height)+ => height < 62 ? HeaderTier.Compact : height < 112 ? HeaderTier.Standard : HeaderTier.Large;++ internal static double ClampRowHeight(double h) => Math.Clamp(h, MinRowHeight, MaxRowHeight);++ internal static double SnapRowHeight(double h)+ {+ foreach (var p in RowPresets)+ if (Math.Abs(h - p) <= SnapPx) return p;+ return ClampRowHeight(Math.Round(h));+ }++ private double TrackRowHeight(TrackVM t) => StoredRowHeight(t.Id);++ private double StoredRowHeight(int trackId)+ => _trackHeights.TryGetValue(trackId, out var h) ? h : DefaultRowHeight;++ private void StoreRowHeight(int trackId, double h)+ {+ h = ClampRowHeight(h);+ if (Math.Abs(h - DefaultRowHeight) < 0.5) _trackHeights.Remove(trackId);+ else _trackHeights[trackId] = h;+ }++ /// <summary>Every non-return track id in the engine, hidden (collapsed) children too, so+ /// "all tracks" still holds when a group is expanded later.</summary>+ private List<int> AllTrackRowIds()+ {+ var ids = new List<int>();+ if (_engine is null) return ids;+ for (int i = 0; i < _engine.TrackCount; i++)+ if (_engine.TryGetTrackInfo(i, out var ti) && !ti.IsReturn) ids.Add(ti.Id);+ return ids;+ }++ /// <summary>Drop heights of tracks that no longer exist (deleted, or undone away).</summary>+ private void PruneTrackHeights()+ {+ if (_engine is null || _trackHeights.Count == 0) return;+ var alive = new HashSet<int>(AllTrackRowIds());+ foreach (var id in _trackHeights.Keys.Where(id => !alive.Contains(id)).ToList())+ _trackHeights.Remove(id);+ }++ // ---- row resize (drag a row's bottom edge) -------------------------------++ private bool _rowResizing, _rowResizeChanged;+ private int[] _rowResizeTargets = Array.Empty<int>();+ private double _rowResizeStartH, _rowResizeStartY;+ private int _rowResizeRowsAbove; // target rows above the dragged one (they grow too)+ private bool _relayoutPending;++ internal bool IsRowResizing => _rowResizing;++ /// <summary>Row <c>i</c> whose bottom edge is within the grab band of <paramref name="y"/>+ /// (slim group bars aren't resizable), or -1.</summary>+ internal int RowSeamAtY(double y)+ {+ for (int i = 0; i < _tracks.Count; i++)+ {+ double bottom = _rowTops[i + 1];+ if (Math.Abs(y - bottom) <= SeamGrabPx / 2) return IsSlimRow(_tracks[i]) ? -1 : i;+ if (bottom > y + SeamGrabPx) break;+ }+ return -1;+ }++ // Alt/Option → every track; a row inside a multi-selection → the selection; else the row.+ private int[] RowResizeTargets(int trackId, bool all)+ {+ if (all) return AllTrackRowIds().ToArray();+ var sel = SelectedTrackIds();+ return sel.Count > 1 && sel.Contains(trackId) ? sel.ToArray() : new[] { trackId };+ }++ internal void BeginRowResize(int trackId, double pointerY, KeyModifiers mods)+ {+ int row = _tracks.FindIndex(t => t.Id == trackId);+ if (row < 0) return;+ _rowResizing = true;+ _rowResizeChanged = false;+ _rowResizeTargets = RowResizeTargets(trackId, (mods & KeyModifiers.Alt) != 0);+ _rowResizeStartH = StoredRowHeight(trackId);+ _rowResizeStartY = pointerY;+ // Rows above the dragged one that resize with it push its edge down too; dividing the+ // pointer travel among them keeps the dragged edge under the pointer.+ var targets = new HashSet<int>(_rowResizeTargets);+ _rowResizeRowsAbove = 0;+ for (int i = 0; i < row; i++)+ if (targets.Contains(_tracks[i].Id) && !IsSlimRow(_tracks[i])) _rowResizeRowsAbove++;+ }++ internal void UpdateRowResize(double pointerY)+ {+ if (!_rowResizing) return;+ // Growing a row at the bottom of the view: scroll so the edge stays reachable.+ double inView = pointerY - _scroller.Offset.Y;+ if (pointerY > _rowResizeStartY && inView > _scroller.Viewport.Height - 16)+ _scroller.Offset = new Vector(_scroller.Offset.X, _scroller.Offset.Y + 6);+ double h = SnapRowHeight(_rowResizeStartH + (pointerY - _rowResizeStartY) / (_rowResizeRowsAbove + 1));+ bool changed = false;+ foreach (var id in _rowResizeTargets)+ {+ if (Math.Abs(StoredRowHeight(id) - h) < 0.5) continue;+ StoreRowHeight(id, h);+ changed = true;+ }+ if (changed) { _rowResizeChanged = true; ScheduleLiveRelayout(); }+ }++ internal void EndRowResize()+ {+ if (!_rowResizing) return;+ _rowResizing = false;+ _rowResizeTargets = Array.Empty<int>();+ // A plain click on the seam changed nothing; after a drag, one full rebuild settles the cards.+ if (_rowResizeChanged) Dispatcher.UIThread.Post(RelayoutRows, DispatcherPriority.Render);+ }++ /// <summary>Double-click on a row seam: the row (or the selection it is in) back to 64 px.</summary>+ internal void ResetRowHeight(int trackId)+ {+ _rowResizing = false;+ SetTrackHeights(RowResizeTargets(trackId, all: false), DefaultRowHeight);+ }++ internal void SetTrackHeights(IEnumerable<int> ids, double h)+ {+ foreach (var id in ids) StoreRowHeight(id, h);+ RelayoutRows();+ }++ internal void SetAllTrackHeights(double h) => SetTrackHeights(AllTrackRowIds(), h);++ // One relayout per frame however fast pointer moves arrive.+ private void ScheduleLiveRelayout()+ {+ if (_relayoutPending) return;+ _relayoutPending = true;+ Dispatcher.UIThread.Post(() => { _relayoutPending = false; RelayoutRowsLive(); }, DispatcherPriority.Render);+ }++ // Re-measure rows and move the existing header cards instead of rebuilding them all —+ // a full rebuild makes dozens of controls per track, too slow per pointer move on a big+ // song. A card is rebuilt only when its height crosses a layout tier, and only while few+ // cards cross at once: an Alt-drag over 40 tracks crossing together would stall a frame+ // (~7 ms a card), so those cards keep their old layout, clipped, until the release.+ private const int LiveTierRebuildLimit = 4;++ private void RelayoutRowsLive()+ {+ RebuildRowGeometry();+ var children = _headers.Children;+ int crossing = 0;+ for (int i = 0; i < _tracks.Count; i++)+ if (!IsSlimRow(_tracks[i]) && _cardTiers.TryGetValue(_tracks[i].Id, out var b) && b != TierFor(RowHeightAt(i))) crossing++;+ bool rebuildTiers = crossing <= LiveTierRebuildLimit;+ for (int i = 0; i < _tracks.Count; i++)+ {+ var t = _tracks[i];+ if (!_headerCards.TryGetValue(t.Id, out var hc)) continue;+ Control card = hc.card;+ double h = RowHeightAt(i);+ if (rebuildTiers && !IsSlimRow(t) && _cardTiers.TryGetValue(t.Id, out var built) && built != TierFor(h))+ {+ int at = children.IndexOf(card);+ var fresh = BuildHeaderCard(t);+ if (at >= 0) children[at] = fresh; else children.Insert(0, fresh);+ Canvas.SetLeft(fresh, 0);+ card = fresh;+ }+ Canvas.SetTop(card, RowTop(i));+ card.Height = h;+ }+ PlaceRowSeamGrips();+ _headers.Height = Math.Max(DefaultRowHeight, RowsHeight);+ _lanes.Height = _headers.Height;+ _overlay.Height = _lanes.Height;+ _lanes.InvalidateVisual();+ _overlay.InvalidateVisual();+ }++ // Header side of the row seams: a thin grip on each resizable row's bottom edge, above+ // the cards so it wins over the card's select/reorder gestures in that band only.+ private void AddRowSeamGrips()+ {+ _rowSeamGrips.Clear();+ for (int i = 0; i < _tracks.Count; i++)+ {+ var t = _tracks[i];+ if (IsSlimRow(t)) continue;+ var grip = RowSeamGrip(t.Id);+ _rowSeamGrips.Add((grip, t.Id));+ _headers.Children.Add(grip);+ }+ PlaceRowSeamGrips();+ }++ private void PlaceRowSeamGrips()+ {+ foreach (var (grip, id) in _rowSeamGrips)+ {+ int i = _tracks.FindIndex(t => t.Id == id);+ grip.IsVisible = i >= 0;+ if (i < 0) continue;+ grip.Width = _headerW;+ Canvas.SetLeft(grip, 0);+ Canvas.SetTop(grip, RowTop(i + 1) - SeamGrabPx / 2);+ }+ }++ private Border RowSeamGrip(int trackId)+ {+ var line = new Border { Height = 1, VerticalAlignment = VerticalAlignment.Center, Background = Brushes.Transparent };+ var grip = new Border+ {+ Height = SeamGrabPx, Background = Brushes.Transparent, Child = line,+ Cursor = new Cursor(StandardCursorType.SizeNorthSouth),+ };+ grip.PointerEntered += (_, _) => line.Background = Brush("Brush.BorderStrong");+ grip.PointerExited += (_, _) => { if (!_rowResizing) line.Background = Brushes.Transparent; };+ grip.PointerPressed += (_, e) =>+ {+ if (!e.GetCurrentPoint(grip).Properties.IsLeftButtonPressed) return;+ e.Handled = true;+ if (e.ClickCount == 2) { ResetRowHeight(trackId); return; }+ BeginRowResize(trackId, e.GetPosition(_headers).Y, e.KeyModifiers);+ e.Pointer.Capture(grip);+ };+ grip.PointerMoved += (_, e) => { if (_rowResizing) { UpdateRowResize(e.GetPosition(_headers).Y); e.Handled = true; } };+ grip.PointerReleased += (_, e) =>+ {+ if (!_rowResizing) return;+ e.Handled = true;+ e.Pointer.Capture(null);+ line.Background = Brushes.Transparent;+ EndRowResize();+ };+ grip.PointerCaptureLost += (_, _) => { line.Background = Brushes.Transparent; EndRowResize(); };+ return grip;+ }++ // ---- column resize (drag the seam between headers and lanes) -------------++ private bool _colResizing;+ private double _colResizeStartW, _colResizeStartX;++ private double EffectiveHeaderW(double wanted)+ {+ double w = Math.Clamp(wanted, MinHeaderW, MaxHeaderW);+ double room = Bounds.Width - MinLanesW; // a narrow window squeezes the lanes first, then the headers+ if (Bounds.Width > 0 && w > room) w = Math.Max(MinHeaderW, room);+ return Math.Round(w);+ }++ /// <summary>Apply a header width the user chose. <paramref name="final"/> rebuilds the+ /// cards so their inner layouts settle; during a drag only widths move.</summary>+ internal void SetHeaderWidth(double wanted, bool final)+ {+ _userHeaderW = Math.Round(Math.Clamp(wanted, MinHeaderW, MaxHeaderW));+ ApplyHeaderWidth(final);+ }++ private void ApplyHeaderWidth(bool final)+ {+ double w = EffectiveHeaderW(_userHeaderW);+ bool moved = Math.Abs(w - _headerW) >= 0.5;+ _headerW = w;+ foreach (var part in _headerColumnParts) part.Width = w;+ foreach (var hc in _headerCards.Values) hc.card.Width = w;+ foreach (var c in _footerHeaders.Children) c.Width = w;+ PlaceRowSeamGrips();+ if (_columnSeam is not null) _columnSeam.Margin = new Thickness(w - SeamGrabPx / 2, 0, 0, 0);+ if (final)+ {+ RebuildHeaders();+ RebuildFooterHeaders();+ }+ if (moved) { _lanes.InvalidateVisual(); _overlay.InvalidateVisual(); }+ }++ // The window resized: re-clamp the effective width (the user's choice is kept).+ private void OnViewSizeChanged()+ {+ if (Math.Abs(EffectiveHeaderW(_userHeaderW) - _headerW) >= 0.5) ApplyHeaderWidth(final: true);+ }++ private Border BuildColumnSeam()+ {+ var line = new Border { Width = 1, HorizontalAlignment = HorizontalAlignment.Center, Background = Brushes.Transparent };+ var seam = new Border+ {+ Width = SeamGrabPx, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Stretch,+ Margin = new Thickness(_headerW - SeamGrabPx / 2, 0, 0, 0),+ Background = Brushes.Transparent, Child = line,+ Cursor = new Cursor(StandardCursorType.SizeWestEast),+ };+ seam.PointerEntered += (_, _) => line.Background = Brush("Brush.BorderStrong");+ seam.PointerExited += (_, _) => { if (!_colResizing) line.Background = Brushes.Transparent; };+ seam.PointerPressed += (_, e) =>+ {+ if (!e.GetCurrentPoint(seam).Properties.IsLeftButtonPressed) return;+ e.Handled = true;+ if (e.ClickCount == 2) { _colResizing = false; SetHeaderWidth(DefaultHeaderW, final: true); return; }+ _colResizing = true;+ _colResizeStartW = _userHeaderW;+ _colResizeStartX = e.GetPosition(this).X;+ e.Pointer.Capture(seam);+ };+ seam.PointerMoved += (_, e) =>+ {+ if (!_colResizing) return;+ e.Handled = true;+ SetHeaderWidth(_colResizeStartW + e.GetPosition(this).X - _colResizeStartX, final: false);+ };+ void End()+ {+ if (!_colResizing) return;+ _colResizing = false;+ line.Background = Brushes.Transparent;+ ApplyHeaderWidth(final: true);+ }+ seam.PointerReleased += (_, e) => { if (_colResizing) { e.Handled = true; e.Pointer.Capture(null); End(); } };+ seam.PointerCaptureLost += (_, _) => End();+ return seam;+ }++ // ---- presets (track context menu) -----------------------------------------++ private MenuItem BuildTrackHeightSubmenu(IReadOnlyList<int> ids)+ {+ var menu = new MenuItem { Header = "Track height" };+ (string name, double h)[] presets = { ("Compact", CompactRowHeight), ("Standard", StandardRowHeight), ("Large", LargeRowHeight) };+ foreach (var (name, h) in presets)+ {+ var mi = new MenuItem+ {+ Header = name, ToggleType = MenuItemToggleType.Radio,+ IsChecked = ids.Count > 0 && ids.All(id => Math.Abs(StoredRowHeight(id) - h) < 0.5),+ };+ mi.Click += (_, _) => SetTrackHeights(ids, h);+ menu.Items.Add(mi);+ }+ menu.Items.Add(new Separator());+ foreach (var (name, h) in presets)+ {+ var mi = new MenuItem { Header = $"All tracks: {name.ToLowerInvariant()}" };+ mi.Click += (_, _) => SetAllTrackHeights(h);+ menu.Items.Add(mi);+ }+ return menu;+ }++ // ---- duplicate / copy / paste carry the height ----------------------------++ private bool CopyTracksToClipboard(IReadOnlyList<int> ids)+ {+ if (_engine is null || ids.Count == 0 || !_engine.CopyTracks(ids.ToArray())) return false;+ _clipboardHeights = ids.Select(id => _trackHeights.TryGetValue(id, out var h) ? h : (double?)null).ToList();+ return true;+ }++ // Engine copies come back in the order asked; when a group brought its children along the+ // counts differ and the pairing is unknown, so those copies keep the default height.+ private void CarryHeights(IReadOnlyList<double?> heights, IReadOnlyList<int> newIds)+ {+ if (heights.Count != newIds.Count) return;+ for (int i = 0; i < newIds.Count; i++)+ if (heights[i] is { } h) StoreRowHeight(newIds[i], h);+ }++ private void CarryHeightsFrom(IReadOnlyList<int> sourceIds, IReadOnlyList<int> newIds)+ => CarryHeights(sourceIds.Select(id => _trackHeights.TryGetValue(id, out var h) ? h : (double?)null).ToList(), newIds);++ // ---- sidecar persistence --------------------------------------------------++ private const string TrackViewSidecar = "track-view.json";++ private sealed class TrackViewDto+ {+ [JsonPropertyName("version")] public int Version { get; set; } = 1;+ [JsonPropertyName("headerWidth")] public double? HeaderWidth { get; set; }+ [JsonPropertyName("trackHeights")] public List<TrackHeightDto> TrackHeights { get; set; } = new();+ }++ private sealed class TrackHeightDto+ {+ [JsonPropertyName("index")] public int Index { get; set; }+ [JsonPropertyName("height")] public double Height { get; set; }+ }++ /// <summary>Write the track heights and header width into a .nota bundle, keyed by track+ /// index (ids only last a session). Cosmetic — a failure here never fails the save.</summary>+ public void SaveTrackView(string bundleDir)+ {+ var path = System.IO.Path.Combine(bundleDir, TrackViewSidecar);+ try+ {+ var dto = new TrackViewDto();+ if (Math.Abs(_userHeaderW - DefaultHeaderW) >= 0.5) dto.HeaderWidth = _userHeaderW;+ if (_engine is not null)+ for (int i = 0; i < _engine.TrackCount; i++)+ if (_engine.TryGetTrackInfo(i, out var ti) && _trackHeights.TryGetValue(ti.Id, out var h))+ dto.TrackHeights.Add(new TrackHeightDto { Index = i, Height = h });+ if (dto.HeaderWidth is null && dto.TrackHeights.Count == 0)+ {+ if (System.IO.File.Exists(path)) System.IO.File.Delete(path);+ return;+ }+ System.IO.File.WriteAllText(path, JsonSerializer.Serialize(dto, new JsonSerializerOptions { WriteIndented = true }));+ }+ catch { /* layout is cosmetic — never block a save */ }+ }++ /// <summary>Read the layout back out of a bundle (absent / corrupt / newer → defaults).+ /// Call after the engine holds the loaded project, before the arrangement refreshes.</summary>+ public void LoadTrackView(string bundleDir)+ {+ ResetTrackView();+ var path = System.IO.Path.Combine(bundleDir, TrackViewSidecar);+ if (!System.IO.File.Exists(path) || _engine is null) return;+ try+ {+ var dto = JsonSerializer.Deserialize<TrackViewDto>(System.IO.File.ReadAllText(path));+ if (dto is null || dto.Version > 1) return;+ if (dto.HeaderWidth is { } w) _userHeaderW = Math.Round(Math.Clamp(w, MinHeaderW, MaxHeaderW));+ foreach (var th in dto.TrackHeights)+ if (th.Index >= 0 && _engine.TryGetTrackInfo(th.Index, out var ti) && !ti.IsReturn)+ StoreRowHeight(ti.Id, th.Height);+ }+ catch { /* a corrupt sidecar just means the default layout */ }+ finally { ApplyHeaderWidth(final: false); }+ }++ /// <summary>Back to the default layout (New project, or before a load).</summary>+ public void ResetTrackView()+ {+ _trackHeights.Clear();+ _clipboardHeights = null;+ _userHeaderW = DefaultHeaderW;+ ApplyHeaderWidth(final: false);+ }+}diff --git a/src/managed/Nota.App/ArrangementView.Tracks.cs b/src/managed/Nota.App/ArrangementView.Tracks.csindex 42f0eed0..63de6472 100644--- a/src/managed/Nota.App/ArrangementView.Tracks.cs+++ b/src/managed/Nota.App/ArrangementView.Tracks.cs@@ -79,7 +79,7 @@ public sealed partial class ArrangementViewpublic bool CopySelectedTracks(){var ids = SelectedTrackIds();- return ids.Count > 0 && _engine is not null && _engine.CopyTracks(ids.ToArray());+ return CopyTracksToClipboard(ids);}public bool CutSelectedTracks() => CutTracks(SelectedTrackIds());@@ -105,7 +105,7 @@ public sealed partial class ArrangementViewprivate bool CutTracks(IReadOnlyList<int> ids){- if (_engine is null || ids.Count == 0 || !_engine.CopyTracks(ids.ToArray())) return false;+ if (!CopyTracksToClipboard(ids)) return false;return DeleteTracks(ids);}@@ -114,6 +114,7 @@ public sealed partial class ArrangementViewif (_engine is null || !_engine.HasTrackClipboard()) return false;var newIds = _engine.PasteTracks(anchorTrackId);if (newIds.Length == 0) return false;+ if (_clipboardHeights is { } heights) CarryHeights(heights, newIds); // pasted rows keep their heightRefresh();SelectNewTracks(newIds);AfterTrackEdit();@@ -125,6 +126,7 @@ public sealed partial class ArrangementViewif (_engine is null || ids.Count == 0) return false;var newIds = _engine.DuplicateTracks(ids.ToArray());if (newIds.Length == 0) return false;+ CarryHeightsFrom(ids, newIds); // a duplicate keeps its source's heightRefresh();SelectNewTracks(newIds);AfterTrackEdit();@@ -198,7 +200,7 @@ public sealed partial class ArrangementViewvar group = MenuKit.Item($"Group {n}", GlyphKind.Folder, () => GroupTracks(-1), MenuKit.GroupKey);var color = BuildColorSubmenu(ids);var freeze = FreezeTracksMenuItems?.Invoke(ids) ?? Array.Empty<Control>();- var copy = MenuKit.Item($"Copy {n}", GlyphKind.Copy, () => _engine.CopyTracks(ids.ToArray()), MenuKit.CopyKey);+ var copy = MenuKit.Item($"Copy {n}", GlyphKind.Copy, () => CopyTracksToClipboard(ids), MenuKit.CopyKey);var cut = MenuKit.Item($"Cut {n}", GlyphKind.Cut, () => CutTracks(ids), MenuKit.CutKey);var paste = MenuKit.Item("Paste track", GlyphKind.Paste, () => PasteTracksAfter(ids[^1]), MenuKit.PasteKey,enabled: _engine.HasTrackClipboard());@@ -207,6 +209,7 @@ public sealed partial class ArrangementViewflyout.Items.Add(group);flyout.Items.Add(color);+ flyout.Items.Add(BuildTrackHeightSubmenu(ids));if (freeze.Count > 0){flyout.Items.Add(new Separator());diff --git a/src/managed/Nota.App/ArrangementView.cs b/src/managed/Nota.App/ArrangementView.csindex fc778430..d935076c 100644--- a/src/managed/Nota.App/ArrangementView.cs+++ b/src/managed/Nota.App/ArrangementView.cs@@ -87,8 +87,8 @@ public sealed partial class ArrangementView : UserControl// Per-track chosen automation target, kept across Refresh (which rebuilds VMs).private readonly Dictionary<int, (AutomationTarget target, int dev, int param, string paramId)> _autoTargets = new();- private const double HeaderW = 228;- private const double RowHeight = 64; // a track row: header carries every control+ // Header column width and track row heights are user-resizable (ArrangementView.Sizing.cs).+ private double HeaderW => _headerW;private const double GroupRowHeight = 26; // a group row: a slim titled bar, no controlsprivate const double RulerH = 24;private const double SectionsH = 22; // song-structure lane above the ruler@@ -106,7 +106,7 @@ public sealed partial class ArrangementView : UserControlfor (int i = 0; i < _tracks.Count; i++){tops[i] = y;- y += IsSlimRow(_tracks[i]) ? GroupRowHeight : RowHeight;+ y += IsSlimRow(_tracks[i]) ? GroupRowHeight : TrackRowHeight(_tracks[i]);}tops[_tracks.Count] = y;_rowTops = tops;@@ -114,7 +114,8 @@ public sealed partial class ArrangementView : UserControl/// <summary>Height of arrangement row <paramref name="i"/> — a slim bar for a group.</summary>internal double RowHeightAt(int i)- => i >= 0 && i < _tracks.Count && IsSlimRow(_tracks[i]) ? GroupRowHeight : RowHeight;+ => i < 0 || i >= _tracks.Count ? DefaultRowHeight+ : IsSlimRow(_tracks[i]) ? GroupRowHeight : TrackRowHeight(_tracks[i]);/// <summary>A group is a slim titled bar (1a: "groups weigh the same as their children"/// was the problem) — until it is the selected track, where it opens to a full row so its@@ -123,12 +124,12 @@ public sealed partial class ArrangementView : UserControlinternal bool IsSlimRowAt(int i) => i >= 0 && i < _tracks.Count && IsSlimRow(_tracks[i]);/// <summary>Top edge of row <paramref name="i"/> in lane coordinates. Indices past the- /// last row extrapolate by a full track row, so "the gap after the end" still has a y.</summary>+ /// last row extrapolate by a default track row, so "the gap after the end" still has a y.</summary>internal double RowTop(int i){if (i <= 0) return 0;int n = _tracks.Count;- return i <= n ? _rowTops[i] : _rowTops[n] + (i - n) * RowHeight;+ return i <= n ? _rowTops[i] : _rowTops[n] + (i - n) * DefaultRowHeight;}/// <summary>Combined height of every visible row.</summary>@@ -206,7 +207,7 @@ public sealed partial class ArrangementView : UserControlprivate Point _hdrDragStart;private readonly Border _trackDropLine = new(){- IsVisible = false, IsHitTestVisible = false, Height = 2, Width = HeaderW,+ IsVisible = false, IsHitTestVisible = false, Height = 2, Width = DefaultHeaderW,Background = NotaPalette.AccentBright,};@@ -216,7 +217,7 @@ public sealed partial class ArrangementView : UserControlprivate readonly Border _footerDropRing = DropRing();private static Border DropRing() => new(){- IsVisible = false, IsHitTestVisible = false, Width = HeaderW,+ IsVisible = false, IsHitTestVisible = false, Width = DefaultHeaderW,BorderThickness = new Thickness(2), BorderBrush = DropEdge, Background = DropWash,};@@ -290,6 +291,10 @@ public sealed partial class ArrangementView : UserControl// tall as the tracks, so instruments dropped in the empty space beneath them// (the natural "make a new track" gesture) would otherwise miss._headers = new Canvas { Width = HeaderW, VerticalAlignment = VerticalAlignment.Top };+ _headerColumnParts.Add(_headers);+ _headerColumnParts.Add(_trackDropLine);+ _headerColumnParts.Add(_headerDropRing);+ _headerColumnParts.Add(_footerDropRing);_hScroll = new ThinScrollBar();_hScroll.Scroll += (_, _) => { _scrollBeats = _hScroll.Value; Redraw(); };// Keep the scroll range in sync with the visible width — outside the@@ -312,6 +317,7 @@ public sealed partial class ArrangementView : UserControlzoomOut, zoomIn,},};+ _headerColumnParts.Add(zoomBar);var topLeft = HeaderPanel(zoomBar);var topGrid = new Grid { Height = RulerH, ColumnDefinitions = new ColumnDefinitions("Auto,*") };topGrid.Children.Add(topLeft);@@ -382,6 +388,7 @@ public sealed partial class ArrangementView : UserControlHorizontalAlignment = HorizontalAlignment.Left,BorderThickness = new Thickness(0, 0, 1, 0),};+ _headerColumnParts.Add(leftBackdrop);leftBackdrop.BindResource(Border.BackgroundProperty, "Brush.SurfaceCard");leftBackdrop.BindResource(Border.BorderBrushProperty, "Brush.BorderDefault");var centerArea = new Grid();@@ -391,6 +398,8 @@ public sealed partial class ArrangementView : UserControl// Return / Master: a slim section pinned under the tracks (no scroll)._footerHeaders = new Canvas { Width = HeaderW };var footerHeaderPanel = new Border { Width = HeaderW, BorderThickness = new Thickness(0, 0, 1, 0), Child = _footerHeaders };+ _headerColumnParts.Add(_footerHeaders);+ _headerColumnParts.Add(footerHeaderPanel);footerHeaderPanel.BindResource(Border.BackgroundProperty, "Brush.SurfaceCard");footerHeaderPanel.BindResource(Border.BorderBrushProperty, "Brush.BorderDefault");_footerLanes = new FooterLaneControl(this);@@ -439,11 +448,16 @@ public sealed partial class ArrangementView : UserControl// A docked panel like the browser: square, no frame of its own — it meets its// neighbours on the seam the shell grid draws. ClipToBounds keeps the ruler, the// header column and the pinned footer inside it.+ // The header/lane seam is draggable along the view's full height (overview to footer).+ _columnSeam = BuildColumnSeam();+ var layered = new Grid { Children = { root, _columnSeam } };+ SizeChanged += (_, _) => OnViewSizeChanged();+var island = new Border{BorderThickness = new Thickness(0),ClipToBounds = true,- Child = root,+ Child = layered,};island.BindResource(Border.CornerRadiusProperty, "Radius.Docked");island.BindResource(Border.BackgroundProperty, "Brush.BgApp"); // lanes sit on the ground@@ -859,6 +873,7 @@ public sealed partial class ArrangementView : UserControl}ApplyHierarchy(); // reorder _tracks into group DFS order (depth + collapse-filtered)+ PruneTrackHeights(); // heights of deleted tracks go with themRebuildRowGeometry(); // row tops depend on which rows are groups → after the reorderRecomputeTotalBeats();LoadMasterAuto(); // master-volume automation for the footer row (M9 follow-up)@@ -867,7 +882,7 @@ public sealed partial class ArrangementView : UserControlRebuildHeaders();RebuildFooterHeaders();}- _lanes.Height = Math.Max(RowHeight, RowsHeight);+ _lanes.Height = Math.Max(DefaultRowHeight, RowsHeight);_overlay.Height = _lanes.Height; // keep the playhead/loop overlay the same spandouble footerH = (_returns.Count + 1) * FooterRowH; // returns + master_footer.Height = footerH;@@ -1298,7 +1313,7 @@ public sealed partial class ArrangementView : UserControl{RebuildRowGeometry();RebuildHeaders();- _lanes.Height = Math.Max(RowHeight, RowsHeight);+ _lanes.Height = Math.Max(DefaultRowHeight, RowsHeight);_overlay.Height = _lanes.Height;}@@ -1694,6 +1709,7 @@ public sealed partial class ArrangementView : UserControl_panBars.Clear();_volDb.Clear();_headerCards.Clear();+ _cardTiers.Clear();for (int i = 0; i < _tracks.Count; i++){var card = BuildHeaderCard(_tracks[i]);@@ -1701,9 +1717,10 @@ public sealed partial class ArrangementView : UserControlCanvas.SetTop(card, RowTop(i)); // pin to the same Y as the lane row_headers.Children.Add(card);}+ AddRowSeamGrips(); // row-height grips sit above the cards_headers.Children.Add(_trackDropLine); // insertion marker (kept invisible until a drag)_headers.Children.Add(_headerDropRing); // browser drop target (kept invisible until a drag)- _headers.Height = Math.Max(RowHeight, RowsHeight);+ _headers.Height = Math.Max(DefaultRowHeight, RowsHeight);}private Control BuildHeaderCard(TrackVM t)@@ -1785,10 +1802,16 @@ public sealed partial class ArrangementView : UserControlreturn card;}+ // One builder, three layouts picked by the row's height (specs/015): compact puts the name+ // and M/S/arm on one line; standard is the classic three rows; large gives the routing,+ // the fader and the pan a row each. The controls and their wiring are shared.private Control BuildTrackCard(TrackVM t){bool selected = IsTrackMultiSelected(t.Id);var (_, _, _, spineBrush) = ClipColors(t.ColorIndex);+ double rowH = TrackRowHeight(t);+ var tier = TierFor(rowH);+ _cardTiers[t.Id] = tier;// Row 1: [group ▸/▾] name (ellipsised) + type-tag chip.var name = new TextBlock@@ -1839,29 +1862,37 @@ public sealed partial class ArrangementView : UserControlif (!t.IsReturn && !t.IsGroup)btnRow.Children.Add(ArmToggle(t.Armed, v => _engine?.SetTrackArmed(t.Id, v)));- // A compact routing selector sits with the arm button (the 64px row leaves no room- // for a 4th row): audio tracks get record-input, instrument tracks get "MIDI To".+ // 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;Control row2 = btnRow;- if (isAudioTrack || t.IsInstrument)+ 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);- var g = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), Margin = new Thickness(0, 5, 0, 0), ColumnSpacing = 3};- btnRow.Margin = new Thickness(0);- Grid.SetColumn(btnRow, 0);- Grid.SetColumn(combo, 1);- g.Children.Add(btnRow);+ 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)+ {+ btnRow.Margin = new Thickness(0);+ Grid.SetColumn(btnRow, col);+ g.Children.Add(btnRow);+ col++;+ }+ Grid.SetColumn(combo, col);g.Children.Add(combo);if (monitor is not null){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, 2);+ Grid.SetColumn(monitor.Chip, col + 1);g.Children.Add(monitor.Chip);}- row2 = g;+ if (ownRow) routingRow = g; else row2 = g;}// Row 3: volume (mini fader + dB readout) and a bipolar pan bar in one row —@@ -1910,9 +1941,42 @@ public sealed partial class ArrangementView : UserControlvolRow.Children.Add(pan);// Indent nested rows so the group hierarchy reads at a glance.- var stack = new StackPanel { Margin = new Thickness(8, 6, 8, 6), Children = { nameRow, row2, volRow } };+ var stack = new StackPanel { Margin = new Thickness(8, 6, 8, 6) };+ switch (tier)+ {+ case HeaderTier.Compact:+ // One line: name · tag · M S ●. 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;+ btnRow.Margin = new Thickness(6, 0, 0, 0);+ btnRow.VerticalAlignment = VerticalAlignment.Center;+ Grid.SetColumn(btnRow, 3);+ nameRow.Children.Add(btnRow);+ stack.Margin = new Thickness(8, 0, 8, 0);+ stack.VerticalAlignment = VerticalAlignment.Center;+ stack.Children.Add(nameRow);+ break;+ case HeaderTier.Large:+ // A row each: the fader takes the full width, the pan its own row below.+ volRow.ColumnDefinitions = new ColumnDefinitions("*");+ volRow.RowDefinitions = new RowDefinitions("Auto,Auto");+ volRow.RowSpacing = 6;+ Grid.SetColumn(pan, 0);+ Grid.SetRow(pan, 1);+ stack.Children.Add(nameRow);+ stack.Children.Add(row2);+ if (routingRow is not null) stack.Children.Add(routingRow);+ stack.Children.Add(volRow);+ break;+ default:+ stack.Children.Add(nameRow);+ stack.Children.Add(row2);+ stack.Children.Add(volRow);+ break;+ }- var meter = new MeterBar { VerticalAlignment = VerticalAlignment.Stretch, Width = 8, Margin = new Thickness(0, 6, 3, 6) };+ var meter = new MeterBar { VerticalAlignment = VerticalAlignment.Stretch, Width = 8, Margin = tier == HeaderTier.Compact ? new Thickness(0, 4, 3, 4) : new Thickness(0, 6, 3, 6) };_meters[t.Id] = meter;DockPanel.SetDock(meter, Dock.Right);var body = new DockPanel { LastChildFill = true, Children = { meter, stack } };@@ -1924,7 +1988,7 @@ public sealed partial class ArrangementView : UserControlvar card = new Border{Width = HeaderW,- Height = RowHeight,+ Height = rowH,ClipToBounds = true,Background = selected ? SelHeaderBg : (t.Frozen || t.LiveRole != 0) ? FrozenHeaderBg : t.IsGroup ? Brush("Brush.SurfaceRaised") : Brush("Brush.SurfaceCard"),BorderBrush = Brush("Brush.BorderDefault"),@@ -2123,7 +2187,7 @@ public sealed partial class ArrangementView : UserControl// its children); paste lands right after this track.var one = new[] { trackId };var copy = new MenuItem { Header = "Copy track", Icon = MenuKit.Icon(GlyphKind.Copy), InputGesture = MenuKit.CopyKey };- copy.Click += (_, _) => _engine.CopyTracks(one);+ copy.Click += (_, _) => CopyTracksToClipboard(one);var cut = new MenuItem { Header = "Cut track", Icon = MenuKit.Icon(GlyphKind.Cut), InputGesture = MenuKit.CutKey };cut.Click += (_, _) => CutTracks(one);var paste = new MenuItem { Header = "Paste track", IsEnabled = _engine.HasTrackClipboard(), Icon = MenuKit.Icon(GlyphKind.Paste), InputGesture = MenuKit.PasteKey };@@ -2151,6 +2215,7 @@ public sealed partial class ArrangementView : UserControlflyout.Items.Add(rename);flyout.Items.Add(color);+ flyout.Items.Add(BuildTrackHeightSubmenu(one));if (recInput is not null) flyout.Items.Add(recInput);if (midiFrom is not null) flyout.Items.Add(midiFrom);if (freeze.Count > 0)@@ -2594,10 +2659,11 @@ public sealed partial class ArrangementView : UserControlHorizontalContentAlignment = HorizontalAlignment.Center,};- // Fixed-width header-column chrome (SurfaceCard + right divider).+ // Header-column chrome (SurfaceCard + right divider), as wide as the header column.private Border HeaderPanel(Control? child){var b = new Border { Width = HeaderW, BorderThickness = new Thickness(0, 0, 1, 0), Child = child };+ _headerColumnParts.Add(b); // follows the header-column widthb.BindResource(Border.BackgroundProperty, "Brush.SurfaceCard");b.BindResource(Border.BorderBrushProperty, "Brush.BorderDefault");return b;diff --git a/src/managed/Nota.App/MainWindow.Files.cs b/src/managed/Nota.App/MainWindow.Files.csindex f0ea7a5f..4d75b7f1 100644--- a/src/managed/Nota.App/MainWindow.Files.cs+++ b/src/managed/Nota.App/MainWindow.Files.cs@@ -185,6 +185,7 @@ public partial class MainWindow_projectPath = null;_learn?.Clear(); // start with a clean MIDI-map for the new projectTimeline.ClearSections(); // …and a clean song structure+ Timeline.ResetTrackView(); // …at the default track sizesNota.Infrastructure.ProjectTemplate.ApplyDefault(Engine); // instrument, audio, Reverb + Delay returnsRefreshAfterLoad();UpdateWindowTitle();@@ -249,6 +250,7 @@ public partial class MainWindow_learn?.LoadMappings(dir); // MIDI-learn mappings ride in the bundle sidecar_modular?.LoadLayout(dir); // modular-editor node/island positions (sidecar)Timeline.LoadSections(dir); // arrangement song sections (sidecar)+ Timeline.LoadTrackView(dir); // track heights + track-list width (sidecar)LoadFreezeLinks(dir); // live-freeze links (v1.1) — re-sleep linked sourcesRecordRecentProject(dir); // surface it on the welcome screen next launchRefreshAfterLoad();@@ -317,6 +319,7 @@ public partial class MainWindow_learn?.SaveMappings(dir); // MIDI-learn mappings ride in the bundle sidecar_modular?.SaveLayout(dir); // modular-editor node/island positions (sidecar)Timeline.SaveSections(dir); // arrangement song sections (sidecar)+ Timeline.SaveTrackView(dir); // track heights + track-list width (sidecar)SaveFreezeLinks(dir); // live-freeze links (v1.1) ride in the bundle sidecar_analysis.AdoptInto(dir); // analysis cached while unsaved moves into the bundlestring? historyNote = RecordVersion(dir, previousPath, note); // after every sidecar is writtendiff --git a/src/managed/Nota.App/PreferencesWindow.cs b/src/managed/Nota.App/PreferencesWindow.csindex 07e66f72..bc811c9c 100644--- a/src/managed/Nota.App/PreferencesWindow.cs+++ b/src/managed/Nota.App/PreferencesWindow.cs@@ -1200,7 +1200,11 @@ public sealed partial class PreferencesWindow : NotaWindow("Right-click the metronome", "Count-in before Play / Record: off · 1 · 2 · 4 bars"),("Drag an audio clip's ADSR handle", "Shape attack · decay + sustain · release (top corners and the dot on hover) · double-click resets the stage"),("⇧-click track header", "Add the track to the selection · again to remove it"),- ("Right-click track headers", "A multi-selection gets its own menu: group, colour, freeze, copy, duplicate, delete"),+ ("Right-click track headers", "A multi-selection gets its own menu: group, colour, track height, freeze, copy, duplicate, delete"),+ ("Drag a track's bottom edge", "Resize the track (header or lane) · snaps to compact / standard / large · a multi-selection resizes together"),+ ("Drag a track's bottom edge + ⌥", "Resize every track at once"),+ ("Double-click a track's bottom edge", "Back to the standard height"),+ ("Drag the track-list edge", "Widen or narrow the track headers · double-click resets"),("Drag sections lane", "Mark a new section over the dragged bars"),("Click section", "Jump the playhead to its start"),("Double-click section", "Rename it"),