feat(editor): toggleable toolbars + density presets (workspace-shell B5) - #205
Conversation
The flat toolbar row's divider-groups become eight named, individually toggleable toolbars (File/Parts/Edit/Transport/Grid/Tempo/Harmony/ Overlays) behind layout-inert display:contents wrappers, with task-based density presets (Compose/Transcribe/Everything), a View menu checklist, a right-click checklist on the row, and Reset layout. State is an editor pref (editorToolbars, never the pack), never auto-reverts, and the key-controls auto-show survives as a sticky Harmony reveal that never overrides an explicit hide. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EBQCHCNA81E9tHmSDHSe2Q
|
Warning Review limit reached
Next review available in: 17 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughAdds eight toggleable editor toolbar groups with density presets, persisted visibility, View-menu and context-menu controls, reset behavior, CSS hiding, and Harmony auto-reveal integration. ChangesToolbar visibility system
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Editor
participant ViewMenu
participant toolbars.js
participant localStorage
participant ToolbarDOM
Editor->>ViewMenu: Open View > Toolbars
ViewMenu->>toolbars.js: Toggle toolbar or apply preset
toolbars.js->>localStorage: Save editorToolbars preference
toolbars.js->>ToolbarDOM: Apply editor-tb-off classes
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/toolbars.js`:
- Line 67: Update all preset validation checks in the state-loading paths at the
visible line and the corresponding checks near lines 85 and 109-110 to require
an own property of TOOLBAR_PRESETS, rejecting inherited names such as toString,
constructor, and __proto__. Preserve valid preset handling, and add a regression
test covering malformed inherited preset names.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 979ccb21-1f3f-41ee-9197-d76e61bcb6b1
📒 Files selected for processing (8)
CHANGELOG.mdassets/v3-theme.cssscreen.htmlsrc/key-view.jssrc/main.jssrc/menu-bar.jssrc/toolbars.jstests/toolbars.test.mjs
applyToolbars() only flipped the editor-tb-off classes; because the toolbar row is flex-wrap + shrink-0 above the flex-1 canvas wrap, a show/hide that changes the wrapped-line count reflows the canvas height, leaving the backing store and setLaneMetrics stale (blurry render + Y hit-test offset until the next resize). Call the rAF-deferred host.scheduleCanvasResize hook after the class flip — covers all four callers (toggle/preset/reset/reveal) since they funnel through here. Also move the Harmony group's trailing divider inside its .editor-tb wrapper so it hides with the group instead of orphaning before Shortcuts. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
# Conflicts: # CHANGELOG.md # src/menu-bar.js
What
The flat toolbar row's divider-groups become eight named, individually toggleable toolbars — File · Parts · Edit · Transport · Grid · Tempo · Harmony · Overlays — with task-based density presets (workspace-shell B5, charrette §2.3/§3.1/D-C4):
editorToolbarsin localStorage — never the pack). First run (no pref) = Everything, i.e. exactly today's surface. The surface never auto-reverts to a lighter preset.How
screen.htmlis wrapped in a.editor-tbspan withdisplay: contents— layout-inert, so the fully-shown row renders pixel-identical to the old flat markup. Hiding a toolbar is one CSS class flip (display:nonebeatscontents); zero canvas cost, zero re-plumbing. One toolbar id may span several wrappers (grid= the zoom chunk + the snap chunk).src/toolbars.jsowns a pure@pure:toolbar-stateblock (preset maps, load/validate, toggle/preset/reveal/visibility) + the thin DOM/persistence layer. Garbage pref blobs degrade key-by-key to defaults.tb/tbPreset/tbReset) resolved in_menuModelPurefrom actx.toolbarssnapshot — a ctx without it (older callers/tests) renders the rows unchecked, never dangling.host.addGlobalListenerinto the teardown registry; the row's contextmenu listener is in-DOM and dies with the screen (same discipline as B4).TOOLBAR_GROUPSwhen it does; the Transport cluster (loop/claps/click/count) takes its slot for now.Tests
tests/toolbars.test.mjs(21, real-import ESM; fail on main — the module doesn't exist there): preset nesting + coverage, garbage-blob degradation, effective-visibility precedence (override > reveal > preset), toggle round-trip, preset/reset purity, sticky reveal that never fights an explicit hide, pref round-trip across a simulated screen re-boot, blocked-localStorage degradation, View-menu checklist rows (checked/unchecked, degraded ctx), the teardown-registry discipline (never a baredocument.addEventListener), and multi-wrapper visibility (gridchunks flip together).Full suite 102/102; ESLint clean (0 errors, warn-ratchet unchanged).
🤖 Generated with Claude Code
https://claude.ai/code/session_01EBQCHCNA81E9tHmSDHSe2Q
Summary by CodeRabbit