Camera 14: fluxer-ui camera buttons, camera menu, "Camera preview" (#966) #990

Closed
charles wants to merge 0 commits from camera-14-ui-camera-buttons-camera into camera
Owner

What

Camera plan, Task 14 (fluxer-ui): the camera buttons, the camera menu and "Camera preview" (Camera spec §10.1, §11; inventory rows 1–9, 11, 45–46).

  • Control bar (call/control_bar.rs): ControlBarModel::camera is the store's camera_button (rows 1–3). Off: CameraSlash, neutral, a click opens the preview (camera_menu::Message::OpenPreview, spec §19 Q3). On: Camera in --vc-success on --vc-success-bg (.buttonCameraOn), a click turns it off. Disabled: 45 %, the tooltip says why, the button sends nothing. Its caret ("Camera settings", always enabled as the original's) and a right-click on the enabled button open the camera menu. COMING_LATER is gone.
  • Voice panel (voice_panel.rs): the camera button first in the media row (row 6), camera_button_on(.., CameraSurface::VoicePanel) (no participant check; "Waiting for connection..." while connecting), --status-online while on, a right-click on the enabled button opens the menu.
  • Camera menu (call/camera_menu.rs, row 8): "Camera" with its hint (the camera in use; "Default" names the first camera, as the original's synthetic default entry) and the radios "Default" + each listed camera; "Mirror camera"; "Preview camera"; "Video settings". A stored camera that is not listed shows as "Default" and the choice is kept (spec §16 D6). Radios and the checkbox leave the menu open; the rows close it. context_menu::Item::HintedSubmenu is new (a submenu with a hint under its label, ContextMenu.tsx:539).
  • "Camera preview" (screens/main/camera_preview.rs, row 9): shown while the store's preview is open; device box, the video widget on LocalCamera (Contain, mirrored with "Mirror camera", only on screen), "Initializing camera..." until the first frame, "Camera error" + the §11 line in place of the picture, the "Mirror camera" switch, "Cancel", "Turn on camera" (TurnOn then ClosePreview: the capture is kept, D1). "Turn on camera" is absent while the camera is on and when model(app, false) (the settings' camera test, for Task 15), disabled with the core's reason otherwise. Cancel, the X, Escape and the backdrop send ClosePreview. The store closes it when the window hides (core). It is a main::Modal layer and is drawn in fullscreen too, so an open capture always has its indication.
  • Notices (spec §11): "Camera permission required" and "Something went wrong" — "Failed to enable camera." as a modal (camera_preview::notice_modal, closed with DismissVoiceError, main::Modal::CameraNotice); the toasts (in use from the shortcut, "Your camera was disconnected.", the camera limit) once each through the menus' toast (main::sync_camera on every snapshot).
  • DM header (calls/dm_header.rs, row 7): the video call button after the voice one: "Start video call" (starts the call; the camera stays off), "Join video call", "Join video call (1 participant)" / "(n participants)", and in the call "Turn on camera" / "Turn off camera" → CameraAction::Toggle (no preview), drawn selected while on.
  • Friends page (friends/mod.rs): "Start video call" after "Start voice call" in a row's "More" menu (friends::more_menu).
  • Window Escape closes the camera notice, then the preview, then the camera menu (app.rs). The shell's first-frame clock also runs while the preview shows its picture without a frame.

Strings copied from the fork: "Turn on camera", "Turn off camera", "Camera settings", "Camera", "Default", "Mirror camera", "Preview camera", "Video settings", "Camera preview", "Initializing camera...", "Cancel", "Camera error", "Start video call", "Join video call", "Join video call (# participant[s])"; the rest (tooltips, notices) are the core's constants from Task 7.

