Add settings for optional close-to-tray behavior and theme preference #21

Closed
opened 2026-11-16 13:17:33 +01:00 by nessar · 2 comments
Owner

Parent

#1

Related: #9 (settings page and API-key management), #19 (Windows-following light/dark theme), #16 (application icon).

What to build

Expose a single settings page with an optional close-to-tray behavior and a theme preference. The user confirmed these defaults: Close to tray off, Theme System.

With close-to-tray enabled, closing the window hides it in the Windows notification area while the application continues running. The tray menu provides Open and Quit. Theme choices are System, Light and Dark; System follows Windows as specified in #19.

Acceptance criteria

Settings and persistence

  • A clearly accessible « Paramètres » page contains « Fermer dans la zone de notification » and a theme choice « Système / Clair / Sombre ». Reuse or extend the settings page planned in #9; there must not be separate competing settings screens.
  • Missing preferences in an existing configuration default to close-to-tray disabled and theme System. Changes persist across application restarts and take effect without restarting.
  • Saving these preferences preserves the existing API key, Account configuration and other settings. Save failures are reported in French without exposing the API key or pretending the change was saved.

Close to tray

  • With close-to-tray disabled, a normal window-close request (× or Alt+F4) exits the application. With it enabled, the same request hides the window and removes its taskbar entry while leaving a recognizable application icon in the Windows notification area.
  • Hiding preserves the current page, Account, filters, search query and sort. Existing import/sync and tracking work continues while hidden; opening the window again shows current data without starting duplicate workers or a second window.
  • The tray menu provides « Ouvrir » to restore and focus the existing window, and « Quitter » to exit completely regardless of the close-to-tray preference. The tray icon identifies Arena Tracker and uses the packaged application icon when available from #16.
  • Explicit Quit and Windows shutdown close the application rather than hiding it again. Existing stored data remains intact, and the tray icon is removed on exit.
  • If the tray icon cannot be created or restored, do not leave the application hidden and unreachable: keep or restore the window and report the problem. Include an Explorer restart in manual validation.

Theme

  • System is selected by default and follows the Windows application appearance at startup and when Windows changes, using #19's theme support.
  • Light and Dark apply immediately and remain selected when Windows changes its theme. Returning to System immediately applies the current Windows preference.
  • Changing the theme preserves the current page and table state. The settings page and its controls remain readable and usable in both themes.

Validation

  • Focused tests cover missing-setting defaults, persistence without losing existing configuration, theme preference behavior, and close-versus-quit decisions where they can be tested independently of Windows.
  • On Windows, verify closing with the option off/on, reopening from the tray repeatedly, explicit Quit, continued background work while hidden, Explorer restart, and System/Light/Dark changes. Record the results on this ticket.

Implementation context and scope

The current app opens its window in crates/app/src/main.rs. Background import work is started there, while StatsPage owns UI updates. Preserve that work and state across hide/restore instead of recreating the application each time.

Config in crates/core/src/config.rs already supports loading defaults and saving local TOML configuration. Extend the existing configuration and error-handling path as needed. Reuse GPUI Kit components and the theme support from #19. Coordinate with #9 for settings navigation and persistence; implementing its API-key setup, refresh button and failure banners is outside this ticket.

This ticket does not add launch-at-Windows-startup, start-minimized behavior, notifications, or new tracking capabilities. It keeps whatever tracking is already implemented running when the window is hidden.

