Skip to content

armgit / nota

Public Imported from GitHub
0

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

(feat) Main window: the menu under a Menu key, the menu bar hidden, the project in the Windows title bar (#518) (#585)

Egor Khindikaynen83c17874a511
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 427f0835..e0600e9c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -181,6 +181,14 @@ Entry categories: `Added`, `Changed`, `Fixed`, `Removed`.
notes in their articulation's colour instead of the track's.
### Changed
+- **The menu under a Menu key, and the menu bar hidden** (Windows / Linux, #518, specs/093).
+ The row of File, Edit, View, Transport and Help no longer sits between the title bar and
+ the transport bar, so the work area gains its height. The whole menu — the same items,
+ shortcuts and check marks, Open recent included — is under the new **☰ Menu** key at the
+ start of the transport bar; **Alt** (pressed and released on its own) or **F10** opens it
+ from the keyboard. **View ▸ Show menu bar**, or **Settings → Appearance → Menu bar**, brings
+ the row back (the key then steps aside). On Windows the title bar now reads
+ "Nota — *project*", as the taskbar does. macOS is unchanged.
- **Nota Remote in the new look** (#556, specs/090). Every phone screen, sheet and banner now
follows the style guide the desktop wears: the same corner scale, one typeface with
fixed-width figures (Geist Mono is gone), sentence-case labels, a true minus and thin
diff --git a/FEATURES.md b/FEATURES.md
index ea9a729b..241cc0e6 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -1486,6 +1486,12 @@ audio effects after it keep running and keep their settings; saved with the proj
frame). **Full screen** — the macOS green button, or View → Toggle Full Screen (F11)
on Windows and Linux — hides the title bar and its separator so the workspace fills the
screen edge to edge; leaving full screen brings the bar back. Maximized keeps the bar.
+- **The menu under a Menu key** (Windows / Linux): the menu bar is hidden by default and the
+ whole menu — File, Edit, View, Transport, Help with the same items, shortcuts and check
+ marks — opens from the **☰** key at the start of the transport bar, or from the keyboard
+ with **Alt** (alone) or **F10**. **View ▸ Show menu bar** or Settings → Appearance → **Menu
+ bar** 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.
- **What's New** — a window showing the release notes (`release-notes/X.Y.Z.en.md`, the GitHub
release text; the CHANGELOG section for versions without them) newer than `LastSeenVersion`, once
after the first launch on a new version; any time from Help ▸ What's New or the version
@@ -1598,7 +1604,8 @@ audio effects after it keep running and keep their settings; saved with the proj
layout (device cards keep theirs), live and remembered. **Waveform** —
**Smooth** (default), **Solid** or **Bars** for audio clips on the lanes. **Phrase
lines** — Off / 4 / 8 / 16 / 32 bars (see Snap grid). **Track headers** — Left / Right
- side of the arrangement's track list.
+ side of the arrangement's track list. **Menu bar** (Windows / Linux) — Hidden (default;
+ the ☰ key gives the menu) or Shown.
- **Editing**: **Label every note in the piano roll** — the keys column names every note
instead of only C (off by default; very short rows keep C only). **Fade audio clips when
splitting** — on by default; a split then writes a 4 ms fade at the cut, which the corner
diff --git a/specs/093-menu-button-title-bar/checklists/requirements.md b/specs/093-menu-button-title-bar/checklists/requirements.md
new file mode 100644
index 00000000..2e94fa06
--- /dev/null
+++ b/specs/093-menu-button-title-bar/checklists/requirements.md
@@ -0,0 +1,38 @@
+# Specification Quality Checklist: Menu button and a hideable menu bar
+
+**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
+
+- The issue left one choice to review — whether the Menu button stays while the menu row is
+ shown. Decided 2026-11-12: it hides (FR-011).
+- The "Where things stand on `develop`" note records that the project name already left the
+ transport bar in the new look (#296), so part (1) of the issue reduces to the Windows caption
+ text.
diff --git a/specs/093-menu-button-title-bar/contracts/ui.md b/specs/093-menu-button-title-bar/contracts/ui.md
new file mode 100644
index 00000000..a10be40f
--- /dev/null
+++ b/specs/093-menu-button-title-bar/contracts/ui.md
@@ -0,0 +1,39 @@
+# UI Contract: Menu button and a hideable menu bar
+
+Applies to Windows and Linux. On macOS none of this exists (FR-020).
+
+## Menu key (transport bar)
+
+- Position: first control of the transport bar, before the view switch.
+- Look: one 28-px icon key (`seg view`) in its own well; glyph ☰ (`GlyphKind.Menu`).
+- Tooltip and accessible name: "Menu" (`main.menu`).
+- Visible: when `ShowMenuBar` is off. Never shed on a narrow window.
+- Click / Alt tap / F10: opens a menu below the key with File, Edit, View, Transport, Help as
+ submenus — the menu row's contents, current at the moment of opening.
+
+## View ▸ Show menu bar
+
+- Check item, command `view.menuBar`, checked when the row is shown.
+- Also in the command palette ("Show menu bar") on Windows / Linux.
+
+## Settings → Appearance ▸ Menu bar
+
+- Segmented picker "Hidden | Shown" (`preferences.menu_bar`, `preferences.menu_bar_hidden`,
+ `preferences.menu_bar_shown`) with a caption (`preferences.menu_bar_caption`).
+- Follows changes made from the View menu while open.
+
+## Keyboard (row hidden)
+
+| Input | Result |
+|---|---|
+| F10 | open the Menu key's menu, first entry highlighted |
+| Alt pressed and released alone | same |
+| Alt + any key / click / wheel / drag | nothing menu-related (existing behaviour) |
+| Escape / click outside | close, focus back where it was |
+| Menu shortcuts (Ctrl+S…) | unchanged |
+
+With the row shown: stock behaviour of the menu row.
+
+## Title bar (Windows)
+
+Caption = OS window title = `Nota — <project name>` (`main.files.nota`).
diff --git a/specs/093-menu-button-title-bar/data-model.md b/specs/093-menu-button-title-bar/data-model.md
new file mode 100644
index 00000000..ac5eefe3
--- /dev/null
+++ b/specs/093-menu-button-title-bar/data-model.md
@@ -0,0 +1,38 @@
+# Data Model: Menu button and a hideable menu bar
+
+## Settings (user settings file)
+
+| Field | Type | Default | Notes |
+|---|---|---|---|
+| `ShowMenuBar` | bool | `false` | Windows / Linux: the in-window menu row is shown. Ignored on macOS. A settings file without the key reads `false` (the new default for upgraders too). Written by Settings → Appearance and View ▸ Show menu bar; every write fires `Settings.Changed`. |
+
+## Command catalogue
+
+| Id | Title | Category | Gesture | View |
+|---|---|---|---|---|
+| `view.menuBar` | Show menu bar | View | — | — |
+
+Bound in `MainWindow.Commands.cs` to `ToggleMenuBar()` (flip `ShowMenuBar`, save, status line).
+
+## Menu mirror (in memory, per opening)
+
+A tree built from the `NativeMenu` each time the Menu key's menu opens; nothing is kept.
+
+| Source (`NativeMenu` side) | Mirror (`ContextMenu` side) |
+|---|---|
+| `NativeMenuItem.Header` | `MenuItem.Header` (same text; `_` access-key escaping kept) |
+| `NativeMenuItem.Gesture` | `MenuItem.InputGesture` (shown, not bound — the window dispatches shortcuts, as today) |
+| `NativeMenuItem.ToggleType` / `IsChecked` | `MenuItem.ToggleType` / `IsChecked` |
+| `NativeMenuItem.IsEnabled` | `MenuItem.IsEnabled` |
+| `NativeMenuItem.ToolTip` | `ToolTip.Tip` |
+| `NativeMenuItem.Menu` | `MenuItem.Items` (recursive) |
+| `NativeMenuItemSeparator` | `Separator` |
+| click | source item's `RaiseClicked()` |
+
+## State transitions (Windows / Linux)
+
+```
+ShowMenuBar = false → menu row detached + hidden, Menu key shown, Alt/F10 → Menu key's menu
+ShowMenuBar = true → menu row attached + shown, Menu key hidden, Alt/F10 → stock menu-row behaviour
+```
+Both directions apply immediately on `Settings.Changed` and at start-up.
diff --git a/specs/093-menu-button-title-bar/plan.md b/specs/093-menu-button-title-bar/plan.md
new file mode 100644
index 00000000..aeee9b69
--- /dev/null
+++ b/specs/093-menu-button-title-bar/plan.md
@@ -0,0 +1,125 @@
+# Implementation Plan: Menu button and a hideable menu bar
+
+**Branch**: `feat/menu-button-title-bar` | **Date**: 2026-11-12 | **Spec**: [spec.md](spec.md)
+
+**Input**: Feature specification from `specs/093-menu-button-title-bar/spec.md`
+
+## Summary
+
+On Windows and Linux the in-window menu row goes away by default and a ☰ Menu key leads the
+transport bar. Its menu is produced, each time it opens, from the very `NativeMenu` the menu
+row renders (MainWindow.axaml) — the one menu definition, whose items already carry the
+command catalogue's labels, shortcut gestures and check marks — so nothing is listed twice.
+A new `ShowMenuBar` user setting (default off) brings the row back; it is switched from
+Settings → Appearance and from a new `view.menuBar` check item in View, following the
+existing "Track headers on the right" pattern (setting + View check item kept in step through
+`Settings.Changed`). With the row hidden the window opens the Menu key's menu itself on F10
+and on a lone Alt tap. On Windows the title-bar caption reads the OS window title
+("Nota — My song"). macOS is untouched: no key, no setting, no View item, no key handling.
+
+## Nota: Read Before Planning
+
+- **UI work** → [`DESIGN.md`](../../DESIGN.md) and the `nota-design` skill: the Menu key is
+ a `seg view` key in its own `segmented view` well, the same 28-px icon key as the view
+ switch; the glyph is drawn as geometry in `Glyph.cs` (no icon font, no emoji).
+- **Anything** → [`CONTRIBUTING.md`](../../CONTRIBUTING.md): AGPL headers on new files, no
+ new dependency.
+
+## Technical Context
+
+**Language/Version**: C# / .NET 10 (managed app only)
+
+**Primary Dependencies**: Avalonia 12.1.4 (already used) — no new dependency
+
+**Storage**: the user settings file (`Settings.cs`, saved by `ISettingsService`): one new bool,
+`ShowMenuBar`, default `false`
+
+**Audio-Thread Impact**: None — UI-only change; no engine call is added or changed
+
+**Testing**: `tests/Nota.SmokeTest` (console smoke runner): a new `MenuMirrorTests` check that
+builds a `NativeMenu` in code and compares it with the Menu key's mirrored menu; the existing
+`PaletteTests.RegistryDrift` source checks cover the new `view.menuBar` command (bound, in the
+menu); manual / harness checks per [quickstart.md](quickstart.md)
+
+**Target Platform**: Windows and Linux (behaviour); macOS (must stay identical)
+
+**Project Type**: desktop app
+
+**Performance Goals**: the Menu key's menu opens with no visible delay (~150 items mirrored per
+open — negligible); showing / hiding the row applies within one frame
+
+**Constraints**: one menu definition (FR-003); no stale state (FR-005); macOS unchanged (FR-020)
+
+**Scale/Scope**: ~8 files in `Nota.App`, 1 in `Nota.Application` (setting), 1 catalogue entry,
+localisation keys, 1 smoke test file, docs (CHANGELOG, FEATURES, nota-docs EN + RU)
+
+## Constitution Check
+
+*GATE: Must pass before Phase 0 research. Re-check after Phase 1 design.*
+
+| Principle | Status |
+|---|---|
+| 0. Approved issue first | ✅ nota-daw/nota#518 carries `approved` |
+| I. Real-time audio safety | ✅ no audio-thread code touched |
+| II. Boundary discipline | ✅ no C ABI / JUCE change; Avalonia stays in `Nota.App` |
+| III. Licensing hygiene | ✅ new files carry the two-line SPDX header; no new dependency |
+| IV. Verification gate | ✅ `scripts/build.sh` incl. smoke test before PR |
+| V. One logical change per PR | ✅ the menu / title chrome of #518 only (#41 out) |
+| VI. Documentation in sync | ✅ CHANGELOG, FEATURES.md, nota-docs EN + RU, Settings → Shortcuts |
+| VII. Spec-first | ✅ this spec / plan / tasks |
+| VIII. Safety rules not weakened | ✅ none touched |
+
+Post-design re-check: unchanged — all pass.
+
+## Project Structure
+
+### Documentation (this feature)
+
+```text
+specs/093-menu-button-title-bar/
+├── spec.md
+├── plan.md # this file
+├── research.md # Phase 0
+├── data-model.md # Phase 1
+├── quickstart.md # Phase 1
+├── contracts/
+│ └── ui.md # the user-facing contract: Menu key, setting, View item, keys
+├── checklists/requirements.md
+└── tasks.md # /speckit-tasks
+```
+
+### Source Code (repository root)
+
+```text
+src/managed/
+├── Nota.Application/
+│ ├── Settings.cs # + ShowMenuBar (default false)
+│ ├── Palette/CommandCatalog.cs # + view.menuBar ("Show menu bar")
+│ └── Localization/en.json (+ others) # + main.show_menu_bar, main.menu, preferences.menu_bar(_caption), commands.show_menu_bar
+└── Nota.App/
+ ├── MenuMirror.cs # NEW: NativeMenu → MenuItem tree, rebuilt per open (Avalonia base only; linked into the smoke test)
+ ├── MainWindow.MenuButton.cs # NEW: the Menu key, ShowMenuBar apply, Alt-tap / F10, menu-row attach/detach
+ ├── MainWindow.axaml # Menu key at the start of the transport bar; View ▸ Show menu bar item; x:Name on the menu-row border
+ ├── MainWindow.MenuKeys.cs # drop view.menuBar on macOS (as file.exit)
+ ├── MainWindow.Commands.cs # bind view.menuBar → ToggleMenuBar
+ ├── MainWindow.Files.cs # Windows caption = Title
+ ├── MainWindow.axaml.cs # wire InitMenuButton(); Settings.Changed → ApplyMenuBar
+ ├── MainWindow.Input.cs # route key down / up to the Alt-tap / F10 detector
+ ├── MainWindow.TransportFit.cs # (no change: the key is not in the shed order — documented)
+ ├── PreferencesWindow.cs # Appearance: "Menu bar" Show/Hide picker (not on macOS); Shortcuts: Alt / F10 row (not on macOS)
+ └── Controls/Glyph.cs # + GlyphKind.Menu (three strokes)
+
+tests/Nota.SmokeTest/
+├── MenuMirrorTests.cs # NEW
+├── Nota.SmokeTest.csproj # link MenuMirror.cs
+└── Program.cs (or the suite list) # register the new suite
+```
+
+**Structure Decision**: all behaviour lives in `Nota.App` next to the existing menu code
+(`MainWindow.MenuKeys.cs`, `MainWindow.RecentMenu.cs`); the mirroring is a separate,
+Avalonia-base-only file so the smoke test can compile it in, as it already does for
+`ShortcutAvaloniaExtensions.cs` and others.
+
+## Complexity Tracking
+
+No constitution violations — nothing to justify.
diff --git a/specs/093-menu-button-title-bar/quickstart.md b/specs/093-menu-button-title-bar/quickstart.md
new file mode 100644
index 00000000..f0c0a751
--- /dev/null
+++ b/specs/093-menu-button-title-bar/quickstart.md
@@ -0,0 +1,34 @@
+# Quickstart: validating the Menu button and the hideable menu bar
+
+## Prerequisites
+
+- A Release build: `scripts/build.sh` (macOS) / `scripts/build-linux.sh` / `scripts/build-win.ps1`.
+- A fresh data dir for default-settings checks: `NOTA_DATA_DIR=$(mktemp -d)`.
+
+## Automated
+
+1. `scripts/build.sh` — must pass; the smoke run includes:
+ - **MenuMirror**: the mirrored menu equals its `NativeMenu` source (items, order, separators,
+ submenus, headers, gestures, check marks, enabled, tooltips) and reflects changes made
+ between two openings.
+ - **Palette registry drift**: `view.menuBar` is in the catalogue, bound, and named in the menu.
+
+## Windows / Linux (manual or harness)
+
+1. Start with a fresh data dir → no menu row; ☰ leads the transport bar (US1-1).
+2. Click ☰ → File, Edit, View, Transport, Help; walk each submenu against the contract (US1-2/3).
+3. Toggle Edit ▸ Grid ▸ Snap via ☰; reopen → check mark follows (US1-5).
+4. Open a project, then ☰ → File → Open recent lists it (US1-6).
+5. Ctrl+S / Ctrl+Z work with the row hidden (US1-7).
+6. Narrow the window to its minimum → ☰ still there (US1-8).
+7. ☰ → View → Show menu bar → row appears, ☰ disappears (US2-1, US2-4); Settings → Appearance
+ shows "Shown"; switch to "Hidden" → row goes, ☰ returns, View item unchecked (US2-2).
+8. Restart with the row shown → shown from the first frame (US2-3).
+9. Row hidden: F10 → menu opens with File highlighted; arrows/Enter work; Escape → closes, focus
+ back (US3-1, US3-4). Tap Alt → opens (US3-2). Alt+drag a clip, Alt+wheel → no menu (US3-3).
+10. Windows: caption reads "Nota — Untitled"; Save As "Demo" → "Nota — Demo" (US4).
+
+## macOS
+
+- Main window, system menu (View has no Show menu bar), Settings → Appearance (no Menu bar row),
+ Settings → Shortcuts (no Alt / F10 row): identical to `develop` (US5, SC-006).
diff --git a/specs/093-menu-button-title-bar/research.md b/specs/093-menu-button-title-bar/research.md
new file mode 100644
index 00000000..7e3fcc31
--- /dev/null
+++ b/specs/093-menu-button-title-bar/research.md
@@ -0,0 +1,103 @@
+# Research: Menu button and a hideable menu bar
+
+## R1 — One menu definition for the row and the Menu key
+
+- **Decision**: Keep `NativeMenu` in `MainWindow.axaml` as the single definition. The Menu key's
+ `ContextMenu` is rebuilt on every `Opening` by `MenuMirror.Build(nativeMenu)`, which walks the
+ tree and makes one `MenuItem` per `NativeMenuItem` (Header, `InputGesture` = Gesture,
+ ToggleType / IsChecked, IsEnabled, ToolTip, submenus) and a `Separator` per
+ `NativeMenuItemSeparator`. Clicking a mirrored item calls the source item's
+ `INativeMenuItemExporterEventsImplBridge.RaiseClicked()` — the very path `TryMenuShortcut`
+ already uses — so it runs the same `Click` handlers (catalogue command, Open recent entry).
+- **Rationale**: every piece of state the app keeps for the menu already lives on the
+ `NativeMenuItem`s (`MenuItemFor(id).IsChecked = …`, the recent list rebuilt in place, labels
+ from `{app:T}`), so mirroring at open time can never be stale (FR-005) and adds no second list
+ (FR-003). Building ~150 items per open is negligible.
+- **Alternatives considered**: (a) a second XAML `Menu` tree — rejected, a second hand-kept
+ list; (b) one long-lived mirror kept in sync by property-change subscriptions — rejected,
+ more code and more ways to drift for no gain; (c) generating both from the command catalogue
+ alone — rejected, the catalogue has no order / grouping / separators; the XAML holds those.
+
+## R2 — Enabled state
+
+- **Finding**: menu commands are never disabled today: `CommandRegistry.Run` runs menu /
+ keyboard commands whatever their availability, and the handler explains in the status line.
+ Only the "No recent projects" placeholder is `IsEnabled = false`.
+- **Decision**: mirror `IsEnabled` as is; no new greying. Spec scenario US1-4 updated to match.
+
+## R3 — Hiding the row
+
+- **Decision**: name the row's border (`MenuBarRow`) and, when hidden, set
+ `MenuBarRow.Child = null` (and `IsVisible = false`); when shown, put the same `NativeMenuBar`
+ back. On macOS the row is left as today (it renders nothing there).
+- **Rationale**: Avalonia's `Menu` registers itself as the window's main menu for the access-key
+ handler while it is in the visual tree; an invisible but attached menu bar would still take
+ Alt / F10 and open off-screen. Detaching it removes that, so the window's own Alt / F10
+ handling (R4) is the only one active while the row is hidden; attaching restores the stock
+ behaviour (FR-016).
+- **Alternatives**: `IsVisible = false` only — rejected for the reason above.
+
+## R4 — Alt tap and F10
+
+- **Decision**: a window-level detector in `MainWindow.MenuButton.cs`, active only on
+ Windows / Linux with the row hidden:
+ - `KeyDown` (tunnel, handledEventsToo): `F10` with no modifiers → open the Menu key's menu,
+ mark handled. `LeftAlt` / `RightAlt` with no other key down → arm; any other key → disarm.
+ - `PointerPressed` and `PointerWheelChanged` (tunnel, handledEventsToo) → disarm.
+ - `KeyUp` of Alt while armed → open the menu, mark handled.
+ - Not while a popup / ContextMenu / modal is already open (the window is not active or a
+ popup has focus → skip).
+ The menu opens with its first item selected, so arrows / Enter / Escape work at once; on close
+ focus returns to the element focused before (saved on open).
+- **Rationale**: matches Windows / GNOME / KDE convention; Alt+drag (free drag), Alt+wheel and
+ ⌥-chords keep working because any intervening input disarms.
+- **Alternatives**: rely on Avalonia's `AccessKeyHandler` with the Menu key as main menu —
+ rejected: it expects a `Menu`/`IMainMenu`, not a ContextMenu, and its Alt handling shows access
+ key underlines across the window.
+
+## R5 — The setting and the View item
+
+- **Decision**: `Settings.ShowMenuBar` (bool, default false — an older settings file without the
+ key reads false, which is the new default, FR-008). Catalogue command `view.menuBar`
+ ("Show menu bar", View category, no shortcut). The View item is
+ `ToggleType="CheckBox"` with `app:Commands.Id="view.menuBar"`. `ToggleMenuBar()` flips the
+ setting and saves; `Settings.Changed` → `ApplyMenuBar(on)` shows / hides the row, shows / hides
+ the Menu key (FR-011), ticks the View item, and re-fits the transport. Settings → Appearance gets
+ a "Menu bar: Hidden / Shown" segmented picker built like `HeaderSidePicker` (repaints on
+ `Settings.Changed`). On macOS: the View item is removed at start-up (like `file.exit`), the
+ Appearance row is not added, the command is not bound to any behaviour beyond a no-op status
+ and is hidden from the palette there.
+- **Applied at start-up** from `App.Services`' `ISettingsService` in the window constructor, so
+ the first frame already has the right row (SC-005).
+
+## R6 — The Menu key
+
+- **Decision**: a `ToggleButton` (`Classes="seg view"`) in its own `Border Classes="segmented view"`,
+ first in transport column 0's `StackPanel`, before the view switch; `GlyphKind.Menu` — three
+ horizontal strokes on the 24 grid (`M4 6.5 H20 M4 12 H20 M4 17.5 H20`), drawn with the shared
+ pen; `ToolTip.Tip` and `AutomationProperties.Name` = "Menu". It is checked while its menu is
+ open (feedback like the other seg keys). It is not in `TransportShedOrder`, so it never sheds
+ (FR-006). Hidden on macOS and while the row is shown.
+
+## R7 — The Windows caption
+
+- **Decision**: `UpdateWindowTitle()` sets `DocTitleText.Text = title` (the "Nota — {0}" string)
+ on Windows; macOS keeps `ProjectDisplayName()`; Linux hides the bar (native frame shows
+ `Title`).
+
+## R8 — Settings → Shortcuts
+
+- **Decision**: on Windows / Linux add a row "Alt F10 → Open the menu" to the general group of
+ `ShortcutGroups` (filtered out on macOS). It is not a catalogue command, so the palette drift
+ check is unaffected.
+
+## R9 — Testing approach
+
+- **Decision**: `MenuMirrorTests` (smoke suite) builds a small `NativeMenu` in code (nested
+ submenu, separator, checkbox checked / unchecked, a gesture, a disabled item, a header with
+ `_`), mirrors it, and compares the two trees field by field; then flips a check mark / adds a
+ recent item and mirrors again to prove freshness. If `MenuItem` can't be constructed without an
+ Avalonia app in the console runner, the comparison runs on `MenuMirror.Describe(...)` — a plain
+ record tree both sides produce — and the `MenuItem` construction is checked in the headless
+ harness instead.
+- Visual / keyboard checks on the real app follow [quickstart.md](quickstart.md).
diff --git a/specs/093-menu-button-title-bar/spec.md b/specs/093-menu-button-title-bar/spec.md
new file mode 100644
index 00000000..31949686
--- /dev/null
+++ b/specs/093-menu-button-title-bar/spec.md
@@ -0,0 +1,359 @@
+# Feature Specification: Menu button and a hideable menu bar
+
+**Feature Branch**: `feat/menu-button-title-bar`
+
+**Created**: 2026-11-12
+
+**Status**: Draft
+
+**Issue**: [nota-daw/nota#518](https://github.com/nota-daw/nota/issues/518)
+
+**Input**: User description: "Issue #518: Main window on Windows/Linux — project name in the title bar, a Menu button in its place, and a setting to hide the menu bar. (1) Title-bar caption shows the project ("Nota — My song", "Nota — Untitled"), same as the OS window title; the project name leaves the transport bar and the transport-fit logic that moves it to the caption on narrow windows goes away. (2) A Menu button at the start of the transport bar opens the whole application menu (File, Edit, Grid, View, Transport, Help as submenus) with the same items, check marks, shortcuts and enabled state as the menu bar, built from the same command catalogue. (3) The menu row is hidden by default. (4) A "Show menu bar" setting in Settings → Appearance and as a check item in View (reachable from the Menu button) brings the row back; whether the Menu button stays when the bar is shown is to decide in review. Keyboard: Alt / F10 opens the Menu button's menu when the row is hidden; menu shortcuts keep working either way. macOS: no change. Related: #41 (out of scope), #427 (Appearance page split)."
+
+## 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).
+
+**Related specs / issues**: [038 style guide](../038-style-guide/spec.md) (the new look,
+#296, which already took the project name out of the transport bar);
+[088 settings reorganisation](../088-settings-reorganisation/spec.md) (#427, where the
+Appearance page lives); #41 (hiding the native title bar — out of scope).
+
+**Where things stand on `develop`** *(what this spec changes, as opposed to what the issue
+text assumed when it was filed)*:
+
+- The transport bar no longer shows the project name: since the new look (#296) it starts
+ with the view switch, and there is no longer any logic that moves the name to the caption
+ on narrow windows. Part (1) of the issue therefore reduces to the caption text itself.
+- Windows: Nota draws its own 32-px title bar whose caption is the project name alone
+ ("My song"); the OS window title is "Nota — My song". Below it sits the in-window menu row
+ (File / Edit / View / Transport / Help, Grid inside Edit), then the transport bar.
+- Linux: the OS draws the window frame and its title ("Nota — My song"); Nota's own title bar
+ is hidden. Below the frame sit the in-window menu row and the transport bar.
+- macOS: the menu lives in the system menu bar; Nota's title bar shows the project name.
+
+## Clarifications
+
+### Session 2026-11-12
+
+- Q: Should the Menu button stay while the menu row is shown? → A: No — it hides while the row is shown (FR-011).
+- Q: What should the Menu button look like? → A: Icon only (☰), a square key the size of the view-switch keys; "Menu" in its tooltip and accessible name (FR-007).
+
+## User Scenarios & Testing *(mandatory)*
+
+### User Story 1 - The whole menu from a Menu button, with the menu row gone (Priority: P1)
+
+On Windows or Linux a user opens Nota and the work area starts higher: there is no menu row
+between the title bar and the transport. At the left end of the transport bar, before the view
+switch, sits a Menu button. Clicking it opens one menu with File, Edit, View, Transport and
+Help as submenus, holding exactly what the menu row held — the same items, in the same order,
+with the same check marks, shortcut hints and greyed-out states, and Open recent with the
+recent projects. Picking an item does what the menu-row item did.
+
+**Why this priority**: This is the point of the issue — a full row of height returned to the
+work without losing any command. Hiding the row is only safe once the button gives the same
+menu.
+
+**Independent Test**: On Windows (or Linux), start Nota with default settings: no menu row is
+shown, a Menu button leads the transport bar, and every item of the old menu row is reachable
+through it and behaves the same.
+
+**Acceptance Scenarios**:
+
+1. **Given** a fresh install on Windows or Linux, **When** the main window opens, **Then**
+ no menu row is shown and the transport bar starts with a Menu button.
+2. **Given** the Menu button, **When** the user clicks it, **Then** a menu opens below it
+ with the submenus File, Edit, View, Transport and Help, in that order.
+3. **Given** the Menu button's menu, **When** the user compares any submenu with the menu
+ row's (shown via the setting), **Then** both list the same items in the same order with
+ the same separators, check marks, shortcut hints and enabled state.
+4. **Given** no recent projects, **When** the user opens Menu → File → Open recent, **Then**
+ the greyed-out "No recent projects" line shows, as it does in the menu row. (Menu commands
+ themselves are never greyed today — a command that can't act explains why in the status
+ line — and the Menu button keeps that.)
+5. **Given** Snap to grid is on, **When** the user opens Menu → Edit → Grid, **Then** Snap to
+ grid carries a check mark; picking it turns snapping off and the next opening shows it
+ unchecked.
+6. **Given** recently opened projects, **When** the user opens Menu → File → Open recent,
+ **Then** the same recent list as the menu row's is shown and picking one opens it.
+7. **Given** the menu row hidden, **When** the user presses a menu shortcut (for example
+ Ctrl+S, Ctrl+Z), **Then** the command runs exactly as it did with the row shown.
+8. **Given** a narrow window, **When** the transport bar sheds parts to fit, **Then** the
+ Menu button stays, like the view switch and the transport keys.
+
+---
+
+### User Story 2 - Bring the menu row back (Priority: P2)
+
+A user who prefers a classic menu row turns on "Show menu bar" — in Settings → Appearance or
+as a check item in Menu → View — and the row reappears under the title bar at once. The choice
+is remembered across restarts. Turning it off hides the row again.
+
+**Why this priority**: The row going away by default changes a habit; people who want it back
+need a one-step way to get it, from where they would look for it.
+
+**Independent Test**: Turn "Show menu bar" on from Menu → View: the row appears; restart:
+it is still there; turn it off in Settings → Appearance: the row disappears and the View item's
+check mark follows.
+
+**Acceptance Scenarios**:
+
+1. **Given** the menu row hidden, **When** the user picks Menu → View → Show menu bar,
+ **Then** the menu row appears immediately and the item shows a check mark.
+2. **Given** the menu row shown, **When** the user unticks Show menu bar in Settings →
+ Appearance, **Then** the row disappears immediately and the View item loses its check mark
+ (and the reverse: the Settings switch follows a change made from the View menu, including
+ while the Settings window is open).
+3. **Given** "Show menu bar" on, **When** Nota is restarted, **Then** the menu row is shown
+ from the first frame.
+4. **Given** the menu row shown, **When** the user looks at the transport bar, **Then** the
+ Menu button is not there (the row already gives the menu) and the view switch leads the bar
+ again; turning the row off brings the button back.
+
+---
+
+### User Story 3 - Open the menu from the keyboard (Priority: P2)
+
+A keyboard user on Windows or Linux taps Alt (pressed and released on its own) or presses F10
+and the menu opens, with the keyboard able to move through it. With the row hidden this opens
+the Menu button's menu; with the row shown it does what it does today for the row.
+
+**Why this priority**: Alt / F10 is the standard way into an application menu on Windows and
+Linux; hiding the row must not make the menu mouse-only.
+
+**Independent Test**: With the row hidden, tap Alt: the Menu button's menu opens and the arrow
+keys move through File…Help and into a submenu; Escape closes it and focus returns to where it
+was.
+
+**Acceptance Scenarios**:
+
+1. **Given** the menu row hidden, **When** the user presses F10, **Then** the Menu button's
+ menu opens with its first entry (File) highlighted.
+2. **Given** the menu row hidden, **When** the user presses and releases Alt with no other key
+ or click in between, **Then** the Menu button's menu opens.
+3. **Given** the menu row hidden, **When** the user holds Alt to drag a clip freely (or uses
+ any Alt+key / Alt+click combination), **Then** the menu does not open.
+4. **Given** the menu open, **When** the user presses Escape (or clicks elsewhere), **Then**
+ the menu closes, nothing runs, and keyboard focus is back where it was.
+5. **Given** the menu row shown, **When** the user taps Alt or presses F10, **Then** the menu
+ row takes keyboard focus as it does today.
+6. **Given** the focus in a text field (rename, BPM entry), **When** the user taps Alt or
+ presses F10, **Then** the menu opens the same way, and the text being edited is not changed.
+
+---
+
+### User Story 4 - The project name in the title bar on Windows (Priority: P3)
+
+On Windows the caption in Nota's own title bar reads "Nota — My song" ("Nota — Untitled" until
+the project is named, or whatever an unsaved new project is called), the same text as the OS
+window title shown in the taskbar and Alt+Tab, and it follows Save As, Open and New.
+
+**Why this priority**: With the menu row gone, the title bar is the one place the app and the
+project are named in the window; it is a small text change.
+
+**Independent Test**: On Windows, open a project called "My song": the caption reads
+"Nota — My song", and Save As "Demo" changes it to "Nota — Demo".
+
+**Acceptance Scenarios**:
+
+1. **Given** a new, never-saved project on Windows, **When** the main window shows, **Then**
+ the title-bar caption reads the same text as the OS window title (for example
+ "Nota — Untitled").
+2. **Given** a project open on Windows, **When** the user saves it under a new name or opens
+ another project, **Then** the caption updates to "Nota — <new name>" at the same time as
+ the OS window title.
+3. **Given** Linux, **When** a project is open, **Then** the OS frame shows "Nota — <name>"
+ as it does today (no change needed).
+4. **Given** macOS, **When** a project is open, **Then** the caption is unchanged from today
+ (the project name alone).
+
+---
+
+### User Story 5 - macOS stays as it is (Priority: P1)
+
+A macOS user sees no change: the menu stays in the system menu bar, there is no Menu button,
+no "Show menu bar" setting in Settings → Appearance and no Show menu bar item in View, and the
+title bar is as before.
+
+**Why this priority**: The issue explicitly limits the change to Windows and Linux; a macOS
+regression would break the platform's convention.
+
+**Independent Test**: On macOS, compare the main window, the system menu and Settings →
+Appearance with the previous release: identical.
+
+**Acceptance Scenarios**:
+
+1. **Given** macOS, **When** the main window opens, **Then** the transport bar starts with
+ the view switch, no Menu button.
+2. **Given** macOS, **When** the user opens View in the system menu bar or Settings →
+ Appearance, **Then** there is no Show menu bar item or setting.
+
+---
+
+### Edge Cases
+
+- The menu changes while the Menu button's menu is closed (Open recent gains an entry, a check
+ state or enabled state changes, the interface language changes): the next opening shows the
+ current state, never a stale copy.
+- The interface language is switched: both the Menu button's menu and the menu row show the
+ new texts; the button's own label / tooltip follows too.
+- Fullscreen on Windows hides Nota's title bar as today; the Menu button is still in the
+ transport bar and the menu row follows the setting.
+- The interface scale (spec 027) and text size settings apply to the Menu button and its menu
+ as to the rest of the transport bar and to context menus.
+- A menu item opens a dialog (Settings…, Export…): the menu closes first and the dialog opens
+ as it does from the menu row.
+- Alt tapped while a menu, popup or modal dialog is already open: no second menu opens; the
+ standard behaviour of that popup applies.
+- Alt pressed then released after a mouse button press or wheel event in between (e.g.
+ Alt+wheel zoom): no menu.
+- Alt tapped in the middle of a clip drag (to switch snapping off and on): no menu — the drag
+ owns Alt until the button is released.
+- Alt or F10 while the command palette is open: the palette keeps the keyboard; no menu.
+- The setting file from an older version has no "Show menu bar" value: the row is hidden
+ (the new default), the user can turn it on.
+- Changing the menu row's visibility changes the height of the work area: the arrangement,
+ session and mixer re-lay out without losing scroll position or selection.
+- Remote / MCP / shortcut-driven commands are unaffected by whether the menu row is shown.
+
+## Requirements *(mandatory)*
+
+### Functional Requirements
+
+**Menu button (Windows / Linux)**
+
+- **FR-001**: On Windows and Linux the transport bar MUST start with a Menu button, placed
+ before the view switch, whenever the menu row is hidden.
+- **FR-002**: Clicking the Menu button MUST open a single menu whose top-level entries are the
+ menu row's top-level menus (File, Edit, View, Transport, Help) as submenus, in the same order.
+- **FR-003**: The Menu button's menu MUST be built from the same menu definition and command
+ catalogue as the menu row, so that items, order, separators, nested submenus (Edit → Grid,
+ File → Open recent), labels, shortcut hints, check marks and enabled state are the same in
+ both, with no second hand-maintained list.
+- **FR-004**: Picking an item in the Menu button's menu MUST run the same command as the
+ corresponding menu-row item.
+- **FR-005**: The Menu button's menu MUST reflect the current state each time it opens (recent
+ projects, check marks, enabled state, language).
+- **FR-006**: The Menu button MUST NOT be shed when the transport bar is too narrow.
+- **FR-007**: The Menu button MUST be an icon-only key (a "menu" ☰ glyph) of the same size as
+ the view-switch keys, with the label "Menu" as its tooltip and accessible name; it follows
+ the transport bar's design language (DESIGN.md) and the interface scale.
+
+**Menu row and the "Show menu bar" setting (Windows / Linux)**
+
+- **FR-008**: On Windows and Linux the menu row MUST be hidden by default, including for users
+ upgrading from a version without the setting.
+- **FR-009**: A "Show menu bar" on/off setting MUST be offered in Settings → Appearance and as
+ a check item in the View menu (thus also reachable from the Menu button).
+- **FR-010**: Changing the setting from either place MUST show or hide the menu row
+ immediately, update the other place's state, and be persisted with the user's settings so
+ it applies from the first frame on the next start.
+- **FR-011**: While the menu row is shown, the Menu button MUST be hidden; when the row is
+ hidden, the button MUST be shown.
+- **FR-012**: Menu keyboard shortcuts MUST work identically whether the menu row is shown or
+ hidden.
+
+**Keyboard access (Windows / Linux)**
+
+- **FR-013**: With the menu row hidden, F10 MUST open the Menu button's menu with keyboard
+ navigation (arrows, Enter, Escape) working in it.
+- **FR-014**: With the menu row hidden, pressing and releasing Alt with no other key, mouse
+ button or wheel input in between MUST open the Menu button's menu; any Alt combination
+ (Alt+key, Alt+click, Alt+drag, Alt+wheel) MUST NOT open it, nor Alt pressed or released
+ while a mouse button is down (during a drag Alt toggles snapping). Neither F10 nor Alt opens
+ it while the command palette is open.
+- **FR-015**: Closing the menu without picking an item MUST return keyboard focus to the
+ control that had it before.
+- **FR-016**: With the menu row shown, Alt and F10 MUST keep their current behaviour for the
+ row.
+- **FR-017**: The Shortcuts list in Settings MUST mention Alt / F10 as the way to open the menu
+ on Windows and Linux.
+
+**Title bar caption**
+
+- **FR-018**: On Windows the caption in Nota's own title bar MUST show the same text as the OS
+ window title ("Nota — <project name>"), updated whenever the project name changes.
+- **FR-019**: On Linux the window title MUST stay "Nota — <project name>" (shown by the OS
+ frame); no change.
+
+**macOS**
+
+- **FR-020**: On macOS there MUST be no Menu button, no "Show menu bar" setting or View item,
+ no Alt / F10 menu handling, and no change to the title bar caption or the system menu.
+
+**Localisation**
+
+- **FR-021**: All new user-visible texts (Menu, Show menu bar and its caption in Settings) MUST
+ go through the localisation catalogue with English entries; other languages follow the
+ project's usual translation flow.
+
+### Key Entities
+
+- **Show menu bar** (user setting): a per-user on/off preference, default off; meaningful on
+ Windows and Linux only; stored with the other appearance settings.
+- **Application menu definition**: the one description of the menu (top-level menus, items,
+ separators, command ids) from which both the menu row and the Menu button's menu are
+ produced; each item draws its label, shortcut, check and enabled state from the command
+ catalogue.
+
+## Success Criteria *(mandatory)*
+
+### Measurable Outcomes
+
+- **SC-001**: On Windows and Linux with default settings, the vertical space above the
+ transport bar shrinks by the full height of the former menu row (the work area gains that
+ height).
+- **SC-002**: 100% of menu-row items (every command, submenu and separator) are present in the
+ Menu button's menu, in the same order, with matching check, enabled and shortcut states —
+ verified by an automated comparison of the two menus.
+- **SC-003**: Every menu command reachable from the menu row is reachable from the Menu button
+ in at most three clicks (button → submenu → item; four for items in nested submenus such as
+ Edit → Grid).
+- **SC-004**: A keyboard-only user can open the menu and run any item without the mouse, with
+ the row hidden.
+- **SC-005**: Turning "Show menu bar" on or off takes effect within one frame and survives a
+ restart in 100% of tries.
+- **SC-006**: On macOS, screenshots of the main window, the system menu and Settings →
+ Appearance are unchanged from the previous release.
+
+## Assumptions
+
+- **Menu button when the row is shown**: the issue left this to review; decided with the
+ contributor on 2026-11-12 — the button hides while the row is shown (FR-011), so there is one
+ menu on screen and the transport bar keeps its width.
+- **Default**: hidden for everyone on Windows / Linux, upgraders included, as the issue says
+ ("hidden by default once the button exists"); there is no migration that keeps the row for
+ existing users.
+- **Where in Settings**: the setting goes on the Appearance page as it is laid out after #427
+ (spec 088), next to the other window-layout choices (track headers side); hidden on macOS.
+- **Project name in the transport**: already removed by the new look (#296); nothing to remove
+ here, and no transport-fit code depends on it.
+- **Linux title**: Linux keeps the native frame (no own title bar), so part (1) needs no change
+ there.
+- **#41** (hiding the native title bar and putting the Menu button in the title bar) is out of
+ scope.
+- **Docs**: the user documentation (nota-docs, EN + RU), FEATURES.md, CHANGELOG `[Unreleased]`
+ and the Shortcuts screen are updated as part of this change.
+
+## Nota Compliance Checklist *(review before implementation; re-check in tasks.md)*
+
+- [x] 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, nothing on the audio thread
+- [x] Managed/native crossings go through the pure C ABI in `nota_engine.h` only (AR-7); no JUCE outside `pluginhost/` — no engine change
+- [x] Smoke-test impact assessed: engine behaviour change → extend `tests/Nota.SmokeTest` — no engine change; UI-level tests cover the menu equivalence
+- [x] 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)
+- [x] UI change → follows `DESIGN.md` (Studio design language)
diff --git a/specs/093-menu-button-title-bar/tasks.md b/specs/093-menu-button-title-bar/tasks.md
new file mode 100644
index 00000000..badee0a8
--- /dev/null
+++ b/specs/093-menu-button-title-bar/tasks.md
@@ -0,0 +1,158 @@
+---
+
+description: "Tasks for 093 — Menu button and a hideable menu bar"
+---
+
+# Tasks: Menu button and a hideable menu bar
+
+**Input**: Design documents from `specs/093-menu-button-title-bar/`
+
+**Prerequisites**: plan.md, spec.md, research.md, data-model.md, contracts/ui.md, quickstart.md
+
+**Tests**: SC-002 asks for an automated comparison of the two menus → one smoke-test suite
+(`MenuMirrorTests`). The rest is verified per [quickstart.md](quickstart.md).
+
+**Organization**: grouped by user story (spec.md priorities).
+
+## Format: `[ID] [P?] [Story] Description`
+
+- **[P]**: can run in parallel (different files, no dependency on unfinished tasks)
+- **[Story]**: US1…US5 from spec.md
+
+---
+
+## Phase 1: Setup
+
+- [X] T001 Add `GlyphKind.Menu` (three strokes `M4 6.5 H20 M4 12 H20 M4 17.5 H20`, stroke only) to the enum and the `Paths` table in `src/managed/Nota.App/Controls/Glyph.cs`
+- [X] T002 [P] Add English localisation keys `main.menu` ("Menu"), `main.show_menu_bar` ("Show menu bar"), `commands.show_menu_bar` ("Show menu bar"), `main.commands.menu_bar_shown` / `main.commands.menu_bar_hidden` (status line), `preferences.menu_bar` ("Menu bar"), `preferences.menu_bar_hidden` ("Hidden"), `preferences.menu_bar_shown` ("Shown"), `preferences.menu_bar_caption` (one sentence: the whole menu is also under the ☰ key at the start of the transport bar; Alt or F10 opens it), `preferences.open_the_menu` ("Open the menu") in `src/managed/Nota.Application/Localization/en.json` (other languages follow the usual translation flow; add the keys where the catalogue check requires them)
+
+---
+
+## Phase 2: Foundational (blocks all stories)
+
+- [X] T003 Add `public bool ShowMenuBar { get; set; }` — default `false`, doc comment "Windows / Linux: the in-window menu row is shown (#518). Off = the ☰ Menu key at the start of the transport bar gives the menu. Ignored on macOS." — next to `ArrangementHeadersRight` in `src/managed/Nota.Application/Settings.cs`
+- [X] T004 Create `src/managed/Nota.App/MenuMirror.cs` (SPDX header; Avalonia base only): `static IReadOnlyList<Control> Build(NativeMenu source)` making a fresh `MenuItem` / `Separator` tree per research R1 / data-model mirror table (Header, InputGesture ← Gesture, ToggleType / IsChecked, IsEnabled, ToolTip, submenus; click → `((INativeMenuItemExporterEventsImplBridge)src).RaiseClicked()`), plus `static MenuShape Describe(NativeMenu)` / `Describe(IEnumerable<Control>)` producing a comparable plain record tree for tests
+- [X] T005 Link `MenuMirror.cs` into `tests/Nota.SmokeTest/Nota.SmokeTest.csproj` and add `tests/Nota.SmokeTest/MenuMirrorTests.cs` (SPDX header): build a `NativeMenu` with a nested submenu, a separator, checked and unchecked checkbox items, a gesture, a disabled item, a tooltip and a header with `__`; assert `Describe(source) == Describe(Build(source))`; flip a check mark and add an item, rebuild, assert again (freshness); register the suite where the smoke runner lists its suites
+
+**Checkpoint**: mirror proven equal to its source.
+
+---
+
+## Phase 3: User Story 1 — the whole menu from a Menu button, row hidden (P1) 🎯 MVP
+
+**Goal**: ☰ leads the transport bar on Windows / Linux and opens the full menu; the row is hidden by default.
+
+**Independent test**: quickstart steps 1–6.
+
+- [X] T006 [US1] In `src/managed/Nota.App/MainWindow.axaml`: name the menu-row border `MenuBarRow` (and the bar `MenuBarHost` = the `NativeMenuBar`); add, first in transport column 0's `StackPanel`, a `Border x:Name="MenuKeyWell" Classes="segmented view"` holding `ToggleButton x:Name="MenuBtn" Classes="seg view"` with `<app:Glyph Kind="Menu" Size="16"/>`, `ToolTip.Tip` / `AutomationProperties.Name` = `{app:T 'main.menu'}`, `IsVisible="False"` (code shows it); update the transport comment to mention the Menu key
+- [X] T007 [US1] Create `src/managed/Nota.App/MainWindow.MenuButton.cs` (SPDX header): `InitMenuButton()` — on macOS leave `MenuKeyWell` hidden and return; else give `MenuBtn` a `ContextMenu` (placement bottom, anchored to the key) whose `Opening` clears and refills `Items` from `MenuMirror.Build(NativeMenu.GetMenu(this))`, keep `MenuBtn.IsChecked` true while open, save / restore keyboard focus around it (FR-015); `OpenMenuFromKeyboard()` opens it with the first item selected; `ApplyMenuBar(bool shown)` — Windows / Linux: `MenuBarRow.Child = shown ? MenuBarHost : null`, `MenuBarRow.IsVisible = shown`, `MenuKeyWell.IsVisible = !shown` (FR-011), tick `MenuItemFor("view.menuBar")`, `RequestTransportFit()`
+- [X] T008 [US1] Wire it in `src/managed/Nota.App/MainWindow.axaml.cs`: call `InitMenuButton()` after `InitRecentMenu()` and apply `ApplyMenuBar(settings.Current.ShowMenuBar)` from `App.Services`' `ISettingsService` in the constructor (first frame right, SC-005); in the `vm.Settings.Changed` handler call `ApplyMenuBar(vm.Settings.Current.ShowMenuBar)`
+- [X] T009 [US1] Confirm `MenuKeyWell` is not in `TransportShedOrder` and add a one-line note to the header comment of `src/managed/Nota.App/MainWindow.TransportFit.cs` that the Menu key, like the view switch, never goes (FR-006)
+
+**Checkpoint**: US1 works with the row permanently hidden.
+
+---
+
+## Phase 4: User Story 2 — bring the menu row back (P2)
+
+**Goal**: "Show menu bar" in View and Settings → Appearance, persisted.
+
+**Independent test**: quickstart steps 7–8.
+
+- [X] T010 [P] [US2] Add `C("view.menuBar", Loc.T("commands.show_menu_bar"), Loc.T("commands.view"), "", "menu bar menubar hamburger file edit row classic")` after `view.fullscreen` in `src/managed/Nota.Application/Palette/CommandCatalog.cs`
+- [X] T011 [US2] Add `<NativeMenuItem Header="{app:T 'main.show_menu_bar'}" app:Commands.Id="view.menuBar" ToggleType="CheckBox"/>` after the Toggle full screen item in the View menu of `src/managed/Nota.App/MainWindow.axaml`
+- [X] T012 [US2] In `src/managed/Nota.App/MainWindow.Commands.cs` bind `B("view.menuBar", ToggleMenuBar)`; `ToggleMenuBar()` (macOS: return) flips `_vm.Settings.Current.ShowMenuBar`, saves, sets the status line (`main.commands.menu_bar_shown` / `_hidden`); `Settings.Changed` applies it via T008
+- [X] T013 [US2] In `src/managed/Nota.App/MainWindow.MenuKeys.cs` remove `view.menuBar` on macOS next to `file.exit` / `prefs.open` (FR-020)
+- [X] T014 [US2] In `src/managed/Nota.App/PreferencesWindow.cs` add `MenuBarPicker()` (segmented Hidden | Shown, built like `HeaderSidePicker`, repainting on `Settings.Changed`) and, on Windows / Linux only, the rows `Row(Loc.T("preferences.menu_bar"), MenuBarPicker())` + caption after the Track headers rows of `AppearancePane()`
+
+**Checkpoint**: US1 + US2 complete.
+
+---
+
+## Phase 5: User Story 3 — open the menu from the keyboard (P2)
+
+**Goal**: F10 and a lone Alt tap open the Menu key's menu while the row is hidden.
+
+**Independent test**: quickstart step 9.
+
+- [X] T015 [US3] In `src/managed/Nota.App/MainWindow.MenuButton.cs` add the Alt-tap / F10 detector per research R4: tunnel + handledEventsToo handlers for `KeyDown`, `KeyUp`, `PointerPressed`, `PointerWheelChanged` registered in `InitMenuButton()` (Windows / Linux only), active only while the row is hidden and no popup / dialog is open; F10 (no modifiers) and Alt released after an un-interrupted Alt press call `OpenMenuFromKeyboard()` and mark the event handled; any other key, click or wheel disarms (FR-013, FR-014)
+- [X] T016 [US3] Make sure the main key handlers in `src/managed/Nota.App/MainWindow.Input.cs` do not consume a bare Alt / F10 before the detector (adjust only if they do), and that F10 doesn't reach a text field's editing
+- [X] T017 [US3] Add an "Alt F10 → Open the menu" row (`preferences.open_the_menu`) to the general group of `ShortcutGroups` in `src/managed/Nota.App/PreferencesWindow.cs`, shown on Windows / Linux only (FR-017; use the existing platform filtering, or filter when the list is built)
+
+---
+
+## Phase 6: User Story 4 — project name in the Windows title bar (P3)
+
+- [X] T018 [P] [US4] In `UpdateWindowTitle()` of `src/managed/Nota.App/MainWindow.Files.cs` set `DocTitleText.Text = title` on Windows, keep `ProjectDisplayName()` on macOS; update the comment (FR-018)
+
+---
+
+## Phase 7: User Story 5 — macOS unchanged (P1)
+
+- [X] T019 [US5] Review every change above for its macOS guard: Menu key hidden, no detector, no View item, no Appearance row, no Shortcuts row, caption unchanged, menu row untouched (FR-020); run the app on macOS and compare with `develop`
+
+---
+
+## Phase 8: Polish & cross-cutting
+
+- [X] T020 [P] `CHANGELOG.md` `[Unreleased]` → Changed entry (Windows / Linux: menu under ☰, menu bar hidden by default, Show menu bar setting, Alt / F10; Windows caption "Nota — name") with `(#518)`
+- [X] T021 [P] Update `FEATURES.md` via the `nota-features` skill
+- [X] T022 [P] Update the user docs (`../nota-docs`, EN + RU) via the `nota-docs` skill: main-window chrome, Settings → Appearance, Shortcuts
+- [ ] T023 Russian (and other shipped languages) strings for the new keys in `src/managed/Nota.Application/Localization/*.json`, as the localisation check requires
+- [X] T024 Visual check on the headless / harness app per quickstart (Windows / Linux layout of the transport with ☰, the open menu, Settings → Appearance) and before / after screenshots for the PR
+- [ ] T025 `scripts/build.sh` passes (smoke test incl. MenuMirror and palette drift)
+
+---
+
+## Dependencies & execution order
+
+- Phase 1 → Phase 2 → US1 (T006–T009) → US2 (T010–T014) → US3 (T015–T017).
+- US4 (T018) depends on nothing but Phase 1; can be done any time.
+- US5 (T019) after all behaviour is in.
+- Polish after the stories; T025 last.
+
+## Parallel opportunities
+
+- T001 ‖ T002; T010 ‖ T018; T020 ‖ T021 ‖ T022.
+
+## Implementation strategy
+
+MVP = Phases 1–3 (the Menu key, row hidden). Then US2 (the way back), US3 (keyboard), US4
+(caption), the macOS review and the docs.
+
+## Nota compliance re-check
+
+- [X] New files (`MenuMirror.cs`, `MainWindow.MenuButton.cs`, `MenuMirrorTests.cs`) carry the SPDX header
+- [X] No new dependency
+- [X] No audio-thread / engine change
+- [X] CHANGELOG, FEATURES, docs, Shortcuts screen updated
+- [X] UI follows DESIGN.md
+
+## Implementation notes (2026-11-12)
+
+- T005: the suite also runs alone with `Nota.SmokeTest --menu-mirror`.
+- T007: `ContextMenu.Open()` does not raise `Opening` (only a right-click does), so
+ `OpenMenuKeyMenu` fills the menu itself (`FillMenuKeyMenu`); found by the headless harness.
+- T015/T019: the platform rule lives in one place, `MainWindow.HasMenuKey` (settable so a
+ headless harness on a Mac can draw the Windows / Linux chrome).
+- T016: nothing in `MainWindow.Input.cs` handles a bare Alt or F10; the detector runs in the
+ tunnel phase with handledEventsToo, ahead of every view.
+- T017: the Alt / F10 row is a plain literal row in `ShortcutGroups` (the docs' shortcuts
+ generator parses literals only) and is filtered out on macOS at render time.
+- T023: open — the repo holds only `en.json`; Russian / French come through the
+ nota-translations reference sync.
+- T024: headless harness `/tmp/menukeyharness` (12 checks: default hidden row, mirror of the
+ real menu = 73 entries, F10 / Alt tap / Alt+S / Alt+click / AltGr, View toggle, Settings
+ toggle, narrow window). Real Windows / Linux hardware not tried (no machine here); the
+ built-in Avalonia access-key behaviour with the row shown is untested there.
+- T025: open — `scripts/build.sh` on 2026-11-12 built everything and the smoke run passed all
+ but 3 render-pool timing guards (VST3 device deadlines, "overloaded" late blocks), the same 3
+ again with `--perf` alone. The machine was loaded (Rider ~270 % CPU, Nota.app running,
+ load average ~9); this change touches no engine / render code. Re-run with them closed.
+ Re-run with Rider closed (load ~5, Nota.app still running): the same guards failed. A/B of
+ `--perf`, twice each, base `eec6a4ff` vs this branch on the same engine build: base 52 / 303
+ late blocks of 4125, branch 233 / 311; the VST3 deadline guard flips on both. The failures
+ are the machine's, not this change's; a fully idle run is still to do.
+- Review on #585 (2026-11-12): Alt during a drag no longer arms the tap (pointer button state
+ tracked; a move with a button down disarms), and Alt / F10 do nothing while the command
+ palette is open. Harness: 15 checks, all pass.
diff --git a/src/managed/Nota.App/Controls/Glyph.cs b/src/managed/Nota.App/Controls/Glyph.cs
index 33b49b8f..bc56a6c5 100644
--- a/src/managed/Nota.App/Controls/Glyph.cs
+++ b/src/managed/Nota.App/Controls/Glyph.cs
@@ -40,6 +40,7 @@ internal enum GlyphKind
Lock, LockOpen, // a reference (read-only) clip in the multi-clip editor, and the unlocked toggle
DockIn, // PopOut's opposite: bring a floating window back into the main one
Expand, Shrink, // a panel filling the window, and back to its split
+ Menu, // the transport bar's Menu key: the whole app menu on Windows / Linux (#518)
}
internal sealed class Glyph : Control
@@ -476,6 +477,8 @@ internal sealed class Glyph : Control
[GlyphKind.Sidebar] = ("M3.5 5.5 h17 v13 h-17 zM9.5 5.5 v13", null),
// Three centred rules, shortening downward (view options).
[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),
// 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.Commands.cs b/src/managed/Nota.App/MainWindow.Commands.cs
index 032ff087..363de12b 100644
--- a/src/managed/Nota.App/MainWindow.Commands.cs
+++ b/src/managed/Nota.App/MainWindow.Commands.cs
@@ -95,6 +95,7 @@ public partial class MainWindow
B("view.showPlayhead", ShowPlayhead);
B("view.clipNames", () => OnMenuCycleClipNames(this, e));
B("view.headersRight", ToggleHeadersRight);
+ B("view.menuBar", ToggleMenuBar);
B("view.automation", () =>
{
AutomationToggle.IsChecked = !(AutomationToggle.IsChecked == true);
diff --git a/src/managed/Nota.App/MainWindow.Files.cs b/src/managed/Nota.App/MainWindow.Files.cs
index 1a4e43c9..ee432022 100644
--- a/src/managed/Nota.App/MainWindow.Files.cs
+++ b/src/managed/Nota.App/MainWindow.Files.cs
@@ -163,9 +163,11 @@ public partial class MainWindow
{
string title = Loc.F("main.files.nota", ProjectDisplayName());
Title = title;
- // The frameless header's caption is the project's name; the OS window title keeps the
- // app too, for the Dock and window switcher.
- DocTitleText.Text = ProjectDisplayName();
+ // macOS: the frameless header's caption is the project's name; the OS window title keeps
+ // the app too, for the Dock and window switcher. Windows: the caption is the window title
+ // itself, "Nota — My song" — with the menu row gone it is where the app is named (#518).
+ // (Linux shows the native frame, whose title is Title.)
+ DocTitleText.Text = OperatingSystem.IsWindows() ? title : ProjectDisplayName();
}
/// <summary>A crash-recovery snapshot to offer on open (set by App at launch). M7-7.</summary>
diff --git a/src/managed/Nota.App/MainWindow.MenuButton.cs b/src/managed/Nota.App/MainWindow.MenuButton.cs
new file mode 100644
index 00000000..d3c4d86a
--- /dev/null
+++ b/src/managed/Nota.App/MainWindow.MenuButton.cs
@@ -0,0 +1,195 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.
+//
+// The Menu key (#518, specs/093). On Windows / Linux the in-window menu row costs a full row
+// for something used now and then, so it is hidden by default and the transport bar starts
+// with a Menu key instead: one ☰ cell whose menu is the whole application menu — a copy of the
+// NativeMenu the row draws, made afresh at every opening (MenuMirror), so the two never differ.
+// View ▸ Show menu bar and Settings → Appearance bring the row back (Settings.ShowMenuBar); the
+// key then steps aside, so one menu is on screen.
+//
+// Keyboard: with the row hidden, F10 or Alt pressed and released on its own opens the key's
+// menu. Any other key, click or wheel turn while Alt is down (Alt+drag to move freely,
+// Alt+wheel, ⌥ chords) cancels that, and so does Alt pressed during a click or drag (where it
+// toggles snapping), so those keep working. Neither key acts while the command palette is open. The hidden row is taken out of the
+// visual tree, not just hidden: an attached menu bar stays the window's main menu for Avalonia's
+// access keys and would take Alt / F10 while invisible.
+//
+// macOS: none of this — the menu lives in the system menu bar.
+
+using System;
+using Avalonia.Controls;
+using Avalonia.Input;
+using Avalonia.Interactivity;
+using Avalonia.Threading;
+using Microsoft.Extensions.DependencyInjection;
+using Nota.Application;
+using Nota.Application.Localization;
+
+namespace Nota.App;
+
+public partial class MainWindow
+{
+ private ContextMenu? _menuKeyMenu;
+ private bool _menuBarShown;
+ private bool _altTapArmed;
+ private bool _pointerButtonDown; // a click or drag in progress: Alt then belongs to it
+ private bool _menuFromKeyboard;
+ private IInputElement? _focusBeforeMenu;
+ private DateTime _menuKeyClosedAt;
+
+ /// <summary>Windows / Linux: the in-window menu can be swapped for the Menu key, and
+ /// Settings / View offer "Show menu bar". The one place this platform rule is decided;
+ /// settable only so a headless harness on a Mac can draw the Windows / Linux chrome.</summary>
+ internal static bool HasMenuKey { get; set; } = !OperatingSystem.IsMacOS();
+
+ private void InitMenuButton()
+ {
+ if (!HasMenuKey) { MenuKeyWell.IsVisible = false; return; }
+
+ var menu = new ContextMenu
+ {
+ Placement = PlacementMode.BottomEdgeAlignedLeft,
+ PlacementTarget = MenuBtn,
+ };
+ // Opening fires for a right-click only; OpenMenuKeyMenu fills the menu itself.
+ menu.Opening += (_, _) => FillMenuKeyMenu();
+ menu.Opened += (_, _) =>
+ {
+ MenuBtn.IsChecked = true;
+ if (!_menuFromKeyboard) 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 += (_, _) =>
+ {
+ MenuBtn.IsChecked = false;
+ _menuKeyClosedAt = DateTime.UtcNow;
+ // Back to where the keyboard was — unless what was picked moved it (a dialog, a field).
+ var back = _focusBeforeMenu;
+ _focusBeforeMenu = null;
+ Dispatcher.UIThread.Post(() =>
+ {
+ var now = FocusManager?.GetFocusedElement();
+ if (back is not null && (now is null || ReferenceEquals(now, MenuBtn) || now is MenuItem))
+ back.Focus();
+ }, DispatcherPriority.Input);
+ };
+ // A ContextMenu opens only on the control it belongs to; right-clicking the key opens it too.
+ MenuBtn.ContextMenu = _menuKeyMenu = menu;
+
+ AddHandler(KeyDownEvent, OnMenuKeyKeyDown, RoutingStrategies.Tunnel, handledEventsToo: true);
+ AddHandler(KeyUpEvent, OnMenuKeyKeyUp, RoutingStrategies.Tunnel, handledEventsToo: true);
+ AddHandler(PointerPressedEvent, (_, _) => { _altTapArmed = false; _pointerButtonDown = true; },
+ RoutingStrategies.Tunnel, handledEventsToo: true);
+ AddHandler(PointerReleasedEvent, (_, e) => _pointerButtonDown = AnyButton(e.GetCurrentPoint(this).Properties),
+ RoutingStrategies.Tunnel, handledEventsToo: true);
+ AddHandler(PointerCaptureLostEvent, (_, _) => _pointerButtonDown = false, RoutingStrategies.Tunnel, handledEventsToo: true);
+ // Alt pressed or released during a drag toggles snapping there; a move with a button
+ // held is a drag, whatever started it.
+ AddHandler(PointerMovedEvent, (_, e) =>
+ {
+ if (!AnyButton(e.GetCurrentPoint(this).Properties)) return;
+ _pointerButtonDown = true;
+ _altTapArmed = false;
+ }, RoutingStrategies.Tunnel, handledEventsToo: true);
+ AddHandler(PointerWheelChangedEvent, (_, _) => _altTapArmed = false, RoutingStrategies.Tunnel, handledEventsToo: true);
+
+ ApplyMenuBar(App.Services.GetRequiredService<ISettingsService>().Current.ShowMenuBar);
+ }
+
+ /// <summary>Shows or hides the in-window menu row; the Menu key takes its place when it is
+ /// hidden. Called at start-up and whenever the setting changes.</summary>
+ private void ApplyMenuBar(bool shown)
+ {
+ if (!HasMenuKey) return;
+ if (MenuItemFor("view.menuBar") is { } item) item.IsChecked = shown;
+ if (_menuBarShown == shown && MenuKeyWell.IsVisible == !shown) return;
+ _menuBarShown = shown;
+ if (shown) _menuKeyMenu?.Close();
+ MenuBarRow.Child = shown ? MenuBarHost : null;
+ MenuBarRow.IsVisible = shown;
+ MenuKeyWell.IsVisible = !shown;
+ _altTapArmed = false;
+ RequestTransportFit();
+ }
+
+ private void OnMenuKeyClick(object? sender, RoutedEventArgs e)
+ {
+ // The press that closed the open menu (light dismiss) is also this click: leave it closed.
+ if ((DateTime.UtcNow - _menuKeyClosedAt).TotalMilliseconds < 300) { MenuBtn.IsChecked = false; return; }
+ OpenMenuKeyMenu(fromKeyboard: false);
+ }
+
+ private void OpenMenuKeyMenu(bool fromKeyboard)
+ {
+ if (_menuKeyMenu is null || _menuBarShown) return;
+ if (_menuKeyMenu.IsOpen) { _menuKeyMenu.Close(); return; }
+ _menuFromKeyboard = fromKeyboard;
+ _focusBeforeMenu = FocusManager?.GetFocusedElement();
+ FillMenuKeyMenu();
+ _menuKeyMenu.Open(MenuBtn);
+ }
+
+ // A fresh copy of the application menu at every opening: never stale (FR-005).
+ private void FillMenuKeyMenu()
+ {
+ if (_menuKeyMenu is null) return;
+ _menuKeyMenu.Items.Clear();
+ if (NativeMenu.GetMenu(this) is { } source)
+ foreach (var entry in MenuMirror.Build(source)) _menuKeyMenu.Items.Add(entry);
+ }
+
+ private static bool AnyButton(PointerPointProperties p) =>
+ p.IsLeftButtonPressed || p.IsRightButtonPressed || p.IsMiddleButtonPressed;
+
+ private void OnMenuKeyKeyDown(object? sender, KeyEventArgs e)
+ {
+ if (_menuBarShown || _menuKeyMenu is null) return;
+ // The command palette has the keyboard while it is open (as for the transport keys).
+ if (PaletteOpen) { _altTapArmed = false; return; }
+ if (e.Key is Key.LeftAlt or Key.RightAlt)
+ {
+ // Alt alone (not AltGr, which arrives as Ctrl+Alt, nor Alt under another modifier),
+ // and not during a click or drag, where Alt toggles snapping.
+ _altTapArmed = !_pointerButtonDown
+ && (e.KeyModifiers & (KeyModifiers.Control | KeyModifiers.Shift | KeyModifiers.Meta)) == 0;
+ return;
+ }
+ _altTapArmed = false;
+ if (e.Key == Key.F10 && e.KeyModifiers == KeyModifiers.None && !_menuKeyMenu.IsOpen)
+ {
+ OpenMenuKeyMenu(fromKeyboard: true);
+ e.Handled = true;
+ }
+ }
+
+ private void OnMenuKeyKeyUp(object? sender, KeyEventArgs e)
+ {
+ if (e.Key is not (Key.LeftAlt or Key.RightAlt)) return;
+ bool tap = _altTapArmed;
+ _altTapArmed = false;
+ if (!tap || _pointerButtonDown || PaletteOpen || _menuBarShown || _menuKeyMenu is null || _menuKeyMenu.IsOpen) return;
+ OpenMenuKeyMenu(fromKeyboard: true);
+ e.Handled = true;
+ }
+
+ // View ▸ Show menu bar: a saved preference shared with Settings → Appearance; Settings.Changed
+ // applies it (ApplyMenuBar), as for the track-header side.
+ private void ToggleMenuBar()
+ {
+ if (_vm is null || !HasMenuKey) return;
+ bool on = !_vm.Settings.Current.ShowMenuBar;
+ _vm.Settings.Current.ShowMenuBar = on;
+ _vm.Settings.Save();
+ _vm.StatusText = on ? Loc.T("main.commands.menu_bar_shown") : Loc.T("main.commands.menu_bar_hidden");
+ }
+}
diff --git a/src/managed/Nota.App/MainWindow.MenuKeys.cs b/src/managed/Nota.App/MainWindow.MenuKeys.cs
index 1615bde8..735affbc 100644
--- a/src/managed/Nota.App/MainWindow.MenuKeys.cs
+++ b/src/managed/Nota.App/MainWindow.MenuKeys.cs
@@ -38,6 +38,7 @@ public partial class MainWindow
RemoveWithSeparatorAbove(menu, "file.exit");
RemoveWithSeparatorAbove(menu, "prefs.open");
}
+ if (!HasMenuKey) RemoveWithSeparatorAbove(menu, "view.menuBar"); // macOS: the menu is in the system bar (#518)
Collect(menu);
void Collect(NativeMenu m)
diff --git a/src/managed/Nota.App/MainWindow.TransportFit.cs b/src/managed/Nota.App/MainWindow.TransportFit.cs
index 2301a683..e3e39611 100644
--- a/src/managed/Nota.App/MainWindow.TransportFit.cs
+++ b/src/managed/Nota.App/MainWindow.TransportFit.cs
@@ -8,6 +8,8 @@
// the tempo, the metronome and the view switch never go. The DSP meter is what you look at
// 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.
using System;
using System.Collections.Generic;
diff --git a/src/managed/Nota.App/MainWindow.axaml b/src/managed/Nota.App/MainWindow.axaml
index 0aac0142..144bd6d4 100644
--- a/src/managed/Nota.App/MainWindow.axaml
+++ b/src/managed/Nota.App/MainWindow.axaml
@@ -88,6 +88,7 @@
<NativeMenuItem Header="{app:T 'main.toggle_overview'}" app:Commands.Id="view.toggleOverview"/>
<NativeMenuItem Header="{app:T 'main.toggle_sections'}" app:Commands.Id="view.toggleSections"/>
<NativeMenuItem Header="{app:T 'main.toggle_full_screen'}" app:Commands.Id="view.fullscreen"/>
+ <NativeMenuItem Header="{app:T 'main.show_menu_bar'}" app:Commands.Id="view.menuBar" ToggleType="CheckBox"/>
<NativeMenuItemSeparator/>
<!-- Header text is matched from code to keep this checkmark in step with the
transport bar's Follow button — see MainWindow.SetFollowPlayhead. -->
@@ -145,9 +146,11 @@
</Border>
<!-- In-window menu bar for Windows/Linux (empty on macOS: menus go to the system bar):
- a menubar-style row — the ground, with a seam under it. -->
- <Border DockPanel.Dock="Top" Background="{DynamicResource Brush.BgApp}">
- <NativeMenuBar/>
+ a menubar-style row — the ground, with a seam under it. Hidden by default there: the
+ Menu key at the start of the transport bar gives the same menu, and View ▸ Show menu
+ bar / Settings → Appearance bring the row back (#518, MainWindow.MenuButton.cs). -->
+ <Border x:Name="MenuBarRow" DockPanel.Dock="Top" Background="{DynamicResource Brush.BgApp}">
+ <NativeMenuBar x:Name="MenuBarHost"/>
</Border>
<!-- Transport (44) under the header, above the work area — a flat docked row on the
@@ -162,8 +165,16 @@
<Grid x:Name="TransportGrid" ColumnDefinitions="Auto,Auto,Auto,Auto,Auto,*,Auto,Auto,Auto,Auto,Auto">
<!-- The view group: three 28px icon cells in a 2px well (corner 9). The project's name
- is the window title, centred in the header above. -->
+ is the window title, centred in the header above. On Windows / Linux, with the menu
+ row hidden, the Menu key leads it: one cell of the same kind holding the whole
+ application menu (#518). -->
<StackPanel Grid.Column="0" Orientation="Horizontal" Spacing="10" Margin="2,0,0,0" VerticalAlignment="Center">
+ <Border x:Name="MenuKeyWell" Classes="segmented view" VerticalAlignment="Center" IsVisible="False">
+ <ToggleButton x:Name="MenuBtn" Classes="seg view" Click="OnMenuKeyClick"
+ ToolTip.Tip="{app:T 'main.menu'}" AutomationProperties.Name="{app:T 'main.menu'}">
+ <app:Glyph Kind="Menu" Size="16"/>
+ </ToggleButton>
+ </Border>
<Border Classes="segmented view" VerticalAlignment="Center">
<StackPanel Orientation="Horizontal">
<!-- The views as icon keys (spec 012): the tooltip and the accessible name carry
diff --git a/src/managed/Nota.App/MainWindow.axaml.cs b/src/managed/Nota.App/MainWindow.axaml.cs
index d702a28b..8fc2f905 100644
--- a/src/managed/Nota.App/MainWindow.axaml.cs
+++ b/src/managed/Nota.App/MainWindow.axaml.cs
@@ -91,6 +91,7 @@ public partial class MainWindow : Window
InitBottomPanels(); // BodyGrid rows for the docked Mixer + Detail panels (specs/054)
InitMenuShortcuts(); // Ctrl instead of Win on Windows / Linux, and bound there
InitRecentMenu(); // File → Open recent (#443)
+ InitMenuButton(); // the Menu key in place of the menu row on Windows / Linux (#518)
UpdateWindowTitle(); // "Nota — Untitled" until a project is opened/saved
// Custom frameless title bar (Phase 2): extend the client area under the
// decorations on macOS/Windows (traffic lights / caption buttons overlay it).
@@ -437,6 +438,7 @@ public partial class MainWindow : Window
Timeline.PhraseBars = vm.Settings.Current.ArrangementPhraseBars;
vm.Engine.SplitFades = vm.Settings.Current.SplitFades;
ApplyHeadersRight(vm.Settings.Current.ArrangementHeadersRight);
+ ApplyMenuBar(vm.Settings.Current.ShowMenuBar);
};
Browser.SetViewModel(vm.Browser);
InitPalette(); // the command palette (⌘⇧P) indexes the library and the registry
diff --git a/src/managed/Nota.App/MenuMirror.cs b/src/managed/Nota.App/MenuMirror.cs
new file mode 100644
index 00000000..265a33ad
--- /dev/null
+++ b/src/managed/Nota.App/MenuMirror.cs
@@ -0,0 +1,119 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.
+//
+// The Menu key's menu (#518): a copy of the application menu — the NativeMenu in
+// MainWindow.axaml, which the in-window menu bar draws on Windows / Linux — made afresh each
+// time the menu opens. Everything the app keeps for the menu lives on the NativeMenuItems
+// (labels, the catalogue's shortcut gestures, check marks set through MenuItemFor, the Open
+// recent list rebuilt in place), so a copy made at opening is never stale and nothing is listed
+// twice. Picking a copied item raises the source item's click — the path TryMenuShortcut takes —
+// so it runs exactly what the menu bar would.
+//
+// Avalonia base only (no window, no app): the smoke test compiles this file in and compares a
+// menu with its copy through Describe.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Avalonia.Controls;
+using Avalonia.Input;
+
+namespace Nota.App;
+
+internal static class MenuMirror
+{
+ /// <summary>Fresh menu entries for <paramref name="source"/>: a MenuItem per NativeMenuItem
+ /// (submenus included), a Separator per NativeMenuItemSeparator.</summary>
+ public static List<Control> Build(NativeMenu source)
+ {
+ var items = new List<Control>(source.Items.Count);
+ foreach (var entry in source.Items)
+ {
+ switch (entry)
+ {
+ case NativeMenuItemSeparator:
+ items.Add(new Separator());
+ break;
+ case NativeMenuItem src:
+ items.Add(Copy(src));
+ break;
+ }
+ }
+ return items;
+ }
+
+ private static MenuItem Copy(NativeMenuItem src)
+ {
+ var item = new MenuItem
+ {
+ Header = src.Header,
+ InputGesture = src.Gesture, // shown only: the window dispatches the shortcut (MenuKeys)
+ ToggleType = src.ToggleType,
+ IsChecked = src.IsChecked,
+ IsEnabled = src.IsEnabled,
+ IsVisible = src.IsVisible,
+ };
+ if (!string.IsNullOrEmpty(src.ToolTip)) ToolTip.SetTip(item, src.ToolTip);
+ if (src.Menu is { } sub)
+ {
+ foreach (var child in Build(sub)) item.Items.Add(child);
+ }
+ else
+ {
+ item.Click += (_, _) => ((INativeMenuItemExporterEventsImplBridge)src).RaiseClicked();
+ }
+ return item;
+ }
+
+ /// <summary>A plain-text outline of a menu — one line per entry, indented by depth — so a
+ /// menu and its copy can be compared in a test.</summary>
+ public static string Describe(NativeMenu menu)
+ {
+ var sb = new StringBuilder();
+ Walk(menu, 0);
+ return sb.ToString();
+
+ void Walk(NativeMenu m, int depth)
+ {
+ foreach (var entry in m.Items)
+ {
+ if (entry is NativeMenuItemSeparator) { Line(depth, nameof(Separator)); continue; }
+ if (entry is not NativeMenuItem i) continue;
+ Line(depth, Entry(i.Header, i.Gesture, i.ToggleType, i.IsChecked, i.IsEnabled, i.IsVisible, i.ToolTip, i.Menu is not null));
+ if (i.Menu is { } sub) Walk(sub, depth + 1);
+ }
+ }
+
+ void Line(int depth, string text) => sb.Append(' ', depth * 2).Append(text).Append('\n');
+ }
+
+ /// <inheritdoc cref="Describe(NativeMenu)"/>
+ public static string Describe(IEnumerable<Control> items)
+ {
+ var sb = new StringBuilder();
+ Walk(items, 0);
+ return sb.ToString();
+
+ void Walk(IEnumerable<Control> list, int depth)
+ {
+ foreach (var entry in list)
+ {
+ if (entry is Separator) { Line(depth, nameof(Separator)); continue; }
+ if (entry is not MenuItem i) continue;
+ var children = i.Items.OfType<Control>().ToList();
+ bool hasSub = children.Count > 0;
+ Line(depth, Entry(i.Header as string, i.InputGesture, i.ToggleType, i.IsChecked, i.IsEnabled, i.IsVisible,
+ ToolTip.GetTip(i) as string, hasSub));
+ if (hasSub) Walk(children, depth + 1);
+ }
+ }
+
+ void Line(int depth, string text) => sb.Append(' ', depth * 2).Append(text).Append('\n');
+ }
+
+ // Every field, '|'-separated: header, gesture, toggle type, checked, enabled, visible,
+ // tooltip, has a submenu.
+ private static string Entry(string? header, KeyGesture? gesture, MenuItemToggleType toggle, bool isChecked, bool enabled,
+ bool visible, string? tip, bool submenu) =>
+ string.Join('|', header, gesture, toggle, isChecked, enabled, visible, tip, submenu);
+}
diff --git a/src/managed/Nota.App/PreferencesWindow.cs b/src/managed/Nota.App/PreferencesWindow.cs
index 7f5fb594..798184a0 100644
--- a/src/managed/Nota.App/PreferencesWindow.cs
+++ b/src/managed/Nota.App/PreferencesWindow.cs
@@ -1372,6 +1372,67 @@ public sealed partial class PreferencesWindow : NotaWindow
return box;
}
+ // Windows / Linux: Hidden / Shown for the in-window menu row (#518). Hidden, the Menu key at
+ // the start of the transport bar gives the menu. Saving fires Settings.Changed, which shows or
+ // hides the row and ticks View ▸ Show menu bar; the same event repaints these buttons, so a
+ // change from the View menu updates an open Appearance pane. Not on macOS (system menu bar).
+ private static Control MenuBarRows()
+ {
+ if (!MainWindow.HasMenuKey) return new Panel { IsVisible = false };
+ return new StackPanel
+ {
+ Spacing = 10,
+ Children =
+ {
+ Row(Loc.T("preferences.menu_bar"), MenuBarPicker()),
+ Row("", Caption(Loc.T("preferences.menu_bar_caption"))),
+ },
+ };
+ }
+
+ private static Control MenuBarPicker()
+ {
+ var settings = App.Services.GetRequiredService<ISettingsService>();
+ var strip = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 2 };
+ var buttons = new List<(bool Shown, ToggleButton Btn)>();
+ void ShowSaved()
+ {
+ bool shown = settings.Current.ShowMenuBar;
+ foreach (var (bs, bb) in buttons) bb.IsChecked = bs == shown;
+ }
+ foreach (var (shown, label) in new[] { (false, Loc.T("preferences.menu_bar_hidden")), (true, Loc.T("preferences.menu_bar_shown")) })
+ {
+ var v = shown;
+ var btn = new ToggleButton { Classes = { "seg" }, FontSize = 12, Content = label };
+ btn.Click += (_, _) =>
+ {
+ if (settings.Current.ShowMenuBar == v) { ShowSaved(); return; }
+ settings.Current.ShowMenuBar = v;
+ settings.Save();
+ };
+ buttons.Add((v, btn));
+ strip.Children.Add(btn);
+ }
+ ShowSaved();
+ var box = new Border { Classes = { "segmented" }, HorizontalAlignment = HorizontalAlignment.Left, Child = strip };
+ var listening = false;
+ void OnChanged() => ShowSaved();
+ box.AttachedToVisualTree += (_, _) =>
+ {
+ ShowSaved();
+ if (listening) return;
+ listening = true;
+ settings.Changed += OnChanged;
+ };
+ box.DetachedFromVisualTree += (_, _) =>
+ {
+ if (!listening) return;
+ listening = false;
+ settings.Changed -= OnChanged;
+ };
+ return box;
+ }
+
// 75–200 % for the whole interface (spec 027, #38). Applies live — this window rescales
// under the pointer too — and is saved for the next launch.
private static Control ScalePicker()
@@ -1447,6 +1508,7 @@ public sealed partial class PreferencesWindow : NotaWindow
Row("", Caption(Loc.T("preferences.phrase_lines_caption"))),
Row(Loc.T("preferences.track_headers"), HeaderSidePicker()),
Row("", Caption(Loc.T("preferences.which_side_of_the_arrangement"))),
+ MenuBarRows(),
Row(Loc.T("preferences.interface_scale"), ScalePicker()),
Row("", Caption(Loc.T("preferences.makes_the_whole_interface_larger"))),
Row(Loc.T("preferences.text_size"), TextSizePicker()),
@@ -1460,6 +1522,11 @@ public sealed partial class PreferencesWindow : NotaWindow
// (the Files tab's sample player). Written with the macOS glyphs; MenuKit.Keys spells them
// Ctrl / Alt / Shift on Windows and Linux. A Key made only of
// keys (see IsKeyToken) is drawn as one key-cap per token; a gesture is plain text.
+ // Windows / Linux: Alt (pressed and released alone) or F10 opens the menu — the Menu key's
+ // while the menu row is hidden (#518). macOS has its menu in the system bar, so Render leaves
+ // the row out there. (A plain row in the list, so the docs' shortcuts generator reads it.)
+ private const string MenuKeysRow = "⌥ F10";
+
private static readonly (string Title, (string Key, string Action)[] Rows)[] ShortcutGroups =
{
(Loc.T("common.file"), new[]
@@ -1473,6 +1540,7 @@ public sealed partial class PreferencesWindow : NotaWindow
}),
(Loc.T("preferences.window"), new[]
{
+ ("⌥ F10", Loc.T("preferences.open_the_menu")), // = MenuKeysRow
("F11", Loc.T("preferences.enter_leave_full_screen_the")),
("⌘⇧F", Loc.T("preferences.the_clip_editor_fills_the")),
(Loc.T("preferences.double_click_a_panel_edge"), Loc.T("preferences.reset_the_detail_panel_the")),
@@ -1730,7 +1798,7 @@ public sealed partial class PreferencesWindow : NotaWindow
var words = _shortcutFilter.Split(' ', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
foreach (var (title, rows) in ShortcutGroups)
{
- var shown = rows.Where(r => words.All(w => title.Contains(w, StringComparison.OrdinalIgnoreCase)
+ var shown = rows.Where(r => (MainWindow.HasMenuKey || r.Key != MenuKeysRow) && words.All(w => title.Contains(w, StringComparison.OrdinalIgnoreCase)
|| MenuKit.Keys(r.Action).Contains(w, StringComparison.OrdinalIgnoreCase)
|| MenuKit.Keys(r.Key).Contains(w, StringComparison.OrdinalIgnoreCase))).ToList();
if (shown.Count == 0) continue;
diff --git a/src/managed/Nota.Application/Localization/en.json b/src/managed/Nota.Application/Localization/en.json
index 200b4229..7c6830ee 100644
--- a/src/managed/Nota.Application/Localization/en.json
+++ b/src/managed/Nota.Application/Localization/en.json
@@ -554,6 +554,7 @@
"commands.settings_updates": "Settings: Updates",
"commands.show_arrangement": "Show Arrangement",
"commands.show_devices": "Show devices",
+ "commands.show_menu_bar": "Show menu bar",
"commands.show_mixer": "Show Mixer",
"commands.show_modular": "Show Modular",
"commands.show_playhead": "Show playhead",
@@ -2284,6 +2285,8 @@
"main.commands.envelopes_follow_clips": "Envelopes follow clips",
"main.commands.envelopes_locked_clip_moves_keep": "Envelopes locked — clip moves keep automation in place",
"main.commands.grouped_tracks": "Grouped tracks",
+ "main.commands.menu_bar_hidden": "Menu bar hidden — the whole menu is under the Menu key",
+ "main.commands.menu_bar_shown": "Menu bar shown",
"main.commands.no_notes_outside_the_scale": "No notes outside the scale",
"main.commands.nothing_to_undo": "Nothing to undo",
"main.commands.open_a_midi_clip_first": "Open a MIDI clip first",
@@ -2512,6 +2515,7 @@
"main.map_a_controller_click_a": "Map a controller — click a control, then move a knob on the controller",
"main.master_volume": "Master volume",
"main.measuring": "measuring…",
+ "main.menu": "Menu",
"main.menu.clip_names_every_clip": "Clip names: every clip",
"main.menu.clip_names_first_of_a": "Clip names: first of a run",
"main.menu.clip_names_none": "Clip names: none",
@@ -2638,6 +2642,7 @@
"main.set_the_tempo_drag_or": "Set the tempo — drag, or double-click to type",
"main.set_the_time_signature_drag": "Set the time signature — drag each field",
"main.settings": "Settings…",
+ "main.show_menu_bar": "Show menu bar",
"main.show_playhead": "Show playhead",
"main.snap_clips_to_the_grid": "Snap clips to the grid (hold Alt to drag freely)",
"main.snap_off_clips_position_freely": "Snap off — clips position freely",
@@ -3530,6 +3535,11 @@
"preferences.look_new": "New",
"preferences.look_classic": "Classic",
"preferences.look_caption": "Classic brings back the colours, corners and monospaced values of Nota 0.59, over any theme.",
+ "preferences.menu_bar": "Menu bar",
+ "preferences.menu_bar_caption": "The row of File, Edit, View… under the title bar. Hidden, the whole menu is under the Menu key at the start of the transport bar, and Alt or F10 opens it. Also in the View menu.",
+ "preferences.menu_bar_hidden": "Hidden",
+ "preferences.menu_bar_shown": "Shown",
+ "preferences.open_the_menu": "Open the menu (Windows, Linux)",
"preferences.outputs_pairs": "Output pairs",
"preferences.outputs_click": "Click",
"preferences.outputs_click_both": "Both",
diff --git a/src/managed/Nota.Application/Palette/CommandCatalog.cs b/src/managed/Nota.Application/Palette/CommandCatalog.cs
index ababac3a..0ff63215 100644
--- a/src/managed/Nota.Application/Palette/CommandCatalog.cs
+++ b/src/managed/Nota.Application/Palette/CommandCatalog.cs
@@ -78,6 +78,8 @@ public static class CommandCatalog
C("view.history", Loc.T("commands.show_version_history"), Loc.T("commands.view"), "", "undo history versions snapshots"),
C("view.midiLearn", Loc.T("commands.midi_learn"), Loc.T("commands.view"), "", "map controller"),
C("view.fullscreen", Loc.T("commands.toggle_full_screen"), Loc.T("commands.view"), Shortcut.None("F11"), "maximize immersive hide chrome"),
+ C("view.menuBar", Loc.T("commands.show_menu_bar"), Loc.T("commands.view"), "", "menu bar menubar hamburger file edit row classic",
+ hide: OperatingSystem.IsMacOS()), // macOS keeps its menu in the system bar (#518)
C(Palette, Loc.T("commands.command_palette"), Loc.T("commands.view"), Shortcut.CmdShift('P'), "search", hide: true),
// ---- Transport --------------------------------------------------------------------
diff --git a/src/managed/Nota.Application/Settings.cs b/src/managed/Nota.Application/Settings.cs
index 56944120..64c035b1 100644
--- a/src/managed/Nota.Application/Settings.cs
+++ b/src/managed/Nota.Application/Settings.cs
@@ -182,6 +182,10 @@ public sealed class Settings
/// <summary>The arrangement's track-header column sits on the right of the lanes (#72);
/// off = on the left. View ▸ Track headers on the right, or Settings → Appearance.</summary>
public bool ArrangementHeadersRight { get; set; }
+ /// <summary>Windows / Linux: the in-window menu row (File, Edit, View…) is shown (#518).
+ /// Off — the default — the Menu key at the start of the transport bar gives the whole menu,
+ /// and Alt / F10 open it. View ▸ Show menu bar, or Settings → Appearance. Ignored on macOS.</summary>
+ public bool ShowMenuBar { get; set; }
/// <summary>How audio clips draw their waveform on the lanes (Settings → Appearance):
/// 0 smooth — the peak outline around its RMS body (default; was bars before #267, so a
/// saved 0 moves to the new default), 1 solid — one column per pixel, 2 bars — spaced
diff --git a/tests/Nota.SmokeTest/LocalizationAllowList.txt b/tests/Nota.SmokeTest/LocalizationAllowList.txt
index e3e9a069..76be8638 100644
--- a/tests/Nota.SmokeTest/LocalizationAllowList.txt
+++ b/tests/Nota.SmokeTest/LocalizationAllowList.txt
@@ -2509,6 +2509,7 @@ Nota.Application/Palette/CommandCatalog.cs map controller # data: search keyword
Nota.Application/Palette/CommandCatalog.cs markers locators # data: search keyword or alias of the palette and the browser, not shown
Nota.Application/Palette/CommandCatalog.cs maximize immersive hide chrome # data: search keywords, device and node names, category ids (FR-004; what is drawn goes through Loc)
Nota.Application/Palette/CommandCatalog.cs maximize maximise full detail panel piano roll restore split # data: search keywords, device and node names, category ids (FR-004; what is drawn goes through Loc)
+Nota.Application/Palette/CommandCatalog.cs menu bar menubar hamburger file edit row classic # data: search keywords, device and node names, category ids (FR-004; what is drawn goes through Loc)
Nota.Application/Palette/CommandCatalog.cs multi clip several open piano roll # data: search keywords, device and node names, category ids (FR-004; what is drawn goes through Loc)
Nota.Application/Palette/CommandCatalog.cs mute disable # data: search keyword or alias of the palette and the browser, not shown
Nota.Application/Palette/CommandCatalog.cs overdub replace take pass loop record # data: search keywords, device and node names, category ids (FR-004; what is drawn goes through Loc)
diff --git a/tests/Nota.SmokeTest/MenuMirrorTests.cs b/tests/Nota.SmokeTest/MenuMirrorTests.cs
new file mode 100644
index 00000000..374b5c16
--- /dev/null
+++ b/tests/Nota.SmokeTest/MenuMirrorTests.cs
@@ -0,0 +1,65 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.
+//
+// The Menu key's menu (#518, specs/093): the copy MenuMirror makes of the application menu
+// matches its source entry for entry — order, separators, submenus, labels, shortcuts, check
+// marks, enabled and visible state, tooltips — and a copy made after the source changed shows
+// the change (the key's menu is rebuilt at every opening, never kept).
+
+using Avalonia.Controls;
+using Avalonia.Input;
+using Nota.App;
+
+internal static class MenuMirrorTests
+{
+ public static IEnumerable<(bool, string)> Run()
+ {
+ var snap = new NativeMenuItem("Snap to grid") { ToggleType = MenuItemToggleType.CheckBox, IsChecked = true };
+ var recent = new NativeMenu();
+ recent.Items.Add(new NativeMenuItem("No recent projects") { IsEnabled = false });
+ var file = new NativeMenu();
+ file.Items.Add(new NativeMenuItem("New") { Gesture = new KeyGesture(Key.N, KeyModifiers.Control) });
+ file.Items.Add(new NativeMenuItem("Open recent") { Menu = recent });
+ file.Items.Add(new NativeMenuItemSeparator());
+ file.Items.Add(new NativeMenuItem("Exit") { Gesture = new KeyGesture(Key.Q, KeyModifiers.Control) });
+ var grid = new NativeMenu();
+ grid.Items.Add(snap);
+ grid.Items.Add(new NativeMenuItem("Triplet grid") { ToggleType = MenuItemToggleType.CheckBox });
+ var edit = new NativeMenu();
+ edit.Items.Add(new NativeMenuItem("Undo") { Gesture = new KeyGesture(Key.Z, KeyModifiers.Control) });
+ edit.Items.Add(new NativeMenuItem("Grid") { Menu = grid });
+ var root = new NativeMenu();
+ root.Items.Add(new NativeMenuItem("File") { Menu = file });
+ root.Items.Add(new NativeMenuItem("Edit") { Menu = edit });
+ root.Items.Add(new NativeMenuItem("Help"));
+
+ string source = MenuMirror.Describe(root);
+ var copy = MenuMirror.Build(root);
+ string mirrored = MenuMirror.Describe(copy);
+ int lines = source.Count(c => c == '\n');
+ yield return (lines == 12 && source == mirrored,
+ source == mirrored ? $"the Menu key's copy matches the menu ({lines} entries, submenus, separators, shortcuts, checks)"
+ : $"the Menu key's copy differs:\n{source}\nvs\n{mirrored}");
+
+ // Change the source as the app does between two openings: a check mark flips, the
+ // recent list is rebuilt, an item is hidden.
+ snap.IsChecked = false;
+ recent.Items.Clear();
+ recent.Items.Add(new NativeMenuItem("My__song") { ToolTip = "/music/My_song.nota" });
+ ((NativeMenuItem)root.Items[2]).IsVisible = false;
+ string after = MenuMirror.Describe(root);
+ string remirrored = MenuMirror.Describe(MenuMirror.Build(root));
+ yield return (after != source && after == remirrored,
+ after == remirrored ? "a copy made after a change shows it (check mark, recent list, hidden item)"
+ : $"the second copy is stale:\n{after}\nvs\n{remirrored}");
+
+ // Picking a copied item runs the source item's click.
+ int clicks = 0;
+ var exit = (NativeMenuItem)file.Items[3];
+ exit.Click += (_, _) => clicks++;
+ var copyFile = (MenuItem)MenuMirror.Build(root)[0];
+ var copyExit = copyFile.Items.OfType<MenuItem>().Last();
+ copyExit.RaiseEvent(new Avalonia.Interactivity.RoutedEventArgs(MenuItem.ClickEvent));
+ yield return (clicks == 1, $"picking a copied item runs the menu's own item (clicks: {clicks})");
+ }
+}
diff --git a/tests/Nota.SmokeTest/Nota.SmokeTest.csproj b/tests/Nota.SmokeTest/Nota.SmokeTest.csproj
index 2c583628..162fc100 100644
--- a/tests/Nota.SmokeTest/Nota.SmokeTest.csproj
+++ b/tests/Nota.SmokeTest/Nota.SmokeTest.csproj
@@ -43,6 +43,8 @@
<ItemGroup>
<PackageReference Include="Avalonia" Version="12.1.4" />
<Compile Include="..\..\src\managed\Nota.App\Input\ShortcutAvaloniaExtensions.cs" Link="ShortcutAvaloniaExtensions.cs" />
+ <!-- The Menu key's copy of the application menu (specs/093; Avalonia base only). -->
+ <Compile Include="..\..\src\managed\Nota.App\MenuMirror.cs" Link="MenuMirror.cs" />
<!-- What's New's changelog / release-notes parsers (no Avalonia inside). -->
<Compile Include="..\..\src\managed\Nota.App\Changelog.cs" Link="Changelog.cs" />
<!-- Which language of the manual the app opens (nota#539; no Avalonia inside). -->
diff --git a/tests/Nota.SmokeTest/Program.cs b/tests/Nota.SmokeTest/Program.cs
index e9eeb5ce..acc521bc 100644
--- a/tests/Nota.SmokeTest/Program.cs
+++ b/tests/Nota.SmokeTest/Program.cs
@@ -190,6 +190,14 @@ if (args.Length >= 1 && args[0] == "--palette")
Console.WriteLine(failures == 0 ? "PALETTE PASSED" : $"PALETTE FAILED ({failures})");
return failures == 0 ? 0 : 1;
}
+// The Menu key's menu copy alone: `--menu-mirror`.
+if (args.Length >= 1 && args[0] == "--menu-mirror")
+{
+ Console.WriteLine("-- menu key --");
+ foreach (var (ok, label) in MenuMirrorTests.Run()) Check(ok, label);
+ Console.WriteLine(failures == 0 ? "MENU MIRROR PASSED" : $"MENU MIRROR FAILED ({failures})");
+ return failures == 0 ? 0 : 1;
+}
// Shortcut builder alone: `--shortcuts`.
if (args.Length >= 1 && args[0] == "--shortcuts")
{
@@ -15894,6 +15902,10 @@ foreach (var (ok, label) in ShortcutBuilderTests.Run()) Check(ok, label);
Console.WriteLine("-- command palette --");
foreach (var (ok, label) in PaletteTests.Run()) Check(ok, label);
+// --- the Menu key's copy of the application menu (#518, specs/093) ---
+Console.WriteLine("-- menu key --");
+foreach (var (ok, label) in MenuMirrorTests.Run()) Check(ok, label);
+
// --- context menus: "Add track ▸ Recent" list rules (spec 034) ---
Console.WriteLine("-- recent instruments --");
foreach (var (ok, label) in RecentInstrumentsTests.Run()) Check(ok, label);