Skip to content

feat: display timer in macOS tray#682

Open
devalnor wants to merge 1 commit intozidoro:masterfrom
devalnor:osx-tray-timer
Open

feat: display timer in macOS tray#682
devalnor wants to merge 1 commit intozidoro:masterfrom
devalnor:osx-tray-timer

Conversation

@devalnor
Copy link

This PR adds a new feature for macOS users that displays the active timer countdown directly in the tray bar. When enabled, the timer replaces the app icon in the tray with a text display showing the remaining time.

Features

  • Display the active timer countdown in the macOS menu bar
  • Automatically hide the tray icon when displaying the timer text
  • Restore the normal icon when the timer is not active
  • Add a user preference toggle in Settings to enable/disable this feature
  • The setting is only visible for macOS users and enabled by default

Technical Implementation

  • Added a new showTimerInTray setting to the app configuration
  • Modified the tray icon update logic to handle the timer display
  • Used a transparent icon when displaying the timer text to avoid redundancy
  • Implemented proper state handling for timer start/stop and preference changes

Testing

  • Build succed on OSX. Not tested because I don't have a valid certificate.

Note: This PR was created with support of Cursor with Claude AI 3.7.
It literally took me 10 minutes to implement this feature.
I reviewed all of the generated code.

@sekwah41
Copy link
Collaborator

WIll take a look tomorrow night :)

autoStartWorkTime: false,
useNativeTitlebar: detectOS() === "Windows" ? false : true,
openAtLogin: false,
showTimerInTray: detectOS() === "MacOS",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I need to take a look as I haven't open the code for this in a while but you'll also need to check if this is the electron version as to if you show this. Otherswise you could also add the rust code to implement it on the tauri side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants