Camera 17: fluxer-core Toggle camera shortcut, tray row, indication rule (#969) #988

Closed
charles wants to merge 0 commits from camera-17-core-toggle-camera-shortcut into camera
Owner

What

Camera plan Task 17 (spec §12, §13.3, §16 D9, Q6 as recommended).

  • ShortcutAction::VoiceToggleCamera added at the end of ShortcutAction::ALL. Id voice_toggle_camera, label "Toggle camera". It is unbound by default, may be global, and fires on press (InputKeybind.ts:897-905). A press becomes CameraAction::Toggle, which Task 7's reducer already handles: off → on without the preview, on → off. The reducer ignores it when not connected, without STREAM, or at the limits. The same arm is in the global path (shell::keybinds::press_action) and the window path (fluxer-ui keybinds::voice_actions). A stored binding for the id (from an older file or the original) is no longer skipped as unknown. It now applies.
  • TrayAction::TurnOffCamera added at the end of TrayAction::ALL. While the camera is on (is_on()), the tray menu shows "Turn off camera" after "Deafen", and the tooltip ends with " - Camera on" (after any unread text). The row sends CameraAction::TurnOff and leaves the window alone. There is no "Turn on camera" row. Closing to the tray does not turn the camera off.
  • voice::camera::indication(app, window_shown, call_view_shown) -> Option<Indication::{PreviewModal, ControlBarAndTile, VoicePanel, Tray}> returns None exactly while the capture is closed. It answers Tray only for a hidden window when a tray is available and its menu has the row. Without a tray, the existing window rule reveals a hidden window, so Tray is never the answer there.

Strings: "Toggle camera" is the original's (TOGGLE_CAMERA_DESCRIPTOR). "Turn off camera" and " - Camera on" are the native additions from spec §12 / D9.

Tests

  • fluxer-core/tests/shell_keybinds.rs: toggle_camera_in_all_and_from_id, stored_binding_from_before_applies (an older file's Ctrl+Shift+C binding goes through the matcher and toggles the camera), shortcut_toggles_without_preview, shortcut_ignored_when_disabled_or_disconnected. The two existing tests that used voice_toggle_camera as the "unknown id" now assert that it applies. They use voice_switch_channel as the unknown id instead.
  • fluxer-core/tests/shell_tray.rs: tray_row_only_while_camera_on (also covers preview-only, close to tray, and off again), tray_action_turns_camera_off, tooltip_suffix, plus the new arm in every_action_maps.
  • fluxer-core/tests/camera_indication.rs: the table indication_exists_whenever_capture_is_open has 48 cases: camera {off, preview, preview failed, starting, live, live + preview} × window {shown, hidden} × tray {yes, no} × call view {yes, no}. All of them go through App::apply. Without a tray, the window is hidden with a tray and then the tray is lost, so the window rule reveals it. Also nothing_is_indicated_while_the_capture_is_closed.
  • Goldens: the five system_shortcuts_* goldens were redrawn on lavapipe (fluxer-native-shots:u2204, UPDATE_GOLDEN=1) because both lists gain the "Toggle camera" row. No other golden changed. No threshold was touched.
  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci is green locally. No desktop, device or opt-in test was run.

Deviations / outside the task's files

  • crates/fluxer-core/src/shell/ports.rs: the two enums live there, so both variants are added there.
  • crates/fluxer-ui/src/keybinds.rs: one arm in the window shortcut handler's exhaustive match. The Keybinds page has no row table of its own; it iterates ALL.
  • Test lists of the global-capable actions now include the camera, as the original's GLOBAL_SHORTCUT_ACTIONS does: fluxer-platform portal unit test and tests/portal_shortcuts_bus.rs, fluxer-ui/tests/settings_system_shortcuts.rs, fluxer-core/tests/{shell_ports,shell_system_shortcuts}.rs. Hyprland lines and the system-wide section gain a row.
  • "Allowed in fullscreen" has no code to change: the native client has no fullscreen gate on shortcuts (the original's VOICE_CALL_FULLSCREEN_ALLOWED_ACTIONS), so the shortcut works everywhere.
  • If the camera is on while the voice block of the tray menu is not shown (not is_live(), which should not happen), the row still appears in a section of its own so that the indication rule holds.
  • docs/parity/* (shell rows 66-68, #938) is left to Task 20. #938 is not closed: only its camera part is built here (I comment on it).

For Charles (Windows / real desktop)

  • Windows: no cfg(windows) code changed. The Windows tray takes the new row through TrayAction::ALL (id flaxative-tray-16).
  • Bind "Toggle camera" in Settings → Shortcuts. In a voice channel the camera turns on without the preview, and pressing again turns it off. Close the window to the tray: the tray shows "Turn off camera" and the tooltip ends with " - Camera on".

Closes #969

🤖 Generated with Claude Code

https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K

## What Camera plan Task 17 (spec §12, §13.3, §16 D9, Q6 as recommended). - `ShortcutAction::VoiceToggleCamera` added at the end of `ShortcutAction::ALL`. Id `voice_toggle_camera`, label "Toggle camera". It is unbound by default, may be global, and fires on press (`InputKeybind.ts:897-905`). A press becomes `CameraAction::Toggle`, which Task 7's reducer already handles: off → on without the preview, on → off. The reducer ignores it when not connected, without STREAM, or at the limits. The same arm is in the global path (`shell::keybinds::press_action`) and the window path (`fluxer-ui` `keybinds::voice_actions`). A stored binding for the id (from an older file or the original) is no longer skipped as unknown. It now applies. - `TrayAction::TurnOffCamera` added at the end of `TrayAction::ALL`. While the camera is on (`is_on()`), the tray menu shows "Turn off camera" after "Deafen", and the tooltip ends with " - Camera on" (after any unread text). The row sends `CameraAction::TurnOff` and leaves the window alone. There is no "Turn on camera" row. Closing to the tray does not turn the camera off. - `voice::camera::indication(app, window_shown, call_view_shown) -> Option<Indication::{PreviewModal, ControlBarAndTile, VoicePanel, Tray}>` returns `None` exactly while the capture is closed. It answers `Tray` only for a hidden window when a tray is available and its menu has the row. Without a tray, the existing window rule reveals a hidden window, so `Tray` is never the answer there. Strings: "Toggle camera" is the original's (`TOGGLE_CAMERA_DESCRIPTOR`). "Turn off camera" and " - Camera on" are the native additions from spec §12 / D9. ## Tests - `fluxer-core/tests/shell_keybinds.rs`: `toggle_camera_in_all_and_from_id`, `stored_binding_from_before_applies` (an older file's Ctrl+Shift+C binding goes through the matcher and toggles the camera), `shortcut_toggles_without_preview`, `shortcut_ignored_when_disabled_or_disconnected`. The two existing tests that used `voice_toggle_camera` as the "unknown id" now assert that it applies. They use `voice_switch_channel` as the unknown id instead. - `fluxer-core/tests/shell_tray.rs`: `tray_row_only_while_camera_on` (also covers preview-only, close to tray, and off again), `tray_action_turns_camera_off`, `tooltip_suffix`, plus the new arm in `every_action_maps`. - `fluxer-core/tests/camera_indication.rs`: the table `indication_exists_whenever_capture_is_open` has 48 cases: camera {off, preview, preview failed, starting, live, live + preview} × window {shown, hidden} × tray {yes, no} × call view {yes, no}. All of them go through `App::apply`. Without a tray, the window is hidden with a tray and then the tray is lost, so the window rule reveals it. Also `nothing_is_indicated_while_the_capture_is_closed`. - Goldens: the five `system_shortcuts_*` goldens were redrawn on lavapipe (`fluxer-native-shots:u2204`, `UPDATE_GOLDEN=1`) because both lists gain the "Toggle camera" row. No other golden changed. No threshold was touched. - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` is green locally. No desktop, device or opt-in test was run. ## Deviations / outside the task's files - `crates/fluxer-core/src/shell/ports.rs`: the two enums live there, so both variants are added there. - `crates/fluxer-ui/src/keybinds.rs`: one arm in the window shortcut handler's exhaustive match. The Keybinds page has no row table of its own; it iterates `ALL`. - Test lists of the global-capable actions now include the camera, as the original's `GLOBAL_SHORTCUT_ACTIONS` does: `fluxer-platform` portal unit test and `tests/portal_shortcuts_bus.rs`, `fluxer-ui/tests/settings_system_shortcuts.rs`, `fluxer-core/tests/{shell_ports,shell_system_shortcuts}.rs`. Hyprland lines and the system-wide section gain a row. - "Allowed in fullscreen" has no code to change: the native client has no fullscreen gate on shortcuts (the original's `VOICE_CALL_FULLSCREEN_ALLOWED_ACTIONS`), so the shortcut works everywhere. - If the camera is on while the voice block of the tray menu is not shown (not `is_live()`, which should not happen), the row still appears in a section of its own so that the indication rule holds. - `docs/parity/*` (shell rows 66-68, #938) is left to Task 20. #938 is not closed: only its camera part is built here (I comment on it). ## For Charles (Windows / real desktop) - Windows: no `cfg(windows)` code changed. The Windows tray takes the new row through `TrayAction::ALL` (id `flaxative-tray-16`). - Bind "Toggle camera" in Settings → Shortcuts. In a voice channel the camera turns on without the preview, and pressing again turns it off. Close the window to the tray: the tray shows "Turn off camera" and the tooltip ends with " - Camera on". Closes #969 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
Refs #969

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
ShortcutAction::VoiceToggleCamera (voice_toggle_camera, "Toggle camera",
unbound, global-capable, a press; InputKeybind.ts:897-905) appended and
reduced to CameraAction::Toggle, so a stored binding of the id applies.
TrayAction::TurnOffCamera appended: "Turn off camera" after "Deafen"
while the camera is on, the tooltip suffix " - Camera on" (spec §12,
§16 D9). camera::indication(app, window_shown, call_view_shown) names
what shows the open capture (spec §13.3), never None while it is open.

Outside fluxer-core, the minimum the new variant needs: one arm in
fluxer-ui's window shortcut handler, and the global-action lists of the
portal tests (fluxer-platform) and the system-wide shortcuts test
(fluxer-ui) gain the action.

Refs #969

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
The five system_shortcuts_* goldens redrawn on lavapipe (the
fluxer-native-shots:u2204 image) with UPDATE_GOLDEN=1: the custom list
and the system-wide list gain the "Toggle camera" row. No other golden
changes.

Refs #969

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
charles changed title from Camera 17: core-toggle-camera-shortcut (#969) to Camera 17: fluxer-core Toggle camera shortcut, tray row, indication rule (#969) 2026-11-20 04:10:56 +00:00
Author
Owner

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

Merged into `camera` by hand (the merge API returns 405); the commits are in the branch.
charles closed this pull request 2026-11-20 04:11:55 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.