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) Dock the Mixer in the main window, keep the pop-out window (#388)
Egor Khindikaynendb9990a2ac6b
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 31e47b7f..ebe97fc5 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -22,6 +22,29 @@ Entry categories: `Added`, `Changed`, `Fixed`, `Removed`.## [Unreleased]+### Added+- **Dock the Mixer in the main window** (#39): View → Mixer (⌘⇧M / Ctrl+Shift+M) now shows+ the full Mixer — strips, Stereo map and the pan law footer — as a panel under Arrangement,+ Session or Modular, above the Devices / Clip panel; either, both or neither can be shown.+ Drag its top edge to resize it. The panel's pop-out button (or **View → Mixer in its own+ window**) moves it into the floating window for a second screen; the window's dock button+ brings it back. Nota remembers whether the Mixer was shown, where and how tall, and restores+ it on the next launch.++### Changed+- **Mixer strips fit the height they get**, docked or in the window: as it shrinks, the I/O+ rows hide first, then the sends, then the fader gets shorter; name, meter, fader, pan and+ M / S / Arm always stay. A hidden section's **Sends** / **I/O** footer toggle shows an+ outline — click it to show the section anyway, and the strips scroll. Strip faders, pan and+ M / S / Arm — in the Mixer and in Session's mixer sections — now follow changes made+ elsewhere (the other mixer, track headers, automation, undo).+- **Mixer strip order** follows the arrangement: the tracks in their order, then the+ returns, then the master.++### Fixed+- **View ▸ Toggle detail panel** no longer leaves an empty band where the hidden panel was;+ showing it again brings back its height.+## [0.58.1] — 2026-10-29### Addeddiff --git a/FEATURES.md b/FEATURES.mdindex b2d16cf7..1695063f 100644--- a/FEATURES.md+++ b/FEATURES.md@@ -106,9 +106,9 @@ on a pool of render threads, export and freeze use every core, and an idle engin## ViewsThree top-level views, switched by three icon keys in the transport (**Arrangement ·-Session · Modular**; each names its view in a tooltip); the mixer opens as a separate-floating window (**View → Mixer**, ⌘M) that is as wide as its channel strips, follows the-track count and closes with Escape.+Session · Modular**; each names its view in a tooltip). The Mixer (**View → Mixer**, ⌘⇧M)+docks as a panel under any of the three, or floats in its own window — see+[Tracks and mixer](#tracks-and-mixer).- **Arrangement View** — a linear timeline:place, move, trim and duplicate clips; the snap grid (below); scroll and zoom;@@ -219,13 +219,23 @@ track count and closes with Escape.arms that track alone, ⌘-click arms several; **Transport ▸ Auto-arm selected track** (off bydefault) arms the instrument track you select.Double-click resets to the default.+- **Mixer** (**View → Mixer**, ⌘⇧M / Ctrl+Shift+M): a strip per track, then the returns, then+ the master (I/O, A/B sends, pan, fader with a stereo meter and dB read-out, M / S / Arm), the+ **Strips | Stereo map** switch and the pan law footer. It docks as a resizable panel under+ Arrangement, Session or Modular, above the Devices / Clip panel (either, both or neither),+ or pops out into its own window for a second screen — the panel's pop-out button, the+ window's dock button or **View → Mixer in its own window** switch it; the window is as wide+ as its strips and closes with Escape. Whether it is shown, where and how tall come back on+ the next launch. Strips fit the height they get: I/O rows hide first, then sends, then the+ fader shortens; the footer's **Sends** / **I/O** toggles show a hidden section anyway (the+ strips then scroll). Faders, pan and M / S / Arm follow changes made anywhere else.- **Pan law** (per project, in the Mixer footer: **Pan law** Stereo / Balance): underStereo, panning a stereo track or return moves its whole image — at full pan bothchannels play from one side; under Balance the opposite channel fades out. Monomaterial and centred tracks sound the same either way. New projects use Stereo; projectsfrom earlier versions keep Balance and are marked **Older project**. Switching isclick-free during playback and one undo step. Groups keep their balance (marked **BAL**).-- **Stereo Map** (Mixer window, **Strips | Stereo map** in its title bar): every track,+- **Stereo Map** (Mixer, **Strips | Stereo map** in its panel or window title bar): every track,return and the master as a dot at its pan (left–right) and fader (up–down), with a measuredcloud — where the sound really sits, how wide it is (from the phase correlation) and howloud — and the master correlation under the map. Drag a dot to set pan and volume at oncediff --git a/specs/054-docked-mixer/checklists/requirements.md b/specs/054-docked-mixer/checklists/requirements.mdnew file mode 100644index 00000000..e1acab7a--- /dev/null+++ b/specs/054-docked-mixer/checklists/requirements.md@@ -0,0 +1,35 @@+# Specification Quality Checklist: Docked Mixer++**Purpose**: Validate specification completeness and quality before proceeding to planning+**Created**: 2026-10-30+**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++- FR-004 resolved 2026-10-30: the docked Mixer is its own panel, stacked with the Devices / Clip panel (option A).+- Items marked incomplete require spec updates before `/speckit-clarify` or `/speckit-plan`diff --git a/specs/054-docked-mixer/contracts/ui-commands.md b/specs/054-docked-mixer/contracts/ui-commands.mdnew file mode 100644index 00000000..76f9d327--- /dev/null+++ b/specs/054-docked-mixer/contracts/ui-commands.md@@ -0,0 +1,32 @@+# UI Contract: Mixer placement++The user-facing surface this feature exposes. No C ABI or MCP change.++## Commands (`src/managed/Nota.Application/Palette/CommandCatalog.cs`)++| Id | Title | Group | Shortcut | Behaviour |+|---|---|---|---|---|+| `view.mixer` *(exists)* | Show Mixer | View | ⌘⇧M / Ctrl+Shift+M | Toggle the Mixer in the remembered placement |+| `view.mixerFloat` *(new)* | Mixer in its own window | View | — | Toggle placement; moves a shown Mixer, otherwise only flips the preference |++## Menu (`MainWindow.axaml`, View)++- `Mixer` → `view.mixer` (unchanged).+- `Mixer in its own window` → `view.mixerFloat`, checkable, checked when floating.++## Docked panel (main window, under the main view, above Devices / Clip)++Toolbar, left → right: `Mixer` caption · `Strips | Stereo map` segments · spacer ·+pop-out button (tooltip *Open the mixer in a window*) · close button (tooltip *Hide the+mixer*). Body: the `MixerView` (strips or map + footer). Top edge: resize splitter.++## Floating window (`MixerWindow`)++Unchanged, plus a dock button (new `DockIn` glyph — PopOut's arrow turned inward) at the right of the title bar (tooltip *Dock the mixer in+the main window*). Close / Escape = hide.++## Footer section toggles (`MixerView`)++`Show Sends I/O` keep their on/off meaning. New state **auto-hidden**: muted look,+tooltip *Hidden: not enough height · click to show anyway*. Click → pinned visible with+vertical scrolling; click again → off.diff --git a/specs/054-docked-mixer/data-model.md b/specs/054-docked-mixer/data-model.mdnew file mode 100644index 00000000..b7da66f2--- /dev/null+++ b/specs/054-docked-mixer/data-model.md@@ -0,0 +1,40 @@+# Data Model: Docked Mixer++No project-file or engine data changes. Everything below is per-user UI state.++## MixerPlacement (persisted in `Settings`, `src/managed/Nota.Application/Settings.cs`)++| Field | Type | Default | Meaning |+|---|---|---|---|+| `MixerView` *(exists)* | string | `"strips"` | Strips or Stereo map (`"map"`), specs/008 |+| `MixerFloating` | bool | `false` | `false` = docked panel, `true` = own window |+| `MixerShown` | bool | `false` | Mixer was shown when last changed by the user |+| `MixerDockHeight` | double | `0` | Docked row height in design units; `0` = full strips, but no more than half of the body |++Validation:+- `MixerDockHeight` is clamped on use to `[MixerPanelMin, available]`, never rewritten by+ a clamp; only a finished splitter drag stores a new value.+- Unknown / missing fields in an older `settings.json` take the defaults (docked, hidden).++## Runtime state (MainWindow, not persisted)++- `Placement`: `Hidden | Docked | Floating` — derived from `MixerShown` + `MixerFloating`+ while the app runs; `MixerView.IsVisible == (Placement != Hidden)` (drives meter ticks).+- `MixerTier` (inside `MixerView`): `Full | NoIo | NoIoNoSends | Compact(faderHeight)`.+- `PinnedSections` (inside `MixerView`): set of {I/O, Sends} the user forced visible while+ auto-hidden; turns on vertical strip scrolling. Session-only, like today's toggles.++## State transitions++```text+Hidden ──view.mixer──▶ Docked | Floating (by MixerFloating)+Docked ──view.mixer / panel ×──▶ Hidden+Floating ──view.mixer / window close / Esc──▶ Hidden+Docked ──panel pop-out / view.mixerFloat──▶ Floating (MixerFloating = true)+Floating ──window dock button / view.mixerFloat──▶ Docked (MixerFloating = false)+Hidden ──view.mixerFloat──▶ Hidden (only flips MixerFloating)+App exit: no transition recorded (MixerShown keeps its value)+App start: Hidden ──restore──▶ state from settings+```++Every user-driven transition writes `MixerShown` / `MixerFloating` and saves settings.diff --git a/specs/054-docked-mixer/plan.md b/specs/054-docked-mixer/plan.mdnew file mode 100644index 00000000..c92f5af8--- /dev/null+++ b/specs/054-docked-mixer/plan.md@@ -0,0 +1,133 @@+# Implementation Plan: Docked Mixer++**Branch**: `054-docked-mixer` | **Date**: 2026-10-30 | **Spec**: [spec.md](spec.md)++**Input**: Feature specification from `/specs/054-docked-mixer/spec.md`++## Summary++Let the full Mixer dock as its own bottom panel in the main window (under the main view,+above the Devices / Clip panel), keep the floating `MixerWindow`, switch between them from+the panel, the window, the View menu and the palette, and restore shown / placement /+height per user on restart. Strips adapt to the height they get. Technically: the single+existing `MixerView` instance is reparented between hosts (as `DetailWindow` already+does), `BodyGrid` rows are built for the visible set of bottom panels by one function,+and `MixerView` gains a height tier. UI-only; no engine or ABI change. Details:+[research.md](research.md).++## Nota: Read Before Planning++- **UI work** → [`DESIGN.md`](../../DESIGN.md) (Studio) and the `nota-design` skill: the+ docked panel copies `DetailPanel`'s docked-on-a-seam look and 32 px toolbar.+- **Anything** → [`CONTRIBUTING.md`](../../CONTRIBUTING.md).++## Technical Context++**Language/Version**: C# / .NET 10 (managed app only)++**Primary Dependencies**: Avalonia (existing). No new dependency.++**Storage**: per-user `settings.json` via `ISettingsService` (`Settings.cs`) — three new+fields, see [data-model.md](data-model.md). No project-file change.++**Audio-Thread Impact**: None — UI-only re-hosting and layout. Meter reads stay on the+UI tick, unchanged; the Mixer is never ticked twice.++**Testing**: `scripts/build.sh` (smoke test, unaffected); feature validated with the+scenarios in [quickstart.md](quickstart.md), driven through a headless Avalonia harness+with screenshots where the GUI can't be launched.++**Target Platform**: macOS, Windows, Linux desktop (Linux native frame: no custom drag+area — the dock button still sits in the title row).++**Project Type**: desktop app++**Performance Goals**: docked ↔ floating switch < 0.2 s with no strip rebuild (SC-002);+tier changes only toggle visibility/height, never rebuild strips; no extra meter cost.++**Constraints**: one `MixerView` instance; main view keeps ≥ 120 px; minimum heights+derived from measured content × UI scale.++**Scale/Scope**: ~6 files in `src/managed/Nota.App`, 2 in `Nota.Application`;+projects with 50+ tracks must scroll horizontally in the panel as in the window.++## Constitution Check++| Principle | Status |+|---|---|+| I. Real-time audio safety | Pass — no audio-thread code touched |+| II. Boundary discipline | Pass — no C ABI / JUCE change |+| III. Licensing hygiene | Pass — no new dependency; any new `.cs` file gets the SPDX header |+| IV. Verification gate | Pass — `scripts/build.sh` before PR; no engine behaviour change, so no smoke-test extension |+| V. One logical change | Pass — one feature; the adaptive strips are part of it (clarified FR-014) |+| VI. Docs in sync | Planned — CHANGELOG `[Unreleased]`, `nota-features`, `nota-docs` (Mixer page EN+RU + screenshots), `nota-shortcuts` check (no new binding) |+| VII. Spec-first | Pass — this run |+| VIII. Rules not weakened | Pass |++Post-design re-check: unchanged — the design adds no native code, no dependency, no+persistent project data.++## Project Structure++### Documentation (this feature)++```text+specs/054-docked-mixer/+├── plan.md+├── research.md+├── data-model.md+├── quickstart.md+├── contracts/ui-commands.md+├── checklists/requirements.md+└── tasks.md # /speckit-tasks+```++### Source Code (repository root)++```text+src/managed/+├── Nota.Application/+│ ├── Settings.cs # + MixerFloating, MixerShown, MixerDockHeight+│ └── Palette/CommandCatalog.cs # + view.mixerFloat+└── Nota.App/+ ├── MainWindow.axaml # MixerPanel + MixerSplitter in BodyGrid; View menu item+ ├── MainWindow.axaml.cs # restore on Opened; splitter DragCompleted → settings+ ├── MainWindow.Mixer.cs # placement controller (show/hide/toggle/float/dock)+ ├── MainWindow.Detail.cs # RowDefinitions[2] → DetailRow; LayoutBottomPanels()+ ├── MainWindow.DetailWindow.cs # same accessor change+ ├── MainWindow.Commands.cs # bind view.mixerFloat+ ├── MainWindow.Palette.cs # docked focus → PaletteOrigin.Mixer+ ├── MixerWindow.cs # dock button, DockRequested; MinHeight from MixerView+ └── MixerView.cs # height tiers, MinContentHeight, auto-hidden toggles++CHANGELOG.md, FEATURES.md # entries+../nota-docs # Mixer page EN + RU (nota-docs skill)+```++**Structure Decision**: all work is in the managed app's presentation code+(`Nota.App`) plus two small `Nota.Application` additions; the existing partial-class+split of `MainWindow` is followed (`MainWindow.Mixer.cs` owns placement).++## Implementation Order++1. `MixerView` height tiers + `MinContentHeight` + auto-hidden toggles (works in the+ window alone — a shippable improvement on its own).+2. `BodyGrid` refactor: `LayoutBottomPanels()`, `DetailRow` accessor; Devices panel+ behaviour must be byte-for-byte the same with the Mixer hidden.+3. Docked panel + placement controller + settings + restore (US1, US2).+4. Pop-out / dock both ways + `view.mixerFloat` + menu (US3).+5. Palette origin, short-window clamping, edge cases; docs and changelog.++## Risks++- **Devices panel regressions** from the row refactor (#53 height drift, Tab cycling,+ pop-out). Mitigation: step 2 lands alone and is checked against the existing flows+ before the Mixer is added.+- **Reparenting across windows** (#164 stale layout entries): reuse `SetHost` /+ `FlushOtherWindows`, never set `Content` directly.+- **Shutdown recording "hidden"** when the app closes `MixerWindow`: guard with+ `_shuttingDown`.++## Complexity Tracking++None — no constitution violations.diff --git a/specs/054-docked-mixer/quickstart.md b/specs/054-docked-mixer/quickstart.mdnew file mode 100644index 00000000..8a3ba9f5--- /dev/null+++ b/specs/054-docked-mixer/quickstart.md@@ -0,0 +1,37 @@+# Quickstart: validating the Docked Mixer++## Prerequisites++- Release engine build in `build/` and the managed app built:+ `dotnet build src/managed/Nota.App/Nota.App.csproj`.+- Isolated user data: `NOTA_DATA_DIR=/tmp/dockmixer/data` (fresh `settings.json`).+- If the GUI can't be launched (sandbox / display asleep), use a headless harness: real+ `MainWindow` with `DataContext` from `App.Services`, tracks added through the engine,+ commands fired via the command registry, frames via `CaptureRenderedFrame()`.++## Scenarios++| # | Steps | Expected |+|---|---|---|+| 1 | Fresh settings, open a project with 6 tracks, ⌘⇧M | Mixer appears docked under the arrangement; arrangement still scrolls and edits (US1-1) |+| 2 | Move a fader, pan, mute; undo | Audible / meters move; undo reverts (US1-2, FR-010) |+| 3 | Switch Strips ↔ Stereo map in the panel toolbar | View changes; `settings.json` `MixerView` updated (US1-3) |+| 4 | Drag the Mixer's top edge up and down, restart | Height follows, clamps at min; restored after restart (US1-4, FR-005) |+| 5 | Drag it low | I/O hides, then sends, then fader shrinks; core stays; drag stops at min (FR-014) |+| 6 | At low height click footer `Sends` (muted) | Sends show, strip row scrolls vertically; click again → off |+| 7 | Show Devices panel too (select a track) | Mixer above, Devices below; both splitters work; hiding either keeps the other (FR-004) |+| 8 | Shrink the main window to ~500 px tall with both panels | Main view keeps ≥120 px; the Mixer shrinks first (down to its minimum), then Devices |+| 9 | Switch Arrangement → Session → Modular | Mixer stays docked, same view/height; Session's own I/O·Sends·Mixer unchanged and in sync (US2) |+| 10 | Panel pop-out button | Mixer moves to a window, panel gone, meters keep running (US3-1) |+| 11 | Window dock button | Window closes, Mixer docked (US3-2) |+| 12 | Floating, quit, relaunch | Mixer reopens floating; same for docked shown, and for hidden (FR-009, SC-004) |+| 13 | Floating, close window, ⌘⇧M | Opens floating again (US3-4) |+| 14 | Focus a docked fader, press Space / Return / ⌘Z / Esc | Transport + undo work; Esc does not hide the docked Mixer |+| 15 | MIDI learn armed, click a docked fader, move a controller | Mapping created and works |+| 16 | Palette from a focused docked control | Opens in the main window with Mixer origin |+| 17 | UI scale 125% + Studio Light theme | Panel restyles live; min heights scale |+| 18 | `view.mixerFloat` from the palette while hidden, then ⌘⇧M | Opens floating |++## Gate++`scripts/build.sh` passes (smoke test; no engine change expected).diff --git a/specs/054-docked-mixer/research.md b/specs/054-docked-mixer/research.mdnew file mode 100644index 00000000..b4e46572--- /dev/null+++ b/specs/054-docked-mixer/research.md@@ -0,0 +1,158 @@+# Research: Docked Mixer++Phase 0 for [plan.md](plan.md). Each entry: Decision / Rationale / Alternatives considered.+Findings are from the current code on `develop` (0.58.1).++## What exists today++- `MixerView` (`src/managed/Nota.App/MixerView.cs`) is created **once** in+ `MainWindow.axaml.cs` (`_mixer = new MixerView(...)`, `IsVisible = false`) and hosted on+ demand. `ToggleMixerWindow()` (`MainWindow.Mixer.cs`) builds a `MixerWindow`, reparents+ the view into `win.Host` through `SetHost` (`MainWindow.DetailWindow.cs`), sets+ `IsVisible = true` so the UI tick (`MainWindow.axaml.cs:304`) pushes meters, and on close+ sets it back to `false`.+- Strip layout (top → bottom): header 24 · I/O row 34 · sends row ~42 · pan 38 · fader+ row with a fixed **190 px** fader · dB read-out · M/S/Arm 28. Footer 44: `Show` Sends /+ I/O toggles (manual, session-only), Pan law group, crossfader placeholder. Full height ≈+ 460 px — the window's default height.+- The bottom Devices / Pattern / Clip panel lives in `BodyGrid` row 2 (`RowDefinitions`+ `*` / `Auto` (splitter) / `0`), resized by `DetailSplitter`; its row is referenced as+ `BodyGrid.RowDefinitions[2]` in `MainWindow.Detail.cs`, `MainWindow.DetailWindow.cs` and+ `MainWindow.axaml.cs`. Its Clip-tab height is kept in memory (`_detailHeight`), not+ persisted. It pops out to `DetailWindow` and docks back on close (`DockRequested`).+- `Settings.MixerView` ("strips" / "map") is the only persisted mixer preference.+- The main window already routes transport keys in the tunnel phase and owns+ `LearnOverlay` (MIDI learn) and `PaletteLayer`; `SnapshotContext` maps a `MixerWindow`+ source to `PaletteOrigin.Mixer`.++## R1 — One `MixerView`, three hosts++**Decision**: Keep the single `MixerView` instance and move it between three states:+hidden (no parent), docked (`MixerHost` in the new main-window panel), floating+(`MixerWindow.Host`) with the existing `SetHost` + `FlushOtherWindows` helpers. A small+placement controller in `MainWindow.Mixer.cs` owns the transitions+(`ShowMixer`, `HideMixer`, `ToggleMixer`, `SetMixerFloating`).++**Rationale**: FR-008 (state carries over, no rebuild delay) comes for free: meters,+scroll offset, Stereo map, MIDI-learn bindings and the pan-law cache live in the+instance. The same pattern already works for `DetailWindow` (#164 layout-queue fix+included).++**Alternatives**: two `MixerView` instances (docked + window) — double meter cost, state+divergence, two refresh paths; rejected.++## R2 — Bottom-zone layout: one function owns `BodyGrid` rows++**Decision**: Replace the fixed three-row `BodyGrid` with rows built by one method,+`LayoutBottomPanels()`, from the visible set: `[main *] [mixer splitter, mixer]? [detail+splitter, detail]?`. Each splitter is a `GridSplitter` (`ResizeDirection=Rows`) on the+seam, as today. Code that touched `RowDefinitions[2]` goes through `DetailRow` /+`MixerRow` accessors that return the current row (or a detached dummy when hidden).+Heights are read from the rows' `ActualHeight` on `DragCompleted` (the #53 lesson: store+the row, not the panel).++**Rationale**: A GridSplitter resizes its neighbouring rows; with a fixed row set a+hidden Mixer would leave a 0-height row next to the Devices splitter and break its drag.+Rebuilding rows for the visible set keeps both splitters correct in every combination+(FR-004): Mixer splitter trades space with the main view; the Devices splitter trades+with whatever sits above it (the Mixer when shown — the natural "boundary between two+panels" behaviour).++**Revised in review (#388)**: between two pixel rows a GridSplitter trades height between+them, so with both panels shown the Detail splitter resized the Mixer. While the Mixer is+docked the Detail panel is resized from its own edge (`DetailEdge`), which changes only the+Detail row and takes room from the main view; the GridSplitter stays for the undocked case.+The Detail row also follows the panel's visibility, and keeps a wanted height that a short+window can shrink and a taller one restores.++**Alternatives**: (a) a fixed five-row grid — breaks the Devices splitter when the Mixer+is hidden; (b) a custom drag handle that resizes only its own panel — re-implements the+splitter and the #53 handling; (c) nesting the Mixer inside `DetailPanel` — that is the+rejected option B from clarification.++## R3 — Fitting into short windows++**Decision**: On `BodyGrid` size changes and after each `LayoutBottomPanels()`, clamp in+order: the main view keeps `MinHeight` 120; the Mixer shrinks to its minimum first, then+the Devices panel to its minimum (FR-005, edge case). Remembered heights are not+overwritten by a clamp — only a user drag writes them. (Changed during implementation: the+Devices tab has a fixed card height and can't be resized, so shrinking it clips cards, while+the Mixer's strips adapt to any height down to their core.)++**Rationale**: pixel rows do not shrink by themselves; without a clamp a short window+pushes the main view to zero.++## R4 — Height-adaptive strips (FR-014)++**Decision**: `MixerView` picks a layout tier from the height its strip area actually+gets (`_main` `SizeChanged` / arrange), not from who hosts it, so docked and floating+behave the same:++1. everything (I/O, sends, 190 px fader);+2. hide I/O rows;+3. hide sends rows;+4. shrink the fader from 190 px down to a minimum (≈ 72 px), meters with it.++The core (header, pan, fader at minimum, dB, M/S/Arm) plus footer defines+`MixerView.MinContentHeight`; the docked panel's row minimum and `MixerWindow.MinHeight`+are derived from it (scaled by `NotaUiScale`), never hard-coded. The footer's existing+`Show` Sends / I/O toggles keep their meaning ("show this when it fits"). When a section+is auto-hidden its toggle shows a muted state with the tooltip *Hidden: not enough+height · click to show anyway*; clicking pins it visible and turns on vertical scrolling+of the strip row (`VerticalScrollBarVisibility.Auto`), which is how a collapsed section+stays reachable. Clicking again turns it off. Tier changes only toggle `IsVisible` /+`Height` on existing controls — no `Refresh()` rebuild.++**Rationale**: matches the clarification (adaptive, core always visible, collapsed+sections reachable) and reuses the controls that already hide these sections. Sends stay+editable elsewhere too (Devices panel Sends card, Session mixer sections).++**Alternatives**: per-strip expanders — 2× controls per strip and noisy at 30+ tracks;+a strip context-menu entry — less discoverable than the existing footer toggles.++**Stereo map**: `StereoMapView` already stretches; check it at the minimum height and give+it a `MinHeight` that fits inside `MinContentHeight` if it clips (task, not a design+change).++## R5 — Persistence (FR-009)++**Decision**: Three new `Settings` properties next to `MixerView`:+`MixerFloating` (bool, default `false` → docked), `MixerShown` (bool, default `false`),+`MixerDockHeight` (double, default `0` → natural height = full strips, clamped). Written+with `settings.Save()` on every user show/hide, placement switch and finished splitter+drag. App shutdown closes `MixerWindow` through the normal path, so the close handler+must skip writing `MixerShown = false` when `_shuttingDown` is set. Restore once, in the+main window's `Opened` (after the welcome-screen flow), because a floating window needs a+shown owner.++**Rationale**: per-user, not per-project (clarification); JSON settings already+round-trip new properties with defaults.++## R6 — Keys, palette, MIDI learn in the docked panel++**Decision**:+- Global keys need nothing new: the docked Mixer is inside `MainWindow`, whose tunnel+ handler already routes transport keys and whose `OnKeyDown` handles the rest.+- Escape: the docked Mixer adds no Escape handler (FR edge case); `MixerWindow` keeps+ Escape-to-close.+- Palette: `SnapshotContext` gets a branch "focus within `MixerPanel`" →+ `PaletteOrigin.Mixer`, mirroring the `MixerWindow` branch.+- MIDI learn: the main window's `LearnOverlay` covers its whole visual tree; the docked+ strips are learnable without wiring. Verify in quickstart.++## R7 — Commands and UI entry points++**Decision**:+- `view.mixer` (View → Mixer, ⌘⇧M / Ctrl+Shift+M) → `ToggleMixer()` in the remembered+ placement. Title "Show Mixer" unchanged.+- New command `view.mixerFloat` — "Mixer in its own window" (View menu, checkable;+ palette keywords "dock undock float pop out mixer window"), no shortcut. Switching+ while hidden only changes the preference; while shown it moves the Mixer.+- Docked panel toolbar (32 px, like `DetailPanel`'s): caption *Mixer* · Strips | Stereo+ map segments · spacer · pop-out (`Glyph Kind=PopOut`) · close (`Kind=Close`).+- `MixerWindow` title bar: add a dock button (same glyph family as the Devices window's+ dock affordance) on the right; it sets placement to docked and closes the window+ without hiding the Mixer.++**Rationale**: no new shortcut means no `nota-shortcuts` change beyond confirming the+list; the palette and menu cover keyboard users.diff --git a/specs/054-docked-mixer/spec.md b/specs/054-docked-mixer/spec.mdnew file mode 100644index 00000000..f0384007--- /dev/null+++ b/specs/054-docked-mixer/spec.md@@ -0,0 +1,263 @@+# Feature Specification: Docked Mixer++**Feature Branch**: `054-docked-mixer`++**Created**: 2026-10-30++**Status**: Draft++**Input**: User description: "Dock the Mixer inside Arrangement / Session / Modular, keep the pop-out window (GitHub issue nota-daw/nota#39). Today the Mixer only opens as a separate floating window (View → Mixer, ⌘⇧M). On a single screen that window covers the arrangement or has to be juggled; on a multi-monitor setup the pop-out is useful and should stay. Let the full Mixer (strips, Stereo map, pan law footer) dock as a panel inside the main window in Arrangement, Session and Modular views — e.g. a bottom panel that can be shown or hidden. Keep the current pop-out window as an option for people with a second monitor, with a way to switch between docked and floating. Session view's own I/O · Sends · Mixer grid sections are out of scope."++## 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++**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).++**Existing behaviour this builds on**: the Mixer (Strips | Stereo map views, pan law+footer) opens only as its own floating window from View → Mixer / ⌘⇧M; the strips/map+choice is remembered per user (specs/008). The main window already has a docked bottom+panel (Devices / Pattern / Clip) that can be popped out into its own window and docked+back — the docked Mixer should feel like a sibling of that pattern.++## Clarifications++### Session 2026-10-30++- Q: How should the docked Mixer coexist with the bottom Devices / Pattern / Clip panel? → A: Its own panel, stacked with it; either, both or neither can be shown (FR-004).+- Q: What should the docked Mixer do when the panel is shorter than a full strip needs? → A: Strips adapt to the height — lower-priority sections collapse, the core controls always stay (FR-014).+- Q: Should the Mixer come back shown after an app restart or when a project opens? → A: Yes, per user — shown/hidden, mode and height are restored from user settings, not the project (FR-009).+- Q: With both bottom panels shown, which sits directly under the main view? → A: The Mixer; the Devices / Clip panel goes under it, at the bottom of the window (FR-004).++## User Scenarios & Testing *(mandatory)*++### User Story 1 - Mix without leaving the main window (Priority: P1)++A producer on a single laptop screen is arranging a song and wants to balance levels. They+show the Mixer and it appears docked at the bottom of the main window, under the+arrangement, instead of a window that covers what they are working on. They adjust faders,+pans, mutes and sends while still seeing and editing the arrangement above. When done,+they hide the Mixer and the arrangement gets its space back.++**Why this priority**: This is the core request of the issue — on one screen the floating+window gets in the way. Delivering just this is already a viable improvement.++**Independent Test**: With a project open in Arrangement view, show the Mixer docked;+verify all strips, the Strips | Stereo map switch and the pan law footer are present and+working, the arrangement stays visible and editable above, and hiding the Mixer restores+the previous layout.++**Acceptance Scenarios**:++1. **Given** a project in Arrangement view with the Mixer hidden, **When** the user+ chooses View → Mixer (or presses ⌘⇧M) with the docked mode active, **Then** the full+ Mixer appears as a panel inside the main window and the arrangement remains visible and+ interactive.+2. **Given** the docked Mixer is shown, **When** the user moves a fader, pan, mute, solo,+ or send, **Then** the change takes effect exactly as in the floating Mixer (audible,+ undoable, MIDI-learnable) and meters keep moving.+3. **Given** the docked Mixer is shown, **When** the user switches between Strips and+ Stereo map, **Then** the docked panel shows the chosen view and the choice is+ remembered as today.+4. **Given** the docked Mixer is shown, **When** the user drags the boundary between the+ Mixer and the view above it, **Then** the Mixer resizes, within sensible minimum+ heights for both parts, and the height is remembered.+5. **Given** the docked Mixer is shown, **When** the user chooses View → Mixer / ⌘⇧M again+ or uses the panel's hide control, **Then** the Mixer hides and the view above reclaims+ the space.++---++### User Story 2 - Docked Mixer in every main view (Priority: P2)++A user switches between Arrangement, Session and Modular while mixing. The docked Mixer+stays in place under whichever view is active, so they do not have to reopen it.++**Why this priority**: The issue explicitly names all three views; switching views must+not lose the mixer, but the value of Story 1 exists even in Arrangement alone.++**Independent Test**: Show the docked Mixer, switch to Session and then to Modular;+verify the Mixer stays shown with the same view (Strips / Stereo map), height and scroll+position, and that each main view remains usable above it.++**Acceptance Scenarios**:++1. **Given** the docked Mixer is shown in Arrangement, **When** the user switches to+ Session or Modular, **Then** the Mixer remains docked and shown, with the same view+ and height.+2. **Given** the docked Mixer is shown in Session view, **When** the user looks at the+ Session grid, **Then** Session's own I/O · Sends · Mixer sections are unchanged and+ both stay in sync (a change in one is reflected in the other).++---++### User Story 3 - Switch between docked and floating (Priority: P2)++A user with a second monitor prefers the Mixer on the other screen. From the docked+Mixer they pop it out into the floating window and move that to the second monitor. Later+they dock it back into the main window. The app remembers which mode they used last.++**Why this priority**: The issue requires keeping the pop-out for multi-monitor users;+without a switch, docking would be a regression for them.++**Independent Test**: Pop the docked Mixer out, verify the floating window shows the+same Mixer and the docked panel disappears; dock it back from the window and verify the+reverse; restart the app and verify View → Mixer opens it in the last-used mode.++**Acceptance Scenarios**:++1. **Given** the docked Mixer is shown, **When** the user activates its pop-out control,+ **Then** the Mixer moves into the floating window (same state, meters live) and the+ docked panel is removed from the main window.+2. **Given** the floating Mixer window is open, **When** the user activates its dock+ control, **Then** the window closes and the Mixer appears docked in the main window.+3. **Given** the user last used the floating mode, **When** they later choose View →+ Mixer (also after restarting the app), **Then** the Mixer opens floating; likewise for+ docked.+4. **Given** the floating Mixer window is open, **When** the user closes it normally,+ **Then** the Mixer is hidden (not re-docked) and the floating mode stays the+ remembered mode.++---++### Edge Cases++- The main window is too short to fit both the view and the Mixer at their minimum+ heights: the Mixer is capped so the view above keeps its minimum height; a remembered+ height larger than fits is clamped, not discarded.+- The bottom Devices / Clip panel is also shown when the Mixer is docked: both stack+ (FR-004); if the window is too short for the main view, the Mixer and the Devices /+ Clip panel at their minimum heights, the panels shrink to their minimums first and the+ main view keeps its minimum height.+- The Devices / Clip panel is popped out into its own window while the Mixer is docked+ (or the other way round): each panel's docked/floating state is independent.+- The user drags the docked Mixer very low: strip sections collapse progressively+ (FR-014) and the drag stops at the height where the strip core still fits; dragging+ back up restores the sections, including any the user had expanded by hand.+- A project with many tracks: the docked Mixer scrolls horizontally like the floating+ one; it never forces the main window wider.+- A project is closed or another project is opened while the Mixer is docked: the panel+ stays shown and reflects the new project's tracks.+- Escape pressed while the docked Mixer has focus: it does not hide the docked Mixer (in+ the main window Escape keeps its existing meanings); in the floating window Escape still+ closes it as today.+- Transport keys (Space / Return) and other global shortcuts work while a control in the+ docked Mixer has focus, as they do in the floating window.+- The command palette opened while focus is in the docked Mixer behaves as it does from+ the main window.+- UI scale and colour theme changes apply to the docked Mixer live, as to the rest of the+ main window.++## Requirements *(mandatory)*++### Functional Requirements++- **FR-001**: The app MUST offer a docked Mixer: the full Mixer (all channel strips,+ returns and master, the Strips | Stereo map switch, the pan law footer) shown as a panel+ at the bottom of the main window.+- **FR-002**: The docked Mixer MUST be available in Arrangement, Session and Modular+ views, and its shown/hidden state, view (Strips / Stereo map) and height MUST carry over+ when the user switches between those views.+- **FR-003**: View → Mixer and its shortcut (⌘⇧M, Ctrl+Shift+M elsewhere) MUST toggle the+ Mixer in the current mode (docked or floating); the menu item and the command palette+ entry keep working in both modes.+- **FR-004**: The docked Mixer MUST be its own panel, independent of the existing bottom+ Devices / Pattern / Clip panel: either, both or neither can be shown. When both are+ shown they stack at the bottom of the main window — the Mixer directly under the main+ view, the Devices / Clip panel under the Mixer — each with its own draggable boundary+ and its own remembered height. Showing or hiding one MUST NOT change the other's+ visibility, tab, or (where space allows) height.+- **FR-005**: The user MUST be able to resize the docked Mixer by dragging its top+ boundary; the height MUST respect minimum heights for the Mixer and the view above and+ MUST be remembered across sessions.+- **FR-006**: The docked Mixer MUST provide a control to hide it and a control to pop it+ out into the floating window.+- **FR-007**: The floating Mixer window MUST keep its current behaviour (own window,+ movable to another monitor, Strips | Stereo map in its title bar, Escape closes it) and+ MUST gain a control to dock it back into the main window.+- **FR-008**: The Mixer MUST exist in only one place at a time; moving between docked and+ floating MUST keep its state (view, scroll position, meters running, MIDI-learn+ mappings, selection) without a visible rebuild delay.+- **FR-009**: The app MUST remember, per user and across restarts, the last-used mode+ (docked or floating), the docked height, and whether the Mixer was shown. On app start+ the Mixer is restored in that state (shown docked, shown floating, or hidden); opening+ another project does not change it. On first use after this change the default is+ docked and hidden.+- **FR-010**: Every mixer interaction available in the floating Mixer (faders, pan, mute,+ solo, arm, sends, routing, MIDI learn, context menus, typed value entry, undo) MUST work+ identically in the docked Mixer.+- **FR-011**: Global keys (transport, undo/redo, view switching, command palette) MUST+ keep working while focus is inside the docked Mixer.+- **FR-012**: Session view's own I/O · Sends · Mixer grid sections MUST remain unchanged+ and stay in sync with the docked Mixer.+- **FR-014**: Channel strips MUST adapt to the available height, in both docked and+ floating modes. The core of a strip — name, meter, fader, pan, mute / solo / arm — is+ always shown. As height shrinks, the other sections (I/O routing, sends, device+ slots, and any similar extra rows) collapse in a fixed priority order; a collapsed+ section stays reachable (e.g. by expanding it or through the strip's menu), and the+ sections come back as height grows. Below the height at which the core fits, the+ panel cannot be made smaller. The Stereo map and pan law footer scale to the height+ the same way and stay usable at the minimum height.+- **FR-013**: The docked panel MUST follow the Studio design language (docked panel on a+ seam, sentence-case labels, accent only for what is live or chosen), matching the+ existing bottom Devices / Clip panel.++### Key Entities++- **Mixer placement preference** (per user): last-used mode (docked / floating), docked+ height, shown / hidden, and — as today — the Strips / Stereo map view. Stored in the+ user's settings, not in the project file.++## Success Criteria *(mandatory)*++### Measurable Outcomes++- **SC-001**: On a single screen, a user can show the Mixer, adjust a track's level, and+ continue editing the arrangement without moving or closing any window — zero window+ management steps (previously at least one: move or close the floating window).+- **SC-002**: Switching between docked and floating takes one action each way and+ completes with no perceptible delay (under 0.2 s), with meters running throughout.+- **SC-003**: Switching between Arrangement, Session and Modular with the docked Mixer+ shown preserves its view and height in 100% of switches.+- **SC-004**: After an app restart, the Mixer comes back shown or hidden, docked or+ floating, at the height last used, in 100% of cases.+- **SC-005**: All mixer interactions covered by the floating Mixer pass the same manual+ checks in the docked Mixer (no feature missing in either mode).+- **SC-006**: Audio performance is unchanged: showing the docked Mixer adds no audio+ dropouts compared with showing the floating one.++## Assumptions++- The Mixer content itself (strips, Stereo map, footer) is reused — the same controls+ and behaviour in both modes; the only change inside it is the height-adaptive strip+ layout (FR-014).+- The shortcut is ⌘⇧M (the issue text says ⌘M; the app binds ⌘⇧M today) — no new+ shortcut is added; pop-out / dock are reachable from controls on the panel/window and+ from the command palette.+- Default mode for existing and new users is docked, since that is what the issue asks+ for; multi-monitor users switch once and the choice is remembered.+- Shown/hidden is one state for the whole main window, not separate per view.+- No engine or C ABI change is required; this is a presentation-layer change.+- Out of scope: Session view's I/O · Sends · Mixer grid sections, docking the Mixer to+ left/right sides, multiple Mixer instances, tabbing the Mixer into other windows.++## 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) — UI-only re-hosting, no engine change+- [x] Managed/native crossings go through the pure C ABI in `nota_engine.h` only (AR-7); no JUCE outside `pluginhost/` — no new crossings+- [x] Smoke-test impact assessed: engine behaviour change → extend `tests/Nota.SmokeTest` — no engine behaviour change+- [ ] 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/054-docked-mixer/tasks.md b/specs/054-docked-mixer/tasks.mdnew file mode 100644index 00000000..bf449a97--- /dev/null+++ b/specs/054-docked-mixer/tasks.md@@ -0,0 +1,197 @@+---++description: "Task list for the Docked Mixer"+---++# Tasks: Docked Mixer++**Input**: Design documents from `/specs/054-docked-mixer/`++**Prerequisites**: [plan.md](plan.md), [spec.md](spec.md), [research.md](research.md),+[data-model.md](data-model.md), [contracts/ui-commands.md](contracts/ui-commands.md),+[quickstart.md](quickstart.md)++**Tests**: No automated test tasks — the spec does not ask for them and the managed UI has+no unit-test project. Each story is validated with the matching+[quickstart.md](quickstart.md) scenarios (headless Avalonia harness + screenshots when the+GUI can't be launched); `scripts/build.sh` is the PR gate.++**Organization**: Tasks are grouped by user story so each story can be built and checked+on its own.++## Format: `[ID] [P?] [Story] Description`++- **[P]**: Can run in parallel (different files, no dependencies)+- **[Story]**: Which user story this task belongs to (US1, US2, US3)++All paths are relative to the repository root. `App/` below means+`src/managed/Nota.App/`.++---++## Phase 1: Setup (Shared Infrastructure)++**Purpose**: Persisted preference fields and the new command id, used by every story.++- [X] T001 [P] Add `MixerFloating` (bool, default `false` → docked), `MixerShown` (bool, default `false`) and `MixerDockHeight` (double, default `0` = natural height) next to `MixerView` in `src/managed/Nota.Application/Settings.cs`, each with a `<summary>` in the file's style; data-model rule: "Unknown / missing fields in an older `settings.json` take the defaults (docked, hidden)"+- [X] T002 [P] Add `C("view.mixerFloat", "Mixer in its own window", "View", "", "dock undock float pop out mixer window")` after `view.mixer` in `src/managed/Nota.Application/Palette/CommandCatalog.cs`++---++## Phase 2: Foundational (Blocking Prerequisites)++**Purpose**: Height-adaptive strips (FR-014 — needed for any docked height and also+improves the floating window) and the `BodyGrid` refactor that makes room for a second+bottom panel.++**⚠️ CRITICAL**: The docked panel (US1) depends on both parts.++### Height-adaptive `MixerView` (research R4)++- [X] T003 In `App/MixerView.cs` make the fader height variable: replace the fixed `Height = 190` grid in `FaderRow` with a height driven by a field (default 190, minimum ≈ 72), keep a list of the fader rows/meters so a height change only sets `Height` on existing controls (no `Refresh()` rebuild); the master strip follows the same height+- [X] T004 In `App/MixerView.cs` add tier selection: on `_main.SizeChanged` (and after `Refresh()` / `ApplyView()`), compute the strip-area height and pick, in order, Full → hide I/O rows → hide sends rows → shrink the fader toward its minimum; effective visibility of a section = user toggle on AND (fits OR pinned); only toggle `IsVisible` on the existing `_ioSections` / `_sendSections`+- [X] T005 In `App/MixerView.cs` expose `public double MinContentHeight` (header + pan + fader at minimum + dB + M/S/Arm + footer + row margins, measured from the built controls, not hard-coded) and an event `MinContentHeightChanged` raised when it changes (strip rebuild, UI scale)+- [X] T006 In `App/MixerView.cs` give the footer `Sends` / `I/O` toggles the auto-hidden state from contracts/ui-commands.md: muted paint + tooltip "Hidden: not enough height · click to show anyway"; click while auto-hidden → pinned visible and `_stripsScroller.VerticalScrollBarVisibility = Auto`; click again → off; turn vertical scrolling back off when no section is pinned+- [X] T007 In `App/MixerWindow.cs` set `MinHeight` from the hosted `MixerView.MinContentHeight` + title bar (`BarH`), scaled by `NotaUiScale`, and update it on `MinContentHeightChanged`; check the Stereo map (`App/StereoMapView.cs`) at that height and give it a `MinHeight` that fits if it clips (research R4)++### `BodyGrid` refactor (research R2, R3)++- [X] T008 In `App/MainWindow.Detail.cs` add `LayoutBottomPanels()` that rebuilds `BodyGrid.RowDefinitions` and the `Grid.Row` of `BrowserGrid`, `DetailSplitter`, `DetailPanel` for the visible set `[main * (MinHeight 120)] [mixer splitter, mixer]? [detail splitter, detail]?`, plus `DetailRow` (current detail `RowDefinition`) accessor; with the Mixer absent the result must equal today's three-row layout+- [X] T009 Replace every `BodyGrid.RowDefinitions[2]` use with `DetailRow` and route show/hide through `LayoutBottomPanels()` in `App/MainWindow.Detail.cs` (`ShowDetail`, the hide at ~line 896), `App/MainWindow.DetailWindow.cs` (`OnToggleDetailWindow`) and `App/MainWindow.axaml.cs` (`DetailSplitter.DragCompleted` — keep storing the row's `ActualHeight`, the #53 rule)+- [X] T010 Add `FitBottomPanels()` in `App/MainWindow.Detail.cs`, called on `BodyGrid.SizeChanged` and after `LayoutBottomPanels()`: keep the main view ≥ 120, shrink the Mixer row toward its minimum first (its strips adapt; device cards have a fixed height), then the Devices row; never write remembered heights from a clamp+- [X] T011 Regression pass of the Devices / Pattern / Clip panel with the Mixer hidden: open Devices, switch to Clip, drag the splitter, re-select clips (no #53 shrink), Tab cycling, pop out to `DetailWindow` and dock back — behaviour identical to `develop`++**Checkpoint**: The floating Mixer adapts to its height; the bottom panel works as before+on the new row builder.++---++## Phase 3: User Story 1 — Mix without leaving the main window (Priority: P1) 🎯 MVP++**Goal**: View → Mixer / ⌘⇧M shows the full Mixer docked under the main view; it+resizes, remembers its height, and hides again.++**Independent Test**: quickstart scenarios 1–8 and 14–17 in Arrangement view.++- [X] T012 [US1] In `App/MainWindow.axaml` add `MixerSplitter` (6 px transparent `GridSplitter` over the seam, like `DetailSplitter`) and `MixerPanel` (`Border` docked on a seam, `Radius.Docked`, same look as `DetailPanel`) inside `BodyGrid`; toolbar 32 px with `Mixer` caption, `Strips | Stereo map` segments, spacer, pop-out (`Glyph Kind=PopOut`, tooltip "Open the mixer in a window") and close (`Kind=Close`, tooltip "Hide the mixer") buttons; body `ContentControl x:Name="MixerHost"`; follow `DESIGN.md` / `nota-design`+- [X] T013 [US1] Extend `LayoutBottomPanels()` in `App/MainWindow.Detail.cs` with the Mixer rows (Mixer directly under the main view, Devices under it — FR-004), `MixerRow` accessor, row `MinHeight` = toolbar + `MixerView.MinContentHeight` (scaled), height = `MixerDockHeight` clamped, or the natural full-strip height when `0`+- [X] T014 [US1] Rewrite `App/MainWindow.Mixer.cs` as the placement controller (research R1): `ShowMixer()`, `HideMixer()`, `ToggleMixer()` (bound to `view.mixer`), `IsMixerShown`; docked path = `SetHost(MixerHost, _mixer)`, `_mixer.IsVisible = true`, `_mixer.Refresh()`, `LayoutBottomPanels()`; hide path detaches via `SetHost(MixerHost, null)`, sets `IsVisible = false`; keep the existing floating code path working for `MixerFloating == true`; update the file header comment+- [X] T015 [US1] Wire the panel toolbar in `App/MainWindow.Mixer.cs`: segments ↔ `_mixer.View` + `settings.Current.MixerView` (same as `MixerWindow.ViewPicked`), close button → `HideMixer()`; keep the segments in sync when the view changes elsewhere+- [X] T016 [US1] In `App/MainWindow.Commands.cs` bind `view.mixer` to `ToggleMixer()` (replacing `ToggleMixerWindow`); `App/MainWindow.Input.cs` ⌘⇧M keeps running `view.mixer` — fix its comment+- [X] T017 [US1] Persist in `App/MainWindow.Mixer.cs` / `App/MainWindow.axaml.cs`: `MixerSplitter.DragCompleted` stores `MixerRow.ActualHeight` (design units) to `MixerDockHeight`; every user show/hide writes `MixerShown`; `settings.Save()` after each+- [X] T018 [US1] Restore on start in `App/MainWindow.axaml.cs` `Opened` (after the welcome / recovery flow): if `MixerShown` and not `MixerFloating`, `ShowMixer()` docked+- [X] T019 [US1] In `App/MainWindow.Palette.cs` `SnapshotContext`: focus within `MixerPanel` → `PaletteOrigin.Mixer`, track = `Timeline.SelectedTrackId` (mirror the `MixerWindow` branch); palette stays in `PaletteLayer`+- [X] T020 [US1] Verify in the docked panel (quickstart 14–17): Space / Return / ⌘Z work with a fader focused, Escape does not hide the docked Mixer, MIDI learn via the main `LearnOverlay` maps a docked fader (wire `LearnOverlay.Refresh()` on show if highlights don't appear), UI scale 125% and Studio Light restyle live; fix what fails in `App/MainWindow.Mixer.cs`++**Checkpoint**: The docked Mixer works in Arrangement — MVP.++---++## Phase 4: User Story 2 — Docked Mixer in every main view (Priority: P2)++**Goal**: The docked Mixer stays shown with the same view and height across Arrangement,+Session and Modular; Session's own sections are untouched and in sync.++**Independent Test**: quickstart scenario 9.++- [X] T021 [US2] Check the view switches (`OnShowSession`, `OnShowModular`, arrangement) in `App/MainWindow*.cs` for code that hides bottom panels or resets `BodyGrid` rows; make them leave `MixerPanel`, `MixerRow` height and `_mixer.View` alone, and call `LayoutBottomPanels()` if they change the Devices panel+- [X] T022 [US2] With the Mixer docked in Session, change volume / pan / sends in `App/SessionView.Mixer.cs` sections and in the docked strips; confirm each side follows the other (both read the engine on the UI tick); fix any missing refresh in `App/MainWindow.axaml.cs` tick (`_mixer.UpdateMeters()`)++**Checkpoint**: US1 + US2 work together.++---++## Phase 5: User Story 3 — Switch between docked and floating (Priority: P2)++**Goal**: Pop out from the panel, dock back from the window, toggle from View menu /+palette; last placement and shown state survive a restart.++**Independent Test**: quickstart scenarios 10–13 and 18.++- [X] T023 [US3] In `App/MixerWindow.cs` add a dock button at the right of the title bar (tooltip "Dock the mixer in the main window") and `public event Action? DockRequested`; clicking raises it and closes the window; plain close / Escape stays "hide"+- [X] T024 [US3] In `App/MainWindow.Mixer.cs` add `SetMixerFloating(bool)` (research R7): writes `MixerFloating`; if shown, moves the Mixer — docked → `SetHost(MixerHost, null)`, hide the panel rows, open `MixerWindow` with the existing setup (view, `FitWidth`, MIDI learn, `StripsChanged`); floating → close the window without recording hidden, then `ShowMixer()` docked; panel pop-out button and `DockRequested` call it+- [X] T025 [US3] In `App/MainWindow.Commands.cs` bind `view.mixerFloat` to `SetMixerFloating(!MixerFloating)`; in `App/MainWindow.axaml` add View → "Mixer in its own window" (`app:Commands.Id="view.mixerFloat"`, checkable) after "Mixer", and keep its check state in sync from `App/MainWindow.Mixer.cs`+- [X] T026 [US3] Floating persistence in `App/MainWindow.Mixer.cs`: user close of the window writes `MixerShown = false`, but not when `_shuttingDown` is set (`App/MainWindow.DetailWindow.cs` sets it) or when the close comes from a dock / float switch; restore in `App/MainWindow.axaml.cs` `Opened`: `MixerShown && MixerFloating` → open the window after the main window is shown++**Checkpoint**: All stories work; quickstart 1–18 pass.++---++## Phase 6: Polish & Cross-Cutting Concerns++- [X] T027 [P] Fix stale comments: `App/MixerView.cs` header ("a third Detail mode"), `App/MainWindow.axaml` Detail panel comment ("… / Mixer for the selected track"), the `_mixer` creation comment in `App/MainWindow.axaml.cs`+- [X] T028 Run all [quickstart.md](quickstart.md) scenarios (headless harness with `NOTA_DATA_DIR=/tmp/dockmixer/data` where the GUI can't launch); capture docked / floating / both-panels / low-height screenshots for the PR++### Nota closing tasks *(always include — these are the PR gates)*++- [X] T029 Run `scripts/build.sh` until native + managed + smoke test are green+- [X] T030 AGPL-3.0-only SPDX two-line header on every new source file — N/A unless a new file is added (plan adds none)+- [X] T031 New dependency — N/A+- [X] T032 `CHANGELOG.md` `[Unreleased]` → Added: the Mixer docks in the main window (Arrangement, Session, Modular) and can pop out / dock back; strips adapt to the height+- [X] T033 FEATURES.md via `nota-features`; Mixer page EN + RU in `../nota-docs` with new screenshots via `nota-docs`; `nota-shortcuts`: confirm ⌘⇧M entry text still fits (no new binding)+- [X] T034 Engine behaviour change → smoke test — N/A (UI-only)++---++## Dependencies & Execution Order++### Phase Dependencies++- **Setup (T001–T002)**: none.+- **Foundational (T003–T011)**: T003 → T004 → T005 → T006/T007; T008 → T009 → T010 → T011. The two tracks are independent of each other.+- **US1 (T012–T020)**: needs T001, T005, T008–T010.+- **US2 (T021–T022)**: needs US1 (there is nothing docked to keep otherwise).+- **US3 (T023–T026)**: needs US1 docked path and T002; T023 can start any time after T007.+- **Polish (T027–T034)**: after the stories.++### Within stories++- US1: T012 → T013 → T014 → T015–T019 → T020.+- US3: T023 → T024 → T025, T026.++### Parallel Opportunities++- T001 ∥ T002.+- MixerView track (T003–T007) ∥ BodyGrid track (T008–T011) — different files.+- T023 (`MixerWindow.cs`) ∥ US1 tasks in `MainWindow.*`.+- T027 ∥ T028.++## Parallel Example++```text+Track A: T003 → T004 → T005 → T006 → T007 (App/MixerView.cs, App/MixerWindow.cs)+Track B: T008 → T009 → T010 → T011 (App/MainWindow.Detail.cs, DetailWindow.cs, axaml.cs)+```++## Implementation Strategy++### MVP First (User Story 1)++1. Setup + Foundational (the floating Mixer already gains adaptive strips).+2. US1 → validate quickstart 1–8, 14–17 → the docked Mixer is usable.++### Incremental Delivery++1. + US2 → view switching verified.+2. + US3 → pop-out / dock, restart restore.+3. Polish, docs, `scripts/build.sh`, PR with screenshots (`nota-pr`).++## Notes++- One `MixerView` instance throughout; always move it with `SetHost`, never assign `Content` directly (#164).+- Only a finished splitter drag writes a height; clamps never do.++## Phase 7: Convergence++- [X] T035 Re-run `scripts/build.sh` on an idle machine (Rider closed) until native + managed + smoke test are green; if the render-pool `overloaded` checks still fail, investigate before the PR per Constitution IV (partial)+- [X] T036 [US2] Make Session's own mixer sections follow the engine on the UI tick — volume (`MiniFader` + dB read-out), pan (`PanBar`) and M / S / Arm toggles in `src/managed/Nota.App/SessionView.Mixer.cs`, skipping a control being dragged — so changes made in the docked Mixer show there per FR-012, US2/AC2 (partial)+- [X] T037 In `src/managed/Nota.App/MixerView.cs` include the Stereo map layout's grid margins (8 + 8) in `MinContentHeight` while `View == StereoMap`, and raise `MinContentHeightChanged` when the view changes, so M / S / Arm stay visible at the minimum docked / window height per FR-014, T007 (partial)++## Phase 8: PR review (nota-daw/nota#388)++- [X] T038 Order the Mixer strips like the arrangement — tracks in their order, then returns, then the master — in `src/managed/Nota.App/MixerView.cs` `Refresh()` (maintainer comment)+- [X] T039 With the Mixer docked, resize the Detail panel from its own edge (`DetailEdge` in `src/managed/Nota.App/MainWindow.axaml`, handlers in `MainWindow.Detail.cs`) so dragging it changes the Detail panel alone, not the Mixer; `DetailSplitter` stops being hit-testable then, and its drag no longer writes the Mixer height per FR-004 (review: "Clip resize changes the Mixer")+- [X] T040 Update Session's `_armed` from the per-tick track snapshot before the cells tick, so arming in the docked Mixer makes an empty slot record, in `src/managed/Nota.App/SessionView.Mixer.cs` (review: "Armed slots do not record")+- [X] T041 Keep the Detail panel's wanted height (`_detailWanted`) and restore it in `FitBottomPanels` when the window grows (review: "Detail stays too short")+- [X] T042 Refit the bottom panels whenever the Detail panel's visibility changes (close, pop-out, View ▸ Toggle detail panel), and collapse / restore its row with it so a hidden panel leaves no empty band (review: "Mixer leaves freed space unused"; the empty band after View ▸ Toggle detail panel predates this feature)+diff --git a/src/managed/Nota.App/Controls/Glyph.cs b/src/managed/Nota.App/Controls/Glyph.csindex e82f9f5e..ae865b2c 100644--- a/src/managed/Nota.App/Controls/Glyph.cs+++ b/src/managed/Nota.App/Controls/Glyph.cs@@ -37,6 +37,7 @@ internal enum GlyphKind// Path kinds (16-unit grid, see Paths)Arrangement, Session, Modular, Keyboard, Sliders, Downloads, Star, StarFilled, Bookmark, Doc, Midi, Map, History, Sidebar, Options, Search, CaretRight, CaretDown, Levels, Gamepad, Phone, Plug, Library, Appearance, Shortcuts, MidiPort, Action, Track, Device, Preset, Patch, Loop, Speaker, SpeakerMute, SpeakerLow, SpeakerHigh, Metronome, Follow, Snap, Automation, Apple, Windows, Linux, ChainLink, Update,Lock, LockOpen, // a reference (read-only) clip in the multi-clip editor, and the unlocked toggle+ DockIn, // PopOut's opposite: bring a floating window back into the main one}internal sealed class Glyph : Control@@ -227,6 +228,15 @@ internal sealed class Glyph : Controlctx.DrawLine(pen, new Point(cx + d, cy - d), new Point(cx + d * 0.1, cy - d * 0.1));break;}+ case GlyphKind.DockIn:+ {+ // PopOut's frame with the arrow turned around: it points into the frame.+ double d = s * 0.36;+ ctx.DrawRectangle(null, pen, new RoundedRect(new Rect(cx - d, cy - d * 0.6, d * 1.4, d * 1.6), 1));+ Stroke(ctx, pen, new Point(cx + d * 0.1, cy - d * 0.75), new Point(cx + d * 0.1, cy - d * 0.1), new Point(cx + d * 0.75, cy - d * 0.1));+ ctx.DrawLine(pen, new Point(cx + d, cy - d), new Point(cx + d * 0.1, cy - d * 0.1));+ break;+ }case GlyphKind.Cycle:{double rr = s * 0.34;diff --git a/src/managed/Nota.App/Controls/PanKnob.cs b/src/managed/Nota.App/Controls/PanKnob.csindex e4022329..80550f1e 100644--- a/src/managed/Nota.App/Controls/PanKnob.cs+++ b/src/managed/Nota.App/Controls/PanKnob.cs@@ -25,6 +25,11 @@ internal sealed class PanKnob : Controlpublic PanKnob(double pan) { _pan = Math.Clamp(pan, -1, 1); Width = 26; Height = 26; }+ /// <summary>The pan (−1..1) and whether a drag is under way — so an external sync+ /// can follow the engine without fighting the user's hand.</summary>+ public double Pan => _pan;+ public bool Dragging => _drag;+/// <summary>The knob as a typeable value; <paramref name="fmt"/> is its read-out at a pan/// (−1..1). Double-click centres it.</summary>internal ValueField EntryField(string name, Func<double, string> fmt)diff --git a/src/managed/Nota.App/MainWindow.Commands.cs b/src/managed/Nota.App/MainWindow.Commands.csindex 1d0a16a2..a3e1105c 100644--- a/src/managed/Nota.App/MainWindow.Commands.cs+++ b/src/managed/Nota.App/MainWindow.Commands.cs@@ -68,7 +68,8 @@ public partial class MainWindowB("view.arrangement", () => SetView(MainView.Arrangement));B("view.session", () => SetView(MainView.Session));B("view.modular", () => SetView(MainView.Modular));- B("view.mixer", ToggleMixerWindow);+ B("view.mixer", ToggleMixer);+ B("view.mixerFloat", () => SetMixerFloating(!MixerFloating));B("view.connectPhone", ShowConnectPhone);B("view.toggleBrowser", () => OnMenuToggleBrowser(this, e));B("view.toggleDetail", () => OnMenuToggleClip(this, e));diff --git a/src/managed/Nota.App/MainWindow.Detail.cs b/src/managed/Nota.App/MainWindow.Detail.csindex 3371f634..19eb040a 100644--- a/src/managed/Nota.App/MainWindow.Detail.cs+++ b/src/managed/Nota.App/MainWindow.Detail.cs@@ -132,12 +132,14 @@ public partial class MainWindow// and less clips them.private void ShowDetail(double height, bool honorPersist, bool resizable = true){- var row = BodyGrid.RowDefinitions[2];+ var row = _detailRow;row.MinHeight = 120;double h = honorPersist && _detailHeight > 120 ? _detailHeight : height;row.Height = new GridLength(h);DetailSplitter.IsVisible = resizable;DetailPanel.IsVisible = true;+ _detailWanted = h;+ FitBottomPanels(); // under a docked Mixer in a short window it may not fit as asked}private void OnTrackSelected(int trackId)@@ -891,11 +893,170 @@ public partial class MainWindowprivate void OnCloseDetail(object? sender, RoutedEventArgs e) => CloseDetail();+ // --- bottom panels: docked Mixer over Detail (specs/054) ----------------------------------+ //+ // BodyGrid is [main *] [mixer splitter, mixer]? [detail splitter, detail]. The Mixer rows+ // are only in the grid while it is docked, so each splitter always has the right neighbour+ // above it: the Mixer's trades with the main view, the Detail one with the Mixer when it's+ // there and the main view otherwise. The row objects persist; the Detail rows are the+ // ones declared in XAML, so everything that sizes them keeps working unchanged.++ private RowDefinition _mainRow = null!, _detailSplitRow = null!, _detailRow = null!;+ private readonly RowDefinition _mixerSplitRow = new(GridLength.Auto);+ private readonly RowDefinition _mixerRow = new(new GridLength(0));+ private bool _mixerDocked; // the Mixer is shown in MixerPanel+ private double _mixerWanted; // its height before fitting into the window+ private double _detailWanted; // the Detail panel's, likewise+ private double _edgeStartY, _edgeStartH; // a DetailEdge drag in progress++ private void InitBottomPanels()+ {+ var rows = BodyGrid.RowDefinitions;+ _mainRow = rows[0];+ _detailSplitRow = rows[1];+ _detailRow = rows[2];+ LayoutBottomPanels();+ BodyGrid.SizeChanged += (_, e) => { if (e.HeightChanged) FitBottomPanels(); };+ MixerSplitter.DragCompleted += (_, _) => OnMixerHeightDragged();+ DetailSplitter.DragCompleted += (_, _) => { if (!_mixerDocked) _detailWanted = _detailRow.ActualHeight; };+ // However the Detail panel is hidden or shown (close, pop-out, a tab, a menu), the+ // Mixer takes back or gives up the room; and the edge follows the splitter.+ DetailPanel.PropertyChanged += (_, e) =>+ {+ if (e.Property != IsVisibleProperty) return;+ FollowDetailVisibility(DetailPanel.IsVisible);+ SyncDetailEdge();+ Dispatcher.UIThread.Post(FitBottomPanels);+ };+ DetailSplitter.PropertyChanged += (_, e) => { if (e.Property == IsVisibleProperty) SyncDetailEdge(); };+ DetailEdge.PointerPressed += OnDetailEdgePressed;+ DetailEdge.PointerMoved += OnDetailEdgeMoved;+ DetailEdge.PointerReleased += OnDetailEdgeReleased;+ }++ // Some paths only flip the panel's visibility (View ▸ Toggle detail panel, a closed clip):+ // the row follows, so a hidden panel leaves no empty band (under the Mixer either), and+ // showing it again brings back its height and splitter.+ private bool _detailSplitterWasVisible;+ private void FollowDetailVisibility(bool shown)+ {+ if (!shown)+ {+ if (Height(_detailRow) <= 0) return;+ _detailSplitterWasVisible = DetailSplitter.IsVisible;+ DetailSplitter.IsVisible = false;+ _detailRow.MinHeight = 0;+ _detailRow.Height = new GridLength(0);+ return;+ }+ if (Height(_detailRow) > 0) return; // ShowDetail sized it already+ _detailRow.MinHeight = 120;+ _detailRow.Height = new GridLength(_detailWanted > 120 ? _detailWanted : 240);+ DetailSplitter.IsVisible = _detailSplitterWasVisible;+ }++ private static double Height(RowDefinition r) => r.Height.IsAbsolute ? r.Height.Value : r.ActualHeight;++ // The Detail panel's top edge while the Mixer is docked above it: only the Detail panel+ // changes height, taking room from the main view down to its minimum; the Mixer keeps its.+ private void SyncDetailEdge()+ {+ DetailEdge.IsVisible = _mixerDocked && DetailSplitter.IsVisible && DetailPanel.IsVisible;+ DetailSplitter.IsHitTestVisible = !_mixerDocked;+ }++ private void OnDetailEdgePressed(object? sender, PointerPressedEventArgs e)+ {+ if (!e.GetCurrentPoint(DetailEdge).Properties.IsLeftButtonPressed) return;+ _edgeStartY = e.GetPosition(BodyGrid).Y;+ _edgeStartH = _detailRow.ActualHeight;+ e.Pointer.Capture(DetailEdge);+ e.Handled = true;+ }++ private void OnDetailEdgeMoved(object? sender, PointerEventArgs e)+ {+ if (!ReferenceEquals(e.Pointer.Captured, DetailEdge)) return;+ double max = BodyGrid.Bounds.Height - _mainRow.MinHeight - _mixerRow.ActualHeight;+ double h = Math.Clamp(_edgeStartH - (e.GetPosition(BodyGrid).Y - _edgeStartY), _detailRow.MinHeight, Math.Max(_detailRow.MinHeight, max));+ _detailRow.Height = new GridLength(Math.Round(h));+ e.Handled = true;+ }++ private void OnDetailEdgeReleased(object? sender, PointerReleasedEventArgs e)+ {+ if (!ReferenceEquals(e.Pointer.Captured, DetailEdge)) return;+ e.Pointer.Capture(null);+ e.Handled = true;+ double h = _detailRow.Height.IsAbsolute ? _detailRow.Height.Value : _detailRow.ActualHeight;+ _detailWanted = h;+ // As the splitter's drag does: only the Clip tab remembers its height (#53).+ bool clipActive = DetailBody.Content is ClipEditorView or AudioClipEditorView or DrumPatternView;+ if (clipActive && h > 120) _detailHeight = h;+ }++ private void LayoutBottomPanels()+ {+ var rows = BodyGrid.RowDefinitions;+ rows.Clear();+ rows.Add(_mainRow);+ int detail = 1;+ if (_mixerDocked)+ {+ rows.Add(_mixerSplitRow);+ rows.Add(_mixerRow);+ Grid.SetRow(MixerSplitter, 1);+ Grid.SetRow(MixerPanel, 2);+ detail = 3;+ }+ else+ {+ _mixerRow.MinHeight = 0;+ _mixerRow.Height = new GridLength(0);+ }+ rows.Add(_detailSplitRow);+ rows.Add(_detailRow);+ Grid.SetRow(DetailSplitter, detail);+ Grid.SetRow(DetailPanel, detail + 1);+ Grid.SetRow(DetailEdge, detail);+ MixerSplitter.IsVisible = _mixerDocked;+ MixerPanel.IsVisible = _mixerDocked;+ SyncDetailEdge();+ FitBottomPanels();+ }++ // Keep the main view at its minimum height: when the window is too short for both bottom+ // panels, the Mixer gives way first (its strips fit any height down to their core), then+ // the Detail panel (device cards have a fixed height, so it clips), each down to its+ // minimum. The Mixer grows back toward the height the user chose; a fit never changes it.+ private void FitBottomPanels()+ {+ double total = BodyGrid.Bounds.Height;+ double mixer = _mixerDocked ? Math.Max(_mixerWanted, _mixerRow.MinHeight) : 0;+ if (total > 0)+ {+ double room = total - _mainRow.MinHeight;+ double detail = !DetailPanel.IsVisible ? 0 : _detailWanted > 0 ? Math.Max(_detailWanted, _detailRow.MinHeight) : Height(_detailRow);+ double over = mixer + detail - room;+ if (over > 0 && mixer > 0)+ {+ double cut = Math.Min(over, Math.Max(0, mixer - _mixerRow.MinHeight));+ mixer -= cut;+ over -= cut;+ }+ if (over > 0 && detail > 0) detail -= Math.Min(over, Math.Max(0, detail - _detailRow.MinHeight));+ // The Detail panel shrinks with the window and grows back to what it was asked for.+ if (detail > 0 && Math.Abs(Height(_detailRow) - detail) >= 0.5) _detailRow.Height = new GridLength(Math.Round(detail));+ }+ if (_mixerDocked) _mixerRow.Height = new GridLength(Math.Round(mixer));++ }+private void CloseDetail(){DetailPanel.IsVisible = false;DetailSplitter.IsVisible = false;- var row = BodyGrid.RowDefinitions[2];+ var row = _detailRow;row.MinHeight = 0;row.Height = new GridLength(0);}diff --git a/src/managed/Nota.App/MainWindow.DetailWindow.cs b/src/managed/Nota.App/MainWindow.DetailWindow.csindex 5bbceebb..e55e58b0 100644--- a/src/managed/Nota.App/MainWindow.DetailWindow.cs+++ b/src/managed/Nota.App/MainWindow.DetailWindow.cs@@ -73,7 +73,7 @@ public partial class MainWindow// Hide the docked panel — state is preserved, it just lives in the window now.DetailPanel.IsVisible = false;DetailSplitter.IsVisible = false;- var row = BodyGrid.RowDefinitions[2];+ var row = _detailRow;row.MinHeight = 0;row.Height = new GridLength(0);diff --git a/src/managed/Nota.App/MainWindow.Input.cs b/src/managed/Nota.App/MainWindow.Input.csindex 5be046c2..5aaec322 100644--- a/src/managed/Nota.App/MainWindow.Input.cs+++ b/src/managed/Nota.App/MainWindow.Input.cs@@ -222,7 +222,7 @@ public partial class MainWindowreturn;}- // ⌘⇧M / ⌃⇧M = open the Mixer window (or focus it if already open).+ // ⌘⇧M / ⌃⇧M = show or hide the Mixer, docked or in its window (specs/054).if (mod && e.Key == Key.M && (e.KeyModifiers & KeyModifiers.Shift) != 0 && (e.KeyModifiers & KeyModifiers.Alt) == 0){_commands.Run("view.mixer");diff --git a/src/managed/Nota.App/MainWindow.Mixer.cs b/src/managed/Nota.App/MainWindow.Mixer.csindex b4e59871..947fa61f 100644--- a/src/managed/Nota.App/MainWindow.Mixer.cs+++ b/src/managed/Nota.App/MainWindow.Mixer.cs@@ -1,10 +1,19 @@// SPDX-License-Identifier: AGPL-3.0-only// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.//-// The Mixer lives in its own window (View → Mixer / ⌘⇧M) rather than as a main-view tab.-// The single MixerView instance is hosted in the window while it's open and detached on close.+// Where the Mixer lives (specs/054): docked as its own bottom panel in the main window (under+// the main view, above the Detail panel), or in its own window for a second screen. The+// single MixerView instance is moved between MixerHost and the window (reparented, not+// rebuilt), so meters, scroll and the Stereo Map carry over. View → Mixer / ⌘⇧M shows or hides+// it in the remembered placement; the panel's pop-out button, the window's dock button and+// View → Mixer in its own window switch placement. Shown / placement / docked height are+// per-user settings, restored on launch.using System;+using Avalonia.Controls;+using Avalonia.Controls.ApplicationLifetimes;+using Avalonia.Interactivity;+using Avalonia.Threading;using Microsoft.Extensions.DependencyInjection;using Nota.Application;@@ -13,36 +22,203 @@ namespace Nota.App;public partial class MainWindow{private MixerWindow? _mixerWindow;+ // Closing the window to move the Mixer into the panel — not the user hiding it.+ private bool _mixerSwitching;+ // The app is quitting: windows closing now must not record the Mixer as hidden.+ private bool _quitRequested;- private void OnMenuMixer(object? sender, EventArgs e) => ToggleMixerWindow();+ // The docked panel's toolbar (32) + its 1px seam margin, around the MixerView.+ private const double MixerPanelChrome = 33;- /// <summary>Open the Mixer window, or close it if it's already open (⌘⇧M / View → Mixer).</summary>- internal void ToggleMixerWindow()+ private static ISettingsService MixerSettings => App.Services.GetRequiredService<ISettingsService>();+ private static bool MixerFloating => MixerSettings.Current.MixerFloating;+ internal bool IsMixerShown => _mixerDocked || _mixerWindow is not null;++ private double MixerPanelMin => MixerPanelChrome + (_mixer?.MinContentHeight ?? 0);+ private double MixerPanelNatural => MixerPanelChrome + (_mixer?.NaturalContentHeight ?? 0);++ private void OnMenuMixer(object? sender, EventArgs e) => ToggleMixer();++ /// <summary>Show the Mixer in its remembered placement, or hide it (⌘⇧M / View → Mixer).</summary>+ internal void ToggleMixer()+ {+ if (IsMixerShown) HideMixer();+ else ShowMixer();+ }++ internal void ShowMixer()+ {+ if (_mixer is null || IsMixerShown) return;+ if (MixerFloating) OpenMixerWindow();+ else DockMixer();+ RememberMixerShown(true);+ }++ internal void HideMixer()+ {+ if (_mixerWindow is not null) { _mixerWindow.Close(); return; } // its close records it+ if (!_mixerDocked) return;+ UndockMixer();+ RememberMixerShown(false);+ }++ /// <summary>Docked ↔ own window. Moves a shown Mixer; a hidden one only changes where it+ /// opens next.</summary>+ internal void SetMixerFloating(bool floating)+ {+ var settings = MixerSettings;+ if (settings.Current.MixerFloating != floating)+ {+ settings.Current.MixerFloating = floating;+ settings.Save();+ if (floating && _mixerDocked) { UndockMixer(); OpenMixerWindow(); }+ else if (!floating && _mixerWindow is not null)+ {+ _mixerSwitching = true;+ try { _mixerWindow.Close(); }+ finally { _mixerSwitching = false; }+ DockMixer();+ }+ }+ SyncMixerMenu();+ }++ // Once the main window is up: bring the Mixer back the way the user left it.+ private void RestoreMixer()+ {+ SyncMixerMenu();+ if (Avalonia.Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)+ desktop.ShutdownRequested += (_, _) =>+ {+ _quitRequested = true;+ // A cancelled quit (unsaved changes → Cancel) returns here: count closes again.+ Dispatcher.UIThread.Post(() => _quitRequested = false, DispatcherPriority.Background);+ };+ if (MixerSettings.Current.MixerShown) ShowMixer();+ }++ private void RememberMixerShown(bool shown)+ {+ var settings = MixerSettings;+ if (settings.Current.MixerShown == shown) return;+ settings.Current.MixerShown = shown;+ settings.Save();+ }++ private void SyncMixerMenu()+ {+ if (MenuItemFor("view.mixerFloat") is { } mi) mi.IsChecked = MixerFloating;+ }++ private static MixerViewMode MixerViewFromSettings()+ => MixerSettings.Current.MixerView == "map" ? MixerViewMode.StereoMap : MixerViewMode.Strips;++ private void PickMixerView(MixerViewMode view)+ {+ if (_mixer is not null) _mixer.View = view;+ var settings = MixerSettings;+ settings.Current.MixerView = view == MixerViewMode.StereoMap ? "map" : "strips";+ settings.Save();+ SyncMixerViewButtons();+ }++ // ---- docked panel ---------------------------------------------------------------------++ private void DockMixer(){- if (_mixerWindow is not null) { _mixerWindow.Close(); return; }if (_mixer is null) return;+ _mixer.View = MixerViewFromSettings();+ SyncMixerViewButtons();+ _mixerDocked = true;+ _mixer.IsVisible = true; // so the tick loop updates its meters+ SetHost(MixerHost, _mixer);+ _mixerRow.MinHeight = MixerPanelMin;+ _mixerWanted = DockedMixerHeight();+ LayoutBottomPanels();+ _mixer.Refresh();+ }++ // The height the user dragged it to; until they have, full strips but no more than half+ // of the body, so the main view keeps its share on a laptop screen.+ private double DockedMixerHeight()+ {+ double h = MixerSettings.Current.MixerDockHeight;+ if (h > 0) return h;+ double body = BodyGrid.Bounds.Height;+ return Math.Max(MixerPanelMin, body > 0 ? Math.Min(MixerPanelNatural, body / 2) : MixerPanelNatural);+ }++ private void UndockMixer()+ {+ _mixerDocked = false;+ SetHost(MixerHost, null);+ if (_mixer is not null && _mixerWindow is null) _mixer.IsVisible = false;+ LayoutBottomPanels();+ }++ // A finished drag of either splitter next to the docked Mixer sets its height.+ private void OnMixerHeightDragged()+ {+ if (!_mixerDocked) return;+ double h = Math.Round(_mixerRow.ActualHeight);+ if (h <= 0) return;+ _mixerWanted = h;+ _mixerRow.Height = new Avalonia.Controls.GridLength(h); // a splitter may leave it in stars+ var settings = MixerSettings;+ settings.Current.MixerDockHeight = h;+ settings.Save();+ }++ private void OnMixerMinHeightChanged()+ {+ if (_mixerDocked)+ {+ _mixerRow.MinHeight = MixerPanelMin;+ if (MixerSettings.Current.MixerDockHeight <= 0) _mixerWanted = DockedMixerHeight(); // measured now+ FitBottomPanels();+ }+ _mixerWindow?.FitHeightLimits(_mixer!);+ }++ private void SyncMixerViewButtons()+ {+ bool map = (_mixer?.View ?? MixerViewFromSettings()) == MixerViewMode.StereoMap;+ MixerStripsBtn.IsChecked = !map;+ MixerMapBtn.IsChecked = map;+ }++ private void OnMixerStrips(object? sender, RoutedEventArgs e) => PickMixerView(MixerViewMode.Strips);+ private void OnMixerMap(object? sender, RoutedEventArgs e) => PickMixerView(MixerViewMode.StereoMap);+ private void OnMixerPopOut(object? sender, RoutedEventArgs e) => SetMixerFloating(true);+ private void OnCloseMixer(object? sender, RoutedEventArgs e) => HideMixer();- // The view (Strips / Stereo Map, specs/008) is a per-user preference.- var settings = App.Services.GetRequiredService<ISettingsService>();- var view = settings.Current.MixerView == "map" ? MixerViewMode.StereoMap : MixerViewMode.Strips;+ // ---- own window -------------------------------------------------------------------------++ private void OpenMixerWindow()+ {+ if (_mixer is null || _mixerWindow is not null) return;+ var view = MixerViewFromSettings();_mixer.View = view;var win = new MixerWindow(this, view);var mixer = _mixer;// The window is as wide as its strips; the Stereo Map keeps whatever width it has.void Fit() { if (mixer.View == MixerViewMode.Strips) win.FitWidth(mixer.StripsWidth); }- win.ViewPicked += v =>+ win.ViewPicked += v => { PickMixerView(v); Fit(); };+ win.DockRequested += () => SetMixerFloating(false);+ win.EnableMidiLearn(_learn); // faders/knobs stay MIDI-mappable in the window+ win.WindowClosed += () =>{- if (_mixer is not null) _mixer.View = v;- settings.Current.MixerView = v == MixerViewMode.StereoMap ? "map" : "strips";- settings.Save();- Fit();+ mixer.StripsChanged -= Fit;+ if (!_mixerDocked) mixer.IsVisible = false;+ _mixerWindow = null;+ // Closing it by hand hides the Mixer; a switch to docked or quitting the app doesn't.+ if (!_mixerSwitching && !_shuttingDown && !_quitRequested) RememberMixerShown(false);};- win.EnableMidiLearn(_learn); // faders/knobs stay MIDI-mappable in the window- win.WindowClosed += () => { mixer.StripsChanged -= Fit; mixer.IsVisible = false; _mixerWindow = null; };_mixerWindow = win;_mixer.IsVisible = true; // so the tick loop updates its metersSetHost(win.Host, _mixer);+ win.FitHeightLimits(_mixer);_mixer.StripsChanged += Fit;_mixer.Refresh();win.Opened += (_, _) => Fit(); // again once shown: only now is it on the owner's screendiff --git a/src/managed/Nota.App/MainWindow.Palette.cs b/src/managed/Nota.App/MainWindow.Palette.csindex c9e30676..0a3730c3 100644--- a/src/managed/Nota.App/MainWindow.Palette.cs+++ b/src/managed/Nota.App/MainWindow.Palette.cs@@ -137,6 +137,7 @@ public partial class MainWindowtrack = origin == PaletteOrigin.PianoRoll ? EditedTrack() : _deviceChain?.TrackId ?? -1;}else if (source is DeviceWindow devw) { origin = PaletteOrigin.DeviceWindow; track = devw.ContextTrackId > 0 ? devw.ContextTrackId : _deviceChain?.TrackId ?? -1; }+ else if (_mixerDocked && (Within(MixerPanel) || _mixerWasLastFocused)) { origin = PaletteOrigin.Mixer; track = Timeline.SelectedTrackId; } // docked Mixer (specs/054)else if (DetailPanel.IsVisible && (Within(DetailPanel) || _detailWasLastFocused)){origin = DetailBody.Content is ClipEditorView or DrumPatternView ? PaletteOrigin.PianoRoll : PaletteOrigin.Devices;diff --git a/src/managed/Nota.App/MainWindow.axaml b/src/managed/Nota.App/MainWindow.axamlindex 034f43e9..7cec0bb1 100644--- a/src/managed/Nota.App/MainWindow.axaml+++ b/src/managed/Nota.App/MainWindow.axaml@@ -78,6 +78,7 @@<NativeMenuItem Header="Command palette…" app:Commands.Id="view.palette"/><NativeMenuItemSeparator/><NativeMenuItem Header="Mixer" app:Commands.Id="view.mixer"/>+ <NativeMenuItem Header="Mixer in its own window" app:Commands.Id="view.mixerFloat" ToggleType="CheckBox"/><NativeMenuItem Header="Connect phone…" app:Commands.Id="view.connectPhone"/><NativeMenuItemSeparator/><NativeMenuItem Header="Toggle browser" app:Commands.Id="view.toggleBrowser"/>@@ -462,18 +463,64 @@</Panel></Grid>+ <!-- Docked Mixer (specs/054): its own bottom panel, directly under the main view and+ above the Detail panel; either, both or neither can be shown. Rows are built by+ LayoutBottomPanels (MainWindow.Detail.cs) — the Grid.Row values here are placeholders.+ The single MixerView is moved between MixerHost and the Mixer window. -->+ <GridSplitter x:Name="MixerSplitter"+ Grid.Row="1"+ Height="6" MinHeight="0" Margin="0,-3,0,-3"+ IsVisible="False"+ HorizontalAlignment="Stretch" ResizeDirection="Rows"+ Background="Transparent"/>+ <Border x:Name="MixerPanel" Grid.Row="2" Margin="0,1,0,0" IsVisible="False" ClipToBounds="True"+ Background="{DynamicResource Brush.BgApp}" BorderThickness="0"+ CornerRadius="{StaticResource Radius.Docked}">+ <DockPanel>+ <!-- Panel toolbar (32, seam under it): caption · Strips | Stereo map · | · pop out · close -->+ <Border DockPanel.Dock="Top" Height="32" Background="{DynamicResource Brush.Panel}"+ BorderBrush="{DynamicResource Brush.Seam}" BorderThickness="0,0,0,1">+ <Grid Margin="12,0,6,0" ColumnDefinitions="Auto,Auto,*,Auto,Auto,Auto">+ <TextBlock Text="Mixer" Classes="Title" VerticalAlignment="Center"/>+ <Border Grid.Column="1" Classes="segmented" Margin="14,0,0,0" VerticalAlignment="Center">+ <StackPanel Orientation="Horizontal" Spacing="1">+ <ToggleButton x:Name="MixerStripsBtn" Classes="seg" Content="Strips" Click="OnMixerStrips"/>+ <ToggleButton x:Name="MixerMapBtn" Classes="seg" Content="Stereo map" Click="OnMixerMap"/>+ </StackPanel>+ </Border>+ <Border Grid.Column="3" Width="1" Height="16" Margin="10,0,6,0" VerticalAlignment="Center"+ Background="{DynamicResource Brush.Rule}"/>+ <Button x:Name="MixerPopOut" Grid.Column="4" Classes="ghost" Height="22" Padding="6,0"+ Foreground="{DynamicResource Brush.TextTertiary}" Click="OnMixerPopOut"+ ToolTip.Tip="Open the mixer in a window">+ <app:Glyph Kind="PopOut"/>+ </Button>+ <Button Grid.Column="5" Classes="ghost" Height="22" Margin="2,0,0,0" Padding="6,0"+ Foreground="{DynamicResource Brush.TextTertiary}" Click="OnCloseMixer" ToolTip.Tip="Hide the mixer">+ <app:Glyph Kind="Close"/>+ </Button>+ </Grid>+ </Border>+ <ContentControl x:Name="MixerHost"/>+ </DockPanel>+ </Border>+<!-- Drag handle to resize the Detail panel (only shown when it is open). Like thebrowser splitter it is a 6px strip laid over the seam instead of adding height. --><GridSplitter x:Name="DetailSplitter"- Grid.Row="1"+ Grid.Row="3"Height="6" MinHeight="0" Margin="0,-3,0,-3"IsVisible="False"HorizontalAlignment="Stretch" ResizeDirection="Rows"Background="Transparent"/>+ <!-- With the Mixer docked above it, a GridSplitter here would trade height between the+ two panels; this edge resizes the Detail panel alone (MainWindow.Detail.cs). -->+ <Border x:Name="DetailEdge" Grid.Row="3" Height="6" Margin="0,-3,0,-3" IsVisible="False"+ Background="Transparent" Cursor="SizeNorthSouth"/>- <!-- Detail panel: Devices chain / Clip (piano roll) / Mixer for the selected track.- Docked under the canvas on a seam, like the browser beside it. -->- <Border x:Name="DetailPanel" Grid.Row="2" Margin="0,1,0,0" IsVisible="False" ClipToBounds="True"+ <!-- Detail panel: Devices chain / Pattern / Clip (piano roll) for the selected track.+ Docked under the canvas (or the docked Mixer) on a seam, like the browser beside it. -->+ <Border x:Name="DetailPanel" Grid.Row="4" Margin="0,1,0,0" IsVisible="False" ClipToBounds="True"Background="{DynamicResource Brush.BgApp}" BorderThickness="0"CornerRadius="{StaticResource Radius.Docked}"><DockPanel>diff --git a/src/managed/Nota.App/MainWindow.axaml.cs b/src/managed/Nota.App/MainWindow.axaml.csindex 9fcf146b..4f3e3f2a 100644--- a/src/managed/Nota.App/MainWindow.axaml.cs+++ b/src/managed/Nota.App/MainWindow.axaml.cs@@ -77,6 +77,7 @@ public partial class MainWindow : Window// True while the detail panel (Devices/Clip) was the last area the user interacted// with — Tab then toggles between the two tabs.private bool _detailWasLastFocused;+ private bool _mixerWasLastFocused; // the docked Mixer was the last area clicked (specs/054)private bool _trackHeadersFocused;private bool _tempoRefreshPosted;@@ -85,6 +86,7 @@ public partial class MainWindow : Windowpublic MainWindow(){InitializeComponent();+ InitBottomPanels(); // BodyGrid rows for the docked Mixer + Detail panels (specs/054)InitMenuShortcuts(); // Ctrl instead of Win on Windows / Linux, and bound thereUpdateWindowTitle(); // "Nota — Untitled" until a project is opened/saved// Custom frameless title bar (Phase 2): extend the client area under the@@ -456,8 +458,8 @@ public partial class MainWindow : WindowTimeline.SessionChanged += () => _session?.Refresh(); // M5-6MainContent.Children.Add(_session);- // Mixer lives in its own window (View → Mixer), not as a main-view tab — created here- // once and hosted in the window when opened (see MainWindow.Mixer.cs).+ // The Mixer is created here once and hosted docked under the main view or in its own+ // window while shown (see MainWindow.Mixer.cs, specs/054)._mixer = new MixerView(vm.Engine){IsVisible = false,@@ -471,6 +473,7 @@ public partial class MainWindow : Windowmap.SelectTrack = id => Timeline.SelectTrackFromOutside(id);},};+ _mixer.MinContentHeightChanged += OnMixerMinHeightChanged;// Modular: signal-graph view of the selected track (mockup 1a). Follows track// selection like the Detail device chain does.@@ -498,6 +501,8 @@ public partial class MainWindow : Window// window menu — File/Edit/View/… — intermittently never installs and only the// "Nota" app menu appears. Force activation once shown so it always lands.Opened += (_, _) => Activate();+ // Bring the Mixer back docked / in its window / hidden as the user left it (specs/054).+ Opened += (_, _) => RestoreMixer();// Remember the detail panel's height once the user drags the splitter — but only// on the Clip tab. The Devices tab keeps its natural card-fitting height, so its@@ -508,7 +513,7 @@ public partial class MainWindow : WindowDetailSplitter.DragCompleted += (_, _) =>{bool clipActive = DetailBody.Content is ClipEditorView or AudioClipEditorView or DrumPatternView;- double h = BodyGrid.RowDefinitions[2].ActualHeight;+ double h = _detailRow.ActualHeight;if (clipActive && DetailPanel.IsVisible && h > 120) _detailHeight = h;};@@ -518,7 +523,11 @@ public partial class MainWindow : WindowAddHandler(PointerPressedEvent, (_, e) =>{if (e.Source is Visual v)+ {_detailWasLastFocused = DetailPanel.IsVisible && v.GetSelfAndVisualAncestors().Contains(DetailPanel);+ // Likewise the docked Mixer, so the palette opens with its context (specs/054).+ _mixerWasLastFocused = _mixerDocked && v.GetSelfAndVisualAncestors().Contains(MixerPanel);+ }// Likewise the track-header column: while it has focus, Cmd+A/C/X/V/D and Delete act on tracks._trackHeadersFocused = Timeline.IsVisible && Timeline.IsInTrackHeaders(e);}, RoutingStrategies.Tunnel, handledEventsToo: true);diff --git a/src/managed/Nota.App/MixerView.cs b/src/managed/Nota.App/MixerView.csindex bed16672..f138ab66 100644--- a/src/managed/Nota.App/MixerView.cs+++ b/src/managed/Nota.App/MixerView.cs@@ -1,11 +1,12 @@// SPDX-License-Identifier: AGPL-3.0-only// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.//-// Mixer (mockup 1f): a dedicated strip mixer as a third Detail mode. One strip-// per track (+ returns + master): name with a 2px colour top, I/O rows, A/B-// sends, a pan knob, a 190px vertical fader with a stereo meter, a dB read-out-// and M/S/Arm. All strips ride the existing engine ops (vol/pan/mute/solo/send/-// meter); meters are pushed each UI tick by MainWindow. Crossfader is M7+. The footer+// Mixer (mockup 1f): one strip per track (+ returns + master): name with a 2px colour+// top, I/O rows, A/B sends, a pan knob, a vertical fader with a stereo meter, a dB+// read-out and M/S/Arm. All strips ride the existing engine ops (vol/pan/mute/solo/send/+// meter); meters are pushed each UI tick by MainWindow, which hosts this one instance+// docked under the main view or in the Mixer window (specs/054). Strips fit the height+// they get (I/O, then sends hide, then the fader shortens). Crossfader is M7+. The footer// also shows and switches the project pan law (specs/006).using System;@@ -50,6 +51,34 @@ public sealed class MixerView : UserControlprivate readonly List<Control> _sendSections = new();private readonly List<Control> _ioSections = new();private bool _sendsVisible = true, _ioVisible = true;++ // Height-adaptive strips (specs/054): the strips fit the height they get, docked or in the+ // window. As it shrinks, I/O rows hide first, then sends, then the fader shortens to+ // FaderMin; below that the host can't get smaller (MinContentHeight). A footer toggle can+ // pin an auto-hidden section back on — the strip row then scrolls vertically.+ private const double FaderMax = 190, FaderMin = 72;+ private const double FaderComfort = 120; // a section hides only if the fader would get shorter+ private const double HeaderH = 24, IoH = 34, SendsH = 42, PanH = 38, ButtonsH = 28;+ private const double FaderPad = 16, RowPad = 20, StripBorder = 2, FooterH = 44;+ private readonly List<Control> _faderGrids = new();+ private double _faderH = FaderMax;+ private double _dbH = 18; // the dB read-out's height, measured once built+ private bool _ioAuto, _sendsAuto; // hidden for lack of height+ private bool _ioPinned, _sendsPinned; // shown anyway by the user+ private Action? _paintIoToggle, _paintSendsToggle;++ // Each strip's controls that follow the engine, so a change made elsewhere — track+ // headers, Session's mixer sections, automation, undo, a MIDI controller — shows here+ // too. The docked Mixer sits right next to those (specs/054).+ private sealed class StripSync+ {+ public VFader? Fader;+ public DragNumber? Db;+ public PanKnob? Pan;+ public Action<bool>? Mute, Solo, Arm;+ }+ private readonly Dictionary<int, StripSync> _syncs = new();+ private StripSync SyncOf(int id) => _syncs.TryGetValue(id, out var s) ? s : _syncs[id] = new StripSync();// The master volume lives in TransportViewModel.MasterVolume (saved with the project, shown// in the MST module and the arrangement's Master row); the master strip goes through these.public Func<float>? GetMasterVolume { get; set; }@@ -83,12 +112,30 @@ public sealed class MixerView : UserControl/// fit its width to them.</summary>public event Action? StripsChanged;+ /// <summary>Raised when <see cref="MinContentHeight"/> changed, so a host can update its+ /// own minimum.</summary>+ public event Action? MinContentHeightChanged;+/// <summary>The width the strip row wants (all strips + master + margin), unclipped.</summary>public double StripsWidth{get { _row.Measure(Size.Infinity); return _row.DesiredSize.Width; }}+ // A strip's always-shown part (header, pan, dB, M/S/Arm) without the fader.+ private double CoreH => HeaderH + PanH + FaderPad + _dbH + ButtonsH + StripBorder;++ /// <summary>The smallest height (design units) at which a strip's core still fits — header,+ /// pan, a FaderMin fader, dB, M/S/Arm — plus the footer. Hosts don't go below it.</summary>+ public double MinContentHeight => CoreH + FaderMin + RowPad + FooterH + MapPad;++ /// <summary>The height at which every strip shows in full (I/O, sends, the full fader).</summary>+ public double NaturalContentHeight => CoreH + FaderMax + IoH + SendsH + RowPad + FooterH + MapPad;++ // The Stereo Map layout's grid margin (8 above and below the strip column).+ private const double MapMargin = 8;+ private double MapPad => _view == MixerViewMode.StereoMap ? 2 * MapMargin : 0;+public MixerView(IAudioEngine engine){ValueEntry.SetScope(this, true); // Tab in a value box walks the values shown here@@ -99,6 +146,7 @@ public sealed class MixerView : UserControlHorizontalScrollBarVisibility = ScrollBarVisibility.Auto,VerticalScrollBarVisibility = ScrollBarVisibility.Disabled,};+ _stripsScroller.SizeChanged += (_, e) => { if (e.HeightChanged) FitHeight(); };var dock = new DockPanel();var footer = Footer();DockPanel.SetDock(footer, Dock.Bottom);@@ -111,7 +159,7 @@ public sealed class MixerView : UserControlpublic MixerViewMode View{get => _view;- set { if (_view == value) return; _view = value; ApplyView(); }+ set { if (_view == value) return; _view = value; ApplyView(); MinContentHeightChanged?.Invoke(); }}private void ApplyView()@@ -130,7 +178,7 @@ public sealed class MixerView : UserControl}if (Map is null) { Map = new StereoMapView(_engine) { MinWidth = 520 }; MapCreated?.Invoke(Map); }_stripsScroller.MaxWidth = 440;- var grid = new Grid { ColumnDefinitions = new ColumnDefinitions("*,Auto"), ColumnSpacing = 8, Margin = new Thickness(8) };+ var grid = new Grid { ColumnDefinitions = new ColumnDefinitions("*,Auto"), ColumnSpacing = 8, Margin = new Thickness(MapMargin) };grid.Children.Add(Map);Grid.SetColumn(_stripsScroller, 1);grid.Children.Add(_stripsScroller);@@ -144,19 +192,25 @@ public sealed class MixerView : UserControl_sendFaders.Clear();_sendSections.Clear();_ioSections.Clear();+ _faderGrids.Clear();+ _syncs.Clear();_balBadges.Clear();int returns = _engine.ReturnTrackCount;int n = _engine.TrackCount;- for (int i = 0; i < n; i++)- {- if (!_engine.TryGetTrackInfo(i, out var ti)) continue;- var c = ArrangementView.TrackBrush(ArrangementView.EffectiveColorIndex(_engine, ti.Id));- _row.Children.Add(Strip(ti, c, returns));- }+ // As in the arrangement: the tracks in their order, then the returns, then the master.+ foreach (bool wantReturns in new[] { false, true })+ for (int i = 0; i < n; i++)+ {+ if (!_engine.TryGetTrackInfo(i, out var ti) || ti.IsReturn != wantReturns) continue;+ var c = ArrangementView.TrackBrush(ArrangementView.EffectiveColorIndex(_engine, ti.Id));+ _row.Children.Add(Strip(ti, c, returns));+ }_row.Children.Add(MasterStrip());_shownLaw = null; // the strips are new: repaint the law state onto themSyncPanLaw();_builtTrackCount = n;+ MeasureDb();+ FitHeight();StripsChanged?.Invoke();}@@ -183,9 +237,30 @@ public sealed class MixerView : UserControldouble v = _engine.GetTrackSend(id, bus);if (Math.Abs(send.Value - v) > 1e-3) send.Value = v;}+ FollowStrips();SyncPanLaw(); // undo/redo or a load elsewhere may have changed it}+ // Volume, pan and M/S/Arm follow the engine (see StripSync); a control being dragged is+ // left to the hand on it.+ private void FollowStrips()+ {+ int n = _engine.TrackCount;+ for (int i = 0; i < n; i++)+ {+ if (!_engine.TryGetTrackInfo(i, out var ti) || !_syncs.TryGetValue(ti.Id, out var s)) continue;+ if (s.Fader is { Dragging: false } f && Math.Abs(f.Value - ti.Volume) > 1e-3)+ {+ f.SetValueExternal(ti.Volume);+ if (s.Db is { } db) db.Value = LinToDb(ti.Volume);+ }+ if (s.Pan is { Dragging: false } k && Math.Abs(k.Pan - ti.Pan) > 1e-3) k.SetPanExternal(ti.Pan);+ s.Mute?.Invoke(ti.Muted != 0);+ s.Solo?.Invoke(ti.Soloed != 0);+ s.Arm?.Invoke(ti.Armed != 0);+ }+ }+// ---- strips -----------------------------------------------------------private Control Strip(NotaTrackInfo ti, IBrush color, int returns)@@ -202,14 +277,14 @@ public sealed class MixerView : UserControl: ti.IsInstrument ? "Monitor auto" : "Monitor in";// Instrument tracks get a live "MIDI To" selector in place of the static I/O text.var ioRow = ti.IsInstrument ? MidiIoRow(id) : IoRow(io1, io2);- ioRow.IsVisible = _ioVisible;+ ioRow.IsVisible = IoShown;_ioSections.Add(ioRow);col.Children.Add(ioRow);if (!isReturn){var sends = SendsRow(id, returns);- sends.IsVisible = _sendsVisible;+ sends.IsVisible = SendsShown;_sendSections.Add(sends);col.Children.Add(sends);}@@ -232,7 +307,7 @@ public sealed class MixerView : UserControlvar col = new StackPanel();col.Children.Add(Header("Master", NotaPalette.Master, MasterBg));var ioRow = IoRow("Sum bus", "→ Output");- ioRow.IsVisible = _ioVisible;+ ioRow.IsVisible = IoShown;_ioSections.Add(ioRow);col.Children.Add(ioRow);@@ -256,8 +331,10 @@ public sealed class MixerView : UserControlprivate Control Footer(){- var sendsToggle = SectionToggle("Sends", _sendsVisible, on => { _sendsVisible = on; foreach (var s in _sendSections) s.IsVisible = on; });- var ioToggle = SectionToggle("I/O", _ioVisible, on => { _ioVisible = on; foreach (var s in _ioSections) s.IsVisible = on; });+ var sendsToggle = SectionToggle("Sends", () => _sendsVisible, () => _sendsAuto, () => _sendsPinned,+ (on, pinned) => { _sendsVisible = on; _sendsPinned = pinned; FitHeight(); }, out _paintSendsToggle);+ var ioToggle = SectionToggle("I/O", () => _ioVisible, () => _ioAuto, () => _ioPinned,+ (on, pinned) => { _ioVisible = on; _ioPinned = pinned; FitHeight(); }, out _paintIoToggle);var left = new StackPanel{Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center,@@ -279,18 +356,83 @@ public sealed class MixerView : UserControlreturn new Border { Height = 44, Background = MasterBg, BorderBrush = NotaPalette.Seam, BorderThickness = new Thickness(0, 1, 0, 0), Padding = new Thickness(12, 0), Child = grid };}- private Border SectionToggle(string label, bool initial, Action<bool> set)+ // A footer section toggle. On = "show when it fits"; when the section is hidden for lack of+ // height it shows muted, and a click pins it on anyway (the strips then scroll); a click on+ // a shown or pinned section turns it off.+ private Border SectionToggle(string label, Func<bool> on, Func<bool> auto, Func<bool> pinned,+ Action<bool, bool> set, out Action paint){- bool on = initial;var t = new TextBlock { Text = label, FontSize = 10, FontWeight = FontWeight.SemiBold, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };var b = new Border { Height = 22, Padding = new Thickness(8, 0), CornerRadius = NotaRadius.Control, BorderThickness = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Cursor = new Cursor(StandardCursorType.Hand), Child = t };- // Toggled on: a solid accent key with derived ink; off: a raised key.- void Paint() { b.Background = on ? Brass : NotaPalette.SurfaceRaised; b.BorderBrush = on ? Brass : NotaPalette.Seam; t.Foreground = on ? OnAccent : TextSecondary; }- b.PointerPressed += (_, e) => { e.Handled = true; on = !on; set(on); Paint(); };+ // Shown: a solid accent key with derived ink; auto-hidden: a raised key with an accent+ // rim; off: a raised key.+ void Paint()+ {+ bool hiddenByHeight = on() && auto() && !pinned();+ bool lit = on() && !hiddenByHeight;+ b.Background = lit ? Brass : NotaPalette.SurfaceRaised;+ b.BorderBrush = lit || hiddenByHeight ? Brass : NotaPalette.Seam;+ t.Foreground = lit ? OnAccent : hiddenByHeight ? TextTertiary : TextSecondary;+ ToolTip.SetTip(b, hiddenByHeight ? "Hidden: not enough height · click to show anyway" : null);+ }+ b.PointerPressed += (_, e) =>+ {+ e.Handled = true;+ if (on() && auto() && !pinned()) set(true, true);+ else if (on()) set(false, false);+ else set(true, false);+ Paint();+ };+ paint = Paint;Paint();return b;}+ private bool IoShown => _ioVisible && (!_ioAuto || _ioPinned);+ private bool SendsShown => _sendsVisible && (!_sendsAuto || _sendsPinned);++ // The dB read-out's height comes from its font; measure it once there is one, so+ // MinContentHeight matches what is drawn.+ private void MeasureDb()+ {+ if (_masterDb is null) return;+ _masterDb.Measure(Size.Infinity);+ double h = Math.Ceiling(_masterDb.DesiredSize.Height);+ if (h <= 0 || Math.Abs(h - _dbH) < 0.5) return;+ _dbH = h;+ MinContentHeightChanged?.Invoke();+ }++ // Fit the strips to the strip area's height: while the fader would drop below FaderComfort,+ // I/O hides first, then sends; the fader takes the rest between FaderMin and FaderMax. Only toggles visibility / height — no rebuild.+ private void FitHeight()+ {+ // Not laid out yet: show everything the toggles allow; the first size pass refits.+ double h = _stripsScroller.Bounds.Height;+ double avail = h > 0 ? h - RowPad - CoreH : double.PositiveInfinity;+ double sends = _sendsVisible ? SendsH : 0, io = _ioVisible ? IoH : 0;+ double pinnedIo = _ioVisible && _ioPinned ? IoH : 0;+ bool ioFits = avail >= FaderComfort + sends + io;+ bool sendsFits = avail - pinnedIo >= FaderComfort + sends;+ _ioAuto = _ioVisible && !ioFits;+ _sendsAuto = _sendsVisible && !sendsFits;+ double used = (IoShown ? IoH : 0) + (SendsShown ? SendsH : 0);+ double fader = Math.Clamp(Math.Floor(avail - used), FaderMin, FaderMax);++ foreach (var s in _ioSections) s.IsVisible = IoShown;+ foreach (var s in _sendSections) s.IsVisible = SendsShown;+ if (Math.Abs(fader - _faderH) >= 0.5)+ {+ _faderH = fader;+ foreach (var g in _faderGrids) g.Height = fader;+ }+ // A pinned section may not fit: let the strip row scroll then.+ _stripsScroller.VerticalScrollBarVisibility = (_ioPinned && _ioAuto) || (_sendsPinned && _sendsAuto)+ ? ScrollBarVisibility.Auto : ScrollBarVisibility.Disabled;+ _paintIoToggle?.Invoke();+ _paintSendsToggle?.Invoke();+ }+// Pan law: the project's pan law as shell segments, a one-line hint, and the Older project// badge for projects made before the law existed (they keep Balance until switched).private Control PanLawGroup()@@ -471,6 +613,7 @@ public sealed class MixerView : UserControlprivate Control PanRow(int id, float pan, bool isGroup = false){var knob = new PanKnob(pan);+ if (id > 0) SyncOf(id).Pan = knob;// One undo step per gesture (specs/009); opened before the automation write so a// recorded lane and the value undo together, closed after it.var undo = new MixGesture(_engine, MixTarget.Pan(id));@@ -516,6 +659,7 @@ public sealed class MixerView : UserControlToolTip.SetTip(dbNum, "Set the gain — drag, or double-click to type");void SetVolume(double v) { if (id < 0) SetMasterVolume?.Invoke((float)v); else _engine.SetTrackVolume(id, (float)v); }if (id < 0) { _masterFader = fader; _masterDb = dbNum; }+ else { var sync = SyncOf(id); sync.Fader = fader; sync.Db = dbNum; }// One undo step per drag of the fader or the dB number, and per reset / typed value// (specs/009). Opened before the automation write, closed after it.var undo = new MixGesture(_engine, id < 0 ? MixTarget.Master : MixTarget.Volume(id));@@ -546,7 +690,7 @@ public sealed class MixerView : UserControlscaleGrid.Children.Add(t);}- var grid = new Grid { Height = 190, ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), Margin = new Thickness(7, 8) };+ var grid = new Grid { Height = _faderH, ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), Margin = new Thickness(7, 8) };grid.Children.Add(scaleGrid);Grid.SetColumn(fader, 1); grid.Children.Add(fader);// Channels lettered under the meter (almanac § level meters), one letter per 11px column.@@ -559,24 +703,26 @@ public sealed class MixerView : UserControlDockPanel.SetDock(letters, Dock.Bottom);var meterCol = new DockPanel { Margin = new Thickness(4, 0, 0, 0), Children = { letters, meter } };Grid.SetColumn(meterCol, 2); grid.Children.Add(meterCol);+ _faderGrids.Add(grid);return grid;}private Control ButtonsRow(int id, NotaTrackInfo ti, bool isReturn){var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 4, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };- var mute = Toggle("M", false, ti.Muted != 0, v => _engine.SetTrackMute(id, v));- var solo = Toggle("S", false, ti.Soloed != 0, v => _engine.SetTrackSolo(id, v));+ var sync = SyncOf(id);+ var mute = Toggle("M", false, ti.Muted != 0, v => _engine.SetTrackMute(id, v), out sync.Mute);+ var solo = Toggle("S", false, ti.Soloed != 0, v => _engine.SetTrackSolo(id, v), out sync.Solo);MidiLearn.Bind(mute, MidiTarget.TrackMute(id), "Mute");MidiLearn.Bind(solo, MidiTarget.TrackSolo(id), "Solo");row.Children.Add(mute);row.Children.Add(solo);- if (!isReturn) row.Children.Add(ArmToggle(ti.Armed != 0, (v, additive) => TrackArming.Set(_engine, id, v, additive)));+ if (!isReturn) row.Children.Add(ArmToggle(ti.Armed != 0, (v, additive) => TrackArming.Set(_engine, id, v, additive), out sync.Arm));return new Border { Height = 28, BorderBrush = BorderInner, BorderThickness = new Thickness(0, 1, 0, 0), Child = row };}// Record-arm: neutral with a red disc at rest, solid record red with a pale disc when armed.- private Border ArmToggle(bool initial, Action<bool, bool> set) // (armed, ⌘/Ctrl held) — #332+ private Border ArmToggle(bool initial, Action<bool, bool> set, out Action<bool> sync) // (armed, ⌘/Ctrl held) — #332{bool on = initial;var disc = new Glyph(GlyphKind.Record, 7);@@ -589,11 +735,12 @@ public sealed class MixerView : UserControldisc.Foreground = on ? NotaPalette.RecordInk : NotaPalette.Record;}b.PointerPressed += (_, e) => { if (!e.GetCurrentPoint(b).Properties.IsLeftButtonPressed) return; e.Handled = true; on = !on; set(on, TrackArming.IsAdditive(e.KeyModifiers)); Paint(); };+ sync = v => { if (v == on) return; on = v; Paint(); };Paint();return b;}- private Border Toggle(string label, bool danger, bool initial, Action<bool> set)+ private Border Toggle(string label, bool danger, bool initial, Action<bool> set, out Action<bool> sync){bool on = initial;var t = new TextBlock { Text = label, FontSize = 9, FontWeight = FontWeight.SemiBold, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };@@ -607,6 +754,7 @@ public sealed class MixerView : UserControlt.Foreground = on ? NotaPalette.InkOn(fill) : TextSecondary;}b.PointerPressed += (_, e) => { e.Handled = true; on = !on; set(on); Paint(); };+ sync = v => { if (v == on) return; on = v; Paint(); };Paint();return b;}diff --git a/src/managed/Nota.App/MixerWindow.cs b/src/managed/Nota.App/MixerWindow.csindex 190d9676..05307fc1 100644--- a/src/managed/Nota.App/MixerWindow.cs+++ b/src/managed/Nota.App/MixerWindow.cs@@ -4,7 +4,8 @@// The Mixer in its own window (opened from View → Mixer). It hosts the single MixerView// instance the main window owns (reparented, not rebuilt), so meters/state carry over and// the tick loop keeps updating it while the window is open. Closing detaches the mixer.-// Its own title bar carries the Strips | Stereo Map switch (specs/008).+// Its own title bar carries the Strips | Stereo Map switch (specs/008) and a dock button that+// moves the Mixer back into the main window (specs/054).using System;using Avalonia;@@ -22,6 +23,9 @@ internal sealed class MixerWindow : NotaWindowpublic event Action? WindowClosed;/// <summary>The user picked a view in the title bar.</summary>public event Action<MixerViewMode>? ViewPicked;+ /// <summary>The user asked to dock the Mixer back into the main window (specs/054); the+ /// owner moves it and closes this window.</summary>+ public event Action? DockRequested;private readonly Action<int> _setViewSegment;private const double BarH = 36;@@ -63,10 +67,20 @@ internal sealed class MixerWindow : NotaWindowi => ViewPicked?.Invoke(i == 1 ? MixerViewMode.StereoMap : MixerViewMode.Strips), out _setViewSegment);seg.HorizontalAlignment = HorizontalAlignment.Center;seg.VerticalAlignment = VerticalAlignment.Center;+ var dockBtn = new Button+ {+ Classes = { "ghost" }, Height = 22, Padding = new Thickness(6, 0), Foreground = NotaPalette.TextTertiary,+ HorizontalAlignment = HorizontalAlignment.Right, VerticalAlignment = VerticalAlignment.Center,+ Content = new Glyph(GlyphKind.DockIn),+ };+ ToolTip.SetTip(dockBtn, "Dock the mixer in the main window");+ dockBtn.Click += (_, _) => DockRequested?.Invoke();var grid = new Grid { ColumnDefinitions = new ColumnDefinitions("*,Auto,*") };grid.Children.Add(caption);Grid.SetColumn(seg, 1);grid.Children.Add(seg);+ Grid.SetColumn(dockBtn, 2);+ grid.Children.Add(dockBtn);var bar = new Border{Height = BarH, Background = NotaPalette.Panel, BorderBrush = NotaPalette.GraphBorder,@@ -85,6 +99,14 @@ internal sealed class MixerWindow : NotaWindow/// <summary>Repaints the title-bar switch (the view changed elsewhere).</summary>public void ShowView(MixerViewMode view) => _setViewSegment(view == MixerViewMode.StereoMap ? 1 : 0);+ /// <summary>Height limits from the hosted mixer's content (specs/054): no shorter than its+ /// strips' core, and — before the first show — tall enough for full strips.</summary>+ public void FitHeightLimits(MixerView mixer)+ {+ if (!IsVisible) Height = Math.Max(Height, BarH + mixer.NaturalContentHeight);+ NotaUiScale.SetDesignMinHeight(this, BarH + mixer.MinContentHeight);+ }+/// <summary>Fits the window to <paramref name="stripsWidth"/> (the mixer's strip row), so/// strips fill it with no dead area: clamped to [MinWidth, the screen's working width]./// A window that grows past the screen's right edge is moved back onto it.</summary>diff --git a/src/managed/Nota.App/SessionView.Mixer.cs b/src/managed/Nota.App/SessionView.Mixer.csindex 529c1094..a97b231a 100644--- a/src/managed/Nota.App/SessionView.Mixer.cs+++ b/src/managed/Nota.App/SessionView.Mixer.cs@@ -75,6 +75,26 @@ public sealed partial class SessionViewreturn s;}+ // Every track's info, read once per UI tick, so the sections below the grid follow volume,+ // pan and M / S / Arm changed anywhere else — the docked Mixer sits right next to them+ // (specs/054), and track headers, automation, undo and controllers move them too.+ private readonly Dictionary<int, NotaTrackInfo> _mixInfo = new();++ private void SnapshotMixInfo()+ {+ _mixInfo.Clear();+ int n = _engine.TrackCount;+ for (int i = 0; i < n; i++)+ if (_engine.TryGetTrackInfo(i, out var t)) _mixInfo[t.Id] = t;+ // Arming elsewhere (the docked Mixer, a track header) must also make an empty slot+ // record: the cells read _armed, and they tick after this.+ foreach (var c in _cols)+ {+ if (c.Kind != ColKind.Track || !_mixInfo.TryGetValue(c.TrackId, out var ct)) continue;+ if (ct.Armed != 0) _armed.Add(c.TrackId); else _armed.Remove(c.TrackId);+ }+ }+private MixerParts BuildMixer(Column c){var root = new StackPanel { Spacing = Gap };@@ -118,6 +138,7 @@ public sealed partial class SessionView}Action meter = () => { };+ var follow = new List<Action<NotaTrackInfo>>();if (_showMixer){Control panRow;@@ -131,6 +152,7 @@ public sealed partial class SessionViewAction<double> setPan = p => _engine.SetTrackPan(id, (float)p);pan.PanChanged += p => panUndo.Change(p, setPan);ValueEntry.Attach(pan, pan.EntryField("Pan"));+ follow.Add(t => { if (!pan.Dragging && Math.Abs(pan.Pan - t.Pan) > 1e-3) pan.Pan = t.Pan; });panRow = FaderRow(pan, ReadoutText());}else panRow = new Border { Height = FaderRowH };@@ -150,6 +172,7 @@ public sealed partial class SessionViewvol.ValueChanged += v => { volUndo.Change(v, setVol); ShowDb(); };ValueEntry.Attach(vol, vol.EntryField("Volume", v => v <= 1e-4 ? "−∞" : NotaNum.Db(AudioMath.LinToDb(v), signed: true)), db);ShowDb();+ if (hasTrack) follow.Add(t => { if (!vol.Dragging && Math.Abs(vol.Value - t.Volume) > 1e-3) { vol.Value = t.Volume; ShowDb(); } });var mL = new MeterLine(); var mR = new MeterLine();var meters = new StackPanel { Height = MeterRowH, Spacing = 1, Margin = new Thickness(4, 0), VerticalAlignment = VerticalAlignment.Center, Children = { mL, mR } };@@ -165,15 +188,19 @@ public sealed partial class SessionViewif (hasTrack){int id = c.TrackId;- btns.Children.Add(MixToggle("M", ti.Muted != 0, false, (v, _) => _engine.SetTrackMute(id, v)));- btns.Children.Add(MixToggle("S", ti.Soloed != 0, false, (v, _) => _engine.SetTrackSolo(id, v)));+ btns.Children.Add(MixToggle("M", ti.Muted != 0, false, (v, _) => _engine.SetTrackMute(id, v), out var syncMute));+ btns.Children.Add(MixToggle("S", ti.Soloed != 0, false, (v, _) => _engine.SetTrackSolo(id, v), out var syncSolo));+ follow.Add(t => { syncMute(t.Muted != 0); syncSolo(t.Soloed != 0); });if (c.Kind == ColKind.Track)+ {btns.Children.Add(MixToggle(null, ti.Armed != 0, true, (v, additive) =>{TrackArming.Set(_engine, id, v, additive);if (v) _armed.Add(id); else _armed.Remove(id);UpdateStates();- }));+ }, out var syncArm));+ follow.Add(t => syncArm(t.Armed != 0));+ }}root.Children.Add(Section(panRow, FaderRow(vol, db), meters, btns));}@@ -182,6 +209,16 @@ public sealed partial class SessionViewvar meterOnly = meter;meter = () => { meterOnly(); foreach (var sync in sendSyncs) sync(); };}+ if (follow.Count > 0)+ {+ var before = meter;+ int trackId = c.TrackId;+ meter = () =>+ {+ before();+ if (_mixInfo.TryGetValue(trackId, out var t)) foreach (var f in follow) f(t);+ };+ }return new MixerParts { Root = root, UpdateMeter = meter };}@@ -205,7 +242,7 @@ public sealed partial class SessionView// M / S / record-arm: a 20px key. Engaged mute fills amber, solo blue, arm the record red// with its white disc (DESIGN.md § Controls), each with derived ink.// set(on, additive): additive = ⌘/Ctrl held (the arm button arms without disarming the others, #332).- private static Control MixToggle(string? label, bool initial, bool arm, Action<bool, bool> set)+ private static Control MixToggle(string? label, bool initial, bool arm, Action<bool, bool> set, out Action<bool> sync){bool on = initial;var text = new TextBlock { Text = label ?? "", FontSize = 10, FontWeight = FontWeight.SemiBold, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };@@ -237,6 +274,7 @@ public sealed partial class SessionViewe.Handled = true;on = !on; set(on, TrackArming.IsAdditive(e.KeyModifiers)); Paint();};+ sync = v => { if (v == on) return; on = v; Paint(); };Paint();return b;}diff --git a/src/managed/Nota.App/SessionView.cs b/src/managed/Nota.App/SessionView.csindex b1ba79ee..76143ae1 100644--- a/src/managed/Nota.App/SessionView.cs+++ b/src/managed/Nota.App/SessionView.cs@@ -341,6 +341,7 @@ public sealed partial class SessionView : UserControlif (_engine.SessionSlotState(c.TrackId, s) >= 2) { active = true; break; }_sessionActive = active;+ SnapshotMixInfo(); // mixer sections and armed slots follow the engine (specs/054)// Cells repaint only when their state moved or while they animate (progress, blink).foreach (var c in _cols){diff --git a/src/managed/Nota.App/Theme/NotaUiScale.cs b/src/managed/Nota.App/Theme/NotaUiScale.csindex d799954e..21918b0c 100644--- a/src/managed/Nota.App/Theme/NotaUiScale.cs+++ b/src/managed/Nota.App/Theme/NotaUiScale.cs@@ -107,6 +107,17 @@ internal static class NotaUiScalecontrol.DetachedFromVisualTree += (_, _) => Changed -= OnChanged;}+ /// <summary>Change a window's minimum height in design units after construction — e.g. when+ /// its content's minimum changes (the Mixer, specs/054). Before the first show it is just+ /// <c>MinHeight</c>; once shown it is scaled and applied like the constructor's minimum.</summary>+ public static void SetDesignMinHeight(Window window, double height)+ {+ if (!Windows.TryGetValue(window, out var entry) || !entry.Opened) { window.MinHeight = height; return; }+ entry.DesignMin = new Size(entry.DesignMin.Width, height);+ SetMinimum(window, entry);+ if (window.IsVisible) KeepOnScreen(window);+ }+private static void OnOpening(Window window, Entry entry){double s = Factor;diff --git a/src/managed/Nota.Application/Palette/CommandCatalog.cs b/src/managed/Nota.Application/Palette/CommandCatalog.csindex 1c0edade..943ddadf 100644--- a/src/managed/Nota.Application/Palette/CommandCatalog.cs+++ b/src/managed/Nota.Application/Palette/CommandCatalog.cs@@ -53,6 +53,7 @@ public static class CommandCatalogC("view.session", "Show Session", "View", "", "clips grid launch"),C("view.modular", "Show Modular", "View", "", "graph patch cv"),C("view.mixer", "Show Mixer", "View", Shortcut.CmdShift('M'), "faders channels"),+ C("view.mixerFloat", "Mixer in its own window", "View", "", "dock undock float pop out mixer window"),C("view.connectPhone", "Connect phone…", "View", "", "remote mobile qr"),C("view.toggleBrowser", "Toggle browser", "View", "", "library sidebar"),C("view.toggleDetail", "Toggle detail panel", "View", "", "devices clip"),diff --git a/src/managed/Nota.Application/Settings.cs b/src/managed/Nota.Application/Settings.csindex 7e555e83..cc00886a 100644--- a/src/managed/Nota.Application/Settings.cs+++ b/src/managed/Nota.Application/Settings.cs@@ -57,6 +57,16 @@ public sealed class Settings/// <summary>The Mixer window's view: "strips" or "map" (the Stereo Map, specs/008)./// A per-user preference, remembered between openings.</summary>public string MixerView { get; set; } = "strips";+ /// <summary>Where the Mixer lives (specs/054): false = docked as a bottom panel in the main+ /// window, true = its own window. Toggled from the panel / window and View → Mixer in its+ /// own window.</summary>+ public bool MixerFloating { get; set; }+ /// <summary>The Mixer was shown when the user last showed or hid it; restored on launch+ /// (specs/054). Quitting the app does not count as hiding it.</summary>+ public bool MixerShown { get; set; }+ /// <summary>Height of the docked Mixer panel in design units, set by dragging its top edge+ /// (specs/054). 0 = its natural height (full strips), clamped to what the window fits.</summary>+ public double MixerDockHeight { get; set; }/// <summary>Record a project version on every save (the History tab). On by default.</summary>public bool KeepVersionHistory { get; set; } = true;/// <summary>Bars of metronome count-in before Play / Record from stop (0 = off). Set from