Skip to content

fix(main): restore Cmd+Q and About menu, fix icon and fullscreen issues#55

Merged
flexiondotorg merged 8 commits intomainfrom
tidy
Mar 26, 2026
Merged

fix(main): restore Cmd+Q and About menu, fix icon and fullscreen issues#55
flexiondotorg merged 8 commits intomainfrom
tidy

Conversation

@flexiondotorg
Copy link
Copy Markdown
Member

Summary

Fixes critical issues affecting menu functionality and window behaviour. Restores Cmd+Q quit functionality and About menu on macOS, prevents About and splash windows from entering fullscreen, and corrects SF Symbol icon rendering with proper sizing and theme adaptation.

Changes

  • Restore Cmd+Q quit functionality on macOS via app menu
  • Add About menu item to main application menu
  • Prevent About and splash windows from entering fullscreen
  • Fix SF Symbol icon rendering with correct size and theme
  • Extract pause timer logic into reusable utility module
  • Extract tray state machine logic into initTrayStateManager function
  • Add comprehensive tests for tray state management and pause timer utility
  • Suppress empty menu bar on macOS

Testing

  • Verify Cmd+Q closes application on macOS
  • Verify About menu item appears and opens dialog
  • Verify About and splash windows stay in windowed mode
  • Verify SF Symbol icons display with correct sizing and adapt to light/dark theme
  • Tray state machine tests passing
  • Pause timer utility tests passing

Move tray event listener setup and state management from
setupContentHandlers() into a dedicated function. Encapsulates 6 closure
variables, 3 event listeners, and a cleanup function. No behaviour
change.

Signed-off-by: Martin Wimpress <code@wimpress.io>
Set application menu to an empty template on macOS instead of null,
which fully suppresses the menu bar. Preserve existing behaviour on
Linux and Windows.

Signed-off-by: Martin Wimpress <code@wimpress.io>
Add 14 new test cases covering:
- Event subscription (nowPlayingItemDidChange, playbackStateDidChange,
  volumeDidChange)
- Pause timeout lifecycle (starts after pause, clears on cleanup, fires
  after 30s)
- Artwork download handling (fetches when now playing changes, handles
  failures)
- Cleanup function (removes all event listeners, clears pause timer)
- Volume updates (rebuilds menu when volume changes)

Signed-off-by: Martin Wimpress <code@wimpress.io>
- Create pauseTimer.ts with PauseTimer interface and createPauseTimer
  factory
- Replace inline timer management in discord-presence with
  createPauseTimer
- Replace inline timer management in tray with createPauseTimer
- Add comprehensive test coverage for pause timer behaviour (start,
  cancel, restart, destroy)

Improves code reusability and testability by centralizing pause timeout
logic.

Signed-off-by: Martin Wimpress <code@wimpress.io>
- Add hslShift [-1, 0, 1] parameter to mark image as template, enabling
  automatic colour adaptation to menu text (light/dark theme)
- Resize SF Symbols to 18px with HiDPI representations (1x and 2x)
- Update getMenuIcon to generate properly scaled multi-representation
  images
- Update test mocks to reflect resize and toPNG method calls

Signed-off-by: Martin Wimpress <code@wimpress.io>
- Add fullscreenable and fullscreen options to About window creation
- Add fullscreenable and fullscreen options to splash screen creation

Fixes macOS fullscreen behaviour on About and splash windows.

Signed-off-by: Martin Wimpress <code@wimpress.io>
- Replace empty application menu template with minimal one
- Include quit role to enable Cmd+Q shortcut
- Menu bar remains effectively invisible on macOS

Signed-off-by: Martin Wimpress <code@wimpress.io>
- Add productName to package.json for correct app name display
- Restore minimal app menu with Cmd+Q quit and About window option on
  macOS
- Export showAboutWindow from tray module for menu integration

Signed-off-by: Martin Wimpress <code@wimpress.io>
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 8 files

Requires human review: This PR involves a significant refactor, moving core tray state management and pause timer logic into new modules, which qualifies as high-impact and requires human review.

@flexiondotorg flexiondotorg merged commit e53d3b1 into main Mar 26, 2026
12 checks passed
@flexiondotorg flexiondotorg deleted the tidy branch March 26, 2026 17:13
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.

1 participant