Shell 1: Spike — iced::daemon, hide / close / reopen, running without a window (#793) #841

Closed
charles wants to merge 0 commits from shell-1-spike-iced-daemon-hide into shell
Owner

What this is

Spike for Desktop shell Task 1 (#793): can the client run as an iced::daemon that outlives its window, which close to tray on Wayland needs? Verdict: yes, so the shell conversion (Task 32) goes ahead as planned; the fallback is not needed. Throw-away code: nothing in the product uses it.

  • crates/fluxer-ui/examples/daemon_lifecycle.rs: an iced::daemon with one window that hides and shows, closes and reopens keeping its state, starts with no window while a subscription still ticks, opens at a saved placement, reports moves, sizes and maximise changes, and hands its raw handle out through window::run. Its decisions are data (Spike::step returns WindowOps) so they are testable without a display. SPIKE_SCRIPT=full|hidden|real-close, SPIKE_START_HIDDEN, SPIKE_SAVED, SPIKE_ON_CLOSE drive the runs by hand.
  • crates/fluxer-ui/tests/daemon_lifecycle.rs (not on Windows, #93): close request with hide keeps the state on X11, Wayland and Windows; reopen at the saved placement, maximise re-asked after Opened; no window still updates; a show while a Wayland window is closing reopens after Closed; a stale window's handle is ignored; placement parsing.
  • crates/fluxer-ui/README.md, section "Window lifecycle": the findings.

What was proven

Run in private headless sessions only, never on the desktop in use: KWin 6 (kwin_wayland --virtual --xwayland), sway (WLR_BACKENDS=headless, close request via swaymsg kill), bare Xvfb. Windows read from winit 0.30.13 source, not run. GNOME not tried.

  • Hide/show with set_mode(Hidden|Windowed) works on X11; does nothing on Wayland (winit's set_visible is empty): there hide is window::close and show is window::open at the kept placement, the daemon keeps running. Reopen costs 230–350 ms on KWin, 650–800 ms on sway (the wgpu compositor is dropped with the last window and recreated).
  • The daemon's state survives a close; the widget tree does not (scroll, focus, cursors). Scroll restored with operation::scroll_to after Opened; a new window's scrollable reports offset 0 before Opened, so those reports are ignored while opening.
  • With no window, subscriptions still deliver; window::frames() delivers nothing. A hidden X11 window keeps redrawing (130–340 frames/s): drop frame/animation subscriptions while hidden.
  • X11 ignores Settings::maximized: window::maximize(id, true) after Opened works. No maximise event in iced: is_maximized after each Resized.
  • X11 position creeps by a title bar per save/restore (client vs outer origin); Tasks 9 and 32 must correct it.
  • Raw handle via window::run: Xlib / Wayland (Win32 by source); window::run does not run once the window is gone.
  • Daemon windows need exit_on_close_request: false; the daemon ends only on iced::exit().

Findings for Task 32

  • Track a closing window (Wayland hide): a show before Closed must open a new window after Closed, not focus the closing one; a hide before Closed cancels that.
  • Apply answers carrying a window id (window::run, is_maximized, position) only when the id is the open window's.
  • Tell the WindowHost "closed" before issuing window::close.

Tests run

  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci green locally.

Closes #793

🤖 Generated with Claude Code

https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K

## What this is Spike for Desktop shell Task 1 (#793): can the client run as an `iced::daemon` that outlives its window, which close to tray on Wayland needs? **Verdict: yes**, so the shell conversion (Task 32) goes ahead as planned; the fallback is not needed. Throw-away code: nothing in the product uses it. - `crates/fluxer-ui/examples/daemon_lifecycle.rs`: an `iced::daemon` with one window that hides and shows, closes and reopens keeping its state, starts with no window while a subscription still ticks, opens at a saved placement, reports moves, sizes and maximise changes, and hands its raw handle out through `window::run`. Its decisions are data (`Spike::step` returns `WindowOp`s) so they are testable without a display. `SPIKE_SCRIPT=full|hidden|real-close`, `SPIKE_START_HIDDEN`, `SPIKE_SAVED`, `SPIKE_ON_CLOSE` drive the runs by hand. - `crates/fluxer-ui/tests/daemon_lifecycle.rs` (not on Windows, #93): close request with hide keeps the state on X11, Wayland and Windows; reopen at the saved placement, maximise re-asked after `Opened`; no window still updates; a show while a Wayland window is closing reopens after `Closed`; a stale window's handle is ignored; placement parsing. - `crates/fluxer-ui/README.md`, section "Window lifecycle": the findings. ## What was proven Run in private headless sessions only, never on the desktop in use: KWin 6 (`kwin_wayland --virtual --xwayland`), sway (`WLR_BACKENDS=headless`, close request via `swaymsg kill`), bare `Xvfb`. Windows read from winit 0.30.13 source, not run. GNOME not tried. - Hide/show with `set_mode(Hidden|Windowed)` works on X11; **does nothing on Wayland** (winit's `set_visible` is empty): there hide is `window::close` and show is `window::open` at the kept placement, the daemon keeps running. Reopen costs 230–350 ms on KWin, 650–800 ms on sway (the wgpu compositor is dropped with the last window and recreated). - The daemon's state survives a close; the widget tree does not (scroll, focus, cursors). Scroll restored with `operation::scroll_to` after `Opened`; a new window's scrollable reports offset 0 before `Opened`, so those reports are ignored while opening. - With no window, subscriptions still deliver; `window::frames()` delivers nothing. **A hidden X11 window keeps redrawing** (130–340 frames/s): drop frame/animation subscriptions while hidden. - X11 ignores `Settings::maximized`: `window::maximize(id, true)` after `Opened` works. No maximise event in iced: `is_maximized` after each `Resized`. - **X11 position creeps** by a title bar per save/restore (client vs outer origin); Tasks 9 and 32 must correct it. - Raw handle via `window::run`: `Xlib` / `Wayland` (Win32 by source); `window::run` does not run once the window is gone. - Daemon windows need `exit_on_close_request: false`; the daemon ends only on `iced::exit()`. ## Findings for Task 32 - Track a closing window (Wayland hide): a show before `Closed` must open a new window after `Closed`, not focus the closing one; a hide before `Closed` cancels that. - Apply answers carrying a window id (`window::run`, `is_maximized`, `position`) only when the id is the open window's. - Tell the `WindowHost` "closed" before issuing `window::close`. ## Tests run - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` green locally. Closes #793 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
An iced::daemon example whose window hides and shows, closes and reopens
keeping its state, runs with no window, opens at a saved placement, reports
moves, sizes and maximise changes and hands out its raw handle; tests drive
its decisions without a display; the README's "Window lifecycle" section
records what was seen on KWin Wayland, XWayland, sway and bare X11.

Refs #793

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
Author
Owner

Review: Shell 1 (spike, iced::daemon), independent reviewer

Reviewed git diff 106ff769..origin/shell-1-spike-iced-daemon-hide (0ea514e3): README section, examples/daemon_lifecycle.rs, tests/daemon_lifecycle.rs. Only fluxer-ui is touched. No product code, no new dependencies, and no I/O in the library.

Findings

[blocking] The PR description belongs to another PR and closes the wrong issue. The body of #841 is a word-for-word copy of #840's (the Task 3 portal-shortcuts spike) and ends with Closes #795. #795 is "Shell 3: Spike — Wayland global shortcuts". Merging as it stands would close Task 3's issue, leave #793 open, and give the merger a description of code this PR does not contain. Fix: replace the body with this spike's summary and findings, followed by Closes #793. The code does not need to change.

[minor] The example has a Wayland hide-then-show race. hide() on Wayland returns Close(id) but leaves window = Some(id) until Closed arrives. A Show that arrives in between returns Focus(id) for the closing window, so the window is not reopened. The README covers "a second show while opening". It should also say that Task 32 must track a closing window and reopen after Closed, so the window is never left unreachable (Review Focus 5).

[minor] Message::Handle does not check the window id. It sets platform from any window id, including a stale one. This does not matter in the spike, but Task 32's WindowHost should match the open id.

Checks

  1. Tests: the plan's three tests exist (close_request_with_hide_keeps_state, reopen_uses_saved_placement, no_window_still_updates), plus saved_placement_parses. They drive Spike::step (the decisions inside update); update and subscription are also built without a runtime. They cover (a) to (f) at the decision level, per platform.
  2. Interfaces: the task's outputs are findings plus an example, and the README answers every question the plan asks: (a)–(f) per X11, KDE Wayland and Windows (from source); what a reopen loses; whether frames and redraw_subscription stop without a window; whether the wgpu device survives; and the effect on the headless harness. Checked against the local registry:
    • winit 0.30.13 Wayland set_visible is empty.
    • iced_winit 0.14.1 Action::Close drops the UI cache and sets *compositor = None when no window is left, so the device is recreated on reopen.
    • Action::Run is a no-op for a missing window, so WindowHost::closed must come before window::close.
  3. Invariants: fluxer-core is untouched. The env reads and the thread exist only in the example, outside the library. No secrets, paths or key data. The test is #![cfg(not(windows))] like the other iced::Renderer suites (#93). The example's code on Windows is type-correct.
  4. Parity, spot-checked against fluxer_desktop/src/main/Window.ts:
    • Maximise applied after the window shows (pendingMaximize on show, lines 741-748) matches maximise after Opened.
    • The saved size is the normal size (getNormalBounds, line 290), as in the spike, which keeps the size from before maximising.
    • The close decision (line 326 tray, showTrayIcon, closeToTray; line 853 hide, else close) matches OnClose::{Hide, Quit}.
  5. Review Focus: no item belongs to Task 1. Item 5 is advisory here (see the minor race above).
  6. FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci in the review worktree: all steps passed (exit 0), and tests/daemon_lifecycle.rs passed 4 of 4.

The spike verdict holds: iced::daemon works, so the iced::application fallback is not needed. Tasks 9 and 32 should take the findings on X11 position creep, X11 maximise after Opened, stopping frame subscriptions while hidden, and ignoring scroll reports while opening.

Verdict: changes requested. The only blocker is the PR body (Closes #793 and this spike's description). The code is approvable as is.

## Review: Shell 1 (spike, iced::daemon), independent reviewer Reviewed `git diff 106ff769..origin/shell-1-spike-iced-daemon-hide` (0ea514e3): README section, `examples/daemon_lifecycle.rs`, `tests/daemon_lifecycle.rs`. Only `fluxer-ui` is touched. No product code, no new dependencies, and no I/O in the library. ### Findings **[blocking] The PR description belongs to another PR and closes the wrong issue.** The body of #841 is a word-for-word copy of #840's (the Task 3 portal-shortcuts spike) and ends with `Closes #795`. #795 is "Shell 3: Spike — Wayland global shortcuts". Merging as it stands would close Task 3's issue, leave #793 open, and give the merger a description of code this PR does not contain. Fix: replace the body with this spike's summary and findings, followed by `Closes #793`. The code does not need to change. **[minor] The example has a Wayland hide-then-show race.** `hide()` on Wayland returns `Close(id)` but leaves `window = Some(id)` until `Closed` arrives. A `Show` that arrives in between returns `Focus(id)` for the closing window, so the window is not reopened. The README covers "a second show while opening". It should also say that Task 32 must track a closing window and reopen after `Closed`, so the window is never left unreachable (Review Focus 5). **[minor] `Message::Handle` does not check the window id.** It sets `platform` from any window id, including a stale one. This does not matter in the spike, but Task 32's `WindowHost` should match the open id. ### Checks 1. Tests: the plan's three tests exist (`close_request_with_hide_keeps_state`, `reopen_uses_saved_placement`, `no_window_still_updates`), plus `saved_placement_parses`. They drive `Spike::step` (the decisions inside `update`); `update` and `subscription` are also built without a runtime. They cover (a) to (f) at the decision level, per platform. 2. Interfaces: the task's outputs are findings plus an example, and the README answers every question the plan asks: (a)–(f) per X11, KDE Wayland and Windows (from source); what a reopen loses; whether frames and `redraw_subscription` stop without a window; whether the wgpu device survives; and the effect on the headless harness. Checked against the local registry: - winit 0.30.13 Wayland `set_visible` is empty. - iced_winit 0.14.1 `Action::Close` drops the UI cache and sets `*compositor = None` when no window is left, so the device is recreated on reopen. - `Action::Run` is a no-op for a missing window, so `WindowHost::closed` must come before `window::close`. 3. Invariants: fluxer-core is untouched. The env reads and the thread exist only in the example, outside the library. No secrets, paths or key data. The test is `#![cfg(not(windows))]` like the other `iced::Renderer` suites (#93). The example's code on Windows is type-correct. 4. Parity, spot-checked against `fluxer_desktop/src/main/Window.ts`: - Maximise applied after the window shows (`pendingMaximize` on `show`, lines 741-748) matches maximise after `Opened`. - The saved size is the normal size (`getNormalBounds`, line 290), as in the spike, which keeps the size from before maximising. - The close decision (line 326 tray, showTrayIcon, closeToTray; line 853 hide, else close) matches `OnClose::{Hide, Quit}`. 5. Review Focus: no item belongs to Task 1. Item 5 is advisory here (see the minor race above). 6. `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` in the review worktree: **all steps passed** (exit 0), and `tests/daemon_lifecycle.rs` passed 4 of 4. The spike verdict holds: `iced::daemon` works, so the `iced::application` fallback is not needed. Tasks 9 and 32 should take the findings on X11 position creep, X11 maximise after `Opened`, stopping frame subscriptions while hidden, and ignoring scroll reports while opening. **Verdict: changes requested.** The only blocker is the PR body (`Closes #793` and this spike's description). The code is approvable as is.
A show while the Wayland window is closing (close sent, Closed not yet
arrived) no longer focuses the closing window: the spike tracks it and
opens a new window once Closed comes; a hide before Closed cancels the
reopen. Message::Handle only sets the platform for the open window's id.
The README says what Task 32's WindowHost must do for both.

Refs #793

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
Author
Owner

Review round 1, addressed in 65f60985:

  • Blocking, PR description: the body was PR #840's (Task 3). Replaced with this spike's summary, findings and verdict, and Closes #793 (no longer mentions #795). No code change needed for this one.
  • Minor, Wayland show while closing: the spike now tracks closing: Option<window::Id> and reopen_after_close. A show before Closed no longer focuses the closing window; a new window opens when Closed arrives, and a hide before Closed cancels that. shown() is false while closing, and a second hide sends nothing. Test: show_while_closing_reopens_after_closed. The README's "Window lifecycle" section says Task 32's WindowHost must do the same.
  • Minor, stale Message::Handle: the platform is set only when the id is the open window's; a stale id is logged and ignored. Test: handle_of_a_stale_window_is_ignored. The README notes that Task 32 should apply id-carrying answers only for the open window.

FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci is green locally.

Review round 1, addressed in 65f60985: - **Blocking, PR description**: the body was PR #840's (Task 3). Replaced with this spike's summary, findings and verdict, and `Closes #793` (no longer mentions #795). No code change needed for this one. - **Minor, Wayland show while closing**: the spike now tracks `closing: Option<window::Id>` and `reopen_after_close`. A show before `Closed` no longer focuses the closing window; a new window opens when `Closed` arrives, and a hide before `Closed` cancels that. `shown()` is false while closing, and a second hide sends nothing. Test: `show_while_closing_reopens_after_closed`. The README's "Window lifecycle" section says Task 32's `WindowHost` must do the same. - **Minor, stale `Message::Handle`**: the platform is set only when the id is the open window's; a stale id is logged and ignored. Test: `handle_of_a_stale_window_is_ignored`. The README notes that Task 32 should apply id-carrying answers only for the open window. `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` is green locally.
Author
Owner

Review round 2: Shell 1 (spike, iced::daemon), independent reviewer

Reviewed git diff 106ff769..origin/shell-1-spike-iced-daemon-hide at 65f60985, covering 0ea514e3 and the round-1 fix. Only crates/fluxer-ui changed: the README, examples/daemon_lifecycle.rs and tests/daemon_lifecycle.rs.

Round 1 findings

  • Blocking, PR body: fixed. The body now describes this spike and ends with Closes #793. #795 is no longer mentioned. Both commits carry Refs #793.
  • Minor, show while a window is closing: fixed. The fix adds closing and reopen_after_close. A show before Closed opens a new window when Closed arrives, and a hide before Closed cancels that. shown() is false while the window is closing. Covered by show_while_closing_reopens_after_closed. I checked this against iced_winit 0.14.1: Action::Close pushes Closed from inside the action. The race is therefore only between issuing the task and the runtime processing it, and the guard handles that.
  • Minor, stale Handle: fixed. Handle now checks the window id, and so do Maximized and Position. Covered by handle_of_a_stale_window_is_ignored.

New findings

  • [minor] README wording. The README says "Task 32's WindowHost tracks the closing window". In the plan, WindowHost is the injected { opened, closed } port. Tracking the closing window is the job of Shell, which holds Option<window::Id>. Task 32 should put that logic in Shell, not in the host trait.
  • [minor, advisory for Task 32] A Hide that arrives while a window is opening (window == None, opening == true) returns nothing, so the window that then opens is shown. The window stays reachable, so Review Focus 5 holds. Still, Task 32 should decide whether to remember the hide, for example a close-to-tray click during a slow Wayland reopen.

Checks

  1. Tests. The plan's tests exist and assert what it says. close_request_with_hide_keeps_state checks Windows, X11 and Wayland: SetMode(Hidden) on Windows and X11, Close on Wayland, and the counter, draft and scroll kept. reopen_uses_saved_placement checks Settings size and position, exit_on_close_request: false, the normal size kept while maximised, and Maximize asked again after Opened. no_window_still_updates checks that a start hidden opens no window and that seconds tick. There are three extra tests.
  2. Interfaces. Findings (a) to (f) are answered per platform: X11, Wayland (KDE) and Windows (from source). The README also covers what a reopen loses, frames and redraw_subscription with no window, the wgpu device, and the headless harness. I checked against the registry: winit 0.30.13 Wayland set_visible is empty; iced_winit Close sets *compositor = None when no window is left; Action::Run does nothing for a missing window.
  3. Invariants. fluxer-core is untouched. The environment reads and the thread are in the example only, not in the library. There are no secrets, paths or key data. The test file is #![cfg(not(windows))], as the other renderer suites are (#93). The example's cfg!(windows) branch is type-correct.
  4. Parity, spot-checked against fluxer_desktop/src/main/Window.ts:
    • The saved size is the normal size (getNormalBounds, l.290). The spike drops pending_size while maximised.
    • The window hides on close only when there is a tray, showTrayIcon and closeToTray (l.326, 853). The spike has OnClose::{Hide, Quit}, and the spec matches §7.1.
    • Bounds are saved 500 ms after the last resize or move, and on close (l.796-803, 853-856). This matches spec §7.1, and the spike's events feed it.
  5. Review Focus. No item belongs to Task 1. Item 5 is advisory: the window is never left unreachable in the spike's state machine.
  6. Gate. FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci in the review worktree: all steps passed. tests/daemon_lifecycle.rs passed 6 of 6.

The spike verdict holds: iced::daemon works and the fallback is not needed.

Verdict: approved. There are no blocking findings and the gate is green.

## Review round 2: Shell 1 (spike, iced::daemon), independent reviewer Reviewed `git diff 106ff769..origin/shell-1-spike-iced-daemon-hide` at 65f60985, covering 0ea514e3 and the round-1 fix. Only `crates/fluxer-ui` changed: the README, `examples/daemon_lifecycle.rs` and `tests/daemon_lifecycle.rs`. ### Round 1 findings - **Blocking, PR body: fixed.** The body now describes this spike and ends with `Closes #793`. #795 is no longer mentioned. Both commits carry `Refs #793`. - **Minor, show while a window is closing: fixed.** The fix adds `closing` and `reopen_after_close`. A show before `Closed` opens a new window when `Closed` arrives, and a hide before `Closed` cancels that. `shown()` is false while the window is closing. Covered by `show_while_closing_reopens_after_closed`. I checked this against iced_winit 0.14.1: `Action::Close` pushes `Closed` from inside the action. The race is therefore only between issuing the task and the runtime processing it, and the guard handles that. - **Minor, stale `Handle`: fixed.** `Handle` now checks the window id, and so do `Maximized` and `Position`. Covered by `handle_of_a_stale_window_is_ignored`. ### New findings - **[minor] README wording.** The README says "Task 32's `WindowHost` tracks the closing window". In the plan, `WindowHost` is the injected `{ opened, closed }` port. Tracking the closing window is the job of `Shell`, which holds `Option<window::Id>`. Task 32 should put that logic in `Shell`, not in the host trait. - **[minor, advisory for Task 32]** A `Hide` that arrives while a window is opening (`window == None`, `opening == true`) returns nothing, so the window that then opens is shown. The window stays reachable, so Review Focus 5 holds. Still, Task 32 should decide whether to remember the hide, for example a close-to-tray click during a slow Wayland reopen. ### Checks 1. **Tests.** The plan's tests exist and assert what it says. `close_request_with_hide_keeps_state` checks Windows, X11 and Wayland: `SetMode(Hidden)` on Windows and X11, `Close` on Wayland, and the counter, draft and scroll kept. `reopen_uses_saved_placement` checks `Settings` size and position, `exit_on_close_request: false`, the normal size kept while maximised, and `Maximize` asked again after `Opened`. `no_window_still_updates` checks that a start hidden opens no window and that seconds tick. There are three extra tests. 2. **Interfaces.** Findings (a) to (f) are answered per platform: X11, Wayland (KDE) and Windows (from source). The README also covers what a reopen loses, frames and `redraw_subscription` with no window, the wgpu device, and the headless harness. I checked against the registry: winit 0.30.13 Wayland `set_visible` is empty; iced_winit `Close` sets `*compositor = None` when no window is left; `Action::Run` does nothing for a missing window. 3. **Invariants.** fluxer-core is untouched. The environment reads and the thread are in the example only, not in the library. There are no secrets, paths or key data. The test file is `#![cfg(not(windows))]`, as the other renderer suites are (#93). The example's `cfg!(windows)` branch is type-correct. 4. **Parity**, spot-checked against `fluxer_desktop/src/main/Window.ts`: - The saved size is the normal size (`getNormalBounds`, l.290). The spike drops `pending_size` while maximised. - The window hides on close only when there is a tray, `showTrayIcon` and `closeToTray` (l.326, 853). The spike has `OnClose::{Hide, Quit}`, and the spec matches §7.1. - Bounds are saved 500 ms after the last resize or move, and on close (l.796-803, 853-856). This matches spec §7.1, and the spike's events feed it. 5. **Review Focus.** No item belongs to Task 1. Item 5 is advisory: the window is never left unreachable in the spike's state machine. 6. **Gate.** `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` in the review worktree: **all steps passed**. `tests/daemon_lifecycle.rs` passed 6 of 6. The spike verdict holds: `iced::daemon` works and the fallback is not needed. **Verdict: approved.** There are no blocking findings and the gate is green.
Author
Owner

Merged into shell by hand (the merge API returns 405); the commits are in the branch.

Merged into `shell` by hand (the merge API returns 405); the commits are in the branch.
charles closed this pull request 2026-11-18 04:27:51 +00:00
Author
Owner

Independent review: Shell 1 (spike: iced daemon, hide / close / reopen)

I reviewed git diff 158c90dd..origin/shell-1-spike-iced-daemon-hide. It changes three files: crates/fluxer-ui/examples/daemon_lifecycle.rs, crates/fluxer-ui/tests/daemon_lifecycle.rs and the README section "Window lifecycle". The branch head is 4edb586f, and origin/shell already contains it.

Plan steps. The three tests that Step 1 names exist and assert what the plan says:

  • close_request_with_hide_keeps_state: Hidden mode on Windows and X11, close on Wayland; counter, draft and scroll survive; Quit when close to tray is off.
  • reopen_uses_saved_placement: size, position, maximized, visible and exit_on_close_request: false; the normal size is kept apart from the maximised one; maximise is asked again after Opened.
  • no_window_still_updates: starting hidden opens no window, the seconds subscription keeps ticking, and Quit works with no window.

There are three extra tests: placement parsing, show while closing, and a stale handle.

Interfaces. Items (a) to (f) are all in the example. The README answers each question the plan asks:

  • which items work on X11, KDE Wayland and Windows (Windows from the winit source)
  • what a reopened window loses
  • that frames() and redraw_subscription stop without a window
  • that the wgpu device does not survive a close
  • that the headless harness is unaffected

The spike succeeded, so the fallback is not needed.

Invariants. The change has no product code and no new dependency. It touches no fluxer-core, does no I/O in the fluxer-ui lib (the env reads and the thread are in the example only), has no secrets and no fixtures. It does not touch any registry.

Parity (checked in fluxer_desktop/src/main/Window.ts):

  • The close handler calls preventDefault and hides when hasActiveDesktopTray() && showTrayIcon && closeToTray (l. 326, 857). This matches spec §7.1 and the spike's OnClose::Hide.
  • Maximise is applied after the window is shown (applyPendingMaximize on show, l. 742–747). This matches the spike's Maximize after Opened.
  • Bounds are saved on close and after a 500 ms debounce (l. 800, 854–856), and the normal bounds are kept (getNormalBounds). This matches the spike keeping the unmaximised size.

Review Focus. Item 5 (the window is never left unreachable) belongs to Tasks 9, 32 and 33. The spike covers its Wayland side: show_while_closing_reopens_after_closed.

Gate. I ran FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci in a fresh review worktree. The result is "all steps passed", exit 0, and all 6 daemon_lifecycle tests pass.

Findings

  1. minor: on X11, window_event(Opened) overwrites placement.position with the reported position. That is the client-area origin, which causes the title-bar creep the README describes. This is fine for the spike, but Task 32 must not copy that line. The README already says to subtract the offset.
  2. minor: when no position is saved, the spike opens at Position::Default. The original uses center: true (Window.ts l. 721–726). Tasks 9 and 32 should restore with Position::Centered for parity.
  3. minor: in script mode only, the example prints the draft text to stdout at the end. This is opt-in throw-away code and not product code. Task 32 must not log user text.

None of the findings is blocking.

Verdict: approved. There are no blocking findings and the gate is green.

## Independent review: Shell 1 (spike: iced daemon, hide / close / reopen) I reviewed `git diff 158c90dd..origin/shell-1-spike-iced-daemon-hide`. It changes three files: `crates/fluxer-ui/examples/daemon_lifecycle.rs`, `crates/fluxer-ui/tests/daemon_lifecycle.rs` and the README section "Window lifecycle". The branch head is 4edb586f, and origin/shell already contains it. **Plan steps.** The three tests that Step 1 names exist and assert what the plan says: - `close_request_with_hide_keeps_state`: Hidden mode on Windows and X11, close on Wayland; counter, draft and scroll survive; Quit when close to tray is off. - `reopen_uses_saved_placement`: size, position, `maximized`, `visible` and `exit_on_close_request: false`; the normal size is kept apart from the maximised one; maximise is asked again after `Opened`. - `no_window_still_updates`: starting hidden opens no window, the seconds subscription keeps ticking, and Quit works with no window. There are three extra tests: placement parsing, show while closing, and a stale handle. **Interfaces.** Items (a) to (f) are all in the example. The README answers each question the plan asks: - which items work on X11, KDE Wayland and Windows (Windows from the winit source) - what a reopened window loses - that `frames()` and `redraw_subscription` stop without a window - that the wgpu device does not survive a close - that the headless harness is unaffected The spike succeeded, so the fallback is not needed. **Invariants.** The change has no product code and no new dependency. It touches no fluxer-core, does no I/O in the fluxer-ui lib (the env reads and the thread are in the example only), has no secrets and no fixtures. It does not touch any registry. **Parity** (checked in `fluxer_desktop/src/main/Window.ts`): - The `close` handler calls `preventDefault` and hides when `hasActiveDesktopTray() && showTrayIcon && closeToTray` (l. 326, 857). This matches spec §7.1 and the spike's `OnClose::Hide`. - Maximise is applied after the window is shown (`applyPendingMaximize` on `show`, l. 742–747). This matches the spike's `Maximize` after `Opened`. - Bounds are saved on close and after a 500 ms debounce (l. 800, 854–856), and the normal bounds are kept (`getNormalBounds`). This matches the spike keeping the unmaximised size. **Review Focus.** Item 5 (the window is never left unreachable) belongs to Tasks 9, 32 and 33. The spike covers its Wayland side: `show_while_closing_reopens_after_closed`. **Gate.** I ran `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` in a fresh review worktree. The result is "all steps passed", exit 0, and all 6 daemon_lifecycle tests pass. ### Findings 1. *minor*: on X11, `window_event(Opened)` overwrites `placement.position` with the reported position. That is the client-area origin, which causes the title-bar creep the README describes. This is fine for the spike, but Task 32 must not copy that line. The README already says to subtract the offset. 2. *minor*: when no position is saved, the spike opens at `Position::Default`. The original uses `center: true` (Window.ts l. 721–726). Tasks 9 and 32 should restore with `Position::Centered` for parity. 3. *minor*: in script mode only, the example prints the draft text to stdout at the end. This is opt-in throw-away code and not product code. Task 32 must not log user text. None of the findings is blocking. **Verdict: approved.** There are no blocking findings and the gate is green.
Author
Owner

Independent review, Task 1 (spike-iced-daemon-hide), re-run 2026-11-18

Scope: git diff f2e3f17db..origin/shell-1-spike-iced-daemon-hide is empty. The branch points at the shell tip, and the spike's commits 0ea514e36 and 65f60985c (plus merge 4f5052f44) are already ancestors of origin/shell. So I reviewed the spike as it exists on shell.

  1. Plan tests: close_request_with_hide_keeps_state, reopen_uses_saved_placement and no_window_still_updates exist in crates/fluxer-ui/tests/daemon_lifecycle.rs. They drive update with no display. They assert: hide on X11 and Windows vs close on Wayland, state kept and no exit on close request; saved size, position, visible and maximized; exit_on_close_request: false; Position::Default when nothing is saved; and no window, with no frames and subscriptions still updating. All three pass.
  2. Interfaces (a)-(f): the example crates/fluxer-ui/examples/daemon_lifecycle.rs covers set_mode, close/open, the no-window subscription, saved placement, Moved/Resized/maximise (via is_maximized) and the raw handle through window::run. The crates/fluxer-ui/README.md "Window lifecycle" section answers every question the plan asks for X11, Wayland (KDE) and Windows (from source): what a reopen loses, frames and redraw_subscription without a window, the wgpu device, and the headless harness.
  3. Invariants: the spike has no I/O, no secrets and no paths, and fluxer-core is untouched.
  4. Parity spot checks against fluxer_desktop/src/main/Window.ts: saved bounds are x, y, width, height and isMaximized; restorable bounds are kept apart from maximised ones; default bounds are used when nothing is saved. The spike's Placement and the test "a maximised size is not the one restored" match all three.
  5. Review Focus: no item is assigned to Task 1. Item 5 (Tasks 9, 32, 33) builds on these findings.
  6. FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci on f2e3f17db: all steps passed (exit 0).

Findings: none.

Verdict: APPROVED. Task 1 is complete on shell, and this branch adds nothing to merge.

**Independent review, Task 1 (spike-iced-daemon-hide), re-run 2026-11-18** Scope: `git diff f2e3f17db..origin/shell-1-spike-iced-daemon-hide` is empty. The branch points at the shell tip, and the spike's commits 0ea514e36 and 65f60985c (plus merge 4f5052f44) are already ancestors of origin/shell. So I reviewed the spike as it exists on shell. 1. Plan tests: `close_request_with_hide_keeps_state`, `reopen_uses_saved_placement` and `no_window_still_updates` exist in `crates/fluxer-ui/tests/daemon_lifecycle.rs`. They drive `update` with no display. They assert: hide on X11 and Windows vs close on Wayland, state kept and no exit on close request; saved size, position, visible and maximized; `exit_on_close_request: false`; `Position::Default` when nothing is saved; and no window, with no frames and subscriptions still updating. All three pass. 2. Interfaces (a)-(f): the example `crates/fluxer-ui/examples/daemon_lifecycle.rs` covers set_mode, close/open, the no-window subscription, saved placement, Moved/Resized/maximise (via `is_maximized`) and the raw handle through `window::run`. The `crates/fluxer-ui/README.md` "Window lifecycle" section answers every question the plan asks for X11, Wayland (KDE) and Windows (from source): what a reopen loses, frames and `redraw_subscription` without a window, the wgpu device, and the headless harness. 3. Invariants: the spike has no I/O, no secrets and no paths, and fluxer-core is untouched. 4. Parity spot checks against `fluxer_desktop/src/main/Window.ts`: saved bounds are x, y, width, height and isMaximized; restorable bounds are kept apart from maximised ones; default bounds are used when nothing is saved. The spike's Placement and the test "a maximised size is not the one restored" match all three. 5. Review Focus: no item is assigned to Task 1. Item 5 (Tasks 9, 32, 33) builds on these findings. 6. `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` on f2e3f17db: all steps passed (exit 0). Findings: none. **Verdict: APPROVED.** Task 1 is complete on shell, and this branch adds nothing to merge.

Pull request closed

Sign in to join this conversation.
No description provided.