Skip to content

feat(editor): the menu bar (workspace-shell B4) - #196

Merged
byrongamatos merged 3 commits into
mainfrom
feat/editor-menu-bar
Jul 11, 2026
Merged

byrongamatos merged 3 commits into
mainfrom
feat/editor-menu-bar

Conversation

@ChrisBeWithYou

@ChrisBeWithYou ChrisBeWithYou commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

What

The workspace-shell's nine-menu bar (charrette §2.2 / D-C2): File · Edit · Add · Note · Part · View · Transport · Tempo/Grid · Help, re-homing the EDITOR_SHORTCUT_COMMANDS registry organized by musical object — Tempo/Grid is the time-model pillar's own top-level menu.

A re-presentation, not a re-plumb. Registry items dispatch through input.js's _editorRunEofCommand (now exported — the exact switch the keyboard uses), and the pre-registry file/panel actions (New/Open/Build/Replace-audio/mixers) call their existing window.editor* entry points. Nothing is implemented twice.

Locked behaviors

  • Accelerators follow the active shortcut profile. Dropdowns render at open time from _editorShortcutRowsPure(profile), so a FeedBack ⇄ EOF Legacy swap relabels every accelerator with zero swap-time bookkeeping (Help has a profile-swap item that demonstrates it live).
  • status:'planned' commands render greyed with a "soon" tag and never dispatch — no false rungs.
  • Mode discipline: sync-point items grey outside Tempo Map mode (they act on a selected sync point); Sync-to-audio hides entirely without a recording.
  • No Alt-mnemonics (browsers/hosts own Alt+F): click-open + arrow-nav + Enter/Escape, the charrette's sanctioned fallback. Menu keystrokes stop propagation so the canvas shortcut layer never sees them.
  • The document-level click-away listener rides the teardown registry — re-injection can't stack copies.

Deliberate adaptations (noted for review)

  • Flyout submenus (Import ▸, Techniques ▸) render as in-menu section headers: same disclosure, no nested-popover machinery; B5 can graduate them.
  • Charrette items with no implementation behind them (Vocals, Chord palette, Bake stems, density presets → B5) are not invented as dead rows — greyed+soon is reserved for registry-backed planned commands.

Tests

tests/menu_model.test.mjs (10, real-import): every registry-backed item resolves to a live registry id (the menu can't dangle as the registry evolves), exactly one home per command, profile-swap relabels accelerators, planned items greyed + dispatch-less, both mode gates, missing entry points grey instead of crash, vanished ids drop cleanly, no menu renders empty. Full suite 91/91 · ESLint 0 errors · CHANGELOG updated.

Screenshots (Tempo/Grid gating + SOON tags, the Note technique catalog, File under the EOF profile) shared with Christian during review.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EBQCHCNA81E9tHmSDHSe2Q

Summary by CodeRabbit

  • New Features
    • Added a revamped, top-of-screen editor menu bar with organized menus, dropdown panels, and improved interaction (including click-open behavior with keyboard navigation).
    • Menu commands now reflect the active shortcut profile for accelerator labels and support full keyboard navigation.
  • Bug Fixes
    • Prevented duplicate event listeners when the editor screen is reloaded.
  • Tests
    • Added menu model tests covering menu structure, shortcut labeling, command gating (including “soon” states), and safe command activation (mode/audio/window-entry rules).

Nine menus (File / Edit / Add / Note / Part / View / Transport / Tempo-Grid /
Help) re-homing the EDITOR_SHORTCUT_COMMANDS registry, organized by musical
object per charrette $2.2 — Tempo/Grid is the time-model pillar's own
top-level menu. A RE-PRESENTATION, never a re-plumb: registry items dispatch
through input.js's _editorRunEofCommand (now exported — the same switch the
keyboard uses), and the handful of pre-registry file/panel actions call their
existing window.editor* entry points. Nothing is implemented twice.

- Accelerators FOLLOW the active shortcut profile: dropdown content renders
  at OPEN time from _editorShortcutRowsPure(profile), so a FeedBack <-> EOF
  swap relabels every accelerator with zero swap-time bookkeeping.
- status:'planned' commands render greyed with a 'soon' tag and never
  dispatch (no false rungs).
- Mode discipline: sync-point items grey outside Tempo Map mode (they act on
  a selected sync point); Sync-to-audio HIDES without a recording.
- No Alt-mnemonics (browsers/hosts own Alt+F and friends): click-open +
  arrow-nav + Enter/Escape, the charrette's sanctioned fallback. Menu
  keystrokes stop propagation — the canvas shortcut layer never sees them.
- Flyout submenus (Import etc.) render as in-menu section headers for now:
  same disclosure, no nested-popover machinery. Charrette items with nothing
  behind them (Vocals, Chord palette, Bake stems) are NOT invented as dead
  rows — greyed+soon is reserved for registry-backed planned commands.
- The one document-level listener (click-away) rides the teardown registry.

tests/menu_model.test.mjs (10): every registry-backed item resolves to a
live registry id (no dangling ids as the registry evolves), one home per
command, profile-swap relabels accelerators, planned items are greyed and
dispatch-less, the two mode gates, missing entry points grey instead of
crash, vanished registry ids drop instead of dangling, and no menu renders
empty. Suite 91/91, ESLint 0 errors.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EBQCHCNA81E9tHmSDHSe2Q
Signed-off-by: ChrisBeWithYou <chris@rifflarr.local>
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f31a9023-fe90-4648-bc08-60e2644ae3b7

📥 Commits

Reviewing files that changed from the base of the PR and between 3f4a73c and be4c1b4.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • assets/v3-theme.css
  • screen.html
  • src/main.js

📝 Walkthrough

Walkthrough

Adds a nine-menu editor menu bar backed by the command registry and active shortcut profile. It supports state-gated and planned commands, command or window-function dispatch, keyboard and click interactions, click-away teardown, scoped styling, editor initialization, and menu-model tests.

Changes

Editor menu bar

Layer / File(s) Summary
Menu specification and model contracts
src/menu-bar.js, tests/menu_model.test.mjs
Defines the menu structure, resolves registry commands and accelerators, applies tempo-map/audio/planned states, and tests ordering, uniqueness, visibility, dispatchability, and separator structure.
Menu rendering, dispatch, and editor wiring
src/input.js, src/menu-bar.js, screen.html, src/main.js
Exports the shared command dispatcher, renders interactive dropdowns, dispatches menu actions, and mounts and initializes the menu bar.
Menu presentation and release documentation
assets/v3-theme.css, CHANGELOG.md
Adds scoped menu bar styling and documents the implementation and interaction behavior.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  actor EditorUser
  participant MenuBar
  participant MenuModel
  participant CommandDispatcher
  participant WindowFunction
  EditorUser->>MenuBar: Open menu
  MenuBar->>MenuModel: Resolve current registry and editor state
  MenuModel-->>MenuBar: Return menu items and accelerator states
  EditorUser->>MenuBar: Activate item
  MenuBar->>CommandDispatcher: Dispatch command item
  MenuBar->>WindowFunction: Invoke function item when available
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding the editor menu bar for workspace-shell B4.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/editor-menu-bar
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch feat/editor-menu-bar

Comment @coderabbitai help to get the list of available commands.

byrongamatos and others added 2 commits July 11, 2026 18:13
editorToggleStemMixer has no implementation anywhere (the screen.html
toolbar button that calls it is class="hidden"), so windowFns() never
found it and the View menu rendered a permanently-greyed row. Remove the
item; wiring the function is out of scope. 91 test files green, lint clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants