Shell 44: Acceptance (#836) #949

Closed
charles wants to merge 0 commits from shell-44-acceptance into shell
Owner

What I built

  • apps/fluxer/tests/shell_acceptance.rs
    • desktop_shell_end_to_end runs one session of the whole client on the devserver shell scenario. It uses FakeTray, FakeBackend (X11), FakeBadge, FakeAutostart, a displays probe, and the single-instance channel in a temp dir. The window is headless: the UI's own window rules (fluxer_ui::shell::Lifecycle) carry out the store's window commands and report back, so the window decisions are the daemon's. The status API is read and driven over loopback (GET /status and a WebSocket with masked frames). The steps, in order:
      • start with --autostart and "Start minimized": no window, also past the 3 s tray grace, and the tray model is there;
      • tray "Show Flaxative" opens the window at exactly the restored placement;
      • join Hangout: the tray gets its voice rows and the payload lists 4 participants;
      • push-to-talk is held through the back end while unfocused: it transmits, then mutes again only after the 400 ms delay;
      • mute and deafen by Ctrl+Shift+M/D and from the tray: the menu labels and the payload follow;
      • the mention: badge Count(1) → (2) → (3), the dot, the tooltip "Unread messages: 2", and attention;
      • read: badge None, no dot and tooltip "Flaxative" with "Enable unread message badge" off while #lounge is still unread; with it on, a Dot. Focus stops the attention;
      • a second launch with fluxer://invite/lounge is Handed and opens the invite modal;
      • a link with ?instance= is refused and logged by kind; nothing opens and the instance does not change;
      • companion set_mute: ignored with control off (no capabilities in the hello); applied with control on (["control"] after reconnecting), and the payload and the tray follow;
      • move, then close: the window is hidden and voice stays connected;
      • tray "Quit": the daemon exits, the shutdown is clean and the tray icon is removed. settings.toml holds the new position, "Start minimized", the control switch, the badge switch and the status API state;
      • no key code, quoted key character, link, link host, status API token or session token appears in the trace log or the --record output.
    • without_a_tray_start_minimised_opens_and_close_quits: with no tray host, the start-minimised launch opens the window at the restored placement, and closing it while in voice quits (never hides).
  • docs/acceptance/shell.md: Charles's checklist with one section each for Windows 11, KDE Plasma 6 Wayland, X11, GNOME with and without AppIndicator, and Sway or Hyprland. It has spec §2 items 1–8, the manual lists from the PRs of Tasks 21–30 and 42, check-install.ps1, the known gaps (spec §16 plus #941, #940, #925, #889, #948, #939), the open questions and follow-ups, and what sub-project 11 adds.
  • apps/fluxer/src/runtime.rs (the control part of #889, needed by the acceptance step): the status API's control switch now follows ShellSettings::status_api_control (set_control at load and on change). The ops it forwards (take_ops) come back as IoEvent::Companion and are applied through companion_action. Default avatars and the port warning stay with #889. The README says so.
  • apps/fluxer/Cargo.toml: iced.workspace = true as a dev-dependency, for window::Id and window::Event in the headless window. iced is already in the tree, so cargo deny stays green.

How I tested it

  • cargo test -p fluxer --features devserver --test shell_acceptance: the test failed first at the companion step ("control never announced") before the runtime wiring, and passes after it (~5 s and ~2 s).
  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci is green locally (both tests ran in it).
  • No FLUXER_DESKTOP_TESTS, FLUXER_X11_TESTS or FLUXER_UINPUT_TESTS test was run. No tray icon, portal, hook or dialog was opened on a real desktop, nothing ran on Windows, and nothing contacted the live server.

Deviations from the plan

  • Step order. The scenario plays its events at fixed offsets (mention 1.5 s, unread 2.5 s, request 3.5 s). So the mention step waits for them and reads the badge and tray histories. Grace's mention therefore arrives while the window is still hidden, and attention is asserted as the command sent; there is no window to flash yet.
  • The badge is not Count(1) for the mention alone. READY already counts one mention in #general, and hedy's request adds one more. The test asserts the exact sequence Count(1) → Count(2) → Count(3), and "all cleared" after reading and after the request goes.
  • The friend request goes by a server event. The devserver refuses ignoring or accepting a scripted friend request (bug #948, opened). The test sends the server's RELATIONSHIP_REMOVE instead (hedy withdraws).
  • Tray "Quit" does not set stopped_on_request. It exits the daemon, and main then shuts the runtime down. The test does the same.
  • Runtime change outside the Files list. apps/fluxer/src/runtime.rs, same crate as the test: the control half of follow-up #889, without which the plan's "control on (muted)" step cannot pass.
  • #55 and #614 are already closed. #55's Wayland raise boxes depend on #941 (the activation token is built but not used).

Strings

No new user-facing strings. The test asserts the original's: "Show Flaxative", "Mute microphone" / "Unmute microphone", "Deafen" / "Undeafen", "Disconnect from …", "Flaxative - Unread messages: N".

For Charles

Run docs/acceptance/shell.md. Until its boxes are ticked, this PR stays open (plan: Task 44 closes #544 after the Windows install check).

Closes #836
Closes #544

🤖 Generated with Claude Code

https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K

## What I built - `apps/fluxer/tests/shell_acceptance.rs` - `desktop_shell_end_to_end` runs one session of the whole client on the devserver `shell` scenario. It uses `FakeTray`, `FakeBackend` (X11), `FakeBadge`, `FakeAutostart`, a displays probe, and the single-instance channel in a temp dir. The window is headless: the UI's own window rules (`fluxer_ui::shell::Lifecycle`) carry out the store's window commands and report back, so the window decisions are the daemon's. The status API is read and driven over loopback (GET /status and a WebSocket with masked frames). The steps, in order: - start with `--autostart` and "Start minimized": no window, also past the 3 s tray grace, and the tray model is there; - tray "Show Flaxative" opens the window at exactly the restored placement; - join Hangout: the tray gets its voice rows and the payload lists 4 participants; - push-to-talk is held through the back end while unfocused: it transmits, then mutes again only after the 400 ms delay; - mute and deafen by Ctrl+Shift+M/D and from the tray: the menu labels and the payload follow; - the mention: badge Count(1) → (2) → (3), the dot, the tooltip "Unread messages: 2", and attention; - read: badge None, no dot and tooltip "Flaxative" with "Enable unread message badge" off while #lounge is still unread; with it on, a Dot. Focus stops the attention; - a second launch with `fluxer://invite/lounge` is `Handed` and opens the invite modal; - a link with `?instance=` is refused and logged by kind; nothing opens and the instance does not change; - companion `set_mute`: ignored with control off (no capabilities in the hello); applied with control on (`["control"]` after reconnecting), and the payload and the tray follow; - move, then close: the window is hidden and voice stays connected; - tray "Quit": the daemon exits, the shutdown is clean and the tray icon is removed. `settings.toml` holds the new position, "Start minimized", the control switch, the badge switch and the status API state; - no key code, quoted key character, link, link host, status API token or session token appears in the trace log or the `--record` output. - `without_a_tray_start_minimised_opens_and_close_quits`: with no tray host, the start-minimised launch opens the window at the restored placement, and closing it while in voice quits (never hides). - `docs/acceptance/shell.md`: Charles's checklist with one section each for Windows 11, KDE Plasma 6 Wayland, X11, GNOME with and without AppIndicator, and Sway or Hyprland. It has spec §2 items 1–8, the manual lists from the PRs of Tasks 21–30 and 42, `check-install.ps1`, the known gaps (spec §16 plus #941, #940, #925, #889, #948, #939), the open questions and follow-ups, and what sub-project 11 adds. - `apps/fluxer/src/runtime.rs` (the control part of #889, needed by the acceptance step): the status API's control switch now follows `ShellSettings::status_api_control` (`set_control` at load and on change). The ops it forwards (`take_ops`) come back as `IoEvent::Companion` and are applied through `companion_action`. Default avatars and the port warning stay with #889. The README says so. - `apps/fluxer/Cargo.toml`: `iced.workspace = true` as a dev-dependency, for `window::Id` and `window::Event` in the headless window. iced is already in the tree, so `cargo deny` stays green. ## How I tested it - `cargo test -p fluxer --features devserver --test shell_acceptance`: the test failed first at the companion step ("control never announced") before the runtime wiring, and passes after it (~5 s and ~2 s). - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` is green locally (both tests ran in it). - No `FLUXER_DESKTOP_TESTS`, `FLUXER_X11_TESTS` or `FLUXER_UINPUT_TESTS` test was run. No tray icon, portal, hook or dialog was opened on a real desktop, nothing ran on Windows, and nothing contacted the live server. ## Deviations from the plan - **Step order.** The scenario plays its events at fixed offsets (mention 1.5 s, unread 2.5 s, request 3.5 s). So the mention step waits for them and reads the badge and tray histories. Grace's mention therefore arrives while the window is still hidden, and attention is asserted as the command sent; there is no window to flash yet. - **The badge is not Count(1) for the mention alone.** READY already counts one mention in #general, and hedy's request adds one more. The test asserts the exact sequence Count(1) → Count(2) → Count(3), and "all cleared" after reading and after the request goes. - **The friend request goes by a server event.** The devserver refuses ignoring or accepting a scripted friend request (bug #948, opened). The test sends the server's `RELATIONSHIP_REMOVE` instead (hedy withdraws). - **Tray "Quit" does not set `stopped_on_request`.** It exits the daemon, and `main` then shuts the runtime down. The test does the same. - **Runtime change outside the Files list.** `apps/fluxer/src/runtime.rs`, same crate as the test: the control half of follow-up #889, without which the plan's "control on (muted)" step cannot pass. - **#55 and #614 are already closed.** #55's Wayland raise boxes depend on #941 (the activation token is built but not used). ## Strings No new user-facing strings. The test asserts the original's: "Show Flaxative", "Mute microphone" / "Unmute microphone", "Deafen" / "Undeafen", "Disconnect from …", "Flaxative - Unread messages: N". ## For Charles Run `docs/acceptance/shell.md`. Until its boxes are ticked, this PR stays open (plan: Task 44 closes #544 after the Windows install check). Closes #836 Closes #544 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
The status API's control switch now follows "Let companion apps control
your voice" (`StatusApi::set_control` at load and on change) and the ops
it forwards (`take_ops`) are decided by `companion_action` and applied as
the tray's actions. The control part of #889, needed by the shell
acceptance run; the default avatars and the port warning stay with #889.

Refs #836
Refs #889

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
`apps/fluxer/tests/shell_acceptance.rs`: one session of the whole client
on the devserver `shell` scenario with the fake tray, shortcut back end,
badge, autostart and instance channel, and a headless window driven by
the UI's own window rules (`fluxer_ui:🐚:Lifecycle`): start
minimised at login, tray Show at the restored placement, voice rows and
status payload, push-to-talk while unfocused, mute and deafen by shortcut
and tray, mention badge, dot, tooltip and attention, read, unread with the
badge setting off, a second launch with an invite link, a link naming an
instance refused, companion set_mute with control off and on, close to
tray with voice running, tray Quit with placement and settings written;
the same start without a tray; no key, link or token in the log or the
recording. `iced` is a dev-dependency for the window ids and events.

`docs/acceptance/shell.md`: Charles's checklist per desktop (Windows 11,
KDE Plasma 6 Wayland, X11, GNOME with and without AppIndicator, Sway or
Hyprland), the manual lists of Tasks 21-30 and 42, check-install.ps1,
the known gaps, the open questions and follow-ups, and sub-project 11.

Refs #836

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

Independent review: Shell 44 Acceptance

Reviewed git diff 46c0bdfe3..origin/shell-44-acceptance (7b9fd35c2): apps/fluxer/tests/shell_acceptance.rs, docs/acceptance/shell.md, apps/fluxer/src/runtime.rs, apps/fluxer/Cargo.toml, README, Cargo.lock.

Gate: FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci in a clean review worktree: all steps passed (both shell_acceptance tests ran under the default devserver feature and passed).

What I checked

  • Plan steps: every step of the end-to-end run is there in the plan's order, plus the no-tray variant (start-minimised opens, close sends Quit, never Hide) and the privacy check (key codes, quoted key characters, both links and the host, the status token and the session token, checked against the trace log and the --record output). The checklist has the five desktop sections, spec §2 items 1-8, the manual lists from Tasks 21-30 and 42, check-install.ps1, known gaps, open issues and sub-project 11.
  • Interfaces: Task 44 produces none. The runtime uses StatusApi::set_control/take_ops and companion_action exactly as they exist on shell.
  • Invariants: no change to fluxer-core/fluxer-ui; no secrets, paths or signed URLs; the only new log line is debug!(?op) on CompanionOp, which holds a bool at most. Control stays off by default (status_api_control: false), set_control is called only after the settings load, forward_op drops ops while control or the API is off, and companion_action checks the setting again and maps only to the tray's actions (Review Focus 9).
  • Parity spot checks against the fork:
    • The tooltip ${APP_NAME} - Unread messages: {count} matches DesktopTray.ts getTrayToolTip and MainI18n.ts.
    • The badge total = mentions + pending friend requests, and the dot shows only with the unread setting on. This matches AppBadgeCount.ts computeAppBadge, so the Count(1)->(2)->(3) deviation is correct parity.
    • Handed/Refused exit SUCCESS (main.rs). The original's attention is flashFrame when !document.hasFocus() (NotificationUtils.ts).
    • The refusal is logged by kind ("the link tries to designate an instance", links.rs).

Findings

  • [minor] The attention check only proves the store sent WindowCommand::Attention. HeadlessWindow::run throws away every op it does not model, so nothing shows that Lifecycle turns the command into an attention request while the window is hidden. The PR states this deviation. A follow-up could record the op.
  • [minor] The close step sends UserAction::Shell(Window(CloseRequested)) straight to the store. It does not feed window::Event::CloseRequested through Lifecycle, so the daemon's handling of the OS close event is not part of this run (Task 32/33 tests cover it).
  • [minor] runtime.rs gets more than the "one routing arm" that registration files allow, and it is outside Task 44's Files list. The change is disclosed, carries Refs #889, is needed for the plan's "control on (muted)" step, and I found nothing wrong with it. Please note on #889 that the control half is done, so the issue keeps only the avatars and the port warning.
  • [minor] Hedy's request is removed by injecting CoreEvent::Gateway(RelationshipRemove) into the runtime's event channel, which bypasses the gateway connection. This is an acceptable workaround while #948 is open.

No blocking findings.

Verdict: APPROVED. CI is green and there are no blocking findings. Per the plan, the PR stays open until Charles runs docs/acceptance/shell.md.

## Independent review: Shell 44 Acceptance Reviewed `git diff 46c0bdfe3..origin/shell-44-acceptance` (7b9fd35c2): `apps/fluxer/tests/shell_acceptance.rs`, `docs/acceptance/shell.md`, `apps/fluxer/src/runtime.rs`, `apps/fluxer/Cargo.toml`, README, Cargo.lock. **Gate:** `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` in a clean review worktree: **all steps passed** (both `shell_acceptance` tests ran under the default `devserver` feature and passed). **What I checked** - Plan steps: every step of the end-to-end run is there in the plan's order, plus the no-tray variant (start-minimised opens, close sends `Quit`, never `Hide`) and the privacy check (key codes, quoted key characters, both links and the host, the status token and the session token, checked against the trace log and the `--record` output). The checklist has the five desktop sections, spec §2 items 1-8, the manual lists from Tasks 21-30 and 42, `check-install.ps1`, known gaps, open issues and sub-project 11. - Interfaces: Task 44 produces none. The runtime uses `StatusApi::set_control`/`take_ops` and `companion_action` exactly as they exist on `shell`. - Invariants: no change to `fluxer-core`/`fluxer-ui`; no secrets, paths or signed URLs; the only new log line is `debug!(?op)` on `CompanionOp`, which holds a bool at most. Control stays off by default (`status_api_control: false`), `set_control` is called only after the settings load, `forward_op` drops ops while control or the API is off, and `companion_action` checks the setting again and maps only to the tray's actions (Review Focus 9). - Parity spot checks against the fork: - The tooltip `${APP_NAME} - Unread messages: {count}` matches `DesktopTray.ts` `getTrayToolTip` and `MainI18n.ts`. - The badge total = mentions + pending friend requests, and the dot shows only with the unread setting on. This matches `AppBadgeCount.ts` `computeAppBadge`, so the Count(1)->(2)->(3) deviation is correct parity. - `Handed`/`Refused` exit `SUCCESS` (`main.rs`). The original's attention is `flashFrame` when `!document.hasFocus()` (`NotificationUtils.ts`). - The refusal is logged by kind ("the link tries to designate an instance", `links.rs`). **Findings** - [minor] The attention check only proves the store sent `WindowCommand::Attention`. `HeadlessWindow::run` throws away every op it does not model, so nothing shows that `Lifecycle` turns the command into an attention request while the window is hidden. The PR states this deviation. A follow-up could record the op. - [minor] The close step sends `UserAction::Shell(Window(CloseRequested))` straight to the store. It does not feed `window::Event::CloseRequested` through `Lifecycle`, so the daemon's handling of the OS close event is not part of this run (Task 32/33 tests cover it). - [minor] `runtime.rs` gets more than the "one routing arm" that registration files allow, and it is outside Task 44's Files list. The change is disclosed, carries `Refs #889`, is needed for the plan's "control on (muted)" step, and I found nothing wrong with it. Please note on #889 that the control half is done, so the issue keeps only the avatars and the port warning. - [minor] Hedy's request is removed by injecting `CoreEvent::Gateway(RelationshipRemove)` into the runtime's event channel, which bypasses the gateway connection. This is an acceptable workaround while #948 is open. No blocking findings. **Verdict: APPROVED.** CI is green and there are no blocking findings. Per the plan, the PR stays open until Charles runs `docs/acceptance/shell.md`.
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-19 12:15:53 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.