Camera 13: fluxer-ui mirrored video and camera tiles (#965) #987

Closed
charles wants to merge 0 commits from camera-13-ui-mirrored-video-and into camera
Owner

What

Camera plan, Task 13 (fluxer-ui): mirrored video and camera tiles (Camera spec §9, §10.2; rows 31–34).

  • widgets::video: video(&bus, key, fit) now returns a Video (an Element through into()) with .mirrored(bool). Mirroring is a display concern only: on wgpu the uv rectangle's left and right edges are swapped (Placement::mirrored, video.wgsl unchanged but documented); on tiny-skia the image's rows are reversed (cached per mirrored flag). placement keeps its tests. The frame on the bus, and so what is sent, is never touched.
  • Tiles: TileModel::camera: TileCamera filled from fluxer_core::voice::camera::tile_camera. tile::view(&model, face, &FrameBus, w, h) draws the five states under the existing plate, speaking border and soundboard emoji: Video { key, mirrored } (the picture, Contain on --voice-surface-0, own camera mirrored with "Mirror camera"), Loading (the buffering frame, tooltip "Camera loading"), Hidden ("Camera hidden" + "Show camera", FeedHiddenOverlay with MonitorPlay 18 px → Message::ShowOwnCamera → SetVoiceSetting(ShowMyOwnCamera(true))), DisabledLocally (VideoCameraSlash 24 px in --status-danger over the avatar under --voice-overlay-strong), Unavailable (the avatar with the camera icon in the plate, spec §8.2). Others' video tiles get the "⋯" button first in the plate (.participantMetadataMenuButton), call::Message::OpenParticipantMenu { user_id, connection_id, position }, routed to the existing participant menu for that connection.
  • SetShown (spec §9): call::shown::report is a draw-nothing widget placed among the grid's drawn tiles (those grid::metrics has room for; grid::shown_cameras) and the focus layout's members row; on the redraw after a layout it publishes call::Message::ShownCameras(connections) when they differ from what the store was told — one message per layout that changes them. call::State::report_cameras turns it into CameraAction::SetShown once per change. The own camera is never in the set (TileModel::shows_camera). The view reports only while the window is shown (call::State::on_screen, set by the shell); when the call view leaves the screen (another channel, the chat over the call, a settings screen, a hidden window: call::on_screen), the shell sends an empty SetShown once (call::hide_cameras, Shell::follow_cameras).
  • Redraw: the shell's clock (awaits_first_frame) also runs while a shown camera tile (own, or a remote one the store says plays) has no frame on the bus yet.
  • Icons Camera (camera-fill) and VideoCameraSlash (video-camera-slash-fill), Phosphor 2.1.10 path data.
  • Strings copied from the fork (voice_participant_tile/shared.ts): "Camera loading", "Camera hidden", "Show camera".

Tests

  • tests/video_widget.rs: mirrored_placement_flips_uv_only, mirror_golden_differs_from_plain_and_matches_flip (+ _wgpu; the asymmetric TestPattern::camera read back with is_mirrored, compared with the plain picture flipped), mirror_with_cover_crops_the_same_middle (+ _wgpu).
  • tests/camera_tiles.rs (new): tile_state_per_tile_camera, video_tiles_draw_the_picture_mirrored_only_for_the_own, hidden_own_tile_offers_show_camera, others_video_tile_has_the_participant_menu_button, disabled_locally_draws_the_slashed_camera_over_the_avatar, set_shown_follows_visible_tiles (including one message per layout pass), set_shown_empty_when_call_view_hidden, own_camera_never_in_shown.
  • Goldens (tests/screenshots.rs, rows added to docs/screenshots/README.md): camera_tile_video, camera_tile_own_mirrored, camera_tile_loading, camera_tile_hidden, camera_tile_disabled_locally, call_grid_cameras. Drawn with UPDATE_GOLDEN=1 on lavapipe in the fluxer-native-shots:u2204 image; every picture is the camera test pattern, never a camera. No existing golden changed.
  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci is green locally (screenshot step included). No camera, microphone or screen was opened; the client was not run; no FLUXER_DESKTOP_TESTS test was run (none was added).

Deviations and notes for the reviewer

  • The failing-test run before the implementation was a compile failure (no Video::mirrored, no tile::view bus argument, no call::Message::ShownCameras); it is commit test(ui): camera tiles and mirrored video (failing).
  • Files outside the task's list, same crate: call/shown.rs (new, the report widget, to keep call/mod.rs additions short), call/grid.rs and call/focus.rs (pass the bus to the tiles, place the report), call/stream_tile.rs (feed_hidden and spinner shared with the camera tile, no change in look), screens/main/mod.rs (routing of the two new messages), app.rs (on_screen, follow_cameras, the first-frame clock), testing/offscreen.rs (render takes impl Into<Element>), and .into() at four video() call sites (pip.rs, stream_tile.rs, screenshare/picker.rs).
  • The "⋯" button is drawn on others' video tiles only (plan text); the original shows it on every grid tile of others. Avatar tiles are unchanged so existing goldens stay.
  • The focus members row reports all its camera tiles while it shows (no per-tile scroll visibility, the original's 120 px margin is not modelled); the row in a scrollable also means the "⋯" menu there opens at the content's coordinates (the same limitation on_right_press documents). Task 16 owns the focus layout with cameras.
  • Video tiles clip to a rectangle (the corners of the picture are square), as the stream tiles already do.

Closes #965

🤖 Generated with Claude Code

https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K

## What Camera plan, Task 13 (`fluxer-ui`): mirrored video and camera tiles (Camera spec §9, §10.2; rows 31–34). - **`widgets::video`**: `video(&bus, key, fit)` now returns a `Video` (an `Element` through `into()`) with `.mirrored(bool)`. Mirroring is a display concern only: on wgpu the `uv` rectangle's left and right edges are swapped (`Placement::mirrored`, `video.wgsl` unchanged but documented); on tiny-skia the image's rows are reversed (cached per mirrored flag). `placement` keeps its tests. The frame on the bus, and so what is sent, is never touched. - **Tiles**: `TileModel::camera: TileCamera` filled from `fluxer_core::voice::camera::tile_camera`. `tile::view(&model, face, &FrameBus, w, h)` draws the five states under the existing plate, speaking border and soundboard emoji: `Video { key, mirrored }` (the picture, `Contain` on `--voice-surface-0`, own camera mirrored with "Mirror camera"), `Loading` (the buffering frame, tooltip "Camera loading"), `Hidden` ("Camera hidden" + "Show camera", `FeedHiddenOverlay` with `MonitorPlay` 18 px → `Message::ShowOwnCamera` → `SetVoiceSetting(ShowMyOwnCamera(true))`), `DisabledLocally` (`VideoCameraSlash` 24 px in `--status-danger` over the avatar under `--voice-overlay-strong`), `Unavailable` (the avatar with the camera icon in the plate, spec §8.2). Others' video tiles get the "⋯" button first in the plate (`.participantMetadataMenuButton`), `call::Message::OpenParticipantMenu { user_id, connection_id, position }`, routed to the existing participant menu for that connection. - **SetShown** (spec §9): `call::shown::report` is a draw-nothing widget placed among the grid's drawn tiles (those `grid::metrics` has room for; `grid::shown_cameras`) and the focus layout's members row; on the redraw after a layout it publishes `call::Message::ShownCameras(connections)` when they differ from what the store was told — one message per layout that changes them. `call::State::report_cameras` turns it into `CameraAction::SetShown` once per change. The own camera is never in the set (`TileModel::shows_camera`). The view reports only while the window is shown (`call::State::on_screen`, set by the shell); when the call view leaves the screen (another channel, the chat over the call, a settings screen, a hidden window: `call::on_screen`), the shell sends an empty `SetShown` once (`call::hide_cameras`, `Shell::follow_cameras`). - **Redraw**: the shell's clock (`awaits_first_frame`) also runs while a shown camera tile (own, or a remote one the store says plays) has no frame on the bus yet. - Icons `Camera` (`camera-fill`) and `VideoCameraSlash` (`video-camera-slash-fill`), Phosphor 2.1.10 path data. - Strings copied from the fork (`voice_participant_tile/shared.ts`): "Camera loading", "Camera hidden", "Show camera". ## Tests - `tests/video_widget.rs`: `mirrored_placement_flips_uv_only`, `mirror_golden_differs_from_plain_and_matches_flip` (+ `_wgpu`; the asymmetric `TestPattern::camera` read back with `is_mirrored`, compared with the plain picture flipped), `mirror_with_cover_crops_the_same_middle` (+ `_wgpu`). - `tests/camera_tiles.rs` (new): `tile_state_per_tile_camera`, `video_tiles_draw_the_picture_mirrored_only_for_the_own`, `hidden_own_tile_offers_show_camera`, `others_video_tile_has_the_participant_menu_button`, `disabled_locally_draws_the_slashed_camera_over_the_avatar`, `set_shown_follows_visible_tiles` (including one message per layout pass), `set_shown_empty_when_call_view_hidden`, `own_camera_never_in_shown`. - Goldens (`tests/screenshots.rs`, rows added to `docs/screenshots/README.md`): `camera_tile_video`, `camera_tile_own_mirrored`, `camera_tile_loading`, `camera_tile_hidden`, `camera_tile_disabled_locally`, `call_grid_cameras`. Drawn with `UPDATE_GOLDEN=1` on lavapipe in the `fluxer-native-shots:u2204` image; every picture is the camera test pattern, never a camera. No existing golden changed. - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` is green locally (screenshot step included). No camera, microphone or screen was opened; the client was not run; no `FLUXER_DESKTOP_TESTS` test was run (none was added). ## Deviations and notes for the reviewer - The failing-test run before the implementation was a compile failure (no `Video::mirrored`, no `tile::view` bus argument, no `call::Message::ShownCameras`); it is commit `test(ui): camera tiles and mirrored video (failing)`. - Files outside the task's list, same crate: `call/shown.rs` (new, the report widget, to keep `call/mod.rs` additions short), `call/grid.rs` and `call/focus.rs` (pass the bus to the tiles, place the report), `call/stream_tile.rs` (`feed_hidden` and `spinner` shared with the camera tile, no change in look), `screens/main/mod.rs` (routing of the two new messages), `app.rs` (`on_screen`, `follow_cameras`, the first-frame clock), `testing/offscreen.rs` (`render` takes `impl Into<Element>`), and `.into()` at four `video()` call sites (`pip.rs`, `stream_tile.rs`, `screenshare/picker.rs`). - The "⋯" button is drawn on others' **video** tiles only (plan text); the original shows it on every grid tile of others. Avatar tiles are unchanged so existing goldens stay. - The focus members row reports all its camera tiles while it shows (no per-tile scroll visibility, the original's 120 px margin is not modelled); the row in a scrollable also means the "⋯" menu there opens at the content's coordinates (the same limitation `on_right_press` documents). Task 16 owns the focus layout with cameras. - Video tiles clip to a rectangle (the corners of the picture are square), as the stream tiles already do. Closes #965 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
The video widget's mirroring (mirrored_placement_flips_uv_only, the camera
pattern drawn mirrored against its flip on both renderers), the tile state
per TileCamera and its drawing (picture mirrored only for the own camera,
"Camera hidden" / "Show camera", the "⋯" button on others' video tiles, the
slashed camera when disabled locally), the call view's SetShown report
(set_shown_follows_visible_tiles, set_shown_empty_when_call_view_hidden,
own_camera_never_in_shown), and the goldens camera_tile_video,
camera_tile_own_mirrored, camera_tile_loading, camera_tile_hidden,
camera_tile_disabled_locally and call_grid_cameras.

Refs #965

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
widgets::video: video() returns a Video with .mirrored(bool), which flips the
picture on screen only (the uv rectangle's edges swapped on wgpu,
Placement::mirrored; the image rows reversed on tiny-skia); the frame on the
bus is untouched. A participant tile draws the store's TileCamera under its
plate, ring and emoji: the picture (Contain on --voice-surface-0, the own one
mirrored with "Mirror camera"), "Camera loading", "Camera hidden" with "Show
camera", the slashed camera over the avatar when disabled locally, the avatar
with the camera icon when no frame came; others' video tiles get the "⋯"
button that opens the participant menu. call::shown::report sits among the
grid's drawn tiles and the focus members row and publishes ShownCameras once
per layout that changes them; call::State::report_cameras turns it into
CameraAction::SetShown, and the shell sends an empty set when the call view
leaves the screen (call::hide_cameras). The shell's clock runs while a shown
camera has no frame yet. Icons Camera and VideoCameraSlash (Phosphor fill).
Strings: "Camera loading", "Camera hidden", "Show camera"
(voice_participant_tile/shared.ts).

Refs #965

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
Drawn on lavapipe in the fluxer-native-shots:u2204 image with
UPDATE_GOLDEN=1: camera_tile_video, camera_tile_own_mirrored,
camera_tile_loading, camera_tile_hidden, camera_tile_disabled_locally and
call_grid_cameras, every picture the camera test pattern. The speaking border
stays over the "disabled locally" overlay, as the original's border is outside
the overlay's box.

Refs #965

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 (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:49 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.