## Parent #1 Related: #9 (settings page and API-key management), #19 (Windows-following light/dark theme), #16 (application icon). ## What to build Expose a single settings page with an optional close-to-tray behavior and a theme preference. The user confirmed these defaults: **Close to tray off**, **Theme System**. With close-to-tray enabled, closing the window hides it in the Windows notification area while the application continues running. The tray menu provides Open and Quit. Theme choices are System, Light and Dark; System follows Windows as specified in #19. ## Acceptance criteria ### Settings and persistence - [ ] A clearly accessible « Paramètres » page contains « Fermer dans la zone de notification » and a theme choice « Système / Clair / Sombre ». Reuse or extend the settings page planned in #9; there must not be separate competing settings screens. - [ ] Missing preferences in an existing configuration default to close-to-tray disabled and theme System. Changes persist across application restarts and take effect without restarting. - [ ] Saving these preferences preserves the existing API key, Account configuration and other settings. Save failures are reported in French without exposing the API key or pretending the change was saved. ### Close to tray - [ ] With close-to-tray disabled, a normal window-close request (× or Alt+F4) exits the application. With it enabled, the same request hides the window and removes its taskbar entry while leaving a recognizable application icon in the Windows notification area. - [ ] Hiding preserves the current page, Account, filters, search query and sort. Existing import/sync and tracking work continues while hidden; opening the window again shows current data without starting duplicate workers or a second window. - [ ] The tray menu provides « Ouvrir » to restore and focus the existing window, and « Quitter » to exit completely regardless of the close-to-tray preference. The tray icon identifies Arena Tracker and uses the packaged application icon when available from #16. - [ ] Explicit Quit and Windows shutdown close the application rather than hiding it again. Existing stored data remains intact, and the tray icon is removed on exit. - [ ] If the tray icon cannot be created or restored, do not leave the application hidden and unreachable: keep or restore the window and report the problem. Include an Explorer restart in manual validation. ### Theme - [ ] System is selected by default and follows the Windows application appearance at startup and when Windows changes, using #19's theme support. - [ ] Light and Dark apply immediately and remain selected when Windows changes its theme. Returning to System immediately applies the current Windows preference. - [ ] Changing the theme preserves the current page and table state. The settings page and its controls remain readable and usable in both themes. ## Validation - Focused tests cover missing-setting defaults, persistence without losing existing configuration, theme preference behavior, and close-versus-quit decisions where they can be tested independently of Windows. - On Windows, verify closing with the option off/on, reopening from the tray repeatedly, explicit Quit, continued background work while hidden, Explorer restart, and System/Light/Dark changes. Record the results on this ticket. ## Implementation context and scope The current app opens its window in `crates/app/src/main.rs`. Background import work is started there, while `StatsPage` owns UI updates. Preserve that work and state across hide/restore instead of recreating the application each time. `Config` in `crates/core/src/config.rs` already supports loading defaults and saving local TOML configuration. Extend the existing configuration and error-handling path as needed. Reuse GPUI Kit components and the theme support from #19. Coordinate with #9 for settings navigation and persistence; implementing its API-key setup, refresh button and failure banners is outside this ticket. This ticket does not add launch-at-Windows-startup, start-minimized behavior, notifications, or new tracking capabilities. It keeps whatever tracking is already implemented running when the window is hidden.
nessar added the ready-for-agent label 2026-11-16 13:17:33 +01:00
Author
Owner

Windows release validation

Validated the working changes on Windows with an isolated profile and a synthetic match database.

  • With the default setting, Alt+F4 exited. With close-to-tray enabled, Alt+F4 and a normal window-close request hid the window and registered the packaged icon. Repeated Ouvrir selections restored and focused the same window. Quitter exited and removed the icon.
  • After restarting Explorer, the notification icon returned while Arena Tracker stayed hidden. Ouvrir restored the same window. A non-default Account, Format, completion filter, search query and sort order matched before and after a hide-and-restore cycle.
  • Champion portraits continued downloading while the window was hidden. A simulated confirmed Windows session end exited the hidden app and removed the icon.
  • Système followed live Windows changes. Clair and Sombre applied immediately and stayed selected across Windows appearance changes. Returning to Système applied the current Windows preference. Both themes were readable in Settings.
  • The saved theme and close-to-tray setting survived an app restart. A blocked save kept the previous appearance and config and showed a French error. Config tests also cover preserving the API key and other values.

The Windows release build, all 19 Windows app tests, all 142 core tests, formatting and core Clippy passed. Live Riot match sync and a full Windows shutdown were outside the desktop checks.

### Windows release validation Validated the working changes on Windows with an isolated profile and a synthetic match database. - With the default setting, Alt+F4 exited. With close-to-tray enabled, Alt+F4 and a normal window-close request hid the window and registered the packaged icon. Repeated **Ouvrir** selections restored and focused the same window. **Quitter** exited and removed the icon. - After restarting Explorer, the notification icon returned while Arena Tracker stayed hidden. **Ouvrir** restored the same window. A non-default Account, Format, completion filter, search query and sort order matched before and after a hide-and-restore cycle. - Champion portraits continued downloading while the window was hidden. A simulated confirmed Windows session end exited the hidden app and removed the icon. - **Système** followed live Windows changes. **Clair** and **Sombre** applied immediately and stayed selected across Windows appearance changes. Returning to **Système** applied the current Windows preference. Both themes were readable in Settings. - The saved theme and close-to-tray setting survived an app restart. A blocked save kept the previous appearance and config and showed a French error. Config tests also cover preserving the API key and other values. The Windows release build, all 19 Windows app tests, all 142 core tests, formatting and core Clippy passed. Live Riot match sync and a full Windows shutdown were outside the desktop checks.
Author
Owner

Decision update (2026-11-19): close-to-tray is now on by default, replacing « Close to tray off » above. A missing close_to_tray preference in an existing configuration therefore defaults to enabled. Implemented in PR #45, where Preferences::default() keeps close_to_tray: true.

Decision update (2026-11-19): close-to-tray is now **on** by default, replacing « Close to tray off » above. A missing `close_to_tray` preference in an existing configuration therefore defaults to enabled. Implemented in PR #45, where `Preferences::default()` keeps `close_to_tray: true`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nessar/arena-tracker#21