Shell 40: ui-companion-apps-control (#832) #892

Closed
charles wants to merge 0 commits from shell-40-ui-companion-apps-control into shell
Owner

What

Settings → Desktop (the "Linux app" tab) → Companion apps, while the status API is on:

  • the original's port warning, first under the "Enable local status API" switch in --status-warning (DesktopStatusApiSection.tsx, PORT_IN_USE_DESCRIPTOR, .warning): "The status API can't start because another program is using port {port}.";
  • the new switch "Let companion apps control your voice" (spec §11, §18 Q7; a new string, fluxer_core::shell::companion::CONTROL_SWITCH), off by default.

CompanionAppsModel gains control and port_warning, both from Task 15's companion_section(app). New settings::Message::StatusApiControlToggled(bool) (appended at the end of the enum) → UserAction::Shell(ShellAction::SetSetting(ShellSettingChange::StatusApiControl(_))).

Strings copied from the original: "The status API can't start because another program is using port {port}." (via core's port_warning). New string: "Let companion apps control your voice" (spec §11).

Tests

  • crates/fluxer-ui/tests/settings_companion.rs: control_switch_shown_and_emits (hidden while the API is off; shown when on; update and a headless click on the toggler emit the setting; the store follows), port_warning_shown (only while on and the port is held; above the URL; gone when the port is free).
  • Goldens settings_companion_control, settings_companion_port_in_use, drawn on lavapipe in fluxer-native-shots:u2204 (UPDATE_GOLDEN=1); rows added to docs/screenshots/README.md.
  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci green locally. No FLUXER_DESKTOP_TESTS needed (no OS integration in this task).

Deviations

  • The control switch and the warning show only while the status API is on (as the rest of the original's section); the control switch sits under the warning, above the connection URL.
  • Also touched crates/fluxer-ui/src/screens/settings/mod.rs (registration file: one Message variant and its update arm) and docs/screenshots/README.md (the suite requires a row per golden). No parity entry: the switch is not a setting of the original.
  • Stacked on: origin/shell-15-core-status-payload-gaps (already contained in shell; the merge was a no-op).

Side by side: the original has no control switch; the warning's placement and colour follow DesktopStatusApiSection.{tsx,module.css}.

Closes #832

🤖 Generated with Claude Code

https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K

## What Settings → Desktop (the "Linux app" tab) → Companion apps, while the status API is on: - the original's port warning, first under the "Enable local status API" switch in `--status-warning` (`DesktopStatusApiSection.tsx`, `PORT_IN_USE_DESCRIPTOR`, `.warning`): "The status API can't start because another program is using port {port}."; - the new switch "Let companion apps control your voice" (spec §11, §18 Q7; a new string, `fluxer_core::shell::companion::CONTROL_SWITCH`), off by default. `CompanionAppsModel` gains `control` and `port_warning`, both from Task 15's `companion_section(app)`. New `settings::Message::StatusApiControlToggled(bool)` (appended at the end of the enum) → `UserAction::Shell(ShellAction::SetSetting(ShellSettingChange::StatusApiControl(_)))`. Strings copied from the original: "The status API can't start because another program is using port {port}." (via core's `port_warning`). New string: "Let companion apps control your voice" (spec §11). ## Tests - `crates/fluxer-ui/tests/settings_companion.rs`: `control_switch_shown_and_emits` (hidden while the API is off; shown when on; update and a headless click on the toggler emit the setting; the store follows), `port_warning_shown` (only while on and the port is held; above the URL; gone when the port is free). - Goldens `settings_companion_control`, `settings_companion_port_in_use`, drawn on lavapipe in `fluxer-native-shots:u2204` (`UPDATE_GOLDEN=1`); rows added to `docs/screenshots/README.md`. - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` green locally. No FLUXER_DESKTOP_TESTS needed (no OS integration in this task). ## Deviations - The control switch and the warning show only while the status API is on (as the rest of the original's section); the control switch sits under the warning, above the connection URL. - Also touched `crates/fluxer-ui/src/screens/settings/mod.rs` (registration file: one `Message` variant and its `update` arm) and `docs/screenshots/README.md` (the suite requires a row per golden). No parity entry: the switch is not a setting of the original. - Stacked on: origin/shell-15-core-status-payload-gaps (already contained in shell; the merge was a no-op). Side by side: the original has no control switch; the warning's placement and colour follow `DesktopStatusApiSection.{tsx,module.css}`. Closes #832 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
Desktop app -> Companion apps gains, while the status API is on, the
original's port warning ("The status API can't start because another
program is using port {port}.", DesktopStatusApiSection.tsx
PORT_IN_USE_DESCRIPTOR, in --status-warning, first under the switch) and
the new switch "Let companion apps control your voice" (spec §11, §18
Q7), both from fluxer_core:🐚:companion::companion_section. The
switch sends UserAction::Shell(SetSetting(StatusApiControl(_))).

Tests: tests/settings_companion.rs (control_switch_shown_and_emits,
port_warning_shown); goldens settings_companion_control and
settings_companion_port_in_use drawn on lavapipe in
fluxer-native-shots:u2204.

Refs #832

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

Review: Shell 40 (independent reviewer)

Scope: git diff baf0a929..origin/shell-40-ui-companion-apps-control (62d56dca).

Checks

  1. Tests: control_switch_shown_and_emits (off by default, hidden while the API is off, update emits UserAction::Shell(SetSetting(StatusApiControl(true))), headless click on the toggler publishes the message, round-trips through the store) and port_warning_shown (exact string with port 21863, hidden while the API is off, ordered after the enable switch and before Connection URL, cleared on StatusApiPortInUse(None)) exist and assert what the plan says. Goldens settings_companion_control and settings_companion_port_in_use exist, are listed in docs/screenshots/README.md, and pass here.
  2. Interfaces: Task 40 has no Interfaces block; it consumes Task 15's CONTROL_SWITCH, companion_section, port_warning exactly as they are on shell. Message::StatusApiControlToggled(bool) is appended at the end of the registration enum.
  3. Invariants: fluxer-ui only; no I/O; CompanionAppsModel's Debug still redacts the URL (token); test token is a placeholder; nothing from the server can panic here.
  4. Parity, against fluxer_app/src/features/user/components/modals/tabs/DesktopStatusApiSection.{tsx,module.css}: (a) PORT_IN_USE_DESCRIPTOR string matches byte for byte; (b) the warning is shown only inside settings.enabled && and first in the field stack, as here; (c) .warning { color: var(--status-warning); font-size: 0.875rem } matches status_warning at BODY_SIZE (14 px).
  5. Review Focus 9: the control switch defaults to off (asserted in the test and in core); the UI only flips the setting.
  6. FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci on 62d56dca: all steps passed (both new tests and both goldens ok).

Findings

  • minor: the control switch is visible only while the status API is on, so control cannot be armed in advance. This is a reasonable reading of spec §11 ("under the existing section"), and the PR notes it as a deviation. No change needed.

Verdict: approved. No blocking findings, and the gate is green.

🤖 Generated with Claude Code

## Review: Shell 40 (independent reviewer) Scope: `git diff baf0a929..origin/shell-40-ui-companion-apps-control` (62d56dca). **Checks** 1. Tests: `control_switch_shown_and_emits` (off by default, hidden while the API is off, update emits `UserAction::Shell(SetSetting(StatusApiControl(true)))`, headless click on the toggler publishes the message, round-trips through the store) and `port_warning_shown` (exact string with port 21863, hidden while the API is off, ordered after the enable switch and before Connection URL, cleared on `StatusApiPortInUse(None)`) exist and assert what the plan says. Goldens `settings_companion_control` and `settings_companion_port_in_use` exist, are listed in `docs/screenshots/README.md`, and pass here. 2. Interfaces: Task 40 has no Interfaces block; it consumes Task 15's `CONTROL_SWITCH`, `companion_section`, `port_warning` exactly as they are on shell. `Message::StatusApiControlToggled(bool)` is appended at the end of the registration enum. 3. Invariants: fluxer-ui only; no I/O; `CompanionAppsModel`'s `Debug` still redacts the URL (token); test token is a placeholder; nothing from the server can panic here. 4. Parity, against `fluxer_app/src/features/user/components/modals/tabs/DesktopStatusApiSection.{tsx,module.css}`: (a) `PORT_IN_USE_DESCRIPTOR` string matches byte for byte; (b) the warning is shown only inside `settings.enabled &&` and first in the field stack, as here; (c) `.warning { color: var(--status-warning); font-size: 0.875rem }` matches `status_warning` at `BODY_SIZE` (14 px). 5. Review Focus 9: the control switch defaults to off (asserted in the test and in core); the UI only flips the setting. 6. `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` on 62d56dca: **all steps passed** (both new tests and both goldens ok). **Findings** - minor: the control switch is visible only while the status API is on, so control cannot be armed in advance. This is a reasonable reading of spec §11 ("under the existing section"), and the PR notes it as a deviation. No change needed. Verdict: **approved**. No blocking findings, and the gate is green. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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 12:41:42 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.