Skip to content

feat: add customizable tray menu with template-based display#96

Open
Serdnaley wants to merge 1 commit intosolidtime-io:mainfrom
Serdnaley:feat/tray-menu
Open

feat: add customizable tray menu with template-based display#96
Serdnaley wants to merge 1 commit intosolidtime-io:mainfrom
Serdnaley:feat/tray-menu

Conversation

@Serdnaley
Copy link
Copy Markdown

@Serdnaley Serdnaley commented Apr 2, 2026

Summary

Adds a colored project and template of the tray menu in settings. Still not validated on all platforms and a bit risky to merge it yet I guess, but may be someone can help me checking it on other OS and leave some feedback so I can adjust it for the main version.

telegram-cloud-photo-size-2-5364015812127167276-y
telegram-cloud-photo-size-2-5364015812127167275-y

  • Replaces the simple timer-only tray title with a canvas-rendered display that supports configurable templates
  • Adds @napi-rs/canvas for native tray icon + text compositing, enabling colored project names directly in the menu bar / system tray
  • Introduces a trayTemplate setting with placeholders: {hours}, {minutes}, {seconds}, {project}, {project_colored}, {description}, {task}
  • Adds a live preview and template editor in the Settings page
  • Supports dark/light mode with proper text colors

Changes

File Description
src/main/tray.ts Canvas-based tray rendering with template parsing, segment coloring, and icon compositing
src/main/settings.ts New trayTemplate setting with persistence
src/renderer/src/pages/SettingsPage.vue Template editor with live preview
src/renderer/src/components/MainTimeEntryTable.vue Pass project/task info to tray via IPC
src/renderer/src/utils/settings.ts Reactive trayTemplate binding
src/preload/main.ts, src/preload/interface.d.ts New updateTrayTemplate IPC channel
src/renderer/src/utils/tray.ts Extended type to include project/task data
package.json Added @napi-rs/canvas dependency

Screenshots

The tray now renders like: 🕐 01:23:45 – Project Name with the project name in its assigned color.

(Will add actual screenshots if requested)

Test plan

  • Verify tray displays timer with default template on macOS
  • Verify tray displays timer on Windows/Linux with dark and light themes
  • Change template in Settings and confirm tray updates live
  • Remove project placeholder from template and confirm timer-only display works
  • Stop timer and confirm tray returns to inactive icon
  • Restart app and confirm template persists from settings

Replace the simple timer-only tray title with a canvas-rendered display
that supports configurable templates with placeholders for time, project
name (with color), task, and description.

- Add @napi-rs/canvas for native tray icon + text compositing
- Add trayTemplate setting with configurable placeholders:
  {hours}, {minutes}, {seconds}, {project}, {project_colored},
  {description}, {task}
- Pass project/task info from renderer to main process via IPC
- Add live preview and template editor in Settings page
- Support dark/light mode with proper text colors
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 2, 2026

CLA assistant check
All committers have signed the CLA.

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.

2 participants