Module Tray

Module Tray 

Source
Expand description

System tray integration.

§Binary Tray Module

System tray integration for the Mountain application.

§RESPONSIBILITIES

§Tray Icon Management

  • Create and configure system tray icon
  • Handle dynamic icon switching based on theme (Light/Dark)
  • Manage tray icon loading and rendering

§Tray Menu

  • Build and configure tray menu with menu items
  • Handle menu item clicks (Open, Hide, Quit)
  • Display tooltips and context information

§Tray Event Handling

  • Handle system tray icon events (click, double-click)
  • Toggle window visibility on left click
  • Manually show/hide main window through tray menu

§ARCHITECTURAL ROLE

§Position in Mountain

  • Subsystem of the Binary entry point
  • Provides system tray functionality to the Tauri application
  • Manages desktop integration and background operation

§Dependencies

  • Tauri: Desktop framework for tray API
  • log: Logging infrastructure

§Dependents

  • Binary/EntryPoint: Initializes tray on application startup

§VSCode Patterns Borrowed

  • System tray integration with menu structure
  • Window visibility toggle on tray icon click
  • Theme-aware icon switching
  • Graceful degradation when tray initialization fails

§TODO

§Immediate Improvements

  • Add support for tray notification badges
  • Implement tray icon animation for activity indication
  • Add context menu customization based on application state

§Future Work

  • Support for custom tray icon sets (third-party themes)
  • Implement tray icon tooltips with dynamic status
  • Add multiple tray instance support for multi-window scenarios
  • Implement tray menu item state (enabled/disabled, checked/unchecked)

§Missing Functionality to Probe

  • Optimal icon size for different DPI settings
  • Platform-specific tray behavior differences (macOS, Windows, Linux)
  • Tray menu item localization support
  • Notification click-through behavior

Modules§

EnableTray
Enable Tray Function
SwitchTrayIcon
Switch Tray Icon Command