Skip to content

[mac] Add View → Hide Toolbar (⌥⌘T) for focused writing#292

Merged
Shpigford merged 1 commit into
mainfrom
toggle-toolbar
Apr 29, 2026
Merged

[mac] Add View → Hide Toolbar (⌥⌘T) for focused writing#292
Shpigford merged 1 commit into
mainfrom
toggle-toolbar

Conversation

@Shpigford

Copy link
Copy Markdown
Owner

Summary

  • Adds a custom View → Hide Toolbar menu item (⌥⌘T) that flips window.toolbar?.isVisible from ClearlyAppDelegate, persisted in UserDefaults("toolbarHidden").
  • When the toolbar is hidden, traffic lights also fade out and reappear via a NSEvent mouseMoved monitor when the cursor enters the top ~50pt of the window — a true focus-mode chrome hide.
  • Scrubs AppKit's auto-injected "Hide Toolbar" / "Customize Toolbar…" items so they don't race with the custom action; filters the Settings window from the main-window lookup so its toolbar isn't accidentally affected; tracks window-identity changes so a close+reopen of the document window restores hidden-mode state on the new NSWindow.

Fixes #287

Test plan

  • Press ⌥⌘T → toolbar items + plate collapse, traffic lights fade out
  • Move cursor toward the top of the window → traffic lights fade in; move down → fade out
  • ⌥⌘T again → full chrome restored, lights stay solid
  • Quit + relaunch with toolbar hidden → still hidden on launch, menu reads "Show Toolbar"
  • All keyboard shortcuts still work in hidden mode (⌘1, ⌘2, ⇧⌘O, ⇧⌘B, ⌘F, ⌘P, ⇧⌘F)
  • Open Settings (⌘,), then ⌥⌘T from main window → only main toolbar toggles, Settings chrome unaffected

Toggles `window.toolbar?.isVisible` from a custom NSMenuItem injected into
the View menu. State persists in UserDefaults("toolbarHidden"). When the
toolbar is hidden, traffic lights also fade out and reappear on hover near
the top of the window. Scrubs the AppKit-auto-injected "Hide Toolbar" /
"Customize Toolbar…" items so they don't race with the custom action.

Fixes #287
@Shpigford
Shpigford merged commit 95c2e40 into main Apr 29, 2026
4 checks passed
@Shpigford
Shpigford deleted the toggle-toolbar branch April 29, 2026 11:00
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.

Option to Toggle Toolbar

1 participant