Skip to content

Add File > Print… (⌘P) to the macOS menu bar - #110

Merged
mberman84 merged 1 commit into
mainfrom
fix/macos-print-menu
Nov 27, 2026
Merged

mberman84 merged 1 commit into
mainfrom
fix/macos-print-menu

Conversation

@mberman84

Copy link
Copy Markdown
Collaborator

Problem

On macOS, Folio uses Electron's default application menu, so the File menu only has Close Window and no Print… item. People looking in the menu bar to print can't find it (#106).

Change

  • Added a macOS application menu (setupMacMenu in electron/main.cjs) keeping Electron's standard App, Edit, View, and Window menus and adding File → Print… (⌘P) above Close Window.
  • Kept File → Print… disabled when no document is open (Library screen or no window) and enabled automatically as tabs open, close, or switch via folio:can-print.
  • Wired folio:menu-command ("print") through preload.cjs into the active reader tab, ignoring it while a modal dialog or print preview is already open.
  • Added macOS menu bar assertions to scripts/smoke-print.mjs verifying disabled/enabled state, modal guard, and opening the Print dialog from File → Print….

Issue or approval

Closes #106.

How I checked it

  • Verified on macOS (darwin): npm run build (tsc --noEmit && vite build) and node scripts/smoke-print.mjs, confirming File → Print… (CommandOrControl+P) starts disabled on the Library screen, enables when a PDF opens, does not open behind Settings, and opens the Print dialog when clicked.
  • Windows and Linux builds and smoke tests run in GitHub Actions CI.

Implemented with Gemini 4 Neon in T3 Code.

@mberman84
mberman84 merged commit 3128d7c into main Nov 27, 2026
5 of 6 checks passed
@mberman84
mberman84 deleted the fix/macos-print-menu branch November 27, 2026 23:52
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.

macOS: add File > Print… (⌘P) to the menu bar

1 participant