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) Modular: a Modular tab in the browser, the arrangement's track headers beside the canvas, group graphs, Show in Modular (#592) (#595)
Egor Khindikaynen3a67d2366286
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex b2813a50..26efda08 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -23,6 +23,22 @@ Entry categories: `Added`, `Changed`, `Fixed`, `Removed`.## [Unreleased]### Added+- **A Modular tab in the browser** (#592, specs/095). While Modular is the view the browser's+ rail carries a **Modular** tab (a patch-cable icon, after MIDI effects) listing every node+ Modular offers — LFO, Envelope Follower, MIDI → CV, ADSR, Macro, Math, Scope — with its+ category and a description, searchable by name, category or alias ("wobble" finds LFO).+ Drag a node onto the canvas and it lands there, unconnected; double-click (or Enter) puts+ it in the middle of the view. The browser remembers its own last tab for Modular (the+ Modular tab the first time) and goes back to the other one when you leave.+- **The arrangement's track headers in Modular** (#592, specs/095). Modular's Track view shows+ the same track column as the arrangement — group trays, every control, the context menu,+ drag to reorder, meters, both looks — on the side **Track headers on the right** picks, and+ it moves at once when that changes. Click a header to see that track's graph; drop a CV+ cable on another track's header to modulate it from here.+- **Group graphs in Modular** (#592, specs/095). A group's header opens the group's own effect+ chain (Tracks in → effects → out); modulators patch its effects like any track's.+- **Show in Modular** (#592, specs/095) in the track menus of the arrangement and the Session+ view: Modular opens in Track view on that track.- **Your own sample folders in the browser** (#268, #346, specs/092). Settings → Librarylists every folder the Files tab shows: **Add folder…**, drop folders from Finder /Explorer, rename the label, set the default, show it, remove it (the files stay on disk).@@ -702,6 +718,10 @@ Entry categories: `Added`, `Changed`, `Fixed`, `Removed`.bottom 22 % of the routing view again, and fixed Modular nodes show their lock. About 35graph tooltips that named colours no longer drawn now describe what is on screen.+### Removed+- **Modular's + Add menu and its Tracks list** (#592, specs/095): nodes come from the browser's+ Modular tab and the command palette; the track column is the arrangement's headers.+## [0.59.2] — 2026-11-08### Addeddiff --git a/FEATURES.md b/FEATURES.mdindex 2459cc0e..732d42f4 100644--- a/FEATURES.md+++ b/FEATURES.md@@ -245,7 +245,14 @@ docks as a panel under any of the three, or floats in its own window — see(param → param). A **CV Scope** oscilloscope reads any modulator signal: drag its tracetaller (76–320 px) or open it in its own window, set its time window in ms or in beats,zoom it 1–8×, hold a repeating shape still with a rising-edge trigger, or freeze it. CV- ports are drawn only where they actually work.+ ports are drawn only where they actually work. Nodes come from the browser's **Modular**+ tab (dragged to a spot on the canvas, or double-clicked into the middle) and the command+ palette. Beside the canvas, Track view shows the arrangement's own track headers — every+ control, menu, tray and meter, on the side **Track headers on the right** picks: click one+ to see its graph, or drop a CV cable on another track's header to modulate it. A group's+ header opens the group's effect chain (Tracks in → effects → out), patched like any+ track's. **Show in Modular** in the arrangement's and Session's track menus opens a track+ here.---@@ -1308,7 +1315,9 @@ audio effects after it keep running and keep their settings; saved with the proj## Browser and assets- An **island panel** with an icon rail down its left edge: **Instruments / Audio Effects /- MIDI Effects**, then **Files** (with folder tree navigation), **Presets** (a tree of+ MIDI Effects** (and, while Modular is the view, **Modular** — its nodes with category and+ description, searchable by name, category or alias; the browser keeps a separate last tab+ for Modular), then **Files** (with folder tree navigation), **Presets** (a tree ofcategory → device → preset), **Projects**, **Map** (MIDI Learn mappings), **History**(the open project's versions) and the **Track inspector**. A hairlineseparates the device tabs from the library tabs, and the active one carries an orange edge.diff --git a/specs/095-modular-browser-headers/checklists/requirements.md b/specs/095-modular-browser-headers/checklists/requirements.mdnew file mode 100644index 00000000..ffd12d98--- /dev/null+++ b/specs/095-modular-browser-headers/checklists/requirements.md@@ -0,0 +1,36 @@+# Specification Quality Checklist: Modular tab in the browser, arrangement track headers in Modular++**Purpose**: Validate specification completeness and quality before proceeding to planning+**Created**: 2026-11-12+**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++- Clarified 2026-11-12: the toolbar's + Add is removed (US4, FR-019); a group header opens the group's effect chain as a graph (US3, FR-017–FR-018), within the no-engine-change scope (FR-021).+- "Where things are today" in Nota Context describes current behaviour for the plan; it names+ no code and sets no requirement.diff --git a/specs/095-modular-browser-headers/contracts/ui-contract.md b/specs/095-modular-browser-headers/contracts/ui-contract.mdnew file mode 100644index 00000000..8c79acbf--- /dev/null+++ b/specs/095-modular-browser-headers/contracts/ui-contract.md@@ -0,0 +1,76 @@+# UI contract: Modular tab, headers in Modular, Show in Modular++Internal seams between views (all in `Nota.App` unless noted). Names are binding for tasks.++## ArrangementView++```csharp+bool HeadersOnly { get; set; } // hides overview, sections, ruler/zoom, lanes,+ // overlay, footer lanes, h-scroll; width = header column+double HeaderColumnWidth { get; }+event Action? HeaderColumnWidthChanged; // seam drag / settings+(int TrackId, Control Anchor)? TrackAtHeaderPoint(Point topLevelPoint); // tracks, groups, returns; not master+void SetColumnHint(bool on); // brass divider while a CV cable drags in Modular+Func<int>? ModularTrackId { get; set; } // asks which track Modular shows (-1 none) when a menu opens+event Action<int>? ShowInModularRequested; // track menu / footer menu (returns) item+```++Show in Modular item: in `BuildTrackMenu` (tracks, groups) and `ShowFooterMenu` (returns only),+in the naming / inputs group, glyph `GlyphKind.Modular`, disabled when+`HeadersOnly && trackId == ModularTrackId()`.++## SessionView++```csharp+event Action<int>? ShowInModularRequested; // ShowHeaderMenu, not on the master column+```++## ModularView++```csharp+void ShowTrack(int trackId); // leaves Global view, then Show(trackId)+int AddModulatorAt(int kind, Point? viewportPoint = null); // null → pointer or centre+Func<Point, (int TrackId, Control Anchor)?>? TrackAtPoint { get; set; } // host: header column+event Action<bool>? ConnectHintChanged; // cable drag started / ended+event Action<string>? StatusRequested; // "Open a track in Modular" etc.+bool CanAddNodes { get; } // Track view with a track shown+```++`Show(masterTrackId)` is a no-op. Groups are accepted. The "Tracks" rail and **+ Add** are gone.++## BrowserView++```csharp+void SetModularContext(bool inModular); // shows / hides the Modular tab, applies BrowserTabMemory+static bool IsModularNodeDrag { get; } // CurrentDrag is a ModularNode row+// IsAcceptableDrag(e) returns false for a ModularNode drag (only the Modular canvas takes it).+// ItemActivated fires for a ModularNode row as for any row.+```++## Nota.Presentation++```csharp+public static class ModularBrowserItems+{+ IReadOnlyList<BrowserItem> Build(IReadOnlyList<ModularNode> nodes);+ bool Matches(BrowserItem item, string query);+}+public sealed class BrowserTabMemory+{+ BrowserTabMemory(int startTab, int modularTab);+ void Picked(int tab);+ int Enter(); // → tab to show in Modular+ int Leave(); // → tab to show outside+}+```++## MainWindow++- `SetView(Modular)`: `Timeline.IsVisible = true; Timeline.HeadersOnly = true;` dock it on the+ header side; `_modular.Margin` = column width on that side; `Browser.SetModularContext(true)`.+ Other views: `HeadersOnly = false`, margin 0, `SetModularContext(false)`.+- `ArrangementShown => Timeline.IsVisible && !Timeline.HeadersOnly` replaces+ `Timeline.IsVisible` where it means "the arrangement is the view".+- `ShowInModularRequested(t)` → `SetView(Modular)`, select `t`, `_modular.ShowTrack(t)`.+- Browser `ItemActivated` with a ModularNode → `_modular.AddModulatorAt(kind)` when+ `CanAddNodes`, else the status line reason.diff --git a/specs/095-modular-browser-headers/data-model.md b/specs/095-modular-browser-headers/data-model.mdnew file mode 100644index 00000000..caf5b468--- /dev/null+++ b/specs/095-modular-browser-headers/data-model.md@@ -0,0 +1,54 @@+# Data model: Modular tab in the browser, arrangement track headers in Modular++No project-file or engine data changes. UI-side shapes only.++## ModularNode (existing, `Nota.Application.Palette.ModularCatalog`)++| Field | Meaning |+|---|---|+| `Name` | "LFO", "Envelope Follower", … |+| `Kind` | engine modulator kind (0 LFO … 6 Scope) |+| `Sub` | category caption (modulator, converter, control, CV utility, monitor) |+| `Descriptor.Aliases` | search words ("wobble", "sidechain", …) |+| `Descriptor.Description` | one-line description |++The catalogue stays the single list for the palette and the browser tab (FR-002, FR-003).++## BrowserItem (extended, `Nota.Presentation`)++- New kind `BrowserItemKind.ModularNode`.+- A Modular row: `Name = node.Name`, `BuiltinKind = node.Kind`, `Sub = node.Sub`,+ `Tip = description`, `Keywords = aliases joined by spaces` (new init-only property,+ default "").+- Rules: a ModularNode row is never auditioned, favourited, tagged or revealed; it is+ draggable and activatable.++## ModularBrowserItems (new, pure)++- `Build(IReadOnlyList<ModularNode>) → IReadOnlyList<BrowserItem>` — one row per node, catalogue+ order.+- `Matches(BrowserItem, string query) → bool` — empty query matches; otherwise every+ whitespace-separated word must occur (case-insensitive) in name, category or keywords.++## BrowserTabMemory (new, pure)++State: `InModular` (bool), `OutsideTab` (int, initially the browser's start tab),+`ModularTab` (int?, null until a tab is picked in Modular).++| Event | Effect | Tab to show |+|---|---|---|+| `Picked(tab)` | stores `tab` for the current context | — |+| `Enter()` (view → Modular) | `InModular = true` | `ModularTab ?? modularTabIndex` |+| `Leave()` (view → Arrangement / Session) | `InModular = false` | `OutsideTab` |++The Modular tab index is never stored as `OutsideTab` (it isn't on the rail there).++## ArrangementView headers-only mode (new state)++| State | Meaning |+|---|---|+| `HeadersOnly` | true while Modular is the view: the timeline bands are hidden, the view is as wide as its header column, docked on the header side |+| `ColumnHint` | brass divider while a CV cable is dragged in Modular |+| `ModularTrackId` | a callback asked when a menu opens: the track Modular shows (for disabling Show in Modular on it); a callback, not a copy, so it can't go stale when a header click switches the graph |++`ArrangementView.HeaderColumnWidth` + `HeaderColumnWidthChanged` let the host inset the canvas.diff --git a/specs/095-modular-browser-headers/plan.md b/specs/095-modular-browser-headers/plan.mdnew file mode 100644index 00000000..764ae87d--- /dev/null+++ b/specs/095-modular-browser-headers/plan.md@@ -0,0 +1,132 @@+# Implementation Plan: Modular tab in the browser, arrangement track headers in Modular++**Branch**: `feat/modular-browser-headers` | **Date**: 2026-11-12 | **Spec**: [spec.md](spec.md)++**Input**: Feature specification from `specs/095-modular-browser-headers/spec.md`+(issue nota-daw/nota#592)++## Summary++Modular view gets the arrangement's track header column and a browser tab of its own.+The header column is **the arrangement's own `ArrangementView` instance in a headers-only+mode**, shown beside the Modular canvas on the side **Track headers on the right** picks —+so every card, control, gesture, menu, meter, fold, row height and look is the arrangement's+by construction, and a header click already routes to the Modular graph. ModularView drops its+"Tracks" rail; the rail's cross-track CV drop moves onto the header column through a+"track under this point" query. Group tracks open their effect chain as a graph (the engine+already runs CV modulation on groups — no engine change). The browser gets a **Modular** tab+(index 9, on the rail after MIDI effects, a new patch-cable glyph) listing `ModularCatalog`+nodes; it shows only while Modular is the view, with its own remembered tab. Nodes drag onto+the canvas (at the drop point) or double-click in (at the centre). The toolbar's **+ Add**+goes. A **Show in Modular** item joins the arrangement's and session's track menus. See+[research.md](research.md).++## Nota: Read Before Planning++- **UI work** → [`DESIGN.md`](../../DESIGN.md) (rail tabs, track header, menus) and the+ `nota-design` skill.+- **Anything** → [`CONTRIBUTING.md`](../../CONTRIBUTING.md).++## Technical Context++**Language/Version**: C# / .NET 10 (managed app only)++**Primary Dependencies**: Avalonia (existing). No new dependency.++**Storage**: N/A — no project-format change. Node positions keep using the existing+`modular-layout.json` sidecar (group graphs use the same per-track keys). Browser tab memory+is runtime only, as the last tab is today.++**Audio-Thread Impact**: None: UI-only change. Adding a node and patching a group's effect+use the existing modulator / CV-link calls (immutable snapshot republish, AR-5).++**Testing**: `tests/Nota.SmokeTest` — new pure tests `ModularBrowserTests`+(`ModularBrowserItems` mapping + search, `BrowserTabMemory`); `DesignTokenCheck` keeps the new+code on tokens; the localisation check covers new keys. Visual / interaction check with the+headless screenshot harness and by hand (quickstart).++**Target Platform**: macOS, Windows, Linux desktop (Avalonia).++**Project Type**: Desktop app.++**Performance Goals**: No new per-tick work (meters already tick for the arrangement). Entering+Modular does one header rebuild at most (SC-005).++**Constraints**: The arrangement must look and behave exactly as before when it is the shown+view; headers-only mode is a pure visibility / width switch. Colours from `NotaPalette`, radii+from `NotaRadius`, strings through `Loc`.++**Scale/Scope**: Projects up to ~100 rows; 7 catalogue nodes today.++## Constitution Check++| Principle | Status |+|---|---|+| 0. Approved issue | ✅ #592 carries `approved`; Show in Modular was added to its text with the user's go-ahead. |+| I. Real-time safety | ✅ No engine / audio-thread code touched. |+| II. Boundary discipline | ✅ No new C ABI; existing calls only. |+| III. Licensing | ✅ New files get the SPDX header; no dependency. |+| IV. Verification gate | ✅ `scripts/build.sh` + new smoke tests on the pure pieces. |+| V. One logical change | ✅ One PR for #592 (tab, headers, groups, menu item — one feature). |+| VI. Docs in sync | ✅ CHANGELOG, FEATURES.md, nota-docs (Browser, Modular pages EN + RU), RU strings. |+| VII. Spec first | ✅ spec → clarify → plan → tasks. |+| VIII. Rules not bent | ✅ Nothing to bend. |++Post-design re-check: unchanged — the design keeps everything in `Nota.App` /+`Nota.Presentation`.++## Project Structure++### Documentation (this feature)++```text+specs/095-modular-browser-headers/+├── plan.md+├── research.md+├── data-model.md+├── quickstart.md+├── contracts/ui-contract.md+└── tasks.md # /speckit-tasks+```++### Source Code++```text+src/managed/+├── Nota.Presentation/+│ ├── ViewModels/BrowserViewModel.cs # BrowserItemKind.ModularNode, BrowserItem.Keywords+│ ├── ModularBrowserItems.cs # NEW: catalogue → rows, search match+│ └── BrowserTabMemory.cs # NEW: per-context last tab+├── Nota.App/+│ ├── ArrangementView.HeadersOnly.cs # NEW: HeadersOnly mode, TrackAtHeaderPoint, column hint+│ ├── ArrangementView.cs # keep refs to the bands headers-only hides; Show in Modular item+│ ├── BrowserView.cs # ModularTab, SetModularContext, filter, refuse node drops elsewhere+│ ├── ModularView.cs # rail removed, + Add removed, groups, master guard,+│ │ # node drop, AddModulatorAt(kind, point), cross-track via host+│ ├── SessionView.Grid.cs # Show in Modular item+│ ├── MainWindow.axaml.cs # SetView: headers-only Timeline + inset Modular; ArrangementShown+│ ├── MainWindow.Browser.cs / .Dnd.cs # node activation, tab context+│ ├── MainWindow.Menu.cs / .Input.cs # Timeline.IsVisible → ArrangementShown+│ ├── Controls/Glyph.cs # GlyphKind.PatchCable+│ └── Localization (en / ru) # new strings+tests/Nota.SmokeTest/+├── ModularBrowserTests.cs # NEW+└── Program.cs # register+```++**Structure Decision**: UI-only; the pure, testable pieces (catalogue rows, search, tab+memory) live in `Nota.Presentation`; the views in `Nota.App`.++## Delivery order++1. Headers-only mode + MainWindow layout + cross-track CV via the header column + rail removal+ (US2) — the biggest risk first.+2. Group graphs + master guard (US3).+3. Browser tab, drops, activation, tab memory (US1).+4. + Add removal (US4).+5. Show in Modular (US5).+6. Strings (EN + RU), CHANGELOG, FEATURES.md, docs, shortcuts check, build + smoke.++## Complexity Tracking++None.diff --git a/specs/095-modular-browser-headers/quickstart.md b/specs/095-modular-browser-headers/quickstart.mdnew file mode 100644index 00000000..f0e962a3--- /dev/null+++ b/specs/095-modular-browser-headers/quickstart.md@@ -0,0 +1,54 @@+# Quickstart: validating 095++## Prerequisites++- `scripts/build.sh` green (Release engine in `build/`, smoke test included).+- A project with: an instrument track, an audio track, a group holding both with an Auto Filter+ on it, a return with a reverb.++## Q1 — Browser tab (US1, US4)++1. Arrangement view: the browser rail has **no** Modular tab.+2. Switch to Modular: the Modular tab appears after MIDI effects with the patch-cable icon and is+ selected (first time). Seven rows, each with category and description.+3. Search "wobble" → LFO; "sidechain" → Envelope Follower; "monitor" → Scope.+4. Drag Envelope Follower onto empty canvas → the node lands at the drop point, unconnected;+ ⌘Z removes it in one step. Double-click LFO → it lands mid-view.+5. Drag a node onto the header column / device panel → refused.+6. Switch to Global view, double-click a node → nothing added, status explains.+7. Pick Audio effects, go to Arrangement (browser shows the tab it had there), come back → Audio+ effects is shown.+8. The Modular toolbar has no **+ Add**; ⌘⇧P in Modular still lists Modular nodes.++## Q2 — Headers (US2)++1. Modular Track view: the column shows the same cards as the arrangement (groups as trays,+ returns and master pinned below), in the current look; switch look in Preferences → both+ views follow.+2. Mute, solo, arm, rename, recolour, change volume/pan, reorder by drag, fold the group — each+ shows in the arrangement and mixer.+3. Play: meters move.+4. Click the audio track's header → its graph shows, the track is selected app-wide.+5. View → Track headers on the right: the column jumps right at once; toggle back.+6. Global view hides the column; Track view brings it back.+7. Drag an LFO's CV out onto another track's header → the cross-track parameter menu opens;+ the column's divider is brass while dragging.+8. Back in Arrangement: overview, sections, ruler, lanes, scrollbar all there, unchanged;+ ⌘⇧C (Copy to Session) and arrow-nudging clips work there and do nothing in Modular.++## Q3 — Show in Modular (US5)++From the arrangement on the instrument track, the group and the return, and from the session+on the audio track: **Show in Modular** opens Modular on that track. The master's menus have no+item. In Modular the item is disabled on the shown track.++## Q4 — Group graph (US3)++Click the group's header in Modular: Tracks in → Auto Filter → Out. Add an LFO from the browser,+patch it to the filter cutoff, play: the cutoff moves. Save, reopen: patch and node positions+kept. Clicking the master row leaves the graph as it was.++## Q5 — Automated++`scripts/build.sh` → smoke test passes incl. `ModularBrowserTests`, `DesignTokenCheck`,+localisation check.diff --git a/specs/095-modular-browser-headers/research.md b/specs/095-modular-browser-headers/research.mdnew file mode 100644index 00000000..c5f676ba--- /dev/null+++ b/specs/095-modular-browser-headers/research.md@@ -0,0 +1,140 @@+# Research: Modular tab in the browser, arrangement track headers in Modular++Spec: [spec.md](spec.md) · Issue: nota-daw/nota#592++## R1 — How Modular gets "the same track headers as the arrangement"++**Decision**: Show the **same `ArrangementView` instance** (`MainWindow.Timeline`) in Modular,+switched into a *headers-only* mode, beside the Modular canvas. In Modular view `MainContent`+shows `Timeline` (headers-only, as wide as its header column, docked on the header side) and+`ModularView` (its canvas, inset by the column's width on that side). ModularView loses its own+"Tracks" rail.++**Rationale**:++- The header cards are ~2 000 lines spread over `ArrangementView` partials and lean on its+ private state (`_tracks`, `RowTop`, fold, row heights, tray slices, meters, selection,+ drag-reorder, menus, looks). Extracting them into a reusable control is a large refactor+ with a high regression risk for the arrangement itself.+- A second `ArrangementView` instance would need every MainWindow wiring duplicated (≈60+ events) and double the per-tick meter work.+- The same instance gives FR-009–FR-016 by construction: identical cards, every gesture and+ menu, live meters (`Timeline.UpdateMeters()` already runs every tick regardless of view),+ shared fold / row heights / header width / multi-selection, and the header side+ (`HeadersOnRight`) moving live — `ApplyHeadersRight` already sets it on the same object.+- Selection already routes to Modular: a header click raises the selection that ends in+ `MainWindow.OnTrackSelected`, which calls `_modular.Show(trackId)` when Modular is visible+ (`MainWindow.Detail.cs`). So FR-012 needs no new path.++**What headers-only mode hides**: the overview row, the sections row, the ruler and zoom bar,+the lanes and their overlay, the footer lanes and the horizontal scrollbar. It keeps the+header canvas (with automation / take sub-rows, since they are part of the shared row+geometry), the pinned return / master footer headers, the column backdrop and the column-width+seam. The top band shrinks to a header-width strip as tall as the Modular toolbar (34 px) with+the "Tracks" caption, and the bottom band to a strip as tall as the Modular status line (22 px),+so the column lines up with the canvas chrome.++**Consequences, handled**:++- Code that reads `Timeline.IsVisible` as "the arrangement is the shown view" (Copy to+ Session in `MainWindow.Menu.cs`, clip nudge arrows in `MainWindow.Input.cs`) switches to a+ new `ArrangementShown` (`Timeline.IsVisible && !Timeline.HeadersOnly`). Track-header keys+ (`_trackHeadersFocused && …`, ⌘A / ⌘C / Delete on tracks) keep working in Modular — that is+ wanted (FR-010).+- Vertical scroll is shared with the arrangement (one scroller). The spec's assumption of a+ per-view scroll position is revised: FR-016 (the column scrolls on its own and keeps its+ position while working on the canvas) still holds.+- The arrangement's automation / take sub-rows show in Modular's column as they do in the+ arrangement (they are header rows, and hiding them would change the shared row geometry).+ Spec assumption revised accordingly.++**Alternatives considered**: extract a `TrackHeaderColumn` control (rejected: size and risk,+see above); a second `ArrangementView` (rejected: wiring duplication, double work); keep the+rail and copy controls into it (rejected: not "the same headers", drifts immediately).++## R2 — Cross-track CV drop onto the track column++The old rail doubled as a drop target: a CV cable dragged from a modulator and released on+another track's row opens `ShowCrossTrackParamMenu` for that track+(`ModularView.FinishConnect`). Removing the rail must not lose it.++**Decision**: `ModularView` asks the host which track is under the release point:+`Func<Point, (int TrackId, Control Anchor)?> TrackAtPoint` (point in top-level coordinates),+answered by `ArrangementView.TrackAtHeaderPoint(Point)` (any track or return row; the master+and the shown track excluded). While a cable is being dragged, ModularView raises+`ConnectHintChanged(bool)` and the host lights the header column's divider in brass+(`ArrangementView.SetColumnHint`), as the rail's border did.++## R3 — Group graphs (US3)++**Finding**: in the engine a group is a regular `Track` in `Graph::tracks` with its own device+chain (`Engine.h` § track groups). `updateModulators` / `applyModulation`+(`Engine_Modulation.cpp`) iterate every `g->tracks` entry, and the modulator / CV-link calls+look tracks up with `findTrackAuthoring(trackId)` with no group exclusion. The Envelope+Follower reads the track's own post-fader meter, which groups have.++**Decision**: no engine change (FR-021 holds). `ModularView.Rebuild` already builds the+audio-track shape (input → effects → output) for any non-instrument track; groups take that+path with the source node labelled **Tracks in** (badge `GROUP`) instead of **Audio in /+CLIPS**. What changes in ModularView: groups are no longer filtered out of the Track view+(`Show` accepts them), Global view keeps skipping them (out of scope). Verified at+implementation with an LFO on a group's Auto Filter (quickstart Q4).++**Master**: `Show(masterId)` is ignored (the graph stays), so a click on the master footer row+selects it without touching the graph; Modular never patches the master (spec Edge Cases).++## R4 — The Modular browser tab++**Findings**: tabs are addressed by index (`TabCount = 9`; 0–4 are VM-driven trees, 5 Projects+is a flat `_sources` list filtered in `ApplyFilter`, 6–8 host custom views). The rail order is+the order of `_tabs` in the `tabStack`. The last tab is not persisted across restarts+(`SelectTab(0)` at start-up). Browser drags carry the item in the static+`BrowserView.CurrentDrag`; every drop target accepts via `BrowserView.IsAcceptableDrag(e)`.++**Decision**:++- New tab index `ModularTab = 9` (`TabCount = 10`), a flat `_sources` list like Projects;+ placed on the rail after MIDI effects (rail order ≠ index). New `GlyphKind.PatchCable`+ (16-unit grid, the rail's stroke) — distinct from `GlyphKind.Modular` (the view switch).+- Items come from `ModularCatalog.All` through a pure mapper+ `ModularBrowserItems.Build(IReadOnlyList<ModularNode>)` in `Nota.Presentation`:+ `Kind = BrowserItemKind.ModularNode`, `BuiltinKind = node.Kind`, `Sub = node.Sub` (category),+ `Tip = description`, `Keywords = aliases` (new `BrowserItem.Keywords`). Search+ (`ModularBrowserItems.Matches`) matches name, category and keywords, case-insensitive —+ `ApplyFilter` uses it for this tab. FR-002–FR-004.+- Visibility: `BrowserView.SetModularContext(bool)`; MainWindow calls it from `SetView`.+ Per-view tab memory is a small pure class `BrowserTabMemory` (Nota.Presentation): it keeps+ the last tab picked outside Modular and the last tab picked in Modular (default: Modular+ tab). Entering Modular → show Modular's remembered tab; leaving → the other one. Runtime+ only, like today's last tab (FR-007a, FR-007b).+- Drops: `IsAcceptableDrag` refuses a `ModularNode` item (so the arrangement, session, device+ panel, mixer and the header column refuse it — FR-007); ModularView accepts it only in Track+ view with a track shown, and adds it via `AddModulatorAt(kind, viewportPoint)` (a new+ overload; the palette's pointer/centre placement stays). Double-click / Enter route through+ `ItemActivated` → MainWindow → `_modular.AddModulatorAt(kind)` (centre). Global view / no+ track → status line reason, nothing added. One engine call = one undo step, as the palette.++## R5 — Show in Modular++**Findings**: track context menus exist in the arrangement (`BuildTrackMenu` for tracks and+groups, `ShowFooterMenu` for returns and the master) and the session (`ShowHeaderMenu`). The+mixer has **no** track context menu — FR-022 applies to the menus that exist.++**Decision**: `ArrangementView` and `SessionView` raise `ShowInModularRequested(int trackId)`;+the item sits in the naming / inputs group, not offered for the master, and disabled in+headers-only mode for the track Modular already shows. MainWindow handles it:+`SetView(Modular)`, select the track, `_modular.ShowTrack(trackId)` (leaves Global view if+needed). Not an undo step (FR-023).++## R6 — Removing + Add++The toolbar's **+ Add** flyout goes (FR-019). The Track/Global segment and the zoom controls+stay. The palette keeps its Modular entries (`PaletteKind.Modular`). The private+`AddModulator(int)` becomes unused and is removed.++## R7 — Tests++`tests/Nota.SmokeTest` gets pure tests (no UI): `ModularBrowserItems` (every catalogue node+mapped, name / category / alias search) and `BrowserTabMemory` (first entry → Modular tab,+memory per context, leaving returns the previous tab). The view wiring is verified with the+headless screenshot harness and by hand (quickstart).diff --git a/specs/095-modular-browser-headers/spec.md b/specs/095-modular-browser-headers/spec.mdnew file mode 100644index 00000000..5b8227dd--- /dev/null+++ b/specs/095-modular-browser-headers/spec.md@@ -0,0 +1,380 @@+# Feature Specification: Modular tab in the browser, arrangement track headers in Modular++**Feature Branch**: `095-modular-browser-headers`++**Created**: 2026-11-12++**Status**: Draft++**Issue**: [nota-daw/nota#592](https://github.com/nota-daw/nota/issues/592) (approved)++**Input**: User description: "Modular view: (1) a new Modular tab in the browser rail, with its own icon, listing every Modular-only node (LFO, Envelope Follower, MIDI → CV, ADSR, Macro, Math, Scope) with category and description, searchable; drag onto the Modular canvas adds the node unconnected at the drop point on the shown track, double-click/Enter adds it at the middle of the view; new node kinds appear automatically. (2) Replace Modular's 'Tracks' rail (name + colour stripe only, groups omitted, always left) with the same track headers the arrangement draws, with all their controls and gestures; clicking a header shows that track's graph; the column follows 'Track headers on the right' live; Global view keeps hiding the column. Out of scope: new modulator kinds, engine/DSP changes, Global view islands, lanes/clips in Modular. Open question: keep or remove the toolbar '+ Add'."++## 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).++**Where things are today** (for the plan, not requirements):++- Modular nodes are reachable only from the Modular toolbar's **+ Add** dropdown and from the+ command palette opened in Modular. The node list is the single catalogue the palette also+ reads (seven nodes, each with a name, a category and a one-line description).+- The browser rail has nine tabs: Instruments, Audio effects, MIDI effects, Files, Presets,+ Projects, MIDI map, History, Track inspector.+- Modular's Track view has a fixed-width "Tracks" rail on the left: one row per track with+ the name and a colour stripe; group tracks are left out; clicking a row shows its graph and+ selects the track in the arrangement. It ignores **View → Track headers on the right**.+- The Modular canvas already accepts browser drops of instruments, effects, MIDI effects and+ samples onto the shown track.++## Clarifications++### Session 2026-11-12++- Q: Keep the toolbar's + Add next to the browser tab? → A: No — remove it (US4, FR-019).+- Q: What does clicking a group's header in Modular do? → A: Opens the group's effect chain as a graph (US3, FR-017–FR-018).+- Q: What does the Modular tab do when Modular isn't the shown view? → A: It isn't shown at all — the tab is on the rail only while Modular is the main view (FR-001, FR-007a).+- Q: Should the browser switch to the Modular tab when Modular opens? → A: The browser keeps a separate last-picked tab for Modular; the first time Modular opens it picks the Modular tab (FR-007b).+- Q (added by the user): Is there a way to jump to a track's graph from elsewhere? → A: Yes — a **Show in Modular** item in the track context menu (US5, FR-022–FR-024).++## User Scenarios & Testing *(mandatory)*++### User Story 1 - Find and add Modular nodes from the browser (Priority: P1)++A producer patching modulation opens the browser's new **Modular** tab and sees every node+Modular offers — LFO, Envelope Follower, MIDI → CV, ADSR, Macro, Math, Scope — each with its+category and a short description. They type "env" in the search field to narrow the list,+drag **Envelope Follower** onto an empty spot on the canvas, and it appears exactly there,+unconnected, ready to patch. Next they double-click **LFO** and it appears in the middle of+the visible canvas.++**Why this priority**: This is the first half of the issue and the main discoverability gap:+today the nodes hide behind a toolbar menu with names only, and they can't be dragged.++**Independent Test**: With a project open in Modular (Track view on an instrument track),+open the Modular tab, check the list, search, drag one node and double-click another;+verify both land on the shown track at the expected places, unconnected, each as one undo+step.++**Acceptance Scenarios**:++1. **Given** Modular is the shown view and the browser is open, **When** the user looks at+ the rail, **Then** there is a Modular tab with its own icon, distinct from every other+ tab's, and a tooltip naming it.+1a. **Given** Arrangement or Session is the shown view, **When** the user looks at the rail,+ **Then** there is no Modular tab; switching to Modular brings it back.+1b. **Given** Modular has never been opened, **When** the user switches to Modular, **Then**+ the browser shows the Modular tab; **Given** the user then picks Audio effects in Modular,+ goes to the arrangement and comes back, **Then** the browser shows Audio effects.+2. **Given** the Modular tab is open, **When** the list shows, **Then** it lists every+ Modular node kind the app offers, each with its name, category and description, in the+ same order the palette uses.+3. **Given** the Modular tab is open, **When** the user types in the browser search field,+ **Then** the list narrows by name, category and the node's search aliases (for example+ "wobble" finds LFO), as the palette's search does.+4. **Given** Modular is in Track view on a track, **When** the user drags a node from the tab+ onto the canvas, **Then** the canvas shows the drop highlight while over it and, on drop,+ the node is added to the shown track, unconnected, at the drop point, as one undo step.+5. **Given** Modular is in Track view on a track, **When** the user double-clicks a node (or+ selects it and presses Enter), **Then** the node is added to the shown track, unconnected,+ in the middle of the visible canvas, as one undo step.+6. **Given** a new node kind is added to the app's Modular node catalogue, **When** the app+ is built and run, **Then** the node appears in the Modular tab with no other change.++---++### User Story 2 - Arrangement track headers in Modular (Priority: P1)++The producer works in Modular and wants the same track column they know from the+arrangement: a group's tray with its children, each track's mute / solo / arm, volume, pan,+meter and context menu. They mute a track right from Modular, rename another, drag a third+into a group, and click a header to switch the graph to that track. Their preference puts+track headers on the right, and Modular's column sits on the right too.++**Why this priority**: The second half of the issue. Without it Modular is the only view where+the track column behaves differently, and mixing while patching means leaving the view.++**Independent Test**: In a project with instrument, audio, group and return tracks, open+Modular Track view: compare the column with the arrangement's (same cards, same controls,+same look); use mute, solo, arm, rename, recolour, drag-reorder and the context menu from+Modular and check the arrangement reflects each; toggle **Track headers on the right** and+see the column move in both views at once.++**Acceptance Scenarios**:++1. **Given** Modular Track view is shown, **When** the user looks at the track column,+ **Then** it shows the same track header cards as the arrangement, for the same tracks, in+ the same order, including group rows with their trays and nesting, in the current look+ (new or classic).+2. **Given** a header card in Modular, **When** the user uses any of its controls or gestures+ (rename, colour, mute, solo, arm, monitor, input, volume, pan, sends, group link, fold /+ unfold, drag to reorder or into / out of a group, the context menu, multi-select), **Then**+ it behaves exactly as the same action on the arrangement's card, and the arrangement,+ mixer and session views reflect it.+3. **Given** the header cards in Modular, **When** audio plays, **Then** their meters move+ as they do in the arrangement.+4. **Given** Modular Track view, **When** the user clicks a patchable track's header (an+ instrument, audio or return track), **Then** Modular shows that track's graph and the+ track becomes the selected track app-wide, as the old rail row did.+5. **Given** **Track headers on the right** is on, **When** Modular Track view is shown,+ **Then** the column is on the right of the canvas; **When** the user toggles the setting+ while Modular is shown, **Then** the column moves immediately, without reopening the view.+6. **Given** Modular switches to Global view, **When** it shows the islands, **Then** the+ header column is hidden, as the rail is today; switching back to Track view brings it+ back.+7. **Given** a track is added, removed, renamed, recoloured or moved from anywhere, **When**+ Modular is shown, **Then** its column updates to match.++---++### User Story 3 - Patch a group's effect chain (Priority: P2)++With every track's header in Modular, groups are there too. The producer clicks a group's+header and Modular shows the group's own effect chain as a graph — the audio coming in from+its tracks, its effects as nodes, its output — so they can drop an LFO on it and modulate the+group's filter the same way they would on any track.++**Why this priority**: Follows from US2 (group headers are now in Modular); without it a group+header in Modular would be the only header that doesn't open a graph.++**Independent Test**: In a project with a group that has an effect on it, click the group's+header in Modular: its chain shows as a graph; add an LFO from the browser tab, patch it to an+effect parameter, play, and hear / see the parameter move; save, reopen, and the patch and node+positions are still there.++**Acceptance Scenarios**:++1. **Given** Modular Track view, **When** the user clicks a group's header, **Then** Modular+ shows the group's effect chain as a graph (input, effects, output), and the group becomes+ the selected track app-wide.+2. **Given** a group's graph is shown, **When** the user adds a node from the browser tab and+ patches it to an effect parameter, **Then** the modulation works during playback as on any+ audio track, and is saved with the project with its node positions.+3. **Given** a group's graph is shown, **When** the user expands, bypasses, duplicates, deletes+ or reorders an effect node, **Then** it behaves as on an audio track's graph.+4. **Given** a group's graph is shown, **When** the user folds or unfolds the group from its+ header, **Then** the graph stays on the group.++---++### User Story 4 - The browser tab replaces the toolbar's + Add (Priority: P3)++With the browser tab in place, the Modular toolbar's **+ Add** dropdown goes away: the browser+tab and the command palette are the ways to add a node, and the toolbar keeps only the view+switch and the zoom controls.++**Why this priority**: Toolbar clean-up; depends on US1 being in.++**Independent Test**: Open Modular and check the toolbar has no **+ Add**; add a node from the+browser tab and from the palette.++**Acceptance Scenarios**:++1. **Given** Modular is shown, **When** the user looks at the toolbar, **Then** there is no+ **+ Add** dropdown.+2. **Given** Modular is shown, **When** the user opens the command palette, **Then** Modular+ nodes are still listed there and added as today.++---++### User Story 5 - Show a track in Modular from its context menu (Priority: P2)++Working in the arrangement, the producer right-clicks a track's header and picks **Show in+Modular**: the main view switches to Modular, in Track view, on that track's graph, and the+track is selected.++**Why this priority**: The quick way into a specific track's graph; useful but the view switch+plus a header click already gets there.++**Independent Test**: From the arrangement, the mixer and the session view, use **Show in+Modular** on an instrument, an audio, a return and a group track; each time Modular opens on+that track.++**Acceptance Scenarios**:++1. **Given** a patchable track (instrument, audio, return, group) in the arrangement, mixer or+ session view, **When** the user picks **Show in Modular** from its context menu, **Then**+ Modular becomes the shown view, in Track view, showing that track's graph, and the track is+ selected.+2. **Given** Modular is in Global view, **When** the user picks **Show in Modular** on a track,+ **Then** Modular switches to Track view on that track.+3. **Given** the master track, **When** the user opens its context menu, **Then** there is no+ **Show in Modular** item.+4. **Given** the track already shown in Modular's Track view, **When** the user opens its+ header's menu in Modular, **Then** **Show in Modular** is absent (or disabled) there.++---++### Edge Cases++- **Leaving Modular with the Modular tab open**: the tab leaves the rail and the browser shows+ the tab that was open before it.+- **Coming back to Modular**: the browser shows the tab last picked while in Modular (the+ Modular tab the first time).+- **Global view or no track shown**: a node can't be added — no track's graph is shown; the+ drop is refused and double-click / Enter explains why ("Open a track in Modular").+- **Dropping a node elsewhere** (the arrangement, session, device panel, the header column+ itself): refused, no change.+- **Dropping a device on a header in Modular**: behaves as dropping it on the same header in+ the arrangement (the arrangement already accepts browser drops on its headers).+- **Group header clicked**: opens the group's effect chain as a graph (US3). A group with no+ effects shows its input wired straight to its output, ready for nodes and drops.+- **Group deleted or ungrouped while its graph is shown**: as when the shown track is deleted —+ the canvas empties.+- **Global view**: groups still get no island (Global view is out of scope).+- **Master**: the arrangement's footer rows (returns, master) appear in Modular's column the+ same way; clicking the master row selects it but does not change the graph (Modular doesn't+ patch the master).+- **The shown track is deleted**: as today, the canvas empties and the column no longer marks+ any track as shown.+- **Very many tracks**: the column scrolls vertically on its own; scrolling it doesn't move the+ canvas.+- **Narrow window**: the column keeps the arrangement's header width setting; the canvas takes+ the rest.++## Requirements *(mandatory)*++### Functional Requirements++**Browser tab**++- **FR-001**: While Modular is the shown view, the browser rail MUST have a Modular tab with+ its own icon (not reused from any other tab) and a localised tooltip.+- **FR-007a**: While Arrangement or Session is the shown view, the rail MUST NOT show the+ Modular tab; leaving Modular with it open MUST return the browser to the tab open before it.+- **FR-007b**: The browser MUST remember a separate last-picked tab for Modular and show it+ whenever Modular opens; the first time Modular opens (no tab picked there yet) it MUST show+ the Modular tab. Whether that memory survives an app restart follows how the browser keeps+ its last tab today.+- **FR-002**: The Modular tab MUST list every node in the app's Modular node catalogue — the+ same list the palette uses — showing each node's name, category and description.+- **FR-003**: A node kind added to that catalogue MUST appear in the tab with no tab-specific+ change.+- **FR-004**: The browser's search field MUST filter the Modular tab by name, category and+ search aliases, with the same matching rules as the other browser tabs.+- **FR-005**: Dragging a node from the tab onto the Modular canvas in Track view MUST add it to+ the shown track, unconnected, at the drop point, as one undo step.+- **FR-006**: Double-click or Enter on a node MUST add it to the shown track, unconnected, at+ the middle of the visible canvas, as one undo step.+- **FR-007**: Where a node can't be added (Global view, no track shown, any drop target other+ than the Modular canvas), the drag MUST be refused and double-click / Enter MUST leave the project+ unchanged and show the reason.+- **FR-008**: The tab MUST keep the browser's behaviour shared by the list tabs: the collapsed+ / expanded browser, keyboard navigation in the list, and remembering the last open tab.++**Track headers in Modular**++- **FR-009**: Modular's Track view MUST show the arrangement's track header cards in place of+ the current "Tracks" rail: the same tracks (groups included), order, nesting, group trays,+ return and master rows, look (new and classic) and header width.+- **FR-010**: Every control, gesture and menu on those cards MUST work in Modular as in the+ arrangement and change the same project state; changes made in Modular MUST show in every+ other view, and changes made elsewhere MUST show in Modular.+- **FR-011**: Meters on the cards MUST animate during playback in Modular.+- **FR-012**: Clicking a patchable track's header (instrument, audio, return, group) MUST show+ that track's graph and make it the app-wide selected track; the shown track MUST be marked on its+ card as the selected track is in the arrangement.+- **FR-013**: The column MUST be on the left or right of the canvas according to **Track+ headers on the right**, and MUST move at once when that setting changes.+- **FR-014**: Global view MUST hide the column; Track view MUST show it.+- **FR-015**: Row heights in Modular's column MUST be the arrangement's row heights (a row+ resized in either view is that height in both).+- **FR-016**: The column MUST scroll vertically on its own and keep its scroll position while+ the user works on the canvas.++**Group graphs**++- **FR-017**: A group's graph MUST show its effect chain (input → effects → output) with the+ same node actions as an audio track's graph (expand, bypass, duplicate, delete, reorder,+ browser drops of effects).+- **FR-018**: Modular nodes MUST be addable to a group's graph and patchable to its effects'+ parameters; the modulation MUST act during playback and be saved and restored with the+ project, node positions included.++**Toolbar**++- **FR-019**: The Modular toolbar MUST NOT have the **+ Add** dropdown; Modular nodes remain+ available in the command palette opened from Modular.++**Show in Modular**++- **FR-022**: Every track context menu that the arrangement, mixer and session views show for+ a patchable track (instrument, audio, return, group) MUST have a **Show in Modular** item.+- **FR-023**: **Show in Modular** MUST make Modular the shown view, in Track view, on that+ track's graph, and select the track; it is one action, not an undo step.+- **FR-024**: The item MUST NOT appear for the master track, and MUST NOT be enabled in+ Modular for the track Modular already shows.++**General**++- **FR-020**: All new user-visible text MUST be localised (English and Russian).+- **FR-021**: The change MUST NOT alter the engine, the project file format or Global view+ (issue #592 scope). Group tracks are engine tracks and already run CV modulation like any+ track; the plan confirms this, and if it turns out false, group graphs (US3) are split out+ into their own issue rather than widening this one.++### Key Entities++- **Modular node**: a node only Modular offers (a modulator, converter, control, CV utility or+ monitor). Has a name, a category, a description and search aliases; added to a track's+ graph unconnected.+- **Track header card**: the arrangement's per-track control card (name, colour, mute / solo /+ arm, monitor, input, volume, pan, meter, sends, context menu, group tray), now shown in two+ views over the same track state.++## Success Criteria *(mandatory)*++### Measurable Outcomes++- **SC-001**: A user can add any Modular node to the canvas from the browser in one drag or+ one double-click, without opening a menu.+- **SC-002**: 100 % of the Modular node kinds the app offers are listed in the Modular tab, and+ searching any node's name, category or alias finds it.+- **SC-003**: Every action available on an arrangement track header (100 % of the controls,+ gestures and context-menu items) is available and gives the same result from Modular's+ column.+- **SC-004**: Toggling **Track headers on the right** moves Modular's column within the same+ frame update as the arrangement's, with no restart or view switch.+- **SC-005**: Showing Modular with 64 tracks feels as responsive as the arrangement with the+ same project: no visible stall when switching to Modular or clicking a header.++## Assumptions++- The tab is placed on the rail right after MIDI effects (devices together); its icon is a new+ glyph in Nota's icon set (a patch cable / modulation mark) drawn to DESIGN.md.+- Nodes in the tab are not presets or files: no audition player and no favourites beyond what+ every list tab already offers.+- "Add at the drop point" and "add at the middle of the view" reuse what the palette already+ does when opened from Modular, so placement, naming and undo behave the same.+- Row heights, header width, fold state, multi-selection and the column's vertical scroll are+ shared with the arrangement (it is the same column; see research R1).+- The arrangement's lane side (clips, automation and take lanes) doesn't come to Modular — only+ the header column (issue out of scope). Automation and take sub-rows that belong to the header+ column show as they do in the arrangement.+- The mixer has no track context menu today, so Show in Modular lands in the arrangement's and+ the session's menus (research R5).+- Shortcuts, FEATURES.md, CHANGELOG and the user docs (Browser and Modular pages, EN + RU) are+ updated with the change.++## 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; node adds use the existing engine calls+- [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 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/095-modular-browser-headers/tasks.md b/specs/095-modular-browser-headers/tasks.mdnew file mode 100644index 00000000..62a22f24--- /dev/null+++ b/specs/095-modular-browser-headers/tasks.md@@ -0,0 +1,140 @@+---+description: "Tasks for 095 — Modular tab in the browser, arrangement track headers in Modular"+---++# Tasks: Modular tab in the browser, arrangement track headers in Modular++**Input**: [spec.md](spec.md), [plan.md](plan.md), [research.md](research.md),+[data-model.md](data-model.md), [contracts/ui-contract.md](contracts/ui-contract.md),+[quickstart.md](quickstart.md) · Issue nota-daw/nota#592++**Tests**: smoke tests only for the pure pieces (plan § Testing); views are verified by the+quickstart and the headless screenshot harness.++## Format: `[ID] [P?] [Story] Description`++---++## Phase 1: Setup++- [X] T001 Create branch `feat/modular-browser-headers` off an up-to-date `develop` (spec files carried over untracked)++---++## Phase 2: Foundational++**Purpose**: the pure Presentation pieces and the BrowserItem kind every story builds on.++- [X] T002 [P] Add `BrowserItemKind.ModularNode` and init-only `string Keywords { get; init; } = ""` to `BrowserItem` in src/managed/Nota.Presentation/ViewModels/BrowserViewModel.cs+- [X] T003 [P] Create `ModularBrowserItems` (`Build(nodes)` one row per node in catalogue order: `Name`, `Kind = ModularNode`, `BuiltinKind = node.Kind`, `Sub = node.Sub`, `Tip = description`, `Keywords = aliases joined by spaces`; `Matches(item, query)`: empty matches, else every whitespace-separated word occurs case-insensitively in name, category or keywords) in src/managed/Nota.Presentation/ModularBrowserItems.cs+- [X] T004 [P] Create `BrowserTabMemory(startTab, modularTab)` with `Picked(tab)`, `Enter()` (→ `ModularTab ?? modularTab`), `Leave()` (→ `OutsideTab`); the Modular tab index is never stored as `OutsideTab` — in src/managed/Nota.Presentation/BrowserTabMemory.cs+- [X] T005 Add `ModularBrowserTests` (every `ModularCatalog.All` node mapped in order; "wobble" → LFO, "sidechain" → Envelope Follower, "monitor" → Scope, "env foll" → Envelope Follower; tab memory: first Enter → modular tab, Picked in Modular survives Leave/Enter, Leave returns the outside tab) in tests/Nota.SmokeTest/ModularBrowserTests.cs and register it in tests/Nota.SmokeTest/Program.cs++**Checkpoint**: Presentation compiles; smoke tests for the pure pieces pass.++---++## Phase 3: User Story 2 — Arrangement track headers in Modular (P1)++**Goal**: Modular's Track view shows the arrangement's header column (same instance, headers-only), on the configured side.++**Independent Test**: quickstart Q2.++- [X] T006 [US2] Create src/managed/Nota.App/ArrangementView.HeadersOnly.cs: `HeadersOnly` property hiding overview row, sections row, ruler + zoom bar, lanes, overlay, footer lanes and h-scroll; the top band becomes a header-width 34 px strip with the "Tracks" caption, the bottom band a 22 px strip; the view docks on the header side with `Width = HeaderColumnWidth`; `HeaderColumnWidth` + `HeaderColumnWidthChanged` (raised from `SetHeaderWidth` and side changes); keep fields for the bands it toggles in src/managed/Nota.App/ArrangementView.cs+- [X] T007 [US2] Add `TrackAtHeaderPoint(Point topLevelPoint)` (tracks, groups, returns; not master) and `SetColumnHint(bool)` (brass column divider) to src/managed/Nota.App/ArrangementView.HeadersOnly.cs+- [X] T008 [US2] Remove the "Tracks" rail from src/managed/Nota.App/ModularView.cs (`_sidebar`, `_sidebarPanel`, `TrackRow`, the list column); keep the empty-state hint; cross-track CV drop in `FinishConnect` asks `TrackAtPoint` (host) and opens `ShowCrossTrackParamMenu` on the returned anchor; `BeginConnect`/`FinishConnect` raise `ConnectHintChanged`+- [X] T009 [US2] In `SetView` (src/managed/Nota.App/MainWindow.axaml.cs): Modular shows `Timeline` with `HeadersOnly = true`, insets `_modular.Margin` by the column width on the header side, updates on `HeaderColumnWidthChanged` and on `ApplyHeadersRight`; other views reset `HeadersOnly` and the margin; wire `TrackAtPoint` → `Timeline.TrackAtHeaderPoint`, `ConnectHintChanged` → `Timeline.SetColumnHint`; keep `Timeline.ModularTrackId` in step with the shown track+- [X] T010 [US2] Add `ArrangementShown => Timeline.IsVisible && !Timeline.HeadersOnly` and use it where `Timeline.IsVisible` means "the arrangement is the view" in src/managed/Nota.App/MainWindow.Menu.cs (Copy to Session) and src/managed/Nota.App/MainWindow.Input.cs (clip nudge arrows); leave track-header keys working in Modular+- [X] T011 [US2] Verify with the headless harness: Modular with headers left and right, new and classic look, arrangement unchanged when shown (quickstart Q2 steps 1, 5, 6, 8)++**Checkpoint**: US2 works; arrangement unchanged.++---++## Phase 4: User Story 1 — Modular nodes from the browser (P1)++**Goal**: a Modular tab listing catalogue nodes; drag and double-click add nodes.++**Independent Test**: quickstart Q1 steps 1–7.++- [X] T012 [P] [US1] Add `GlyphKind.PatchCable` (16-unit grid, the rail's stroke weight, distinct from `GlyphKind.Modular`) in src/managed/Nota.App/Controls/Glyph.cs+- [X] T013 [US1] Add the Modular tab to src/managed/Nota.App/BrowserView.cs: `ModularTab = 9`, `TabCount = 10`, rail position after MIDI effects, tooltip `browser.modular`, `_sources[ModularTab] = ModularBrowserItems.Build(ModularCatalog.All)`, `ApplyFilter` uses `ModularBrowserItems.Matches` for it, no audition / chips / favourites for it; rows show category and the description tooltip+- [X] T014 [US1] Add `SetModularContext(bool)` with `BrowserTabMemory` (tab hidden outside Modular; Enter/Leave pick the tab; `SelectTab` reports `Picked`) in src/managed/Nota.App/BrowserView.cs; call it from `SetView` in src/managed/Nota.App/MainWindow.axaml.cs+- [X] T015 [US1] Add `IsModularNodeDrag`; make `IsAcceptableDrag` refuse ModularNode drags in src/managed/Nota.App/BrowserView.cs+- [X] T016 [US1] In src/managed/Nota.App/ModularView.cs accept ModularNode drags on the canvas only when `CanAddNodes` (Track view, track shown) with the drop glow; on drop call `AddModulatorAt(kind, dropPoint)` (new optional viewport-point parameter); `StatusRequested` for refusals+- [X] T017 [US1] Route browser `ItemActivated` for ModularNode rows to `_modular.AddModulatorAt(kind)` (centre) or the status reason ("Open a track in Modular") in src/managed/Nota.App/MainWindow.Browser.cs; `Timeline.Refresh()` after an add, as the palette does+- [X] T018 [US1] Verify quickstart Q1 steps 1–7 in the running app++---++## Phase 5: User Story 3 — Group graphs (P2)++**Goal**: a group's header opens its effect chain as a graph; modulation works on it.++**Independent Test**: quickstart Q4.++- [X] T019 [US3] In src/managed/Nota.App/ModularView.cs accept group tracks in `Show`; source node "Tracks in" (badge `GROUP`) for groups; `Show(engine.MasterTrackId)` is a no-op; add `ShowTrack(id)` (leaves Global view); Global view keeps skipping groups+- [X] T020 [US3] Verify quickstart Q4 (LFO → group Auto Filter cutoff moves during playback; save / reopen keeps patch and positions)++---++## Phase 6: User Story 5 — Show in Modular (P2)++**Goal**: track menus jump to the track's graph.++**Independent Test**: quickstart Q3.++- [X] T021 [P] [US5] Add **Show in Modular** (`GlyphKind.Modular`, naming / inputs group) to `BuildTrackMenu` and to `ShowFooterMenu` for returns only, disabled when `HeadersOnly && trackId == ModularTrackId`; raise `ShowInModularRequested` in src/managed/Nota.App/ArrangementView.cs+- [X] T022 [P] [US5] Add **Show in Modular** to `ShowHeaderMenu` (not the master column) and raise `ShowInModularRequested` in src/managed/Nota.App/SessionView.Grid.cs+- [X] T023 [US5] Handle `ShowInModularRequested` from both views in src/managed/Nota.App/MainWindow.axaml.cs: `SetView(Modular)`, select the track, `_modular.ShowTrack(t)`+- [X] T024 [US5] Verify quickstart Q3++---++## Phase 7: User Story 4 — Remove + Add (P3)++- [X] T025 [US4] Remove the **+ Add** flyout and the unused `AddModulator(int)` from src/managed/Nota.App/ModularView.cs; palette Modular entries unchanged (quickstart Q1 step 8)++---++## Phase 8: Polish & cross-cutting++- [X] T026 Add the new strings (`browser.modular`, `common.show_in_modular`, `modular.tracks_in`, `modular.open_a_track_to_add_nodes`, …) to src/managed/Nota.Application/Localization/en.json; drop keys that became unused (`modular.add`, `modular.tracks`, `modular.no_tracks_yet` if unused)+- [X] T027 RU strings for the new keys — follow the project's reference-sync flow for translations (the repo keeps only the en.json reference; RU follows the reference sync)+- [X] T028 [P] CHANGELOG.md `[Unreleased]` entry (Added: Modular browser tab, headers in Modular, group graphs, Show in Modular; Removed: Modular + Add)+- [X] T029 [P] FEATURES.md via the nota-features skill (Modular View, Browser, Windows and interface)+- [X] T030 [P] User docs via the nota-docs skill (Browser and Modular pages, EN + RU) in ../nota-docs+- [X] T031 Shortcuts check via the nota-shortcuts skill (no new bindings expected; confirm)+- [ ] T032 `scripts/build.sh` green (smoke test incl. `ModularBrowserTests`, `DesignTokenCheck`, localisation check)+- [X] T033 `/speckit-converge` reports Converged++---++## Dependencies & Execution Order++- T001 → T002–T005 (T002–T004 parallel; T005 after T003/T004).+- US2 (T006–T011) after Phase 2; it is the riskiest, done first.+- US1 (T012–T018) after Phase 2; T016 needs T008 (ModularView after rail removal) to avoid+ conflicting edits; T014 touches `SetView` after T009.+- US3 (T019–T020) after T008.+- US5 (T021–T024) after T006 (`HeadersOnly`, `ModularTrackId`) and T019 (`ShowTrack`).+- US4 (T025) after T016.+- Polish after all stories.++## Parallel examples++- Phase 2: T002, T003, T004 together.+- US1: T012 alongside T013.+- US5: T021 and T022 together (different files).+- Polish: T028, T029, T030 together.++## Implementation Strategy++US2 first (biggest risk, the headline change), then US1 (the tab) — together they are the+issue's MVP. US3, US5 and US4 follow as small increments; polish and the build gate close.++---++## Phase 9: Convergence++- [X] T034 Align `ModularTrackId` in specs/095-modular-browser-headers/contracts/ui-contract.md and data-model.md with the code (`Func<int>?` asked when a menu opens, so it never goes stale) per plan: contracts/ui-contract.md (contradicts)diff --git a/src/managed/Nota.App/ArrangementView.HeadersOnly.cs b/src/managed/Nota.App/ArrangementView.HeadersOnly.csnew file mode 100644index 00000000..d2c047ed--- /dev/null+++ b/src/managed/Nota.App/ArrangementView.HeadersOnly.cs@@ -0,0 +1,139 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.+//+// Headers only (specs/095, #592): Modular shows the arrangement's own track-header column+// beside its canvas — this same view with the timeline put away — so every card, control,+// gesture, menu, meter, fold and look is the arrangement's by construction, and a header+// click selects the track as it always has (the host turns that into the Modular graph).+// The mode only hides bands and narrows the view to its column; nothing else changes.++using System;+using Avalonia;+using Avalonia.Controls;+using Avalonia.Layout;+using Avalonia.Media;+using Avalonia.VisualTree;+using Nota.Application.Localization;++namespace Nota.App;++public sealed partial class ArrangementView+{+ // Modular's own chrome heights, so the column lines up with its toolbar and status line.+ private const double ModularToolbarH = 34, ModularStatusH = 22;++ private bool _headersOnly;+ private Control _zoomBar = null!;+ private Grid _topGrid = null!;+ private Grid _bottomGrid = null!;+ private readonly TextBlock _tracksCaption = new()+ {+ Classes = { "SectionLabel" }, IsVisible = false,+ VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(NameGap, 0, 0, 0),+ };++ /// <summary>The header column alone (Modular view): no overview, sections, ruler, lanes or+ /// scrollbar; the view is as wide as its column and docks on the header side.</summary>+ public bool HeadersOnly+ {+ get => _headersOnly;+ set+ {+ if (_headersOnly == value) return;+ _headersOnly = value;+ // Overview and Sections keep their own (user) visibility; collapse them instead.+ _overviewRow.MaxHeight = value ? 0 : double.PositiveInfinity;+ _sectionsRow.MaxHeight = value ? 0 : double.PositiveInfinity;+ _ruler.IsVisible = !value;+ _zoomBar.IsVisible = !value;+ _tracksCaption.IsVisible = value;+ _topGrid.Height = value ? ModularToolbarH - 1 : RulerH; // + the band's 1 px rule+ _lanes.IsVisible = !value;+ _overlay.IsVisible = !value;+ _footerLanes.IsVisible = !value;+ _hScroll.IsVisible = !value;+ _bottomGrid.Height = value ? ModularStatusH - 1 : double.NaN;+ if (!value) SetColumnHint(false);+ ApplyHeaderWidth(final: true); // the window-width clamp differs between the modes+ FitHeadersOnlyWidth();+ }+ }++ /// <summary>The header column's width as drawn.</summary>+ public double HeaderColumnWidth => _headerW;++ /// <summary>The column changed width or side — a host laying something beside it re-fits.</summary>+ public event Action? HeaderColumnWidthChanged;++ /// <summary>The track Modular shows (-1 none), asked when a menu opens: its Show in+ /// Modular is disabled there.</summary>+ public Func<int>? ModularTrackId { get; set; }++ // Headers only: the view is exactly its column, on the header side. Otherwise it fills.+ private void FitHeadersOnlyWidth()+ {+ if (_headersOnly)+ {+ Width = _headerW;+ HorizontalAlignment = _headersRight ? HorizontalAlignment.Right : HorizontalAlignment.Left;+ }+ else+ {+ Width = double.NaN;+ HorizontalAlignment = HorizontalAlignment.Stretch;+ }+ HeaderColumnWidthChanged?.Invoke();+ }++ /// <summary>The track (or group, or return) whose header is under a point given in the+ /// window's coordinates, with its card to anchor a menu on; null over the master, empty+ /// space or outside the column. Modular's cross-track CV drop asks this.</summary>+ public (int TrackId, Control Anchor)? TrackAtHeaderPoint(Point windowPoint)+ {+ if (TopLevel.GetTopLevel(this) is not { } top || !IsEffectivelyVisible) return null;+ if (top.TranslatePoint(windowPoint, _headers) is { } hp && hp.X >= 0 && hp.X <= _headerW+ && _scroller.TranslatePoint(new Point(0, 0), top) is { } so+ && windowPoint.Y >= so.Y && windowPoint.Y <= so.Y + _scroller.Bounds.Height)+ {+ int row = RowAtY(hp.Y);+ if (row >= 0)+ {+ int id = _tracks[row].Id;+ Control anchor = _headerCards.TryGetValue(id, out var hc) ? hc.card : _headers;+ return (id, anchor);+ }+ }+ // The pinned footer scrolls when returns are tall: only its visible part counts.+ if (_footerScroller.TranslatePoint(new Point(0, 0), top) is { } fo+ && windowPoint.Y >= fo.Y && windowPoint.Y <= fo.Y + _footerScroller.Bounds.Height+ && top.TranslatePoint(windowPoint, _footerHeaders) is { } fp && fp.X >= 0 && fp.X <= _headerW)+ for (int i = 0; i < _returns.Count && i < _footerCards.Count; i++)+ {+ var card = _footerCards[i].card;+ if (card.Bounds.Contains(fp)) return (_returns[i].Id, card);+ }+ return null;+ }++ /// <summary>A track menu's Show in Modular (specs/095): the host opens Modular on the track.</summary>+ public event Action<int>? ShowInModularRequested;++ // Show in Modular, for a track, group or return menu (never the master). In Modular it is+ // disabled on the track already shown.+ private MenuItem ShowInModularItem(int trackId)+ {+ var mi = MenuKit.Item(Loc.T("common.show_in_modular"), GlyphKind.Modular, () => ShowInModularRequested?.Invoke(trackId));+ mi.IsEnabled = !(_headersOnly && trackId == (ModularTrackId?.Invoke() ?? -1));+ return mi;+ }++ /// <summary>A CV cable is being dragged in Modular: the column's divider turns orange+ /// to say a header is a drop target (another track's parameter).</summary>+ public void SetColumnHint(bool on)+ {+ IBrush brush = on ? NotaPalette.Accent : Brush("Brush.BorderDefault");+ foreach (var b in _columnDividers) b.BorderBrush = brush;+ if (on) foreach (var b in _columnDividers) b.BorderThickness = _headersRight ? new Thickness(2, 0, 0, 0) : new Thickness(0, 0, 2, 0);+ else foreach (var b in _columnDividers) b.BorderThickness = ColumnDivider;+ }+}diff --git a/src/managed/Nota.App/ArrangementView.Sizing.cs b/src/managed/Nota.App/ArrangementView.Sizing.csindex 81b9b20f..ddcfe492 100644--- a/src/managed/Nota.App/ArrangementView.Sizing.cs+++ b/src/managed/Nota.App/ArrangementView.Sizing.cs@@ -467,7 +467,8 @@ public sealed partial class ArrangementView{double w = Math.Clamp(wanted, MinHeaderW, MaxHeaderW);double room = Bounds.Width - MinLanesW; // a narrow window squeezes the lanes first, then the headers- if (Bounds.Width > 0 && w > room) w = Math.Max(MinHeaderW, room);+ // Headers only (Modular, specs/095): the view is the column, the canvas beside it has the room.+ if (!_headersOnly && Bounds.Width > 0 && w > room) w = Math.Max(MinHeaderW, room);return Math.Round(w);}@@ -489,6 +490,7 @@ public sealed partial class ArrangementViewforeach (var c in _footerHeaders.Children) c.Width = w;PlaceRowSeamGrips();PlaceColumnSeam();+ FitHeadersOnlyWidth();if (final){RebuildHeaders();@@ -598,6 +600,7 @@ public sealed partial class ArrangementViewforeach (var b in _columnDividers) b.BorderThickness = ColumnDivider;_columnBackdrop.HorizontalAlignment = _headersRight ? HorizontalAlignment.Right : HorizontalAlignment.Left;PlaceColumnSeam();+ FitHeadersOnlyWidth();// The cards carry their own divider: rebuild them with it on the new side.RebuildHeaders();RebuildFooterHeaders();diff --git a/src/managed/Nota.App/ArrangementView.cs b/src/managed/Nota.App/ArrangementView.csindex 5e889221..a59ba1d4 100644--- a/src/managed/Nota.App/ArrangementView.cs+++ b/src/managed/Nota.App/ArrangementView.cs@@ -420,8 +420,10 @@ public sealed partial class ArrangementView : UserControl}zoomBar.SizeChanged += (_, _) => FitZoomLabel();_overviewRange.PropertyChanged += (_, e) => { if (e.Property == TextBlock.TextProperty) FitZoomLabel(); };- var topLeft = HeaderPanel(zoomBar);- var topGrid = new Grid { Height = RulerH };+ _zoomBar = zoomBar;+ _tracksCaption.Text = Loc.T("modular.tracks");+ var topLeft = HeaderPanel(new Panel { Children = { zoomBar, _tracksCaption } });+ var topGrid = _topGrid = new Grid { Height = RulerH };topGrid.Children.Add(topLeft);topGrid.Children.Add(_ruler);AddSideRow(topGrid, topLeft, _ruler);@@ -522,7 +524,7 @@ public sealed partial class ArrangementView : UserControl};// Bottom: a thin horizontal scrollbar under the lanes, on the well, past a hairline.- var bottomGrid = new Grid();+ var bottomGrid = _bottomGrid = new Grid();var bottomLeft = HeaderPanel(null);bottomLeft.BindResource(Border.BackgroundProperty, "Brush.BgSunken");bottomGrid.Children.Add(bottomLeft);@@ -2881,6 +2883,7 @@ public sealed partial class ArrangementView : UserControlvar vm = _tracks.FirstOrDefault(v => v.Id == trackId);var rename = MenuKit.Item(Loc.T("common.rename"), GlyphKind.Edit, () => PromptRenameTrack(anchor, trackId));+ var showInModular = ShowInModularItem(trackId);// Record input ▸ (audio tracks only): hardware, master, or another track's output// (internal resampling). The active source is ticked and shown on the item.@@ -2978,7 +2981,7 @@ public sealed partial class ArrangementView : UserControlMenuKit.AddGroups(flyout.Items,new Control[] { MenuKit.Header(vm?.Name ?? "", TrackBrush(EffectiveColorIndex(_engine, trackId)), TrackBadge(trackId)) },new Control[] { TrackColourRow(one), TrackHeightRow(one) },- new Control?[] { rename, recInput, midiInput, midiFrom }.OfType<Control>(),+ new Control?[] { rename, showInModular, recInput, midiInput, midiFrom }.OfType<Control>(),FreezeMenuItems?.Invoke(trackId),create,clipboard,@@ -3522,7 +3525,9 @@ public sealed partial class ArrangementView : UserControlTrackBrush(EffectiveColorIndex(_engine, trackId)), isReturn ? Loc.T("common.return") : Loc.T("common.master")) },new Control[] { TrackColourRow(new[] { trackId }) },new Control[] { FooterHeightRow(isReturn ? _returns.FindIndex(r => r.Id == trackId) : _returns.Count) },- new Control[] { MenuKit.Item(Loc.T("common.rename"), GlyphKind.Edit, () => PromptRenameTrack(anchor, trackId)) },+ isReturn+ ? new Control[] { MenuKit.Item(Loc.T("common.rename"), GlyphKind.Edit, () => PromptRenameTrack(anchor, trackId)), ShowInModularItem(trackId) }+ : new Control[] { MenuKit.Item(Loc.T("common.rename"), GlyphKind.Edit, () => PromptRenameTrack(anchor, trackId)) },isReturn ? new Control[] { MenuKit.Danger(Loc.T("common.delete"), GlyphKind.Trash, () => DeleteTracks(new[] { trackId }), MenuKit.DeleteKey) } : null);flyout.ShowAt(anchor, showAtPointer: true);}diff --git a/src/managed/Nota.App/BrowserView.cs b/src/managed/Nota.App/BrowserView.csindex e51ffff4..b35d8a4a 100644--- a/src/managed/Nota.App/BrowserView.cs+++ b/src/managed/Nota.App/BrowserView.cs@@ -29,6 +29,7 @@ using Avalonia.Interactivity;using Avalonia.Layout;using Avalonia.Media;using Avalonia.Platform.Storage;+using Avalonia.VisualTree;using Nota.Application;using Nota.Application.Input;using Nota.Application.Samples;@@ -53,6 +54,9 @@ public sealed partial class BrowserView : UserControl/// <summary>True while a browser row is being dragged (used by drop targets).</summary>public static bool IsBrowserDrag => CurrentDrag is not null;+ /// <summary>True while the drag is a Modular node (spec 095): only the Modular canvas takes it.</summary>+ public static bool IsModularNodeDrag => CurrentDrag is { Kind: BrowserItemKind.ModularNode };+/// <summary>True while the drag is an arrangement audio clip pulled out as a sample (it/// rides the browser payload, so every sample drop target takes it as-is).</summary>public static bool IsClipDrag { get; private set; }@@ -82,6 +86,7 @@ public sealed partial class BrowserView : UserControl/// where some backends don't expose the file list yet; the drop re-checks.</summary>public static bool IsAcceptableDrag(DragEventArgs e)=> !DeviceDrag.IsActive // a device card's drag carries text too, but isn't a file+ && !IsModularNodeDrag // a Modular node goes on the Modular canvas only (spec 095)&& (IsBrowserDrag || e.DataTransfer.Contains(DataFormat.File) || HasPathText(e.DataTransfer));// A drag that may name files without Avalonia's file list (#300): plain text or a@@ -157,13 +162,17 @@ public sealed partial class BrowserView : UserControlreturn g;}- private const int TabCount = 9; // Instr / FX / MIDI / Files / Preset / Proj / Map / History / Track+ private const int TabCount = 10; // Instr / FX / MIDI / Files / Preset / Proj / Map / History / Track / Modularprivate const int EffectsTab = 1; // Audio effectsprivate const int FilesTab = 3; // samples: the player auditions the fileprivate const int PresetsTab = 4; // Instr / FX / MIDI / Files / Presets carry the playerprivate const int MapTab = 6; // MIDI-learn mappings — hosts a MidiMapView, not a listprivate const int HistoryTab = 7; // the open project's versions — hosts a HistoryViewprivate const int InspectorTab = 8; // the selected track's settings — hosts a TrackInspectorView+ // Modular-only nodes (spec 095): a flat list on the rail after MIDI effects, shown only+ // while Modular is the view. The index is last so the others keep theirs.+ private const int ModularTab = 9;+ private readonly BrowserTabMemory _tabMemory = new(0, ModularTab);private static bool IsCustomTab(int index) => index is MapTab or HistoryTab or InspectorTab;private const double RowH = 30; // single-line index row (style guide: browser rows 30)private const double GroupRowH = 30;@@ -271,7 +280,10 @@ public sealed partial class BrowserView : UserControlRailTab(6, Loc.T("browser.midi_map"), GlyphKind.Map),RailTab(7, Loc.T("browser.history"), GlyphKind.History),RailTab(InspectorTab, Loc.T("browser.track_inspector"), GlyphKind.Track),+ RailTab(ModularTab, Loc.T("browser.modular"), GlyphKind.PatchCable),};+ _tabs[ModularTab].IsVisible = false; // Modular view only (SetModularContext)+ _sources[ModularTab] = ModularBrowserItems.Build(Nota.Application.Palette.ModularCatalog.All);// A hairline above Files, Map and the inspector: devices · library · mappings · track.foreach (int i in new[] { 3, 6, InspectorTab }){@@ -279,7 +291,7 @@ public sealed partial class BrowserView : UserControl_tabs[i].BindResource(Border.BorderBrushProperty, "Brush.BorderDefault");}var tabStack = new StackPanel { Margin = new Thickness(0, 5, 0, 0) };- foreach (var t in _tabs) tabStack.Children.Add(t);+ foreach (int i in new[] { 0, 1, 2, ModularTab, 3, 4, 5, 6, 7, InspectorTab }) tabStack.Children.Add(_tabs[i]);_collapseBtn = RailButton(GlyphKind.Sidebar, Loc.T("browser.collapse_browser"), () => SetCollapsed(!_collapsed, persist: true));_collapseBtn.Margin = new Thickness(0, 0, 0, 6);var rail = new DockPanel { Width = 40 };@@ -507,6 +519,17 @@ public sealed partial class BrowserView : UserControlCollapsedChanged?.Invoke(collapsed);}+ /// <summary>Modular became (or stopped being) the view (spec 095): the Modular tab joins or+ /// leaves the rail, and the browser shows the tab last picked in that context — the+ /// Modular tab the first time.</summary>+ public void SetModularContext(bool inModular)+ {+ if (inModular == _tabMemory.InModular) return;+ _tabs[ModularTab].IsVisible = inModular;+ int tab = inModular ? _tabMemory.Enter() : _tabMemory.Leave();+ SelectTab(tab);+ }+/// <summary>Persist the view options (the ⋮ menu) across sessions. Optional: without it/// the browser still works, it just forgets the toggles on quit.</summary>public void SetSettings(ISettingsService settings)@@ -598,6 +621,7 @@ public sealed partial class BrowserView : UserControlstring q = _search.Text?.Trim() ?? "";foreach (var it in src){+ if (index == ModularTab) { if (ModularBrowserItems.Matches(it, q)) dst.Add(it); continue; }if (q.Length == 0|| it.Name.Contains(q, StringComparison.OrdinalIgnoreCase)|| it.Sub.Contains(q, StringComparison.OrdinalIgnoreCase))@@ -691,6 +715,7 @@ public sealed partial class BrowserView : UserControl{3 => Loc.Plural("browser.samples", n) + AnalysingSuffix(),4 => Loc.Plural("browser.presets_n", n),+ ModularTab => Loc.Plural("browser.nodes_n", n),_ => Loc.Plural("browser.projects_n", n),};}@@ -706,6 +731,7 @@ public sealed partial class BrowserView : UserControl{if (index == _active) return;_active = index;+ _tabMemory.Picked(index);for (int i = 0; i < _tabs.Length; i++)_tabs[i].Classes.Set("active", !_collapsed && i == index);// The MIDI-map, History and inspector tabs host bespoke views, not a filtered item list.@@ -1258,8 +1284,23 @@ public sealed partial class BrowserView : UserControlItemTemplate = itemTemplate,};+ /// <summary>A Return pressed on the Modular tab's list with a node selected adds it+ /// (spec 095): the window's transport keys leave that Return to the list.</summary>+ public bool TakesReturn(object? source)+ => source is Visual v && _active == ModularTab+ && _pages[ModularTab].SelectedItem is BrowserItem { Kind: BrowserItemKind.ModularNode }+ && (v == _pages[ModularTab] || v.GetVisualAncestors().Contains(_pages[ModularTab]));+private void HookActivation(ListBox list){+ // Enter / Return on a Modular node adds it, as a double-click does (spec 095).+ list.KeyDown += (_, e) =>+ {+ if (e.Key is not (Key.Enter or Key.Return) || e.KeyModifiers != KeyModifiers.None) return;+ if (list.SelectedItem is not BrowserItem { Kind: BrowserItemKind.ModularNode } node) return;+ ItemActivated?.Invoke(node, e.KeyModifiers);+ e.Handled = true;+ };list.DoubleTapped += (_, e) =>{if (list.SelectedItem is not BrowserItem { IsGroup: false } item) return;@@ -1690,6 +1731,7 @@ public sealed partial class BrowserView : UserControlBrowserItemKind.Preset => Loc.T("browser.preset"),BrowserItemKind.Folder => Loc.T("browser.folder"),BrowserItemKind.OtherFile => Loc.T("browser.file"),+ BrowserItemKind.ModularNode => Loc.T("browser.modular_node"),_ => "",};diff --git a/src/managed/Nota.App/Controls/Glyph.cs b/src/managed/Nota.App/Controls/Glyph.csindex 64882a5d..d69483fe 100644--- a/src/managed/Nota.App/Controls/Glyph.cs+++ b/src/managed/Nota.App/Controls/Glyph.cs@@ -35,7 +35,7 @@ internal enum GlyphKindCopy, Cut, Paste, Trash, Duplicate, Split, Consolidate, Stems, Reverse, Folder, Ungroup,Palette, Note, Input, Arrow, Grid, Select, Save, List, Compare, Flatten,// Path kinds (24-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, Overdub, Replace, Speaker, SpeakerMute, SpeakerLow, SpeakerHigh, Metronome, Follow, Snap, Automation, Apple, Windows, Linux, ChainLink, Update,+ 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, PatchCable, Loop, Overdub, Replace, Speaker, SpeakerMute, SpeakerLow, SpeakerHigh, Metronome, Follow, Snap, Automation, Apple, Windows, Linux, ChainLink, Update,Output, Globe, // Settings → Outputs and LanguageLock, LockOpen, // a reference (read-only) clip in the multi-clip editor, and the unlocked toggleDockIn, // PopOut's opposite: bring a floating window back into the main one@@ -504,6 +504,8 @@ internal sealed class Glyph : Control// A bookmark (a preset).[GlyphKind.Preset] = ("M7 4 H17 V20 L12 16 L7 20 Z", null),// Two nodes joined by a cable (a modular patch).+ // Two jacks and the cable sagging between them: the browser's Modular tab (spec 095).+ [GlyphKind.PatchCable] = ("M2.5 7 A2.5 2.5 0 1 0 7.5 7 A2.5 2.5 0 1 0 2.5 7 Z M16.5 7 A2.5 2.5 0 1 0 21.5 7 A2.5 2.5 0 1 0 16.5 7 Z M5 9.5 C5 21 19 21 19 9.5", null),[GlyphKind.Patch] = ("M4 7 A2.501 2.501 0 1 0 9 7 A2.501 2.501 0 1 0 4 7 M15 17 A2.501 2.501 0 1 0 20 17 A2.501 2.501 0 1 0 15 17 M8.5 8.5 L15.5 15.5", null),// Two arrows chasing each other (loop).[GlyphKind.Loop] = ("M17 3 l3 3 l-3 3 M20 6 H8 a4 4 0 0 0 -4 4 v1.001 M7 21 l-3 -3 l3 -3 M4 18 h12 a4 4 0 0 0 4 -4 v-1.001", null),diff --git a/src/managed/Nota.App/MainWindow.Browser.cs b/src/managed/Nota.App/MainWindow.Browser.csindex cd3308eb..5198d880 100644--- a/src/managed/Nota.App/MainWindow.Browser.cs+++ b/src/managed/Nota.App/MainWindow.Browser.cs@@ -85,6 +85,7 @@ public partial class MainWindowprivate void OnBrowserItemActivated(BrowserItem item, KeyModifiers mods){if (_vm is null) return;+ if (item.Kind == BrowserItemKind.ModularNode) { AddModularNode(item); return; }try{RecordUse(PaletteIdOf(item), fromPalette: false);@@ -314,4 +315,15 @@ public partial class MainWindow_vm.StatusText = Loc.F("main.browser.save_preset_failed", ex.Message);}}++ // A Modular node double-clicked (or Enter) in the browser's Modular tab (specs/095): onto+ // the shown track's canvas, unconnected, in the middle of the view — as the palette does.+ private void AddModularNode(BrowserItem item)+ {+ if (_vm is null || _modular is null) return;+ if (!_modular.IsVisible || !_modular.CanAddNodes) { _vm.StatusText = Loc.T("modular.open_a_track_to_add_nodes"); return; }+ if (_modular.AddModulatorAt(item.BuiltinKind) < 0) { _vm.StatusText = Loc.F("main.palette.couldnt_add", item.Name); return; }+ Timeline.Refresh();+ _vm.StatusText = Loc.F("modular.node_added", item.Name);+ }}diff --git a/src/managed/Nota.App/MainWindow.Input.cs b/src/managed/Nota.App/MainWindow.Input.csindex 76933857..fc025c2d 100644--- a/src/managed/Nota.App/MainWindow.Input.cs+++ b/src/managed/Nota.App/MainWindow.Input.cs@@ -63,6 +63,11 @@ public partial class MainWindow_commands.Run((e.KeyModifiers & KeyModifiers.Shift) != 0 ? "transport.playPause" : "transport.playStop");e.Handled = true;}+ else if (e.Key == Key.Return && Browser.TakesReturn(e.Source))+ {+ // A Modular node selected in the browser: Return adds it (specs/095), so leave the+ // key to the list rather than stopping the transport.+ }else if (e.Key == Key.Return){// In the Session grid Return launches the selected slot or scene (design 1a);@@ -309,7 +314,7 @@ public partial class MainWindow// ←/→ nudge the selected arrangement clips by the grid step (⌥: a 64th); ⌥↑/⌥↓ move them// to the next track that takes them (#302). Only with clips selected, and not while the// piano roll, the detail panel or the floating detail window has the keys.- if (e.Key is Key.Left or Key.Right or Key.Up or Key.Down && Timeline.IsVisible && !_detailWasLastFocused+ if (e.Key is Key.Left or Key.Right or Key.Up or Key.Down && ArrangementShown && !_detailWasLastFocused&& _detailWindow?.IsActive != true&& _editorRoll is not { GridFocused: true }&& (e.KeyModifiers & (KeyModifiers.Control | KeyModifiers.Meta | KeyModifiers.Shift)) == 0)diff --git a/src/managed/Nota.App/MainWindow.Menu.cs b/src/managed/Nota.App/MainWindow.Menu.csindex c158c16a..237dc5d8 100644--- a/src/managed/Nota.App/MainWindow.Menu.cs+++ b/src/managed/Nota.App/MainWindow.Menu.cs@@ -207,7 +207,7 @@ public partial class MainWindow{if (!_session.CopySelectionToArrangement()) _vm.StatusText = Loc.T("main.menu.select_a_clip_or_a");}- else if (Timeline.IsVisible && Timeline.CopySelectionToSession() < 0)+ else if (ArrangementShown && Timeline.CopySelectionToSession() < 0)_vm.StatusText = Loc.T("main.menu.select_clips_to_copy_to");}private void OnMenuDeleteSel(object? sender, EventArgs e)diff --git a/src/managed/Nota.App/MainWindow.axaml.cs b/src/managed/Nota.App/MainWindow.axaml.csindex d5a386b8..220780c8 100644--- a/src/managed/Nota.App/MainWindow.axaml.cs+++ b/src/managed/Nota.App/MainWindow.axaml.cs@@ -491,6 +491,7 @@ public partial class MainWindow : WindowRecordPreview = _recordPreview,};_session.SlotEditRequested += OpenSessionClipEditor;+ _session.ShowInModularRequested += id => ShowInModular(id); // specs/095_session.ItemDropped += OnSessionDrop; // browser drag & drop (M7-5)HookSessionDeviceMoves(_session); // a device card dropped on a column (specs/043)_session.ArrangementChanged += () => Timeline.Refresh(); // M5-6@@ -532,6 +533,14 @@ public partial class MainWindow : Window_modular.Changed += () => { Timeline.Refresh(); if (_deviceChain is { } dc && dc.TrackId > 0) dc.Refresh(); };_modular.TrackActivated += OnTrackSelected; // Global-view island → select that track_modular.ItemDropped += OnModularDrop; // browser drag onto the modular canvas+ // The track column beside the canvas is the arrangement's header column (specs/095).+ _modular.TrackAtPoint = p => Timeline.TrackAtHeaderPoint(p);+ _modular.ConnectHintChanged += on => Timeline.SetColumnHint(on);+ _modular.StatusRequested += msg => { if (_vm is not null) _vm.StatusText = msg; };+ Timeline.ModularTrackId = () => _modular?.TrackId ?? -1;+ Timeline.HeaderColumnWidthChanged += FitModularBesideHeaders;+ _modular.GlobalChanged += _ => FitModularBesideHeaders(); // Global hides the column+ Timeline.ShowInModularRequested += ShowInModular;MainContent.Children.Add(_modular);WireMixerGroups(); // fold state, selection and compact strips (specs/070)@@ -746,7 +755,11 @@ public partial class MainWindow : Windowif (_session is null || _modular is null) return;SetDetailMaximized(false); // a view picked is a view to seebool session = view == MainView.Session, modular = view == MainView.Modular;+ // Modular keeps the arrangement's header column beside its canvas (specs/095).+ Timeline.HeadersOnly = modular;Timeline.IsVisible = view == MainView.Arrangement;+ FitModularBesideHeaders(); // in Modular: the column, unless Global view is up+ Browser.SetModularContext(modular);_session.IsVisible = session;_modular.IsVisible = modular;ArrangeBtn.IsChecked = view == MainView.Arrangement;@@ -757,12 +770,36 @@ public partial class MainWindow : Windowif (modular){int t = Timeline.SelectedTrackId > 0 ? Timeline.SelectedTrackId : LastInstrumentTrack();- if (t <= 0) t = _modular.FirstPatchableTrack(); // after opening a project nothing is selected (F3)- _modular.Show(t); // Show(-1) still builds the sidebar and its empty state+ if (t <= 0 || t == Engine.MasterTrackId) t = _modular.FirstPatchableTrack(); // after opening a project nothing is selected (F3)+ _modular.Show(t); // Show(-1) still shows the empty state}SyncClipTab(); // Clip tab availability is per-context (arrangement vs session)}+ /// <summary>The arrangement is the shown view — not just its header column in Modular.</summary>+ private bool ArrangementShown => Timeline.IsVisible && !Timeline.HeadersOnly;++ // Modular's canvas sits beside the header column, on the side the column takes.+ private void FitModularBesideHeaders()+ {+ if (_modular is null) return;+ // Track view shows the header column beside the canvas; Global view hides it (the+ // islands are the tracks) and gives the canvas the whole width.+ bool column = Timeline.HeadersOnly && !_modular.IsGlobal;+ if (Timeline.HeadersOnly) Timeline.IsVisible = column;+ double w = column ? Timeline.HeaderColumnWidth : 0;+ _modular.Margin = Timeline.HeadersOnRight ? new Thickness(0, 0, w, 0) : new Thickness(w, 0, 0, 0);+ }++ // Show in Modular (a track menu, specs/095): Modular, Track view, that track's graph.+ private void ShowInModular(int trackId)+ {+ if (_modular is null || trackId <= 0) return;+ SetView(MainView.Modular);+ if (Timeline.SelectedTrackId != trackId) Timeline.SelectTrackFromOutside(trackId);+ _modular.ShowTrack(trackId);+ }+private void OnPickProjectKey(object? sender, RoutedEventArgs e){if (_vm is null) return;diff --git a/src/managed/Nota.App/ModularView.cs b/src/managed/Nota.App/ModularView.csindex 23b872e4..d8bb9472 100644--- a/src/managed/Nota.App/ModularView.cs+++ b/src/managed/Nota.App/ModularView.cs@@ -69,9 +69,20 @@ public sealed partial class ModularView : UserControlprivate readonly TextBlock _status = new() { Text = "", FontSize = 10, Foreground = Text2, VerticalAlignment = VerticalAlignment.Center };private readonly TextBlock _statusRight = new() { Text = "", FontSize = 10, Foreground = Text2, VerticalAlignment = VerticalAlignment.Center };- // track-list sidebar (Track view)- private readonly StackPanel _sidebar = new();- private readonly Border _sidebarPanel;+ // The track column beside the canvas is the arrangement's own header column (specs/095);+ // the host answers "which track's header is under this point" for cross-track CV drops.+ /// <summary>Host hook: the track (and its header card) under a window point, or null.</summary>+ public Func<Point, (int TrackId, Control Anchor)?>? TrackAtPoint { get; set; }+ /// <summary>A CV cable drag started (true) or ended (false) — the host lights the column.</summary>+ public event Action<bool>? ConnectHintChanged;+ /// <summary>A line for the status bar (why a node couldn't be added, …).</summary>+ public event Action<string>? StatusRequested;+ /// <summary>Global view (islands) is shown.</summary>+ public bool IsGlobal => _global;+ /// <summary>Track ↔ Global switched — the host hides or shows the header column.</summary>+ public event Action<bool>? GlobalChanged;+ /// <summary>Nodes can be added: Track view with a track shown.</summary>+ public bool CanAddNodes => !_global && _trackId > 0;/// <summary>Raised when a browser item is dropped on the canvas (adds it to the current track).</summary>public event Action<BrowserItem>? ItemDropped;@@ -147,7 +158,8 @@ public sealed partial class ModularView : UserControlDragDrop.SetAllowDrop(_viewport, true);DragDrop.AddDragOverHandler(_viewport, (_, e) =>{- bool ok = BrowserView.IsAcceptableDrag(e) && _trackId > 0;+ bool ok = BrowserView.IsModularNodeDrag ? CanAddNodes // a Modular node (specs/095)+ : BrowserView.IsAcceptableDrag(e) && _trackId > 0;e.DragEffects = ok ? DragDropEffects.Copy : DragDropEffects.None;_dropGlow.IsVisible = ok;});@@ -155,30 +167,24 @@ public sealed partial class ModularView : UserControlDragDrop.AddDropHandler(_viewport, (_, e) =>{_dropGlow.IsVisible = false;- foreach (var item in BrowserView.DroppedItems(e)) ItemDropped?.Invoke(item);e.Handled = true;+ if (BrowserView.CurrentDrag is { Kind: BrowserItemKind.ModularNode } node)+ {+ // The node lands unconnected where it was dropped (specs/095).+ if (!CanAddNodes) { StatusRequested?.Invoke(Loc.T("modular.open_a_track_to_add_nodes")); return; }+ if (AddModulatorAt(node.BuiltinKind, e.GetPosition(_viewport)) >= 0)+ StatusRequested?.Invoke(Loc.F("modular.node_added", node.Name));+ return;+ }+ foreach (var item in BrowserView.DroppedItems(e)) ItemDropped?.Invoke(item);});- // Middle row: track-list sidebar (Track view) + the canvas.- var header = new Border- {- Height = 26, Child = new TextBlock { Text = Loc.T("modular.tracks"), FontSize = 10, FontWeight = FontWeight.SemiBold, Foreground = Text3, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(10, 0) },- BorderBrush = BorderDef, BorderThickness = new Thickness(0, 0, 0, 1),- };- var listCol = new DockPanel { LastChildFill = true };- DockPanel.SetDock(header, Dock.Top);- listCol.Children.Add(header);- listCol.Children.Add(new ScrollViewer { Content = _sidebar, HorizontalScrollBarVisibility = Avalonia.Controls.Primitives.ScrollBarVisibility.Disabled });- _sidebarPanel = new Border { Width = 176, Background = Rail, BorderBrush = BorderDef, BorderThickness = new Thickness(0, 0, 1, 0), Child = listCol };- var body = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*") };- body.Children.Add(_sidebarPanel);- Grid.SetColumn(_viewport, 1);- body.Children.Add(_viewport);-+ // Middle row: the canvas. The track column beside it is the arrangement's header+ // column, laid out by the host (specs/095).var root = new Grid{RowDefinitions = new RowDefinitions("34,*,22"),- Children = { Toolbar(), Row(body, 1), StatusBar() },+ Children = { Toolbar(), Row(_viewport, 1), StatusBar() },};// A docked panel like the browser and the arrangement: square, no frame of its own.@@ -215,6 +221,7 @@ public sealed partial class ModularView : UserControl/// removed track's nodes on screen still wired to a dead track id.</summary>public void Show(int trackId){+ if (trackId > 0 && trackId == _engine.MasterTrackId) return; // Modular doesn't patch the masterif (trackId <= 0) { _trackId = -1; Rebuild(); RefreshSidebar(); return; }bool changed = trackId != _trackId;_trackId = trackId;@@ -223,7 +230,13 @@ public sealed partial class ModularView : UserControlif (changed) FitToScreen();}- // The sidebar is the way in, so it refreshes even with no track picked yet (critique F3).+ /// <summary>Show a track's graph from elsewhere (Show in Modular): Track view, that track.</summary>+ public void ShowTrack(int trackId)+ {+ if (_global) { _trackId = trackId; SetGlobal(false); FitToScreen(); return; }+ Show(trackId);+ }+public void Refresh() { if (_global || _trackId > 0) Rebuild(); RefreshSidebar(); }/// <summary>The track Modular opens on when nothing is selected: the first track that is@@ -248,6 +261,7 @@ public sealed partial class ModularView : UserControl_globalBtn.IsChecked = global;if (_global == global) return;_global = global;+ GlobalChanged?.Invoke(global);Rebuild(); // island / chain-node keys don't collide, so kept positions surviveRefreshSidebar();FitToScreen();@@ -260,35 +274,10 @@ public sealed partial class ModularView : UserControlelse Show(trackId); // already in Track view → just switch the graph}- // ---- track-list sidebar (Track view) --------------------------------+ // ---- the empty-state hint (Track view with no track) -------------------private void RefreshSidebar(){- _sidebarPanel.IsVisible = !_global; // collapses in Global view (islands are the tracks)_emptyHint.IsVisible = !_global && _trackId <= 0; // the hint is Track view's; Global has islands- if (_global) return;- _sidebar.Children.Clear();- foreach (int i in ArrangementView.DisplayOrder(_engine))- if (_engine.TryGetTrackInfo(i, out var ti) && !ti.IsGroup)- _sidebar.Children.Add(TrackRow(ti.Id, ti));- if (_sidebar.Children.Count == 0)- _sidebar.Children.Add(new TextBlock { Text = Loc.T("modular.no_tracks_yet"), Classes = { "Caption" }, Margin = new Thickness(10, 8) });- }-- private Control TrackRow(int trackId, NotaTrackInfo ti)- {- bool active = trackId == _trackId;- string name = _engine.GetTrackName(trackId);- if (string.IsNullOrEmpty(name)) name = ti.IsReturn ? Loc.F("common.return_n", trackId) : ti.IsInstrument ? Loc.F("modular.inst", trackId) : Loc.F("common.audio_n", trackId);- var color = ArrangementView.TrackBrush(ArrangementView.EffectiveColorIndex(_engine, trackId));- var row = new Border- {- Height = 34, Background = active ? NotaPalette.SurfaceHover : Brushes.Transparent,- BorderBrush = color, BorderThickness = new Thickness(3, 0, 0, 0),- Cursor = new Cursor(StandardCursorType.Hand), Tag = trackId, // Tag → cross-track CV drop target- Child = new TextBlock { Text = name, FontSize = 11, FontWeight = active ? FontWeight.SemiBold : FontWeight.Normal, Foreground = active ? Text1 : Text2, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(10, 0) },- };- row.PointerPressed += (_, e) => { OpenTrack(trackId); e.Handled = true; };- return row;}// ---- layout persistence (UI-only data; sidecar in the .nota bundle) ----@@ -382,9 +371,11 @@ public sealed partial class ModularView : UserControlif (_global) { RebuildGlobal(); return; }if (_trackId <= 0) { _grid.InvalidateVisual(); _edges.InvalidateVisual(); _mini.InvalidateVisual(); return; }- bool isInstrument = _engine.TryGetTrackInfo(TrackIndex(_trackId), out var ti) && ti.IsInstrument;+ bool known = _engine.TryGetTrackInfo(TrackIndex(_trackId), out var ti);+ bool isInstrument = known && ti.IsInstrument;+ bool isGroup = known && ti.IsGroup; // a group's own effect chain (specs/095)string trackName = _engine.GetTrackName(_trackId);- if (string.IsNullOrEmpty(trackName)) trackName = isInstrument ? Loc.F("modular.instrument", _trackId) : Loc.F("common.audio_n", _trackId);+ if (string.IsNullOrEmpty(trackName)) trackName = isInstrument ? Loc.F("modular.instrument", _trackId) : isGroup ? Loc.T("common.group") : Loc.F("common.audio_n", _trackId);// Pre-scan incoming CV links (this track) so each modulated param gets its own input// port on its node — built before the nodes so their port blocks know the count.@@ -430,9 +421,10 @@ public sealed partial class ModularView : UserControl}else{- var src = SimpleNode("input", Loc.T("modular.audio_in"), Sage, new Point(x, y),+ // An audio track's clips / input, or the sum of a group's tracks.+ var src = SimpleNode("input", isGroup ? Loc.T("modular.tracks_in") : Loc.T("modular.audio_in"), Sage, new Point(x, y),audioIn: false, audioOut: true, midiIn: false, midiOut: false,- badge: "CLIPS", slot: Slot.Input);+ badge: isGroup ? "GROUP" : "CLIPS", slot: Slot.Input);AddNode(src);prevAudio = src;x += NodeW + GapX;@@ -948,15 +940,16 @@ public sealed partial class ModularView : UserControl// ---- modulators (Phase 3: LFO node + CV links) ---------------------- /// <summary>Adds a modulator node to the shown track without connections, at the pointer- /// when it is over the canvas, else in the middle of the view (the command palette). Returns- /// its id, or -1.</summary>- internal int AddModulatorAt(int kind)+ /// <summary>Adds a modulator node to the shown track without connections: at+ /// <paramref name="viewportPoint"/> (a browser drop), else at the pointer when it is over the+ /// canvas, else in the middle of the view (the palette, a browser double-click). Returns its+ /// id, or -1.</summary>+ internal int AddModulatorAt(int kind, Point? viewportPoint = null){if (_trackId <= 0) return -1;int id = _engine.ModulatorAdd(_trackId, kind);if (id < 0) return -1;- var scr = _pointerInViewport ?? Center();+ var scr = viewportPoint ?? _pointerInViewport ?? Center();_savedPos[$"{_trackId}/mod{id}"] = new Point((scr.X - _pan.X) / _scale - 60, (scr.Y - _pan.Y) / _scale - 28);Rebuild(); Changed?.Invoke();return id;@@ -964,13 +957,6 @@ public sealed partial class ModularView : UserControlprivate Point? _pointerInViewport;- private void AddModulator(int kind)- {- if (_trackId <= 0) return;- _engine.ModulatorAdd(_trackId, kind); // 0 = LFO, 1 = envelope follower- Rebuild(); Changed?.Invoke();- }-private void RemoveModulatorNode(GNode n){_engine.ModulatorRemove(_trackId, n.ModId);@@ -1816,7 +1802,7 @@ public sealed partial class ModularView : UserControl_connectCursor = e.GetPosition(_viewport);e.Pointer.Capture(_viewport);HighlightTargets(true);- _sidebarPanel.BorderBrush = Brass; // hint: drop on a track here to modulate across tracks+ ConnectHintChanged?.Invoke(true); // hint: drop on a track's header to modulate across tracks_edges.InvalidateVisual();}@@ -1825,14 +1811,13 @@ public sealed partial class ModularView : UserControl_connecting = false;e.Pointer.Capture(null);HighlightTargets(false);- _sidebarPanel.BorderBrush = BorderDef; // clear the cross-track drop hint+ ConnectHintChanged?.Invoke(false); // clear the cross-track drop hint- // Dropped on the track list (left) → wire the modulator into a param on THAT track.- var sp = e.GetPosition(_sidebar);- if (sp.X >= 0 && sp.X <= _sidebar.Bounds.Width)- foreach (var child in _sidebar.Children)- if (child is Control c && c.Tag is int otherTrack && otherTrack != _trackId && c.Bounds.Contains(sp))- { ShowCrossTrackParamMenu(c, otherTrack, _connectMod); return; }+ // Dropped on another track's header (the column beside the canvas) → wire the+ // modulator into a param on THAT track.+ if (TopLevel.GetTopLevel(this) is { } top && TrackAtPoint?.Invoke(e.GetPosition(top)) is var (otherTrack, anchor)+ && otherTrack != _trackId)+ { ShowCrossTrackParamMenu(anchor, otherTrack, _connectMod); return; }var scr = e.GetPosition(_viewport);var world = new Point((scr.X - _pan.X) / _scale, (scr.Y - _pan.Y) / _scale);@@ -2203,20 +2188,8 @@ public sealed partial class ModularView : UserControlBackground = Sunken, CornerRadius = NotaRadius.Group, Padding = new Thickness(2),Child = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 2, Children = { _trackBtn, _globalBtn } },};- // All the modulator sources collapse into one "+ Add" dropdown (a normal chip- // button + a menu flyout) so the toolbar stays compact.- var addMenu = new MenuFlyout { Placement = PlacementMode.BottomEdgeAlignedLeft };- void AddItem(string label, int kind)- {- var mi = new MenuItem { Header = label };- mi.Click += (_, _) => AddModulator(kind);- addMenu.Items.Add(mi);- }- foreach (var node in Nota.Application.Palette.ModularCatalog.All) AddItem(node.Name, node.Kind); // the palette lists the same nodes- var addBtn = Chip(Loc.T("modular.add")); addBtn.Content = Glyph.Labeled(Loc.T("modular.add"), GlyphKind.ChevronDown);- addBtn.Flyout = addMenu;+ // Nodes come from the browser's Modular tab and the palette (specs/095), not a toolbar menu.left.Children.Add(seg);- left.Children.Add(addBtn);var right = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 8, VerticalAlignment = VerticalAlignment.Center };var zoomOut = ZoomBtn("−"); zoomOut.Click += (_, _) => ZoomAround(Center(), 1 / 1.15);diff --git a/src/managed/Nota.App/SessionView.Grid.cs b/src/managed/Nota.App/SessionView.Grid.csindex 0603b587..8e908154 100644--- a/src/managed/Nota.App/SessionView.Grid.cs+++ b/src/managed/Nota.App/SessionView.Grid.cs@@ -985,7 +985,11 @@ public sealed partial class SessionViewMenuKit.AddGroups(f.Items,new Control[] { MenuKit.Header(c.Name, c.Brush, pos >= 0 ? $"{c.KindLabel} · {pos + 1}" : c.KindLabel) },new Control[] { colour },- new Control[] { MenuKit.Item(Loc.T("common.rename"), GlyphKind.Edit, () => PromptRenameTrack(anchor, c.TrackId)) },+ new Control[]+ {+ MenuKit.Item(Loc.T("common.rename"), GlyphKind.Edit, () => PromptRenameTrack(anchor, c.TrackId)),+ MenuKit.Item(Loc.T("common.show_in_modular"), GlyphKind.Modular, () => ShowInModularRequested?.Invoke(c.TrackId)), // specs/095+ },new Control[] { AddTrackSubmenu(c.TrackId) },new Control[]{diff --git a/src/managed/Nota.App/SessionView.cs b/src/managed/Nota.App/SessionView.csindex a0419955..4537ad83 100644--- a/src/managed/Nota.App/SessionView.cs+++ b/src/managed/Nota.App/SessionView.cs@@ -91,6 +91,8 @@ public sealed partial class SessionView : UserControlinternal LocateHooks? Locate { get; set; }/// <summary>Raised after slots are copied / moved into the arrangement (M5-6) or a track is renamed.</summary>public event Action? ArrangementChanged;+ /// <summary>A column's menu asked for Show in Modular (specs/095).</summary>+ public event Action<int>? ShowInModularRequested;/// <summary>A context menu asked for a new track (kind, the track to place it after, or -1 = at the end).</summary>public event Action<NewTrackKind, int>? AddTrackRequested;/// <summary>A one-line status message for the main window's status bar.</summary>diff --git a/src/managed/Nota.Application/Localization/en.json b/src/managed/Nota.Application/Localization/en.jsonindex 730796f1..63e78a9a 100644--- a/src/managed/Nota.Application/Localization/en.json+++ b/src/managed/Nota.Application/Localization/en.json@@ -419,6 +419,8 @@"browser.midi_effects_2": "MIDI effects","browser.midi_file": "MIDI file","browser.midi_map": "MIDI map",+ "browser.modular": "Modular",+ "browser.modular_node": "Modular node","browser.new_tag": "New tag…","browser.no_audio_effects_yet": "No audio effects yet","browser.no_instruments_yet": "No instruments yet",@@ -428,6 +430,7 @@"browser.no_presets_yet": "No presets yet","browser.no_projects_yet": "No projects yet","browser.no_samples_yet": "No samples yet",+ "browser.nodes_n": { "one": "{0} node", "other": "{0} nodes" },"browser.not_a_folder": "Not a folder Nota can open","browser.nota_is_still_analysing_your": "Nota is still analysing your samples — more matches appear as it goes.","browser.nota_kits": "Nota Kits",@@ -701,6 +704,7 @@"common.sends": "Sends","common.settings": "Settings","common.show": "Show",+ "common.show_in_modular": "Show in Modular","common.solo": "Solo","common.start": "Start","common.stereo_map": "Stereo map",@@ -2978,7 +2982,6 @@"model_store.model_catalog.the_library_notas_ai_models": "The library Nota's AI models run on. Installed with the first model.","model_store.the_download_of_doesnt_contain": "The download of {0} doesn't contain {1}.","model_store.unknown_ai_model": "Unknown AI model \"{0}\".",- "modular.add": "+ Add","modular.add_2": "Add","modular.add_an_lfo_expose_a": "Add an LFO / expose a param first","modular.audio_in": "Audio in",@@ -3005,7 +3008,6 @@"modular.global": "Global","modular.global_n": "Global · {0}","modular.hide_the_parameters_that_arent": "Hide the parameters that aren't modulated (Esc)",- "modular.inst": "Inst {0}","modular.instrument": "Instrument {0}","modular.invert": "Invert","modular.islands": { "one": "{0} island", "other": "{0} islands" },@@ -3024,11 +3026,12 @@"modular.multiply": "Multiply","modular.no_modulatable_parameters_on_that": "No modulatable parameters on that track","modular.no_parameters": "No parameters",- "modular.no_tracks_yet": "No tracks yet",+ "modular.node_added": "{0} added to the canvas — connect it from its CV out","modular.nodes": "{0} nodes","modular.nodes_caps": "{0} NODES","modular.note": "Note","modular.offset": "Offset",+ "modular.open_a_track_to_add_nodes": "Open a track in Modular's Track view to add a node","modular.open_in_a_window": "Open in a window","modular.out": "Out","modular.override": "Override",@@ -3067,6 +3070,7 @@"modular.sync": "Sync","modular.track_output": "Track output","modular.tracks": "Tracks",+ "modular.tracks_in": "Tracks in","modular.tri": "Tri","modular.unexpose_cv_output": "Unexpose CV output","modular.vel": "Vel",diff --git a/src/managed/Nota.Presentation/BrowserTabMemory.cs b/src/managed/Nota.Presentation/BrowserTabMemory.csnew file mode 100644index 00000000..d9940e6d--- /dev/null+++ b/src/managed/Nota.Presentation/BrowserTabMemory.cs@@ -0,0 +1,46 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.+//+// The browser keeps two "last tab" memories (spec 095, #592): one for Arrangement / Session+// and one for Modular, whose rail carries the Modular tab only there. The first time Modular+// opens it shows the Modular tab; after that whichever tab was last picked in Modular.+// Runtime only, like the browser's last tab has always been.++namespace Nota.Presentation;++public sealed class BrowserTabMemory+{+ private readonly int _modularTab;+ private int _outside;+ private int? _inModular;++ public BrowserTabMemory(int startTab, int modularTab)+ {+ _modularTab = modularTab;+ _outside = startTab == modularTab ? 0 : startTab;+ }++ /// <summary>True between <see cref="Enter"/> and <see cref="Leave"/>.</summary>+ public bool InModular { get; private set; }++ /// <summary>The user picked <paramref name="tab"/> in the current context.</summary>+ public void Picked(int tab)+ {+ if (InModular) _inModular = tab;+ else if (tab != _modularTab) _outside = tab; // never on the rail outside Modular+ }++ /// <summary>Modular became the view: the tab to show.</summary>+ public int Enter()+ {+ InModular = true;+ return _inModular ?? _modularTab;+ }++ /// <summary>Modular stopped being the view: the tab to show.</summary>+ public int Leave()+ {+ InModular = false;+ return _outside;+ }+}diff --git a/src/managed/Nota.Presentation/ModularBrowserItems.cs b/src/managed/Nota.Presentation/ModularBrowserItems.csnew file mode 100644index 00000000..cb815660--- /dev/null+++ b/src/managed/Nota.Presentation/ModularBrowserItems.cs@@ -0,0 +1,41 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.+//+// The browser's Modular tab (spec 095, #592): one row per Modular-only node, built from the+// same catalogue the command palette reads, so a node kind added there shows up here as is.+// Search matches a node's name, its category and its aliases ("wobble" finds LFO).++using Nota.Application.Palette;++namespace Nota.Presentation;++public static class ModularBrowserItems+{+ /// <summary>One row per node, in catalogue order.</summary>+ public static IReadOnlyList<BrowserItem> Build(IReadOnlyList<ModularNode> nodes)+ {+ var rows = new List<BrowserItem>(nodes.Count);+ foreach (var n in nodes)+ rows.Add(new BrowserItem+ {+ Name = n.Name,+ Kind = BrowserItemKind.ModularNode,+ BuiltinKind = n.Kind,+ Sub = n.Sub,+ Tip = n.Descriptor.Description,+ Keywords = string.Join(' ', n.Descriptor.Aliases),+ });+ return rows;+ }++ /// <summary>True when every word of <paramref name="query"/> occurs (any case) in the+ /// row's name, category or keywords. An empty query matches everything.</summary>+ public static bool Matches(BrowserItem item, string query)+ {+ if (string.IsNullOrWhiteSpace(query)) return true;+ string hay = item.Name + " " + item.Sub + " " + item.Keywords;+ foreach (var word in query.Split(' ', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries))+ if (!hay.Contains(word, StringComparison.OrdinalIgnoreCase)) return false;+ return true;+ }+}diff --git a/src/managed/Nota.Presentation/ViewModels/BrowserViewModel.cs b/src/managed/Nota.Presentation/ViewModels/BrowserViewModel.csindex f4ca0860..62b5351d 100644--- a/src/managed/Nota.Presentation/ViewModels/BrowserViewModel.cs+++ b/src/managed/Nota.Presentation/ViewModels/BrowserViewModel.cs@@ -27,6 +27,9 @@ public enum BrowserItemKind/// <summary>A file the Files browse view lists but Nota can't add (spec 092): shown/// faded, never dragged, opened or auditioned.</summary>OtherFile,+ /// <summary>A Modular-only node (LFO, Envelope Follower, …; spec 095): the browser's+ /// Modular tab lists them and only the Modular canvas takes one.</summary>+ ModularNode,}/// <summary>Active library filter for the device tabs (Instr / FX / MIDI).</summary>@@ -67,6 +70,8 @@ public sealed class BrowserItem : INotifyPropertyChanged/// <summary>Long-form description for the row's tooltip, where <see cref="Sub"/> (the/// narrow tag column) has no room for it. Falls back to Sub when empty.</summary>public string Tip { get; init; } = "";+ /// <summary>Extra search words a row matches on but doesn't show (Modular nodes' aliases).</summary>+ public string Keywords { get; init; } = "";/// <summary>Section-header row (see <see cref="BrowserItemKind.Group"/>): Name is the/// caption and <see cref="GroupCount"/> how many rows it heads.</summary>diff --git a/tests/Nota.SmokeTest/ModularBrowserTests.cs b/tests/Nota.SmokeTest/ModularBrowserTests.csnew file mode 100644index 00000000..47cd4ffd--- /dev/null+++ b/tests/Nota.SmokeTest/ModularBrowserTests.cs@@ -0,0 +1,47 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.+//+// The browser's Modular tab (spec 095, #592): every catalogue node becomes a row, search+// finds a node by name, category or alias, and the browser remembers a separate last tab for+// Modular. Headless: no window.++using Nota.Application.Palette;+using Nota.Presentation;++namespace Nota.SmokeTest;++internal static class ModularBrowserTests+{+ public static IEnumerable<(bool, string)> Run()+ {+ var nodes = ModularCatalog.All;+ var rows = ModularBrowserItems.Build(nodes);+ yield return (rows.Count == nodes.Count, $"modular tab: one row per catalogue node ({rows.Count}/{nodes.Count})");+ bool inOrder = true;+ for (int i = 0; i < Math.Min(rows.Count, nodes.Count); i++)+ inOrder &= rows[i].Name == nodes[i].Name && rows[i].BuiltinKind == nodes[i].Kind+ && rows[i].Kind == BrowserItemKind.ModularNode && rows[i].Sub == nodes[i].Sub+ && rows[i].Tip.Length > 0;+ yield return (inOrder, "modular tab: rows keep catalogue order, kind, category and description");++ string[] Find(string q) => rows.Where(r => ModularBrowserItems.Matches(r, q)).Select(r => r.Name).ToArray();+ yield return (Find("").Length == rows.Count, "modular tab: an empty search lists every node");+ yield return (Find("wobble") is ["LFO"], $"modular tab: 'wobble' finds LFO ({string.Join(",", Find("wobble"))})");+ yield return (Find("sidechain").Contains("Envelope Follower"), "modular tab: 'sidechain' finds Envelope Follower");+ yield return (Find("monitor").Contains("Scope"), "modular tab: 'monitor' (category) finds Scope");+ yield return (Find("env foll") is ["Envelope Follower"], $"modular tab: every word must match ({string.Join(",", Find("env foll"))})");+ yield return (Find("ADSR") is ["ADSR"] && Find("adsr").Length == 1, "modular tab: search ignores case");+ yield return (Find("zzz").Length == 0, "modular tab: nonsense finds nothing");++ const int Start = 0, Modular = 9, Fx = 1, Files = 3;+ var m = new BrowserTabMemory(Start, Modular);+ yield return (m.Enter() == Modular, "tab memory: the first visit to Modular shows the Modular tab");+ m.Picked(Fx);+ yield return (m.Leave() == Start, "tab memory: leaving Modular returns to the tab picked outside");+ m.Picked(Files);+ yield return (m.Enter() == Fx, "tab memory: Modular remembers the tab picked there");+ yield return (m.Leave() == Files, "tab memory: outside remembers its own tab");+ m.Picked(Modular); // can't happen outside (the tab isn't on the rail); ignored+ yield return (m.Leave() == Files, "tab memory: the Modular tab is never the outside tab");+ }+}diff --git a/tests/Nota.SmokeTest/Program.cs b/tests/Nota.SmokeTest/Program.csindex f69b8542..06708b18 100644--- a/tests/Nota.SmokeTest/Program.cs+++ b/tests/Nota.SmokeTest/Program.cs@@ -858,6 +858,14 @@ if (args.Length >= 1 && args[0] == "--vocoder")Console.WriteLine(failures == 0 ? "VOCODER PASSED" : $"VOCODER FAILED ({failures})");return failures == 0 ? 0 : 1;}+// Modular browser tab alone (fast iteration): `--modular-browser`. Also part of the full run.+if (args.Length >= 1 && args[0] == "--modular-browser")+{+ Console.WriteLine("-- modular browser tab --");+ foreach (var (ok, label) in ModularBrowserTests.Run()) Check(ok, label);+ Console.WriteLine(failures == 0 ? "MODULAR BROWSER PASSED" : $"MODULAR BROWSER FAILED ({failures})");+ return failures == 0 ? 0 : 1;+}// Arrangement group trays alone (fast iteration): `--group-trays`. Also part of the full run.if (args.Length >= 1 && args[0] == "--group-trays"){@@ -15722,6 +15730,10 @@ foreach (var (ok, label) in FoldTests.Run()) Check(ok, label);Console.WriteLine("-- arrangement group trays --");foreach (var (ok, label) in GroupTrayTests.Run()) Check(ok, label);+// --- Modular browser tab (specs/095): catalogue rows, search, per-view tab memory ---+Console.WriteLine("-- modular browser tab --");+foreach (var (ok, label) in ModularBrowserTests.Run()) Check(ok, label);+// --- browser: preset audition (offline-rendered, cached, played on the preview voice) ---Console.WriteLine("-- browser: preset audition --");foreach (var (ok, label) in AuditionTests.Run()) Check(ok, label);