mirror of
https://github.com/vector-im/element-call.git
synced 2026-10-16 23:45:50 +00:00
Add a background of one's own, kept on this device
- An add tile after the pictures opens the file picker, and the image chosen joins the backgrounds on offer without being put on; it is in force once chosen, like a shipped one. The tile is a command rather than a choice, so a menu item beside the radios, and it isn't offered where effects can't run. - Kept in IndexedDB on this device and never sent anywhere, behind a small interface, so the unit tests use an in-memory store; the IndexedDB store itself is tested against fake-indexeddb, a new dev dependency. - The picker takes the focus, which the menu reads as a click elsewhere, so the menu holds itself open until a file is chosen or the picker is cancelled. - A chosen image the device no longer keeps, as after its storage is cleared, falls back to no effect once the device has said what it keeps. - Switching is checked between any two kinds of effect. End to end on Chromium and Firefox: an added image shows in the preview once chosen; once it is in force, no request carries the file or the copy kept, which a deliberate upload fails; chosen, it is in force again after a reload, gone once storage is cleared, and can be added again. - Kept as given here; what can be added is checked in the commit after. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -68,6 +68,8 @@ export interface FooterActions {
|
||||
toggleVideo: (() => void) | undefined;
|
||||
/** Undefined where background effects can't be chosen. */
|
||||
selectBackgroundEffect: ((id: string) => void) | undefined;
|
||||
/** Undefined where no background can be added. */
|
||||
addBackgroundImage: ((file: File) => void) | undefined;
|
||||
toggleScreenSharing: (() => void) | undefined;
|
||||
/** Also controls if the settings button is visible */
|
||||
openSettings: (() => void) | undefined;
|
||||
@@ -176,6 +178,7 @@ export const CallFooter: FC<FooterProps> = ({
|
||||
const selectBackgroundEffect = useBehavior(vm.selectBackgroundEffect$);
|
||||
const backgroundEffectNotice = useBehavior(vm.backgroundEffectNotice$);
|
||||
const backgroundEffectSettling = useBehavior(vm.backgroundEffectSettling$);
|
||||
const addBackgroundImage = useBehavior(vm.addBackgroundImage$);
|
||||
const backgroundEffects = useBackgroundEffectLabels(
|
||||
useBehavior(vm.backgroundEffects$),
|
||||
);
|
||||
@@ -244,6 +247,7 @@ export const CallFooter: FC<FooterProps> = ({
|
||||
selectedBackgroundEffect={backgroundEffect}
|
||||
onSelectBackgroundEffect={selectBackgroundEffect}
|
||||
backgroundEffectSettling={backgroundEffectSettling}
|
||||
onAddBackgroundImage={addBackgroundImage}
|
||||
backgroundEffectNotice={
|
||||
backgroundEffectNotice === "unavailable"
|
||||
? t("background_effects.unavailable")
|
||||
|
||||
Reference in New Issue
Block a user