Screen share 26: Source picker (#173) #242
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "screenshare-26-ui-source-picker"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Stacked on: screenshare-25-ui-share-controls
What this builds
The screen-share source picker (spec §10 "Source picker"), cloned from
fluxer_app/src/features/voice/components/modals/ScreenSharePickerModal.{tsx,module.css}andscreen_share_picker_modal/{PickerGrid,PickerCardButton,NativeDisplayPickerState,PickerEmptyState,useNativePickerCopy}.tsx. No Electron reference image is attached (no Electron client on this machine); the dimensions come fromScreenSharePickerModal.module.css(each constant names its rule), the strings from themsg()descriptors.screens/main/screenshare/picker.rs: a modal over the main screen while the store isGoLive::Picking. Sizemin(73.75rem, window − clamp(2rem, 4vw, 4rem))×min(47.5rem, …), min heightmin(32.5rem, window − 1rem), the ≤900 px and ≤520 px media queries (metrics(), unit-tested), radius 1rem, backdroprgba(0,0,0,.35)(blur left out).theme::iconsfrom@phosphor-icons/react2.1.10, fill weight); window cards on the first, screen cards on the second.FrameBus[VideoKey::Source { id }]through the video widget (Fit::Contain) or the placeholder icon; hover overlay 52 % black with the white "Share screen" pill; icon + title under it ("App window" / "Display" when the source has no title).StartScreenShare(Source(id)), orChangeScreenShareSource(Source(id))when opened by "Change stream".capabilities.in_app_picker == false): each tab shows the native-picker state with the original's copy and "Open system picker" →StartScreenShare(SystemPicker)(ChangeScreenShareSource(SystemPicker)in switch mode).stream_settings_modeland the audio settings), the previews notice with "Disable", and the gear, which opens the stream settings menu of Task 25 for the shown tab (MenuOrigin::Picker:settings_menu::full_in(app, Some(tab context)), so "Capture app audio" on Applications and the toggle writesShareAppAudio; no "Screen share settings" row, asapplyToLiveStream={false}).CloseScreenSharePicker; Escape is left to the gear's menu while that is open.Tests
crates/fluxer-ui/tests/screenshare_picker.rs:tabs_split_screens_and_windows,card_click_starts_share(clicks through the real widget tree; also Escape and the backdrop),switch_mode_changes_source,wayland_shows_system_picker_state,footer_summary_text(also the gear's menu and its per-tab sound checkbox). Written first and seen failing (commitaa1882e). Follow-ups opened: #237, #238.picker.rs:metrics_follow_the_css,summary_joins_with_bullets.picker_windows(fake backend's sources, one window card with a test-pattern thumbnail on theFrameBus, one with the placeholder) andpicker_wayland, added todocs/screenshots/README.md. The goldens were drawn on this machine's hardware Vulkan adapter (no lavapipe here); the existing goldens pass on it within the tolerance, but if the Linux runner disagrees they need redrawing on lavapipe.FLUXER_SCREENSHOT_TESTS=1 cargo xtask cigreen locally. No capture/encoder/device tests apply to this task.Deviations and notes for the reviewer
FrameBusdoes not reach the UI yet:fluxer_ui::runtakes none and no plan task adds it. The picker readspicker::State::frames: Option<FrameBus>(set in the screenshot test), so in the app every card shows its placeholder until #237 hands the bus over and adds the redraw subscription. BecauseFrameBusis notPartialEq,screenshare::Stateno longer derivesPartialEq(nothing compared it).previews_enabledis alwaystrue; follow-up #238.Pickingwith such a listing only if something sets it. The picker renders the state the spec asks for whenever that is the case; I left the reducer alone (outside this task's files).theme/icons.rs+ two SVGs (the plan's "add the icons it needs throughtheme::icons"),screenshare/settings_menu.rs(full_intaking the share context;fullunchanged),tests/screenshots.rs,docs/screenshots/README.md,crates/fluxer-ui/README.md.Closes #173
🤖 Generated with Claude Code
Independent review: Screen share 26 (Source picker)
Scope:
git diff 40d3ea5..origin/screenshare-26-ui-source-picker(4fe84ee).Checks
tabs_split_screens_and_windows,card_click_starts_share,switch_mode_changes_source,wayland_shows_system_picker_state,footer_summary_text) are intests/screenshare_picker.rs, committed failing first inaa1882e, and they assert what the plan asks. Strings match the fork's catalogue ("No application windows found", the Wayland portal copy, "Screen share previews are enabled.", "Clearer text"/"Smoother video", "Shared window"/"Entire system"). Screenshotspicker_windowsandpicker_waylandexist with goldens and README rows.StartScreenShare/ChangeScreenShareSourcein switch mode,StartScreenShare(SystemPicker), the tabs, the hover pill, the footer summary, the gear opening the settings menu, the previews notice with "Disable", and Escape all exist.MenuOrigin::Pickeris a new variant; no other merged or open branch matchesMenuOriginexhaustively outsidescreenshare/. RemovingPartialEqfromscreenshare::Statebreaks no current user.max(0), and an empty title falls back. No secrets.generation()takes a short read lock and an atomic load.FLUXER_SCREENSHOT_TESTS=1 cargo xtask ciin the review worktree: all steps passed, including both picker goldens, on this machine's hardware Vulkan.Findings
picker.rs:689callsbus.generation(&key)in view code. CLAUDE.md says the UI reads the bus only inwidgets::video(draw andredraw_subscription). The call is cheap and reads metadata only, but it is outside the sanctioned place. Either move the placeholder fallback into the video widget, or amend CLAUDE.md to allowgeneration()checks in views.Messagethatleaves()arrives. If the store leavesPickingsome other way (a disconnect, a capture error, or the reducer going straight to the portal),state.menustaysSome(Picker).menu()hides it while the picker is closed, but the next picker opening shows it again at the old anchor, and Escape then closes the menu instead of the picker. A possible fix: clear aPicker-origin menu inmain::view/updatewhenpicker::modelisNone.stream_settings_model(app)with no share context. The original'sresolveScreenShareTargettakescontext, so the resolution and frame rate can differ per tab. Also, with one specific audio source the native summary says "1 app", while the original shows that source's name (summariseSelectedSources).Verdict: approve. No blocking findings; local CI is green.
🤖 Generated with Claude Code