How it was tested

  • tests/camera_controls.rs (new): button_state_and_tooltip_per_camera_button, click_off_opens_preview_click_on_turns_off, disabled_button_emits_nothing, caret_and_right_click_open_menu, menu_rows_and_device_radio, voice_panel_has_no_participant_limit, dm_header_labels, friends_more_menu_starts_video_call, notice_to_modal_or_toast.
  • tests/camera_preview.rs (new): preview_states (initializing, picture mirrored and not, errors, window hidden), turn_on_disabled_with_reason, cancel_escape_backdrop_close_and_emit.
  • tests/keybinds.rs: camera_preview_and_notice_are_modals. tests/call_view.rs updated for the live camera button.
  • Goldens (rows in docs/screenshots/README.md): control_bar_camera_off, control_bar_camera_on, control_bar_camera_disabled, camera_menu, camera_preview, camera_preview_initializing, camera_preview_error, voice_panel_camera_on, camera_permission_modal; control_bar_sharing and stream_settings_menu redrawn (the camera caret and the panel's camera button pushed them over 0.5 %). Drawn with UPDATE_GOLDEN=1 on lavapipe in the fluxer-native-shots:u2204 image; every picture is the camera test pattern. No threshold changed.
  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci green locally. No camera, microphone or screen was opened, the client was not run, no FLUXER_DESKTOP_TESTS / FLUXER_CAMERA_TESTS test was run (none added).

Deviations and notes for the reviewer

  • Files outside the task's list, same crate: screens/main/header.rs (takes the DM's call buttons as a slice), app.rs (Local::camera, snapshot sync, Escape, first-frame clock), widgets/context_menu.rs (Item::HintedSubmenu) and the one-line arm it needs in entity_settings/guild/roles.rs, screenshare/mod.rs (radio_row made pub(crate) for the device radios), tests menus_admin.rs / menus_channel_guild.rs (label helpers match the new variant). No other crate touched: the friends "Start video call" row is added on the UI side (friends::more_menu) rather than in fluxer-core::social.
  • The preview has no spinner (text only), no background row (spec §15) and no "Optimizing/Finalizing" statuses (row 12). Device radios have no leading camera icon.
  • The original's system DMs (which cannot host calls) do not exist in this client, so "System DMs cannot host video calls" is not built.
  • On the control bar the camera-limit state can only show with ≤ 25 connections; with 25 others on camera the bar says "Cameras are off above 25 participants" first (core's order); the panel and the preview show the cap.
  • A toast notice that repeats without the store clearing it in between (e.g. two shortcut presses both finding the camera busy) shows once.
  • Task 15 should open the preview from the settings with camera_preview::model(app, false) and draw it with camera_preview::over.

Closes #966

🤖 Generated with Claude Code

https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K

## What Camera plan, Task 14 (`fluxer-ui`): the camera buttons, the camera menu and "Camera preview" (Camera spec §10.1, §11; inventory rows 1–9, 11, 45–46). - **Control bar** (`call/control_bar.rs`): `ControlBarModel::camera` is the store's `camera_button` (rows 1–3). Off: `CameraSlash`, neutral, a click opens the preview (`camera_menu::Message::OpenPreview`, spec §19 Q3). On: `Camera` in `--vc-success` on `--vc-success-bg` (`.buttonCameraOn`), a click turns it off. Disabled: 45 %, the tooltip says why, the button sends nothing. Its caret ("Camera settings", always enabled as the original's) and a right-click on the enabled button open the camera menu. `COMING_LATER` is gone. - **Voice panel** (`voice_panel.rs`): the camera button first in the media row (row 6), `camera_button_on(.., CameraSurface::VoicePanel)` (no participant check; "Waiting for connection..." while connecting), `--status-online` while on, a right-click on the enabled button opens the menu. - **Camera menu** (`call/camera_menu.rs`, row 8): "Camera" with its hint (the camera in use; "Default" names the first camera, as the original's synthetic `default` entry) and the radios "Default" + each listed camera; "Mirror camera"; "Preview camera"; "Video settings". A stored camera that is not listed shows as "Default" and the choice is kept (spec §16 D6). Radios and the checkbox leave the menu open; the rows close it. `context_menu::Item::HintedSubmenu` is new (a submenu with a hint under its label, `ContextMenu.tsx:539`). - **"Camera preview"** (`screens/main/camera_preview.rs`, row 9): shown while the store's preview is open; device box, the `video` widget on `LocalCamera` (`Contain`, mirrored with "Mirror camera", only on screen), "Initializing camera..." until the first frame, "Camera error" + the §11 line in place of the picture, the "Mirror camera" switch, "Cancel", "Turn on camera" (`TurnOn` then `ClosePreview`: the capture is kept, D1). "Turn on camera" is absent while the camera is on and when `model(app, false)` (the settings' camera test, for Task 15), disabled with the core's reason otherwise. Cancel, the X, Escape and the backdrop send `ClosePreview`. The store closes it when the window hides (core). It is a `main::Modal` layer and is drawn in fullscreen too, so an open capture always has its indication. - **Notices** (spec §11): "Camera permission required" and "Something went wrong" — "Failed to enable camera." as a modal (`camera_preview::notice_modal`, closed with `DismissVoiceError`, `main::Modal::CameraNotice`); the toasts (in use from the shortcut, "Your camera was disconnected.", the camera limit) once each through the menus' toast (`main::sync_camera` on every snapshot). - **DM header** (`calls/dm_header.rs`, row 7): the video call button after the voice one: "Start video call" (starts the call; the camera stays off), "Join video call", "Join video call (1 participant)" / "(n participants)", and in the call "Turn on camera" / "Turn off camera" → `CameraAction::Toggle` (no preview), drawn selected while on. - **Friends page** (`friends/mod.rs`): "Start video call" after "Start voice call" in a row's "More" menu (`friends::more_menu`). - Window Escape closes the camera notice, then the preview, then the camera menu (`app.rs`). The shell's first-frame clock also runs while the preview shows its picture without a frame. Strings copied from the fork: "Turn on camera", "Turn off camera", "Camera settings", "Camera", "Default", "Mirror camera", "Preview camera", "Video settings", "Camera preview", "Initializing camera...", "Cancel", "Camera error", "Start video call", "Join video call", "Join video call (# participant[s])"; the rest (tooltips, notices) are the core's constants from Task 7. ## How it was tested - `tests/camera_controls.rs` (new): `button_state_and_tooltip_per_camera_button`, `click_off_opens_preview_click_on_turns_off`, `disabled_button_emits_nothing`, `caret_and_right_click_open_menu`, `menu_rows_and_device_radio`, `voice_panel_has_no_participant_limit`, `dm_header_labels`, `friends_more_menu_starts_video_call`, `notice_to_modal_or_toast`. - `tests/camera_preview.rs` (new): `preview_states` (initializing, picture mirrored and not, errors, window hidden), `turn_on_disabled_with_reason`, `cancel_escape_backdrop_close_and_emit`. - `tests/keybinds.rs`: `camera_preview_and_notice_are_modals`. `tests/call_view.rs` updated for the live camera button. - Goldens (rows in `docs/screenshots/README.md`): `control_bar_camera_off`, `control_bar_camera_on`, `control_bar_camera_disabled`, `camera_menu`, `camera_preview`, `camera_preview_initializing`, `camera_preview_error`, `voice_panel_camera_on`, `camera_permission_modal`; `control_bar_sharing` and `stream_settings_menu` redrawn (the camera caret and the panel's camera button pushed them over 0.5 %). Drawn with `UPDATE_GOLDEN=1` on lavapipe in the `fluxer-native-shots:u2204` image; every picture is the camera test pattern. No threshold changed. - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` green locally. No camera, microphone or screen was opened, the client was not run, no `FLUXER_DESKTOP_TESTS` / `FLUXER_CAMERA_TESTS` test was run (none added). ## Deviations and notes for the reviewer - Files outside the task's list, same crate: `screens/main/header.rs` (takes the DM's call buttons as a slice), `app.rs` (`Local::camera`, snapshot sync, Escape, first-frame clock), `widgets/context_menu.rs` (`Item::HintedSubmenu`) and the one-line arm it needs in `entity_settings/guild/roles.rs`, `screenshare/mod.rs` (`radio_row` made `pub(crate)` for the device radios), tests `menus_admin.rs` / `menus_channel_guild.rs` (label helpers match the new variant). No other crate touched: the friends "Start video call" row is added on the UI side (`friends::more_menu`) rather than in `fluxer-core::social`. - The preview has no spinner (text only), no background row (spec §15) and no "Optimizing/Finalizing" statuses (row 12). Device radios have no leading camera icon. - The original's system DMs (which cannot host calls) do not exist in this client, so "System DMs cannot host video calls" is not built. - On the control bar the camera-limit state can only show with ≤ 25 connections; with 25 others on camera the bar says "Cameras are off above 25 participants" first (core's order); the panel and the preview show the cap. - A toast notice that repeats without the store clearing it in between (e.g. two shortcut presses both finding the camera busy) shows once. - Task 15 should open the preview from the settings with `camera_preview::model(app, false)` and draw it with `camera_preview::over`. Closes #966 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
Refs #966

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
Drawn with UPDATE_GOLDEN=1 on lavapipe in the fluxer-native-shots:u2204 image; every
picture is the camera test pattern. control_bar_sharing and stream_settings_menu are
redrawn for the camera button's caret and the voice panel's camera button.

Refs #966

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

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

Merged into camera by hand (conflicts with the other wave-6 tasks in the screenshot tests, docs and camera_awaits_first_frame, which now serves both previews). The full gate passed on the combined tree.

Merged into `camera` by hand (conflicts with the other wave-6 tasks in the screenshot tests, docs and `camera_awaits_first_frame`, which now serves both previews). The full gate passed on the combined tree.
charles closed this pull request 2026-11-20 05:36:43 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.