Shell: tray (Task 8) and window rules (Task 9) track window visibility separately #883

Open
opened 2026-11-18 08:06:06 +00:00 by charles · 0 comments
Owner

Seen while stacking Shell 20 (#812) on origin/shell (a68e4701) + origin/shell-8-core-tray-model-and.

Task 8 (tray) and Task 9 (window rules) each keep their own idea of whether the window is visible:

  • Task 8: ShellState::window_visible, from UserAction::WindowVisible and the store's own Show / Hide (crates/fluxer-core/src/shell/tray.rs).
  • Task 9: ShellState::window.visible, from ShellAction::Window(WindowRequest::Shown | Hidden) (crates/fluxer-core/src/shell/window.rs).

Merged together, they disagree. Steps (core test, no UI):

  1. A loaded app with app.shell.tray = Some(TrayAvailability::Available).
  2. Apply ShellAction::Window(WindowRequest::Hidden).
  3. app.shell.window.visible is false, but window_visible stays true: the tray model sent still says Hide Flaxative, and the tray click (ToggleWindow) would answer Hide for a hidden window.

Also, tests/shell_window.rs::hidden_without_any_tray_is_shown_at_once asserted effects.is_empty() and fails once Task 8 is merged (the tray model is sent with the event); the Shell 20 branch relaxes it to "no window command, no timer".

Suggested: one source of truth (e.g. the tray reads app.shell.window, or WindowRequest::Shown/Hidden also sets window_visible), decided when Task 8 lands on shell or in Task 33.

Seen while stacking Shell 20 (#812) on `origin/shell` (a68e4701) + `origin/shell-8-core-tray-model-and`. Task 8 (tray) and Task 9 (window rules) each keep their own idea of whether the window is visible: - Task 8: `ShellState::window_visible`, from `UserAction::WindowVisible` and the store's own `Show` / `Hide` (`crates/fluxer-core/src/shell/tray.rs`). - Task 9: `ShellState::window.visible`, from `ShellAction::Window(WindowRequest::Shown | Hidden)` (`crates/fluxer-core/src/shell/window.rs`). Merged together, they disagree. Steps (core test, no UI): 1. A loaded app with `app.shell.tray = Some(TrayAvailability::Available)`. 2. Apply `ShellAction::Window(WindowRequest::Hidden)`. 3. `app.shell.window.visible` is false, but `window_visible` stays true: the tray model sent still says **Hide Flaxative**, and the tray click (`ToggleWindow`) would answer `Hide` for a hidden window. Also, `tests/shell_window.rs::hidden_without_any_tray_is_shown_at_once` asserted `effects.is_empty()` and fails once Task 8 is merged (the tray model is sent with the event); the Shell 20 branch relaxes it to "no window command, no timer". Suggested: one source of truth (e.g. the tray reads `app.shell.window`, or `WindowRequest::Shown/Hidden` also sets `window_visible`), decided when Task 8 lands on `shell` or in Task 33.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/fluxer-native#883
No description provided.