Skip to content

Conversation

@GeneralGDA
Copy link
Contributor

This pull request introduces a new Settings abstraction for managing application settings and refactors related logic throughout the desktop app. It also adds tests for settings management, introduces a new utility for accessing bundled files, and improves tray and window management behavior.
Settings abstraction and refactor:

  • Introduced a new Settings class in settings.ts to encapsulate reading and writing of settings such as server URL, minimize-to-tray, and window bounds, replacing direct use of electron-store. All logic for handling these settings is now centralized in this class.
  • Refactored start.ts to use the new Settings class throughout, including for reading the server URL, window bounds, and minimize-to-tray state. This removes duplicated logic and simplifies the main process code. [1] [2] [3] [4]

Testing improvements:

  • Added a comprehensive test suite for the new Settings class, covering all major behaviors and edge cases.
  • Added tests for tray badge icon logic in trayUtils.test.ts.

Tray and window management enhancements:

  • Improved minimize-to-tray behavior: window now hides instead of closing if the setting is enabled, and the tray controller is notified of badge updates. [1] [2]
  • Added IPC handler for retrieving the minimize-to-tray setting from the renderer process.
  • Updated menu action dispatching to support toggling minimize-to-tray from the menu and to close the window (not quit the app) when "exit" is selected. [1] [2] [3]

Utilities and configuration:

  • Added a utility function to retrieve files from the bundled public folder, improving code clarity and cross-platform compatibility. [1] [2]
  • Minor fix to config file path construction for better compatibility.

Other:

  • Minor formatting and copyright/license header additions.
  • Small cleanup in test files for consistency.

These changes collectively improve the modularity, testability, and user experience of the desktop application.

Signed-off-by: Denis Gladkiy <denis.gladkiy@hardcoreeng.com>
Signed-off-by: Denis Gladkiy <denis.gladkiy@hardcoreeng.com>
Signed-off-by: Denis Gladkiy <denis.gladkiy@hardcoreeng.com>
@huly-github-staging
Copy link

Connected to Huly®: UBERF-13726

@GeneralGDA GeneralGDA requested a review from Copilot September 18, 2025 09:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request introduces a comprehensive minimize-to-tray feature for the desktop application by implementing a new Settings abstraction and tray management system. The changes improve application modularity by centralizing settings management and enhance user experience with proper tray integration.

  • Introduces a new Settings class to centralize application settings management, replacing direct electron-store usage
  • Adds minimize-to-tray functionality with tray controller, badge notifications, and proper window management
  • Refactors menu system to support dynamic tray settings and improved event handling

Reviewed Changes

Copilot reviewed 17 out of 117 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
desktop/start-dev.ps1 Removes redundant comments for cleaner script
desktop/src/ui/types.ts Adds minimize-to-tray action and IPC methods, reformats menu actions array
desktop/src/ui/titleBarMenuState.ts Code style improvements with consistent formatting and null comparisons
desktop/src/ui/titleBarMenu.ts Updates menu setup to be async and adds tray toggle functionality
desktop/src/ui/preload.ts Adds IPC handlers for minimize-to-tray settings
desktop/src/ui/index.ts Updates menu initialization to handle async setup
desktop/src/main/windowsSpecificSetup.ts Code cleanup and formatting improvements
desktop/src/main/trayUtils.ts New utility for tray badge icon management
desktop/src/main/tray.ts New tray controller implementation
desktop/src/main/start.ts Major refactor to use Settings class and implement tray functionality
desktop/src/main/settings.ts New Settings abstraction for centralized configuration management
desktop/src/main/path.ts New utility for bundled file path resolution
desktop/src/main/customMenu.ts Updates menu actions to support tray toggle
desktop/src/main/config.ts Minor path construction fix
desktop/src/test/main/trayUtils.test.ts Comprehensive tests for tray badge logic
desktop/src/test/main/settings.test.ts Complete test suite for Settings class
desktop/src/test/main/selfCheckingNode.test.ts Code formatting cleanup

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Signed-off-by: Denis Gladkiy <denis.gladkiy@hardcoreeng.com>
Signed-off-by: Denis Gladkiy <denis.gladkiy@hardcoreeng.com>
Signed-off-by: Denis Gladkiy <denis.gladkiy@hardcoreeng.com>
@aonnikov aonnikov merged commit 9d147f0 into develop Sep 19, 2025
25 of 26 checks passed
@aonnikov aonnikov deleted the win-desktop-app-minimize-to-tray branch September 19, 2025 11: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.

3 participants