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) Transport bar: a ⋯ menu with everything the bar had no room for, and the interface scale (#520) (#598)
Egor Khindikaynen75444377308a
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex b4161f9e..1512a6e7 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -23,6 +23,16 @@ Entry categories: `Added`, `Changed`, `Fixed`, `Removed`.## [Unreleased]### Added+- **Nothing on the transport bar goes out of reach** (#520, specs/097). A **⋯** key now ends+ the transport bar. When the window is too narrow — or the interface scale too large — for+ the whole bar, the parts it hides (Tap, Key, Grid, Snap, Follow, Automation, Mixer, MIDI learn,+ Remote, the time signature, loop and loop-record mode, the master level, the DSP meter)+ are listed in the ⋯ menu, in bar order, and work from there as they do in the bar: toggles+ as check items, Grid and the time signature as submenus, Tap stays open for tapping, the+ master fader drags in place. An accent dot on ⋯ says something is in it; widen the window+ and the parts go back to the bar. The menu also switches the **interface scale** (75–200 %)+ at every width, the same setting as Settings → Appearance. When the Grid cell is hidden its+ separator now goes with it, so the bar no longer shows two rules side by side.- **A Mixer button in the toolbar** (#516, specs/092). Next to Automation, the faders key showsor hides the Mixer with one click, docked or in its own window, as View → Mixer and ⌘⇧M do.It reads as on while the Mixer is shown and stays in step however you open or close it: thediff --git a/FEATURES.md b/FEATURES.mdindex 7a1af0ad..9df3af18 100644--- a/FEATURES.md+++ b/FEATURES.md@@ -1533,6 +1533,12 @@ audio effects after it keep running and keep their settings; saved with the projwith **Alt** (alone) or **F10**. **View ▸ Show menu bar** or Settings → Appearance → **Menubar** brings the row back, and the key steps aside. The Windows title bar reads"Nota — *project*". On macOS the menu stays in the system menu bar.+- **The ⋯ key at the end of the transport bar**: on a narrow window or a large interface+ scale the bar hides its least-needed parts (Tap, Key, Grid, Snap, Follow, Automation, Mixer,+ MIDI learn, Remote, time signature, loop, loop-record mode, master, DSP meter), and the ⋯ menu+ lists each one, in bar order, working as in the bar — check items, Grid and time-signature+ submenus, Tap that stays open, the master fader in place. An accent dot on ⋯ says something+ is in it. At any width the menu also switches the **Interface scale**.- **What's New** — a window showing the release notes (`release-notes/X.Y.Z.en.md`, the GitHubrelease text; the CHANGELOG section for versions without them) newer than `LastSeenVersion`, onceafter the first launch on a new version; any time from Help ▸ What's New or the version@@ -1648,7 +1654,7 @@ audio effects after it keep running and keep their settings; saved with the projcolour too close to the record red, mute, solo or the meter green is refused with thereason. Applied live, Esc in the picker puts the previous one back. **Interface scale** — 75 / 100 / 125 / 150 / 200 % for the wholeinterface (every window, menu, tooltip and dialog; text stays sharp), applied live and- remembered; timeline, piano roll and audio editor zoom work on top of it. **Text size** —+ remembered (also from the transport bar's ⋯ menu); timeline, piano roll and audio editor zoom work on top of it. **Text size** —Smaller / Default / Larger / Largest steps every text by −1 to +2 pt without changing thelayout (device cards keep theirs), live and remembered. **Waveform** —**Smooth** (default), **Solid** or **Bars** for audio clips on the lanes. **Phrasediff --git a/specs/097-toolbar-overflow/checklists/requirements.md b/specs/097-toolbar-overflow/checklists/requirements.mdnew file mode 100644index 00000000..05ac755a--- /dev/null+++ b/specs/097-toolbar-overflow/checklists/requirements.md@@ -0,0 +1,37 @@+# Specification Quality Checklist: Toolbar overflow++**Purpose**: Validate specification completeness and quality before proceeding to planning+**Created**: 2026-11-13+**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++- Presentation (drop-down menu) and outside-click behaviour were settled with the maintainer+ on 2026-11-13 and recorded under Clarifications.+- "Where things stand today" names the existing #303 shed order: a product fact the+ reviewer needs, not an implementation choice.diff --git a/specs/097-toolbar-overflow/contracts/overflow-menu.md b/specs/097-toolbar-overflow/contracts/overflow-menu.mdnew file mode 100644index 00000000..f4524f08--- /dev/null+++ b/specs/097-toolbar-overflow/contracts/overflow-menu.md@@ -0,0 +1,37 @@+# Contract: the overflow menu++Opened by the ⋯ button at the right end of the transport bar. Built at open time.++## Section 1 — shed controls (only when at least one is shed), in bar order++| Part | Entry | Kind | Does |+|------|-------|------|------|+| Loop | Loop · *range* | check | `Transport.LoopOn` |+| LoopRecord | Loop record: Replace | check | `Transport.LoopRecordReplace` |+| Tap | Tap tempo · *bpm* | stays open | `TapTempoBeat()` |+| TimeSignature | Time signature ▸ | radio submenu | numerator / denominator |+| Key | Key… · *current key* | item | opens the key picker under the ⋯ button |+| Grid | Grid ▸ | submenu | the Grid chip's own items |+| Follow | Follow playhead | check | `SetFollowPlayhead` |+| Snap | Snap to grid | check (⌘4) | same as the magnet |+| Automation | Automation | check | `Timeline.AutomationMode`; + "Re-enable automation" when the chip shows |+| Mixer | Mixer | check (⌘⇧M) | `view.mixer` |+| MidiLearn | MIDI learn | check | `ToggleMidiLearn()` |+| Remote | Connect Phone… · *count* | item | `ShowConnectPhone()` |+| DspMeter | DSP *n* % | disabled, live | — |+| Master | Master · fader | stays open | master volume, one undo step per drag |++A separator follows the section.++## Section 2 — quick functions (always)++| Entry | Kind | Does |+|-------|------|------|+| Interface scale ▸ 75 / 100 / 125 / 150 / 200 % | radio submenu | `InterfaceScale` setting, saved, applied live |++## Behaviour++- Closes on: choosing an item (except Tap and Master), Escape, a second click of ⋯, a click+ outside (which does nothing else).+- Keyboard: ⋯ is in the tab order; Space / Return opens with focus on the first item.+- Shortcuts bound to an entry's action are shown beside it (`MenuKit`).diff --git a/specs/097-toolbar-overflow/data-model.md b/specs/097-toolbar-overflow/data-model.mdnew file mode 100644index 00000000..d858caf8--- /dev/null+++ b/specs/097-toolbar-overflow/data-model.md@@ -0,0 +1,29 @@+# Data model: Toolbar overflow++All in memory, no persistence beyond the existing `InterfaceScale` setting.++## ToolbarPart (enum, `Nota.Presentation`)++The transport-bar parts that can shed: `CpuBar`, `RemoteLabel`, `Tap`, `Key`, `Remote`,+`Follow`, `Automation`, `Mixer`, `TimeSignature`, `MidiLearn`, `Grid`, `Snap`, `LoopRecord`, `Loop`,+`Master`, `DspMeter`.++## ToolbarOverflow (static, `Nota.Presentation`)++| Member | Meaning |+|--------|---------|+| `ShedOrder : IReadOnlyList<ToolbarPart>` | today's #303 order, one part per step |+| `BarOrder : IReadOnlyList<ToolbarPart>` | left-to-right position in the bar: Loop, LoopRecord, Tap, TimeSignature, Key, Grid, Follow, Snap, Automation, Mixer, MidiLearn, Remote, DspMeter, Master (+ info-only parts) |+| `IsInfoOnly(part)` | true for `CpuBar`, `RemoteLabel` |+| `Entries(int shedSteps) : IReadOnlyList<ToolbarPart>` | the parts in the first `shedSteps` steps, minus info-only ones, sorted by `BarOrder` |++Rules:+- `shedSteps` is clamped to `0 … ShedOrder.Count`.+- `Entries` never contains duplicates; `Entries(n)` ⊆ `Entries(n + 1)`.+- `Entries(0)` is empty (the menu then holds only the quick functions).++## Shed state (App, `MainWindow`)++- `_shedSteps : int` — set by `FitTransport`; drives the button's cue and the menu.+- The App maps each `ToolbarPart` to the controls it hides (`TimeSignature` → `TimeSigCell`,+ `MidiLearn` → `RemotePanel`, `Loop` → `LoopSep` + `LoopCell`, `DspMeter` → `CpuMeter` + `CpuSep`, …).diff --git a/specs/097-toolbar-overflow/plan.md b/specs/097-toolbar-overflow/plan.mdnew file mode 100644index 00000000..6e45dd4e--- /dev/null+++ b/specs/097-toolbar-overflow/plan.md@@ -0,0 +1,111 @@+# Implementation Plan: Toolbar overflow++**Branch**: `feat/toolbar-overflow` | **Date**: 2026-11-13 | **Spec**: [spec.md](spec.md)++**Input**: Feature specification from `specs/097-toolbar-overflow/spec.md` (issue #520)++## Summary++The transport bar already sheds controls on a narrow window (#303, `MainWindow.TransportFit.cs`);+a shed control is just hidden. This feature adds a never-shed overflow button (⋯) at the right+end of the bar. Clicking it opens an ordinary Nota menu (a `MenuFlyout` built with `MenuKit`):+first one entry per shed control, in bar order, each doing what the control does; then a fixed+quick-functions group with the interface-scale presets. Which entries appear for a given fit is+decided by a small pure model in `Nota.Presentation` (testable in the smoke test); the App+layer builds the menu from it at open time and wires each entry to the handler the bar+control already uses.++## Nota: Read Before Planning++- **UI work** → [`DESIGN.md`](../../DESIGN.md) and the `nota-design` skill: the button is a+ `tp-icon` key like the other tool keys; the menu is a stock `MenuKit` menu (spec 034).+- **Anything** → [`CONTRIBUTING.md`](../../CONTRIBUTING.md).++## Technical Context++**Language/Version**: C# / .NET 10 (managed app only).++**Primary Dependencies**: Avalonia 12.1.4 (existing). No new dependency.++**Storage**: the interface scale is the existing `AppSettings.InterfaceScale` (settings file);+nothing new is stored.++**Audio-Thread Impact**: None — UI-only change. Entries call the same view-model / engine+setters the bar controls call (tempo, master volume through `MixGesture`, transport flags).++**Testing**: `tests/Nota.SmokeTest` — new `ToolbarOverflowTests` on the pure model (entries per+shed step, bar order, no duplicates, info-only parts omitted); the existing localization and+menu source checks cover the new keys and menu code. In-app check per+[quickstart.md](quickstart.md).++**Target Platform**: macOS, Windows, Linux.++**Project Type**: desktop app.++**Performance Goals**: the menu opens within one frame; the fit pass gains no extra measure.++**Constraints**: the shed order and never-shed set stay exactly as today (FR-003); the+overflow button joins the never-shed set.++**Scale/Scope**: one new button, one menu, ~15 entry kinds; one new glyph; ~25 new English+strings.++## Constitution Check++| Principle | Status |+|-----------|--------|+| 0. Approved issue first | ✅ #520 carries `approved` |+| I. Real-time audio safety | ✅ no audio-thread code touched |+| II. Boundary discipline | ✅ no ABI / JUCE change |+| III. Licensing hygiene | ✅ new files carry the SPDX header; no dependency |+| IV. Verification gate | ✅ `scripts/build.sh` + smoke test before the PR |+| V. One logical change per PR | ✅ #520 only |+| VI. Documentation in sync | ✅ CHANGELOG, FEATURES.md, nota-docs (transport bar page), shortcuts unaffected |+| VII. Spec first | ✅ this spec |+| VIII. Safety rules not weakened | ✅ |++Post-design re-check: unchanged — all green.++## Project Structure++### Documentation (this feature)++```text+specs/097-toolbar-overflow/+├── spec.md+├── plan.md # this file+├── research.md+├── data-model.md+├── quickstart.md+├── contracts/+│ └── overflow-menu.md # the menu's entries, per shed control+└── tasks.md # /speckit-tasks+```++### Source Code++```text+src/managed/+├── Nota.Presentation/+│ └── ToolbarOverflow.cs # NEW pure model: parts, shed order, bar order, entries for a fit+├── Nota.Application/Localization/en.json # new "overflow.*" keys+└── Nota.App/+ ├── MainWindow.axaml # OverflowBtn in the bar's last column+ ├── MainWindow.TransportFit.cs # shed order from the model; remembers how many steps are shed; marks the button+ ├── MainWindow.TransportOverflow.cs # NEW: build + show the overflow menu+ ├── MainWindow.axaml.cs # master fader factory shared with the menu; tap/time-sig helpers reused+ ├── SnapChip.cs # grid menu items reusable as a submenu+ ├── PreferencesWindow.cs # scale picker follows NotaUiScale.Changed+ └── Controls/Glyph.cs # GlyphKind.More (three dots)++tests/Nota.SmokeTest/+└── ToolbarOverflowTests.cs # NEW+```++**Structure Decision**: the decision "which entries for which fit" is pure data and goes in+`Nota.Presentation` so the smoke test (which does not reference `Nota.App`) can check it; all+Avalonia code stays in `Nota.App` beside the existing fit code.++## Complexity Tracking++No violations.diff --git a/specs/097-toolbar-overflow/quickstart.md b/specs/097-toolbar-overflow/quickstart.mdnew file mode 100644index 00000000..a9d5d04a--- /dev/null+++ b/specs/097-toolbar-overflow/quickstart.md@@ -0,0 +1,31 @@+# Quickstart: validating the toolbar overflow++## Automated++```bash+scripts/build.sh # builds, runs tests/Nota.SmokeTest (ToolbarOverflowTests + source checks)+```++Expected: all checks pass, including `ToolbarOverflowTests`, localization (every new key used+and present in en.json) and the menu guard.++## In the app++1. Launch Nota with a project open, window wide: the ⋯ button sits after the master strip,+ without the dot. Open it: only "Interface scale ▸".+2. Narrow the window one step at a time. After each step open ⋯: the entries match the+ controls that left the bar (contract table), in bar order; nothing still in the bar is+ listed; the dot shows.+3. Use each entry: Snap / Follow / Loop / Automation / MIDI learn toggle and the bar reflects it+ after widening; Grid ▸ picks a step; Key… opens the picker; Time signature ▸ changes the+ signature; Tap tempo tapped 4× sets the tempo with the menu open; Master fader drags and+ undoes in one step; DSP line moves during playback; Connect Phone… opens its dialog.+4. Interface scale ▸ 125 %: the UI rescales; Settings → Appearance shows 125 %; restart keeps it.+ With Settings open, change it from the menu: the Settings picker follows.+5. Escape, a second click on ⋯ and a click on a clip each close the menu; the clip click does+ not select the clip.+6. Widen the window: controls return, the dot goes.+7. Repeat 2 at 150 % and 200 %, in Studio Light and the classic look; check playback never+ stutters.++Screenshots for the PR: the bar narrow with the ⋯ dot and the open menu (before/after).diff --git a/specs/097-toolbar-overflow/research.md b/specs/097-toolbar-overflow/research.mdnew file mode 100644index 00000000..974519bb--- /dev/null+++ b/specs/097-toolbar-overflow/research.md@@ -0,0 +1,69 @@+# Research: Toolbar overflow++## R1 — How the menu is presented++- **Decision**: a `MenuFlyout` anchored under the overflow button, built with `MenuKit` at+ open time (Clarifications, 2026-11-13).+- **Rationale**: every Nota menu is a `MenuKit` menu with the Nota MenuItem theme (spec 034);+ light dismiss, Escape and keyboard navigation come for free and match the other menus;+ building at open time means the entries always match the current fit and state, so no+ live syncing of hidden menu items is needed.+- **Alternatives**: a second toolbar row or a floating panel of live controls — rejected by+ the maintainer in favour of an ordinary menu.++## R2 — Which controls get entries++- **Decision**: one model, `ToolbarOverflow`, holds the parts in shed order (today's array in+ `TransportFit`, moved over) and in bar order; for "N steps shed" it returns the entries in+ bar order. `CpuBar` and `RemoteLabel` are info-only (their information stays in the bar) and+ give no entry. The `RemotePanel` step (MIDI learn + the already-shed Remote button) gives the+ MIDI learn entry; Remote's own step gives Connect Phone.+- **Rationale**: keeps the order in one place; the App's fit keeps a `Control[][]` mapped+ from the model's parts, so the shed behaviour itself does not change.+- **Alternatives**: reading `IsVisible` of each control at open time — works, but is not+ testable without the app and ties the menu to layout state.++## R3 — Entries that are not a simple toggle++- **Grid**: `SnapChip.OpenMenu` already builds the grid menu; it is split into+ `BuildItems()` (returns the items) used by both the chip and a "Grid" submenu.+- **Key**: the key picker is a custom flyout (`KeyPicker.Show`), not menu items. The entry+ "Key…" (with the current key as trailing text) opens that same picker anchored to the+ overflow button after the menu closes.+- **Time signature**: a submenu of common signatures (2/4, 3/4, 4/4, 5/4, 6/8, 7/8, 9/8,+ 12/8) as radio items, the current one checked; an uncommon current signature is shown as an+ extra checked item at the top. Sets `Transport.TimeSigNumerator/Denominator` like the+ fields.+- **Tap**: a `MenuItem` with `StaysOpenOnClick = true` calling `TapTempoBeat()`; its trailing+ text shows the tapped tempo, refreshed on each tap.+- **Master**: a menu item whose header hosts a second `MiniFader` made by the same factory as+ the bar's (shared `MixGesture` undo, double-click to type, MIDI-learnable is not needed in+ the menu). `StaysOpenOnClick` so dragging does not close the menu.+- **DSP meter**: a disabled item "DSP 23 %" refreshed by the existing CPU tick while the menu+ is open.+- **Automation**: check item; when the Re-enable chip is shown, a "Re-enable automation" item+ follows it.+- **Remote**: "Connect Phone…" with the count text the chip shows.++## R4 — Interface scale from the menu++- **Decision**: a radio submenu of `InterfaceScale.Presets`; picking one sets+ `settings.Current.InterfaceScale`, saves and calls `NotaUiScale.Set` — the same three steps+ as Settings → Appearance. The Settings scale picker subscribes to `NotaUiScale.Changed` so an+ open Settings window follows.+- **Rationale**: one setting, two faces; no new state.++## R5 — Button look and "something is shed" cue++- **Decision**: a `tp-icon` key with a new `GlyphKind.More` (three dots), in the bar's last+ column after the master strip; when at least one step is shed it carries a small accent dot+ (the same 5 px dot language as the MIDI / Remote dots).+- **Rationale**: Studio design language — tool keys draw what they do; the dot is the+ existing "activity" cue.++## R6 — Fit interaction++- The button is not in the shed order, so it is measured with the never-shed controls; the+ fit loop is unchanged otherwise. `FitTransport` stores `_shedSteps` and updates the cue.+- A resize while the menu is open leaves the open menu as built; the next open reflects the+ new fit (spec edge case).diff --git a/specs/097-toolbar-overflow/spec.md b/specs/097-toolbar-overflow/spec.mdnew file mode 100644index 00000000..eaa87499--- /dev/null+++ b/specs/097-toolbar-overflow/spec.md@@ -0,0 +1,232 @@+# Feature Specification: Toolbar overflow++**Feature Branch**: `feat/toolbar-overflow`++**Created**: 2026-11-13++**Status**: Draft++**Input**: Issue [#520](https://github.com/nota-daw/nota/issues/520) (approved) "Add Expandable+Toolbar Buttons and Overflow Menu": toolbar controls that don't fit must stay reachable+through an overflow (⋯) button that expands the toolbar, and come back when there is room;+the overflow area also hosts a few less-frequent quick functions (the issue's example:+switching the interface scale between 100 % and 125 %). User-customised overflow content+and expandable individual buttons (metronome options, #404) are out of scope.++## Nota Context *(fill in — drives plan and tasks)*++**Feature area** *(pick the main one)*:++- [ ] Engine (C++, `src/native/nota.engine`) — real-time audio rules apply, see `ARCHITECTURE.md` AR table+- [x] 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 stand today**: on a narrow window, or at a large interface scale, the+transport bar sheds its least-needed controls in a fixed order (#303): the CPU bar (the DSP+number stays), the Remote label, Tap, Key, Remote, Follow, Automation, Mixer (#516), the time signature,+MIDI learn, Grid, Snap, loop-record mode, loop, the master strip, and last the DSP meter. A+shed control is simply hidden. Some have a menu entry or a shortcut, but Tap's beat dots,+the project-key picker, the time-signature fields and the master level have no other place+in the main window at all. Stop / play / record, the position, the tempo, the metronome, the+view switch and the Menu key (#518) never shed. The interface scale (75 / 100 / 125 / 150 /+200 %) is changed only in Settings → Appearance.++## Clarifications++### Session 2026-11-13++- Q: How does the ⋯ button show what doesn't fit — a second toolbar row that pushes the workspace down, a row floating over it, or a drop-down menu? → A: An ordinary drop-down menu, like the rest of Nota's menus.+- Q: When the overflow is open and the user clicks in the workspace, what does that click do? → A: As with any Nota menu: the menu closes on the click outside it, on Escape and when an item is chosen; the click outside only closes the menu.++## User Scenarios & Testing *(mandatory)*++### User Story 1 - Nothing on the toolbar becomes unreachable (Priority: P1)++A musician works on a laptop screen at 125 % interface scale. The transport bar no longer+has room for every control. Instead of Grid, Snap, Key and the master strip silently+vanishing, an overflow (⋯) button sits at the end of the bar. Clicking it opens a menu with+an entry for each control that didn't fit — Snap as a check item, Grid and Key as+submenus, the master level adjustable in place — each doing what the control does in the+bar. When the window is widened, the controls go back to the bar and their entries leave+the menu.++**Why this priority**: It is the core of #520 — today some functions are reachable only by+shortcut, or not at all, on a small screen.++**Independent Test**: Narrow the main window step by step; at every width open the overflow+menu and use the entry of each shed control; widen again and check the entries go as the+controls return.++**Acceptance Scenarios**:++1. **Given** a window too narrow for Snap and Grid, **When** the user opens the overflow+ menu, **Then** it lists Snap and Grid, in the bar's left-to-right order, and nothing+ that is still in the bar.+2. **Given** Snap is shed, **When** the user chooses Snap in the menu, **Then** snapping+ toggles exactly as from the bar and the item shows the new state next time.+3. **Given** Grid or Key is shed, **When** the user opens its submenu, **Then** it offers+ the same choices as the control's own menu in the bar, with the current one marked.+4. **Given** the master strip is shed, **When** the user opens the menu, **Then** the master+ level can be read and adjusted from it.+5. **Given** the time signature is shed, **When** the user opens its submenu, **Then** the+ common signatures are offered with the current one marked.+6. **Given** Tap is shed, **When** the user taps its entry repeatedly, **Then** the menu+ stays open and each tap counts toward the tempo as on the bar's Tap button.+7. **Given** the DSP meter is shed, **When** the user opens the menu, **Then** it shows the+ current DSP load (read-only), updating while the menu is open.+8. **Given** the bar is wide enough for everything, **When** the user looks at the bar,+ **Then** it looks as it does today apart from the overflow button.++---++### User Story 2 - The overflow menu behaves like every Nota menu (Priority: P1)++The overflow is a temporary menu: the user opens it, picks something, and it goes.++**Why this priority**: A predictable way in and out keeps it from getting in the way.++**Independent Test**: Open the menu, close it with each route, check the workspace below is+unaffected by the closing click.++**Acceptance Scenarios**:++1. **Given** the menu is closed, **When** the user clicks the overflow button, **Then** the+ menu opens under it.+2. **Given** the menu is open, **When** the user chooses an item, presses Escape, clicks+ the overflow button again or clicks outside the menu, **Then** the menu closes; a click+ outside does nothing else.+3. **Given** keyboard navigation, **When** the user tabs to the overflow button and presses+ Space / Return, **Then** the menu opens with keyboard focus on its first item.++---++### User Story 3 - Quick functions in the overflow menu (Priority: P2)++The overflow menu also carries a small, fixed group of quick functions that would otherwise+need a trip to Settings — first the interface scale, with its presets one submenu away. A+user who flips between 100 % and 125 % often does it from the toolbar.++**Why this priority**: The issue's second purpose; useful, but not needed to fix the+disappearing controls.++**Independent Test**: With a wide window, open the menu, change the interface scale there,+check Settings → Appearance shows the same value and it is kept after a restart.++**Acceptance Scenarios**:++1. **Given** any window width, **When** the user opens the menu, **Then** the quick+ functions are listed after the shed controls' entries, separated from them.+2. **Given** the scale is 100 %, **When** the user picks 125 % in the menu, **Then** the+ interface rescales at once, Settings → Appearance shows 125 % and the value persists.++---++### Edge Cases++- The window is resized while the menu is open: the menu closes (or keeps showing what was+ shed when it opened); the next open reflects the new fit. It never lists a control that+ is in the bar.+- Purely informational parts shed early (the CPU bar beside the DSP number, the Remote+ label beside its glyph and count) leave their information visible in the bar and get no+ menu entry.+- When the whole Remote panel is shed, the menu offers MIDI learn (checked when on) and+ Connect Phone (with the number of connected phones).+- The Re-enable automation chip appears while Automation is shed: Automation's entry in the+ menu offers the re-enable action too.+- The interface scale changes so much that even the never-shed controls barely fit: the+ overflow button still fits and is never shed.+- Menu row hidden on Windows / Linux (#518): the Menu key and the overflow button are both+ present and never shed.+- Language change makes labels wider or narrower: the fit is redone at once.++## Requirements *(mandatory)*++### Functional Requirements++- **FR-001**: Every control the transport bar sheds for lack of room MUST remain usable+ through the overflow menu; no control may be unreachable at any window width the app+ allows and at any interface-scale preset.+- **FR-002**: The overflow menu MUST list an entry for each shed control, in bar order, and+ none for controls still in the bar. Each entry MUST do what the control does:+ - toggles (Follow, Automation, Mixer, Snap, loop, loop-record mode, MIDI learn) as check items+ showing their state;+ - Grid, Key and the time signature as submenus offering the control's choices with the+ current one marked (time signature: the common signatures);+ - Tap as an item that stays open on click so it can be tapped repeatedly;+ - Remote as Connect Phone, with the phone count;+ - the master level readable and adjustable in the menu;+ - the DSP meter as a read-only line with the current load.+ Informational parts whose information stays in the bar (CPU bar, Remote label) need no+ entry.+- **FR-003**: The shed order and the never-shed set MUST stay as today (#303, #518); the+ overflow button itself MUST never shed.+- **FR-004**: When room returns, controls MUST move back into the bar in reverse shed order+ and their entries MUST leave the menu.+- **FR-005**: The overflow menu MUST behave like Nota's other menus: it closes when an item+ is chosen (except Tap), on Escape, on a second click of the button and on a click outside,+ and a click outside only closes it.+- **FR-006**: The menu MUST hold a fixed quick-functions group after the shed controls'+ entries, containing an interface-scale submenu with all presets and the current one+ marked; a change there MUST be the same setting Settings → Appearance shows, and MUST+ persist.+- **FR-007**: Because of the quick functions the overflow button MUST be shown at every+ width; it MUST indicate when controls are currently shed into the menu.+- **FR-008**: The overflow button and the menu MUST be keyboard-reachable, with tooltips,+ accessible names and item labels in every supported language; an entry's shortcut, when+ the control has one, is shown beside it as in other menus.+- **FR-009**: The button and menu MUST follow the Studio design language in all four themes+ and the classic look, and scale with the interface scale.+- **FR-010**: Opening the menu, using it and re-fitting the bar MUST NOT interrupt playback+ or recording.++### Key Entities++- **Toolbar control**: a part of the transport bar with a place in the shed order (or marked+ never-shed); while shed, it is represented by an entry in the overflow menu.+- **Quick function**: an entry always present in the overflow menu, independent of width; the+ interface scale is the first.++## Success Criteria *(mandatory)*++### Measurable Outcomes++- **SC-001**: At every window width from the app's minimum up and at every interface-scale+ preset, 100 % of the transport bar's controls are usable in at most three clicks.+- **SC-002**: Switching the interface scale from the toolbar takes three clicks (button,+ Interface scale, preset), against four or more through Settings today.+- **SC-003**: Checked at every shed step, the menu lists exactly the shed controls — none+ missing, none duplicated with the bar.+- **SC-004**: The menu opens within a single frame of the click, with no audio dropout+ during playback.++## Assumptions++- The overflow button sits at the right end of the bar, after the master strip, and uses a+ three-dot glyph.+- The quick-functions group is fixed; user customisation and expandable individual buttons+ (#404) are out of scope.+- The phrase-lines toggle (#517) is not built yet; when it joins the bar it takes part in+ the shed order and so in the overflow menu, as the Mixer key (#516) already does.+- Only the main window's transport bar is covered; the Session toolbar and the editors'+ toolbars keep their current behaviour.+- Time signatures outside the common list stay settable from the bar's own fields at a+ wider window or from the project; the submenu does not need a free-entry field.++## 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 change+- [x] Managed/native crossings go through the pure C ABI in `nota_engine.h` only (AR-7); no JUCE outside `pluginhost/`+- [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/097-toolbar-overflow/tasks.md b/specs/097-toolbar-overflow/tasks.mdnew file mode 100644index 00000000..3cf90568--- /dev/null+++ b/specs/097-toolbar-overflow/tasks.md@@ -0,0 +1,102 @@+---+description: "Tasks for 097 — Toolbar overflow (#520)"+---++# Tasks: Toolbar overflow++**Input**: Design documents from `specs/097-toolbar-overflow/`++**Prerequisites**: [plan.md](plan.md), [spec.md](spec.md), [research.md](research.md),+[data-model.md](data-model.md), [contracts/overflow-menu.md](contracts/overflow-menu.md),+[quickstart.md](quickstart.md)++**Tests**: the plan asks for `ToolbarOverflowTests` in the smoke test on the pure model.++## Format: `[ID] [P?] [Story] Description`++## Phase 1: Setup++- [X] T001 [P] Add `GlyphKind.More` (three dots, drawn from geometry like the other tool glyphs) in `src/managed/Nota.App/Controls/Glyph.cs`++## Phase 2: Foundational (blocking)++- [X] T002 Create the pure model `ToolbarPart` + `ToolbarOverflow` (`ShedOrder` = today's #303 order; `BarOrder` = Loop, LoopRecord, Tap, TimeSignature, Key, Grid, Follow, Snap, Automation, MidiLearn, Remote, DspMeter, Master with CpuBar / RemoteLabel placed beside DspMeter / Remote; `IsInfoOnly` true for CpuBar, RemoteLabel; `Entries(int shedSteps)` — "`shedSteps` is clamped to `0 … ShedOrder.Count`", "never contains duplicates; `Entries(n)` ⊆ `Entries(n + 1)`", "`Entries(0)` is empty", sorted by `BarOrder`) in `src/managed/Nota.Presentation/ToolbarOverflow.cs`+- [X] T003 [P] Add `ToolbarOverflowTests` (empty at 0, full order at max, clamping, monotonic, no duplicates, info-only omitted, bar-order sort, Snap+Grid case from US1 #1) in `tests/Nota.SmokeTest/ToolbarOverflowTests.cs` and register it in `tests/Nota.SmokeTest/Program.cs`+- [X] T004 Drive `TransportShedOrder` from `ToolbarOverflow.ShedOrder` through a part → controls map (TimeSignature → TimeSigCell, MidiLearn → RemotePanel, Loop → LoopSep + LoopCell, DspMeter → CpuMeter + CpuSep, …), keep the shed behaviour identical, and store `_shedSteps` after each fit in `src/managed/Nota.App/MainWindow.TransportFit.cs`++**Checkpoint**: build green; the bar sheds exactly as before.++## Phase 3: User Story 1 — Nothing on the toolbar becomes unreachable (P1) 🎯 MVP++**Goal**: every shed control has a working entry in the ⋯ menu.++**Independent Test**: quickstart steps 2, 3 and 6.++- [X] T005 [US1] Add `OverflowBtn` (`tp-icon` ToggleButton-free `Button`, `GlyphKind.More`, tooltip + accessible name `{app:T 'main.overflow'}`, a 5 px accent `OverflowDot` shown while anything is shed) in the bar's last column (Grid.Column 10) in `src/managed/Nota.App/MainWindow.axaml`; it is never in the shed order+- [X] T006 [US1] Update the dot from `_shedSteps` in `FitTransport` in `src/managed/Nota.App/MainWindow.TransportFit.cs`+- [X] T007 [P] [US1] Split `SnapChip.OpenMenu` into `BuildItems()` (returns the items) used by the chip and reusable as a submenu in `src/managed/Nota.App/SnapChip.cs`; expose the arrangement chip from `InitSnapGrid` in `src/managed/Nota.App/MainWindow.axaml.cs`+- [X] T008 [US1] Extract the master-fader construction into `CreateMasterFader()` (MiniFader + `MixGesture` undo + `ValueEntry`) used by the bar and the menu in `src/managed/Nota.App/MainWindow.axaml.cs`+- [X] T009 [US1] Create `MainWindow.TransportOverflow.cs`: `OnOverflowClick` builds a `MenuFlyout` with `MenuKit` from `ToolbarOverflow.Entries(_shedSteps)` per [contracts/overflow-menu.md](contracts/overflow-menu.md) — check items for Loop, LoopRecord, Follow (`SetFollowPlayhead`), Snap (same path as the magnet, ⌘4 shown), Automation (+ "Re-enable automation" while `ReenableAutoBtn` is visible), MIDI learn (`ToggleMidiLearn`); Tap (`StaysOpenOnClick`, `TapTempoBeat`, trailing BPM); Time signature ▸ radio submenu (2/4 3/4 4/4 5/4 6/8 7/8 9/8 12/8 + the current one if uncommon); Key… (closes, then `KeyPicker.Show` under `OverflowBtn`); Grid ▸ (`BuildItems`); Connect Phone… with the count; DSP line (disabled, refreshed by the CPU tick while open); Master fader item (`StaysOpenOnClick`) — in `src/managed/Nota.App/MainWindow.TransportOverflow.cs`+- [X] T010 [US1] Refresh the open menu's DSP line and Tap trailing text from the existing CPU tick / `TapTempoBeat` in `src/managed/Nota.App/MainWindow.axaml.cs`+- [X] T011 [P] [US1] Add the `main.overflow` and `overflow.*` strings (entry labels, DSP line format, Connect Phone count) in `src/managed/Nota.Application/Localization/en.json`++**Checkpoint**: US1 independently testable.++## Phase 4: User Story 2 — The overflow menu behaves like every Nota menu (P1)++**Goal**: predictable opening / closing and keyboard reach.++**Independent Test**: quickstart step 5; Tab to ⋯, Space opens with focus on the first item.++- [X] T012 [US2] Second click on ⋯ while open closes the menu (track the open flyout, hide instead of re-open); outside click only closes (flyout light dismiss, overlay input pass-through off) in `src/managed/Nota.App/MainWindow.TransportOverflow.cs`+- [X] T013 [US2] Keyboard: `OverflowBtn` focusable in tab order; opening by keyboard focuses the first item in `src/managed/Nota.App/MainWindow.TransportOverflow.cs`++## Phase 5: User Story 3 — Quick functions (P2)++**Goal**: interface scale from the toolbar.++**Independent Test**: quickstart step 4.++- [X] T014 [US3] Add the quick-functions section after a separator: "Interface scale ▸" radio submenu over `InterfaceScale.Presets`, current checked; picking sets `settings.Current.InterfaceScale`, `Save()`, `NotaUiScale.Set(p)` in `src/managed/Nota.App/MainWindow.TransportOverflow.cs`+- [X] T015 [P] [US3] Make the Settings scale picker follow `NotaUiScale.Changed` (re-check its buttons; unsubscribe on close) in `src/managed/Nota.App/PreferencesWindow.cs`+- [X] T016 [P] [US3] Strings for the quick functions in `src/managed/Nota.Application/Localization/en.json`++## Phase 6: Polish & Cross-Cutting++- [X] T017 Fix the stale "launch quantize" note in the bar's header comment and document the ⋯ button in the comments of `src/managed/Nota.App/MainWindow.axaml` and `src/managed/Nota.App/MainWindow.TransportFit.cs`+- [X] T018 Run [quickstart.md](quickstart.md) in the app (headless harness screenshots per the Nota UI verify recipe): narrow / wide, 100 % / 150 %, Studio Dark / Studio Light / classic look++### Nota closing tasks++- [ ] T019 Run `scripts/build.sh` until native + managed + smoke test are green+- [X] T020 AGPL-3.0-only SPDX two-line header on `ToolbarOverflow.cs`, `ToolbarOverflowTests.cs`, `MainWindow.TransportOverflow.cs`+- [X] T021 New dependency: N/A+- [X] T022 `CHANGELOG.md` `[Unreleased]` → Added: toolbar overflow menu (#520)+- [X] T023 FEATURES.md via `nota-features`; transport, main-window and appearance docs pages (EN + RU) via `nota-docs` in ../nota-docs-520 (branch docs/transport-overflow-520, transport-bar shot retaken); shortcuts — N/A (no key added)+- [X] T024 Engine behaviour change: N/A++---++## Dependencies & Execution Order++- Phase 1 and T002 → T003, T004 → US1 (T005–T011) → US2 (T012–T013, same file as T009) → US3 (T014–T016) → Polish.+- US3's T015 / T016 can run alongside US1 (different files).++### Parallel Opportunities++- T001 ‖ T002; T003 ‖ T004 after T002.+- In US1: T007, T011 ‖ T005/T006/T008.+- In US3: T015 ‖ T016 ‖ T014.++## Parallel Example: User Story 1++```text+T007 SnapChip.BuildItems (SnapChip.cs)+T011 overflow strings (en.json)+T008 CreateMasterFader (MainWindow.axaml.cs)+```++## Implementation Strategy++MVP = Phases 1–3 (the disappearing-controls fix). US2 hardens the menu's open/close; US3 adds+the interface scale. Each checkpoint builds green.diff --git a/src/managed/Nota.App/Controls/Glyph.cs b/src/managed/Nota.App/Controls/Glyph.csindex df8c66a3..f852711d 100644--- a/src/managed/Nota.App/Controls/Glyph.cs+++ b/src/managed/Nota.App/Controls/Glyph.cs@@ -42,6 +42,7 @@ internal enum GlyphKindExpand, Shrink, // a panel filling the window, and back to its splitHome, Drive, AudioFile, // the Files browse view: home folder, a drive, an audio file (spec 092)Menu, // the transport bar's Menu key: the whole app menu on Windows / Linux (#518)+ More, // the transport bar's overflow key: what the bar had no room for (#520)}internal sealed class Glyph : Control@@ -471,6 +472,8 @@ internal sealed class Glyph : Control[GlyphKind.Options] = ("M4 7 H20 M7 12 H17 M10 17 H14", null),// Three equal rules: the application menu (#518).[GlyphKind.Menu] = ("M4 6.5 H20 M4 12 H20 M4 17.5 H20", null),+ // Three dots in a row: more of the bar, in a menu (#520).+ [GlyphKind.More] = (null, "M5 10.25 A1.75 1.75 0 1 0 5 13.75 A1.75 1.75 0 1 0 5 10.25 Z M12 10.25 A1.75 1.75 0 1 0 12 13.75 A1.75 1.75 0 1 0 12 10.25 Z M19 10.25 A1.75 1.75 0 1 0 19 13.75 A1.75 1.75 0 1 0 19 10.25 Z"),// A magnifier.[GlyphKind.Search] = ("M10.5 4 A6.5 6.5 0 1 0 10.5 17 A6.5 6.5 0 1 0 10.5 4 M15.5 15.5 L21 21", null),// A small solid triangle pointing right (a closed disclosure).diff --git a/src/managed/Nota.App/MainWindow.Input.cs b/src/managed/Nota.App/MainWindow.Input.csindex b6884a53..45ccd53c 100644--- a/src/managed/Nota.App/MainWindow.Input.cs+++ b/src/managed/Nota.App/MainWindow.Input.cs@@ -53,6 +53,7 @@ public partial class MainWindow}if (_vm.SuspendEnginePolling || PaletteOpen) return; // the palette has the keyboardif (e.Source is TextBox || e.Source is NumericUpDown) return;+ if (TakesOverflowKey(e)) { e.Handled = true; return; } // ⋯ focused by Tab (#520)if (Keys.Is(e, "session.launchSelection") && SessionFocused){diff --git a/src/managed/Nota.App/MainWindow.TransportFit.cs b/src/managed/Nota.App/MainWindow.TransportFit.csindex e8adc922..df3e7aa5 100644--- a/src/managed/Nota.App/MainWindow.TransportFit.cs+++ b/src/managed/Nota.App/MainWindow.TransportFit.cs@@ -9,43 +9,56 @@// when the audio starts to crackle and isn't shown anywhere else, so it only folds to its// number early on and goes last of all (#303).// The Menu key (Windows / Linux, #518) is never in the order either: with the menu row hidden-// it is the only way to the menu by mouse.+// it is the only way to the menu by mouse. Nor is the ⋯ key at the end (#520): nothing shed is+// lost — the ⋯ menu lists every part the bar had no room for. The order itself lives in+// Nota.Presentation.ToolbarOverflow, so the menu and the smoke test read the same list.using System;using System.Collections.Generic;+using System.Linq;using Avalonia;using Avalonia.Controls;using Avalonia.Layout;using Avalonia.Threading;using Avalonia.VisualTree;using Nota.Application.Localization;+using Nota.Presentation;namespace Nota.App;public partial class MainWindow{- // Each step hides its controls together; steps go in this order and come back in reverse.+ // Each step hides its controls together; steps go in ToolbarOverflow.ShedOrder and come+ // back in reverse. What a step hid is listed in the ⋯ menu (MainWindow.TransportOverflow.cs).private Control[][]? _transportShedOrder;private bool _transportFitPosted;- private Control[][] TransportShedOrder => _transportShedOrder ??= new[]+ /// <summary>How many steps of the shed order the last fit hid (0 = the whole bar shows).</summary>+ private int _shedSteps;++ private Control[][] TransportShedOrder => _transportShedOrder ??=+ ToolbarOverflow.ShedOrder.Select(ShedControls).ToArray();++ // The controls a part takes with it.+ private Control[] ShedControls(ToolbarPart part) => part switch{- new Control[] { CpuBar }, // the DSP meter keeps its number- new Control[] { RemoteLabel }, // Remote keeps its glyph, count and dot- new Control[] { TapChip }, // palette ▸ Tap Tempo; the BPM field stays- new Control[] { KeyChip }, // set once per project- new Control[] { RemoteBtn }, // View ▸ Connect Phone…- new Control[] { FollowBtn }, // View ▸ Follow playhead- new Control[] { AutomationToggle }, // ⌘⇧A- new Control[] { MixerToggle }, // View ▸ Mixer, ⌘⇧M- new Control[] { TimeSigCell }, // set once per project- new Control[] { RemotePanel }, // MIDI learn (the panel goes with its last chip)- new Control[] { SnapChip }, // the grid; snapping itself stays switchable- new Control[] { SnapToggle }, // hold Alt to drag freely- new Control[] { LoopRecordCell }, // ⌘⇧R / Transport menu- new Control[] { LoopSep, LoopCell }, // ⌘L; the range stays visible on the ruler- new Control[] { MasterWell }, // the master strip is in the mixer- new Control[] { CpuMeter, CpuSep }, // only when nothing else is left to give+ ToolbarPart.CpuBar => [CpuBar], // the DSP meter keeps its number+ ToolbarPart.RemoteLabel => [RemoteLabel], // Remote keeps its glyph, count and dot+ ToolbarPart.Tap => [TapChip], // palette ▸ Tap Tempo; the BPM field stays+ ToolbarPart.Key => [KeyChip], // set once per project+ ToolbarPart.Remote => [RemoteBtn], // View ▸ Connect Phone…+ ToolbarPart.Follow => [FollowBtn], // View ▸ Follow playhead+ ToolbarPart.Automation => [AutomationToggle], // ⌘⇧A+ ToolbarPart.Mixer => [MixerToggle], // View ▸ Mixer, ⌘⇧M+ ToolbarPart.TimeSignature => [TimeSigCell], // set once per project+ ToolbarPart.MidiLearn => [RemotePanel], // MIDI learn (the panel goes with its last chip)+ ToolbarPart.Grid => [GridSep, SnapChip], // the grid; snapping itself stays switchable+ ToolbarPart.Snap => [SnapToggle], // hold Alt to drag freely+ ToolbarPart.LoopRecord => [LoopRecordCell], // ⌘⇧R / Transport menu+ ToolbarPart.Loop => [LoopSep, LoopCell], // ⌘L; the range stays visible on the ruler+ ToolbarPart.Master => [MasterWell], // the master strip is in the mixer+ ToolbarPart.DspMeter => [CpuMeter, CpuSep], // only when nothing else is left to give+ _ => [],};private void InitTransportFit()@@ -94,6 +107,8 @@ public partial class MainWindowhidden++;}+ _shedSteps = hidden;+ OverflowDot.IsVisible = hidden > 0;TransportGrid.InvalidateMeasure();}diff --git a/src/managed/Nota.App/MainWindow.TransportOverflow.cs b/src/managed/Nota.App/MainWindow.TransportOverflow.csnew file mode 100644index 00000000..0d68f7d1--- /dev/null+++ b/src/managed/Nota.App/MainWindow.TransportOverflow.cs@@ -0,0 +1,263 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.+//+// The transport bar's ⋯ key (specs/097, #520). A narrow bar sheds parts (TransportFit); this+// menu lists every part it shed, in bar order, each doing what the part does — so nothing on+// the bar is ever out of reach — and then a few quick settings that would otherwise be a trip+// to Settings (the interface scale). It is an ordinary Nota menu, built afresh on each open+// from the current fit and state: Escape, a click outside or a pick closes it, and a click+// outside does nothing else. Toggles run the same commands as their keys and menu twins.++using System;+using System.Collections.Generic;+using Avalonia;+using Avalonia.Controls;+using Avalonia.Controls.Primitives;+using Avalonia.Input;+using Avalonia.Layout;+using Avalonia.Interactivity;+using Avalonia.Threading;+using Microsoft.Extensions.DependencyInjection;+using Nota.Application;+using Nota.Application.Localization;+using Nota.Presentation;++namespace Nota.App;++public partial class MainWindow+{+ // The signatures the menu offers; the bar's own fields still reach any other.+ private static readonly (int Num, int Den)[] CommonTimeSignatures =+ { (2, 4), (3, 4), (4, 4), (5, 4), (6, 8), (7, 8), (9, 8), (12, 8) };++ private SnapChip? _snapChip;+ private MenuFlyout? _overflowMenu;+ private DateTime _overflowClosedAt;++ private void OnOverflowClick(object? sender, RoutedEventArgs e)+ {+ // The press that closed the open menu (light dismiss) is also this click: leave it closed.+ if ((DateTime.UtcNow - _overflowClosedAt).TotalMilliseconds < 300) return;+ OpenOverflowMenu(fromKeyboard: false);+ }++ /// <summary>Space / Return on ⋯ while it has keyboard focus (Tab) opens the menu; the+ /// window's transport keys would take them first (Space = Play everywhere), so they ask+ /// here. A ⋯ merely clicked keeps Space as Play.</summary>+ internal bool TakesOverflowKey(KeyEventArgs e)+ {+ if (e.KeyModifiers != KeyModifiers.None || e.Key is not (Key.Space or Key.Enter)) return false;+ if (!ReferenceEquals(e.Source, OverflowBtn) || !OverflowBtn.Classes.Contains(":focus-visible")) return false;+ OpenOverflowMenu(fromKeyboard: true);+ return true;+ }++ private void OpenOverflowMenu(bool fromKeyboard)+ {+ if (_vm is null) return;+ if (_overflowMenu is { IsOpen: true } open) { open.Hide(); return; }++ var focusBefore = FocusManager?.GetFocusedElement();+ var menu = _overflowMenu = new MenuFlyout { Placement = PlacementMode.BottomEdgeAlignedRight };+ MenuKit.AddGroups(menu.Items, ShedEntries(_vm), QuickEntries());+ menu.Opened += (_, _) =>+ {+ if (!fromKeyboard) return;+ // From the keyboard the first entry is highlighted, so the arrows, Enter and Escape act at once.+ Dispatcher.UIThread.Post(() =>+ {+ foreach (var entry in menu.Items)+ if (entry is MenuItem { IsVisible: true, IsEnabled: true } first) { first.Focus(NavigationMethod.Directional); break; }+ }, DispatcherPriority.Input);+ };+ menu.Closed += (_, _) =>+ {+ _overflowClosedAt = DateTime.UtcNow;+ if (ReferenceEquals(_overflowMenu, menu)) _overflowMenu = null;+ // Back to where the keyboard was — unless what was picked moved it (a dialog, a picker).+ Dispatcher.UIThread.Post(() =>+ {+ var now = FocusManager?.GetFocusedElement();+ if (focusBefore is not null && (now is null || ReferenceEquals(now, OverflowBtn) || now is MenuItem))+ focusBefore.Focus();+ }, DispatcherPriority.Input);+ };+ menu.ShowAt(OverflowBtn);+ }++ // One entry per shed part, in bar order (ToolbarOverflow.Entries).+ private IEnumerable<Control> ShedEntries(MainWindowViewModel vm)+ {+ foreach (var part in ToolbarOverflow.Entries(_shedSteps))+ {+ switch (part)+ {+ case ToolbarPart.Loop:+ {+ // The bar's Loop key: a plain on / off (⌘L also sets the loop to a selection).+ var mi = Toggle(Loc.T("common.loop"), vm.Transport.LoopOn, () => vm.Transport.LoopOn = !vm.Transport.LoopOn, MenuKit.LoopKey);+ MenuKit.SetTrailing(mi, vm.Transport.LoopRangeText);+ yield return mi;+ break;+ }+ case ToolbarPart.LoopRecord:+ yield return Check(Loc.T("main.transport_overflow.loop_record_replace"), vm.Transport.LoopRecordReplace,+ "transport.loopRecordMode", MenuKit.Bound("transport.loopRecordMode"));+ break;+ case ToolbarPart.Tap:+ yield return TapEntry(vm);+ break;+ case ToolbarPart.TimeSignature:+ yield return TimeSignatureEntry(vm);+ break;+ case ToolbarPart.Key:+ {+ var mi = MenuKit.Item(Loc.T("main.transport_overflow.key"), click: () =>+ // After the menu is gone, so the picker opens on its own under ⋯.+ Dispatcher.UIThread.Post(() => PickProjectKey(OverflowBtn)));+ MenuKit.SetTrailing(mi, KeyLabel.Text);+ yield return mi;+ break;+ }+ case ToolbarPart.Grid when _snapChip is not null:+ {+ var mi = MenuKit.ValueItem(Loc.T("common.grid"), null, SnapLabel.Text ?? "");+ foreach (var item in _snapChip.BuildItems()) mi.Items.Add(item);+ yield return mi;+ break;+ }+ case ToolbarPart.Follow:+ // As the bar's key: a paused Follow is picked up again rather than turned off.+ yield return Toggle(Loc.T("main.follow_playhead"), FollowBtn.IsChecked == true,+ () => SetFollowPlayhead(Timeline.FollowSuspended || !Timeline.FollowPlayhead), MenuKit.Bound("view.follow"));+ break;+ case ToolbarPart.Snap:+ {+ bool on = EditorGrids.Shared.Get(EditorKind.Arrangement).SnapOn;+ var mi = new MenuItem+ {+ Header = Loc.T("snap_chip.snap_to_grid"), ToggleType = MenuItemToggleType.CheckBox,+ IsChecked = on, InputGesture = MenuKit.Bound("grid.snap"),+ };+ mi.Click += (_, _) => SetSnapEnabled(!on);+ yield return mi;+ break;+ }+ case ToolbarPart.Automation:+ yield return Check(Loc.T("main.transport_overflow.automation"), AutomationToggle.IsChecked == true,+ "view.automation", MenuKit.Bound("view.automation"));+ if (ReenableAutoBtn.IsVisible)+ yield return MenuKit.Item(Loc.T("main.transport_overflow.reenable_automation"),+ click: () => OnReenableAutomation(this, new RoutedEventArgs()));+ break;+ case ToolbarPart.Mixer:+ yield return Check(Loc.T("common.mixer"), MixerToggle.IsChecked == true, "view.mixer", MenuKit.Bound("view.mixer"));+ break;+ case ToolbarPart.MidiLearn:+ yield return Check(Loc.T("main.transport_overflow.midi_learn"), MidiLearnBtn.IsChecked == true,+ "view.midiLearn", MenuKit.Bound("view.midiLearn"));+ break;+ case ToolbarPart.Remote:+ {+ var mi = MenuKit.Item(Loc.T("main.connect_phone"), click: ShowConnectPhone);+ MenuKit.SetTrailing(mi, RemoteCount.Text);+ yield return mi;+ break;+ }+ case ToolbarPart.DspMeter:+ {+ // Read-only, and live while the menu is open: it mirrors the bar's read-out.+ var mi = new MenuItem { IsEnabled = false };+ mi[!MenuItem.HeaderProperty] = CpuText[!TextBlock.TextProperty];+ yield return mi;+ break;+ }+ case ToolbarPart.Master:+ yield return MasterEntry(vm);+ break;+ }+ }+ }++ // The quick settings, shown at every width.+ private static IEnumerable<Control> QuickEntries()+ {+ var settings = App.Services.GetRequiredService<ISettingsService>();+ int current = InterfaceScale.Normalize(settings.Current.InterfaceScale);+ var scale = MenuKit.ValueItem(Loc.T("preferences.interface_scale"), null, $"{current} %");+ foreach (var percent in InterfaceScale.Presets)+ {+ int p = percent;+ var mi = new MenuItem { Header = $"{p} %", ToggleType = MenuItemToggleType.Radio, IsChecked = current == p };+ mi.Click += (_, _) =>+ {+ if (settings.Current.InterfaceScale == p) return;+ settings.Current.InterfaceScale = p; // the same setting as Settings → Appearance+ settings.Save();+ NotaUiScale.Set(p);+ };+ scale.Items.Add(mi);+ }+ yield return scale;+ }++ // A toggle that runs the part's command, so the bar, the app menu and its key stay one path.+ private MenuItem Check(string header, bool on, string command, KeyGesture? gesture)+ => Toggle(header, on, () => _commands.Run(command), gesture);++ private static MenuItem Toggle(string header, bool on, Action flip, KeyGesture? gesture)+ {+ var mi = new MenuItem { Header = header, ToggleType = MenuItemToggleType.CheckBox, IsChecked = on, InputGesture = gesture };+ mi.Click += (_, _) => flip();+ return mi;+ }++ // Tap stays open: a tempo takes several taps. The tapped tempo shows beside it.+ private MenuItem TapEntry(MainWindowViewModel vm)+ {+ var mi = new MenuItem { Header = Loc.T("main.transport_overflow.tap_tempo"), StaysOpenOnClick = true };+ void Show() => MenuKit.SetTrailing(mi, Loc.F("browser.bpm", NotaNum.Bpm((double)vm.Transport.Bpm)));+ Show();+ mi.Click += (_, _) => { TapTempoBeat(); Show(); };+ return mi;+ }++ private static MenuItem TimeSignatureEntry(MainWindowViewModel vm)+ {+ int num = vm.Transport.TimeSigNumerator, den = vm.Transport.TimeSigDenominator;+ var mi = MenuKit.ValueItem(Loc.T("main.transport_overflow.time_signature"), null, $"{num}/{den}");+ var list = new List<(int Num, int Den)>(CommonTimeSignatures);+ if (!list.Contains((num, den))) list.Insert(0, (num, den)); // an uncommon one, still marked+ foreach (var (n, d) in list)+ {+ var item = new MenuItem { Header = $"{n}/{d}", ToggleType = MenuItemToggleType.Radio, IsChecked = n == num && d == den };+ item.Click += (_, _) =>+ {+ vm.Transport.TimeSigNumerator = n;+ vm.Transport.TimeSigDenominator = d;+ };+ mi.Items.Add(item);+ }+ return mi;+ }++ // The master fader in a row of its own; it stays open so a drag doesn't close the menu.+ private static MenuItem MasterEntry(MainWindowViewModel vm)+ {+ var fader = CreateMasterFader(vm);+ // Follow the level while shown (a phone, a controller, undo), except mid-drag.+ void Sync(object? s, System.ComponentModel.PropertyChangedEventArgs e)+ {+ if (e.PropertyName == nameof(vm.Transport.MasterVolume) && !fader.Dragging) fader.Value = vm.Transport.MasterVolume;+ }+ fader.AttachedToVisualTree += (_, _) => { fader.Value = vm.Transport.MasterVolume; vm.Transport.PropertyChanged += Sync; };+ fader.DetachedFromVisualTree += (_, _) => vm.Transport.PropertyChanged -= Sync;+ fader.Width = 120;+ fader.Height = 16;+ fader.VerticalAlignment = VerticalAlignment.Center;+ var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 10 };+ row.Children.Add(new TextBlock { Text = Loc.T("common.master"), VerticalAlignment = VerticalAlignment.Center });+ row.Children.Add(fader);+ return new MenuItem { Header = row, StaysOpenOnClick = true };+ }+}diff --git a/src/managed/Nota.App/MainWindow.axaml b/src/managed/Nota.App/MainWindow.axamlindex 7225195f..977df365 100644--- a/src/managed/Nota.App/MainWindow.axaml+++ b/src/managed/Nota.App/MainWindow.axaml@@ -157,10 +157,10 @@panel tone with a seam under it. Stop / play / record, position and loop share one30px recessed group inside it, so playback reads as one object rather than a row ofkeys. Reads left to right as: which view · what plays · the numbers you set ·- the switches you flip · then, pinned right, what the machine is doing. Launch- quantize shows only in Session, where it applies. The view switch leads the row.- When the window is too narrow the row sheds its least-needed parts first —- see MainWindow.TransportFit.cs for the order. -->+ the switches you flip · then, pinned right, what the machine is doing, and ⋯ last.+ The view switch leads the row. When the window is too narrow the row sheds its+ least-needed parts first — see MainWindow.TransportFit.cs for the order — and the ⋯+ menu lists whatever it shed (MainWindow.TransportOverflow.cs, #520). --><Border x:Name="TransportBar" DockPanel.Dock="Top" Classes="transport" Height="{StaticResource Control.TransportBar}"><Grid x:Name="TransportGrid" ColumnDefinitions="Auto,Auto,Auto,Auto,Auto,*,Auto,Auto,Auto,Auto,Auto">@@ -295,7 +295,7 @@<TextBlock Classes="CellLabel" Text="{app:T 'main.key'}" VerticalAlignment="Center"/></StackPanel></Button>- <Border Classes="tb-sep"/>+ <Border x:Name="GridSep" Classes="tb-sep"/><!-- Clip snap grid (SnapChip.cs): the step in effect, live with the zoom in Auto;click for the grid menu. SnapChip sizes the value to its widest label. --><Button x:Name="SnapChip" Classes="cell">@@ -412,6 +412,19 @@<Panel x:Name="MasterMeterHost" Width="120" Height="8"/></StackPanel></StackPanel>++ <!-- More (#520): what the bar had no room for, as a menu, then a few quick settings+ (MainWindow.TransportOverflow.cs). Never shed. The dot says something is in it. -->+ <Button x:Name="OverflowBtn" Grid.Column="10" Classes="tp-icon" Margin="8,0,0,0" VerticalAlignment="Center"+ Click="OnOverflowClick"+ ToolTip.Tip="{app:T 'main.more'}" AutomationProperties.Name="{app:T 'main.more'}">+ <Panel>+ <app:Glyph Kind="More" Size="16"/>+ <Ellipse x:Name="OverflowDot" Width="5" Height="5" IsVisible="False"+ HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,-3,-4,0"+ Fill="{DynamicResource Brush.Accent}"/>+ </Panel>+ </Button></Grid></Border>diff --git a/src/managed/Nota.App/MainWindow.axaml.cs b/src/managed/Nota.App/MainWindow.axaml.csindex 220780c8..16e8c35e 100644--- a/src/managed/Nota.App/MainWindow.axaml.cs+++ b/src/managed/Nota.App/MainWindow.axaml.cs@@ -239,15 +239,7 @@ public partial class MainWindow : WindowMasterMeterHost.Children.Add(_masterMeter);// The master slider: a flat bar over the master meter, its gain in dB written inside.- var masterVol = new MiniFader((double)vm.Transport.MasterVolume, 1.5) { Default = 1.0, Text = v => NotaNum.GainDb(v) };- var masterUndo = new MixGesture(vm.Engine, MixTarget.Master); // one undo step per drag (specs/009)- masterVol.GestureBegin += masterUndo.Begin;- masterVol.GestureEnd += masterUndo.End;- Action<double> setMaster = v => vm.Transport.MasterVolume = v;- masterVol.ValueChanged += v => masterUndo.Change(v, setMaster);- // Double-click the dB written in the bar (or ⌥-click anywhere) to type the master gain;- // a double-click elsewhere on the bar resets to 0 dB.- ValueEntry.Attach(masterVol, masterVol.EntryField(Loc.T("main.master_volume"), v => NotaNum.GainDb(v)));+ var masterVol = CreateMasterFader(vm);MasterVolHost.Children.Add(masterVol);MidiLearn.Bind(masterVol, MidiTarget.MasterVolume, "Master Volume");@@ -800,10 +792,13 @@ public partial class MainWindow : Window_modular.ShowTrack(trackId);}- private void OnPickProjectKey(object? sender, RoutedEventArgs e)+ private void OnPickProjectKey(object? sender, RoutedEventArgs e) => PickProjectKey(KeyChip);++ /// <summary>The project-key picker, under the KEY cell — or under ⋯ when the cell is shed (#520).</summary>+ private void PickProjectKey(Control anchor){if (_vm is null) return;- KeyPicker.Show(KeyChip, _vm.Transport.Key, Loc.T("main.no_key"), k =>+ KeyPicker.Show(anchor, _vm.Transport.Key, Loc.T("main.no_key"), k =>{_vm.Transport.KeyCode = k?.Code ?? -1;_vm.StatusText = k is { } key ? Loc.F("main.project_key", key.Long) : Loc.T("main.no_project_key");@@ -870,6 +865,21 @@ public partial class MainWindow : Window_cpuTipTick();}+ /// <summary>A master-gain fader: the transport bar's, and the one in the ⋯ menu while the+ /// master strip is shed (#520). One undo step per drag (specs/009); double-click the dB+ /// written in it (or ⌥-click anywhere) to type the gain, elsewhere to reset to 0 dB.</summary>+ private static MiniFader CreateMasterFader(MainWindowViewModel vm)+ {+ var fader = new MiniFader((double)vm.Transport.MasterVolume, 1.5) { Default = 1.0, Text = v => NotaNum.GainDb(v) };+ var undo = new MixGesture(vm.Engine, MixTarget.Master);+ fader.GestureBegin += undo.Begin;+ fader.GestureEnd += undo.End;+ Action<double> set = v => vm.Transport.MasterVolume = v;+ fader.ValueChanged += v => undo.Change(v, set);+ ValueEntry.Attach(fader, fader.EntryField(Loc.T("main.master_volume"), v => NotaNum.GainDb(v)));+ return fader;+ }+private readonly TapTempo _tap = new();private readonly System.Diagnostics.Stopwatch _tapClock = System.Diagnostics.Stopwatch.StartNew();private DispatcherTimer? _tapIdle;@@ -1031,9 +1041,11 @@ public partial class MainWindow : Window// Snap on/off: the latch you reach for to nudge something off-grid for a while. The// same switch as ⌘4 and the grid menu's "Snap to grid" (EditorGrids.Arrangement.SnapOn).- private void OnToggleSnapEnabled(object? sender, RoutedEventArgs e)+ private void OnToggleSnapEnabled(object? sender, RoutedEventArgs e) => SetSnapEnabled(SnapToggle.IsChecked == true);++ /// <summary>Snap on/off — the magnet, and its entry in the ⋯ menu while the magnet is shed.</summary>+ private void SetSnapEnabled(bool on){- bool on = SnapToggle.IsChecked == true;var grids = EditorGrids.Shared;grids.Set(EditorKind.Arrangement, grids.Get(EditorKind.Arrangement) with { SnapOn = on });if (_vm is not null) _vm.StatusText = on ? Loc.T("main.snap_on") : Loc.T("main.snap_off_clips_position_freely");@@ -1043,7 +1055,7 @@ public partial class MainWindow : Window// (zoom, the menu, ⌘1–⌘5).private void InitSnapGrid(){- var chip = Nota.App.SnapChip.Attach(SnapChip, SnapLabel, SnapCaption, EditorKind.Arrangement, () => Timeline.SnapGridState);+ var chip = _snapChip = Nota.App.SnapChip.Attach(SnapChip, SnapLabel, SnapCaption, EditorKind.Arrangement, () => Timeline.SnapGridState);Timeline.GridChanged += chip.Refresh;void SyncLatch() => SnapToggle.IsChecked = EditorGrids.Shared.Get(EditorKind.Arrangement).SnapOn;EditorGrids.Shared.Changed += k => { if (k == EditorKind.Arrangement) SyncLatch(); };diff --git a/src/managed/Nota.App/PreferencesWindow.cs b/src/managed/Nota.App/PreferencesWindow.csindex 6a24b640..9ffdfaa9 100644--- a/src/managed/Nota.App/PreferencesWindow.cs+++ b/src/managed/Nota.App/PreferencesWindow.cs@@ -1454,6 +1454,14 @@ public sealed partial class PreferencesWindow : NotaWindowbuttons.Add((p, btn));strip.Children.Add(btn);}+ // The scale can also change from the transport bar's ⋯ menu (#520) while Settings is open.+ void Follow()+ {+ int now = InterfaceScale.Normalize(settings.Current.InterfaceScale);+ foreach (var (bp, bb) in buttons) bb.IsChecked = bp == now;+ }+ strip.AttachedToVisualTree += (_, _) => NotaUiScale.Changed += Follow;+ strip.DetachedFromVisualTree += (_, _) => NotaUiScale.Changed -= Follow;return new Border { Classes = { "segmented" }, HorizontalAlignment = HorizontalAlignment.Left, Child = strip };}diff --git a/src/managed/Nota.App/SnapChip.cs b/src/managed/Nota.App/SnapChip.csindex e28412a9..32360dfc 100644--- a/src/managed/Nota.App/SnapChip.cs+++ b/src/managed/Nota.App/SnapChip.cs@@ -10,6 +10,7 @@// stay in step with it.using System;+using System.Collections.Generic;using Avalonia.Controls;using Avalonia.Input;using Avalonia.Layout;@@ -114,27 +115,36 @@ internal sealed class SnapChipprivate void OpenMenu(){- var s = Grids.Get(_kind);var f = new MenuFlyout();+ foreach (var item in BuildItems()) f.Items.Add(item);+ f.ShowAt(_button);+ }++ /// <summary>The grid menu's items — the chip's own menu, and the Grid submenu of the+ /// transport bar's ⋯ menu when the chip is shed (#520).</summary>+ public List<Control> BuildItems()+ {+ var s = Grids.Get(_kind);+ var f = new List<Control>();void Item(string header, bool on, Func<GridSetting, GridSetting> apply, KeyGesture? gesture = null){var mi = new MenuItem { Header = header, InputGesture = gesture };mi.ToggleType = MenuItemToggleType.Radio; mi.IsChecked = on;mi.Click += (_, _) => Grids.Set(_kind, apply(Grids.Get(_kind)));- f.Items.Add(mi);+ f.Add(mi);}foreach (var d in new[] { GridDensity.Narrow, GridDensity.Medium, GridDensity.Wide })Item(Loc.F("snap_chip.auto", d), s.Adaptive && s.Density == d, g => SnapGrid.PickAdaptive(g, d));- f.Items.Add(new Separator());+ f.Add(new Separator());for (int i = 0; i < GridStep.Count; i++){int idx = i;Item(GridStep.Of(i, s.Triplets).Label, !s.Adaptive && s.FixedIndex == i, g => SnapGrid.PickFixed(g, idx));}- f.Items.Add(new Separator());+ f.Add(new Separator());Item(Loc.T("snap_chip.triplets"), s.Triplets, SnapGrid.ToggleTriplets, MenuKit.Cmd(Key.D3));Item(Loc.T("snap_chip.snap_to_grid"), s.SnapOn, SnapGrid.ToggleSnap, MenuKit.Cmd(Key.D4));- f.ShowAt(_button);+ return f;}}diff --git a/src/managed/Nota.Application/Localization/en.json b/src/managed/Nota.Application/Localization/en.jsonindex fcae9142..af5d0a3c 100644--- a/src/managed/Nota.Application/Localization/en.json+++ b/src/managed/Nota.Application/Localization/en.json@@ -2707,6 +2707,7 @@"main.missing_plugins.this_project_uses_which_arent": "This project uses {0}, which aren't installed. They're open source and available from the Nota plugin registry. Install and reopen the project?","main.missing_plugins.this_project_uses_which_isnt": "This project uses {0}, which isn't installed. It's open source and available from the Nota plugin registry. Install and reopen the project?","main.mixer_in_its_own_window": "Mixer in its own window",+ "main.more": "More: what the bar has no room for, and quick settings","main.mosaic.created_presets_loaded": "Created {0} presets · loaded {1}","main.mosaic.created_the_preset": "Created the preset {0}","main.narrow_grid": "Narrow grid",@@ -2813,6 +2814,13 @@"main.toggle_sections": "Toggle sections","main.toggled_clip_s": "Toggled clip(s)","main.track_headers_on_the_right": "Track headers on the right",+ "main.transport_overflow.automation": "Automation",+ "main.transport_overflow.key": "Project key…",+ "main.transport_overflow.loop_record_replace": "Loop record: replace",+ "main.transport_overflow.midi_learn": "MIDI learn",+ "main.transport_overflow.reenable_automation": "Re-enable automation",+ "main.transport_overflow.tap_tempo": "Tap tempo",+ "main.transport_overflow.time_signature": "Time signature","main.triplet_grid": "Triplet grid","main.turn_the_metronome_on_or": "Turn the metronome on or off (⌘M) · right-click for count-in","main.updates.check_for_updates": "Check for updates",diff --git a/src/managed/Nota.Presentation/ToolbarOverflow.cs b/src/managed/Nota.Presentation/ToolbarOverflow.csnew file mode 100644index 00000000..0b7049ad--- /dev/null+++ b/src/managed/Nota.Presentation/ToolbarOverflow.cs@@ -0,0 +1,92 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.+//+// The transport bar's overflow (specs/097, #520). On a narrow window the bar sheds its+// least-needed parts in a fixed order (#303); the ⋯ key at its end lists what was shed, so+// nothing on the bar is ever out of reach. Which parts that is for a given fit — and in what+// order the menu lists them — is decided here, as data, so the rules can be checked without+// a window. The view maps each part to its controls and builds the menu.++namespace Nota.Presentation;++/// <summary>A part of the transport bar that can be shed for lack of room.</summary>+public enum ToolbarPart+{+ CpuBar, // the DSP meter's bar; its number stays+ RemoteLabel, // the word "Remote"; the glyph, count and dot stay+ Tap,+ Key,+ Remote, // the Remote chip (Connect Phone)+ Follow,+ Automation,+ Mixer, // the Mixer show / hide key (#516)+ TimeSignature,+ MidiLearn, // the MIDI learn chip — the panel goes with its last chip+ Grid,+ Snap,+ LoopRecord,+ Loop,+ Master,+ DspMeter,+}++public static class ToolbarOverflow+{+ /// <summary>The order the bar sheds in, one part per step; parts come back in reverse.+ /// First what is shown elsewhere or merely informative, then what has a menu entry or a+ /// shortcut, last the readouts you set while playing (#303).</summary>+ public static IReadOnlyList<ToolbarPart> ShedOrder { get; } =+ [+ ToolbarPart.CpuBar,+ ToolbarPart.RemoteLabel,+ ToolbarPart.Tap,+ ToolbarPart.Key,+ ToolbarPart.Remote,+ ToolbarPart.Follow,+ ToolbarPart.Automation,+ ToolbarPart.Mixer,+ ToolbarPart.TimeSignature,+ ToolbarPart.MidiLearn,+ ToolbarPart.Grid,+ ToolbarPart.Snap,+ ToolbarPart.LoopRecord,+ ToolbarPart.Loop,+ ToolbarPart.Master,+ ToolbarPart.DspMeter,+ ];++ /// <summary>Left to right as the parts sit in the bar — the order the menu lists them in.</summary>+ public static IReadOnlyList<ToolbarPart> BarOrder { get; } =+ [+ ToolbarPart.Loop,+ ToolbarPart.LoopRecord,+ ToolbarPart.Tap,+ ToolbarPart.TimeSignature,+ ToolbarPart.Key,+ ToolbarPart.Grid,+ ToolbarPart.Follow,+ ToolbarPart.Snap,+ ToolbarPart.Automation,+ ToolbarPart.Mixer,+ ToolbarPart.MidiLearn,+ ToolbarPart.Remote,+ ToolbarPart.RemoteLabel,+ ToolbarPart.CpuBar,+ ToolbarPart.DspMeter,+ ToolbarPart.Master,+ ];++ /// <summary>A part whose information stays in the bar when it goes (the DSP number beside+ /// the bar, the Remote glyph and count beside the word): it needs no menu entry.</summary>+ public static bool IsInfoOnly(ToolbarPart part) => part is ToolbarPart.CpuBar or ToolbarPart.RemoteLabel;++ /// <summary>The parts the menu lists when the first <paramref name="shedSteps"/> steps of+ /// <see cref="ShedOrder"/> are shed (clamped to 0 … count), in bar order.</summary>+ public static IReadOnlyList<ToolbarPart> Entries(int shedSteps)+ {+ int n = Math.Clamp(shedSteps, 0, ShedOrder.Count);+ var shed = new HashSet<ToolbarPart>();+ for (int i = 0; i < n; i++) shed.Add(ShedOrder[i]);+ return BarOrder.Where(p => shed.Contains(p) && !IsInfoOnly(p)).ToList();+ }+}diff --git a/tests/Nota.SmokeTest/Program.cs b/tests/Nota.SmokeTest/Program.csindex b4696d35..b71559dc 100644--- a/tests/Nota.SmokeTest/Program.cs+++ b/tests/Nota.SmokeTest/Program.cs@@ -883,6 +883,14 @@ if (args.Length >= 1 && args[0] == "--modular-browser")Console.WriteLine(failures == 0 ? "MODULAR BROWSER PASSED" : $"MODULAR BROWSER FAILED ({failures})");return failures == 0 ? 0 : 1;}+// Toolbar overflow alone (fast iteration): `--toolbar-overflow`. Also part of the full run.+if (args.Length >= 1 && args[0] == "--toolbar-overflow")+{+ Console.WriteLine("-- toolbar overflow --");+ foreach (var (ok, label) in ToolbarOverflowTests.Run()) Check(ok, label);+ Console.WriteLine(failures == 0 ? "TOOLBAR OVERFLOW PASSED" : $"TOOLBAR OVERFLOW 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"){@@ -15747,6 +15755,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);+// --- Toolbar overflow (specs/097): the shed parts the ⋯ menu lists ---+Console.WriteLine("-- toolbar overflow --");+foreach (var (ok, label) in ToolbarOverflowTests.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);diff --git a/tests/Nota.SmokeTest/ToolbarOverflowTests.cs b/tests/Nota.SmokeTest/ToolbarOverflowTests.csnew file mode 100644index 00000000..4c3e94f6--- /dev/null+++ b/tests/Nota.SmokeTest/ToolbarOverflowTests.cs@@ -0,0 +1,64 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.+//+// The transport bar's overflow menu (specs/097, #520): for each fit, the shed parts the ⋯+// menu lists — in bar order, never twice, the purely informative ones left out. Headless.++using Nota.Presentation;++namespace Nota.SmokeTest;++internal static class ToolbarOverflowTests+{+ public static IEnumerable<(bool, string)> Run()+ {+ int all = ToolbarOverflow.ShedOrder.Count;++ yield return (all == Enum.GetValues<ToolbarPart>().Length+ && ToolbarOverflow.ShedOrder.Distinct().Count() == all,+ "overflow: the shed order holds every part once");+ yield return (ToolbarOverflow.BarOrder.Count == all+ && ToolbarOverflow.BarOrder.Distinct().Count() == all,+ "overflow: the bar order holds every part once");++ yield return (ToolbarOverflow.Entries(0).Count == 0, "overflow: nothing shed → no entries");+ yield return (ToolbarOverflow.Entries(-3).Count == 0, "overflow: a negative fit clamps to none");+ yield return (ToolbarOverflow.Entries(all + 5).SequenceEqual(ToolbarOverflow.Entries(all)),+ "overflow: an over-long fit clamps to all");++ // The first two steps are informative only: the DSP number and the Remote count stay.+ yield return (ToolbarOverflow.Entries(2).Count == 0, "overflow: CPU bar and Remote label need no entry");+ yield return (ToolbarOverflow.Entries(3).SequenceEqual([ToolbarPart.Tap]), "overflow: Tap is the first entry");++ var full = ToolbarOverflow.Entries(all);+ yield return (!full.Any(ToolbarOverflow.IsInfoOnly) && full.Count == all - 2,+ "overflow: everything shed → every part but the informative ones");+ yield return (full.SequenceEqual(ToolbarOverflow.BarOrder.Where(p => !ToolbarOverflow.IsInfoOnly(p))),+ "overflow: entries follow the bar, left to right");++ bool monotonic = true, unique = true;+ for (int n = 0; n < all; n++)+ {+ var a = ToolbarOverflow.Entries(n);+ var b = ToolbarOverflow.Entries(n + 1);+ if (!a.All(b.Contains)) monotonic = false;+ if (b.Distinct().Count() != b.Count) unique = false;+ }+ yield return (monotonic, "overflow: one more step shed never drops an entry");+ yield return (unique, "overflow: no entry twice");++ // US1 #1: down to Snap — Grid and Snap are listed, Grid first as in the bar.+ int snapStep = 0;+ for (int i = 0; i < all; i++) if (ToolbarOverflow.ShedOrder[i] == ToolbarPart.Snap) snapStep = i + 1;+ var bySnap = ToolbarOverflow.Entries(snapStep);+ int grid = IndexOf(bySnap, ToolbarPart.Grid), snap = IndexOf(bySnap, ToolbarPart.Snap);+ yield return (grid >= 0 && snap > grid && !bySnap.Contains(ToolbarPart.Loop) && !bySnap.Contains(ToolbarPart.Master),+ "overflow: Grid and Snap shed → listed in bar order, Loop and Master still in the bar");+ }++ private static int IndexOf(IReadOnlyList<ToolbarPart> list, ToolbarPart p)+ {+ for (int i = 0; i < list.Count; i++) if (list[i] == p) return i;+ return -1;+ }+}