Merge branch 'toger5/move-settings-out-of-bottom-bar' into toger5/bottom-bar-storybook

This commit is contained in:
Timo K
2026-04-15 14:42:26 +02:00
6 changed files with 12 additions and 15 deletions
+2 -2
View File
@@ -71,8 +71,8 @@ export const AppBar: FC<Props> = ({ children }) => {
> >
<LeftNav> <LeftNav>
<Tooltip label={t("common.back")}> <Tooltip label={t("common.back")}>
<IconButton onClick={onBackClick}> <IconButton size="24px" onClick={onBackClick}>
<CollapseIcon /> <CollapseIcon aria-hidden />
</IconButton> </IconButton>
</Tooltip> </Tooltip>
</LeftNav> </LeftNav>
+1 -1
View File
@@ -193,7 +193,7 @@ export const SettingsIconButton: FC<SettingsIconButtonProps> = ({
className={classNamesForScrrenWidth(className, showForScreenWidth)} className={classNamesForScrrenWidth(className, showForScreenWidth)}
{...props} {...props}
> >
<Icon /> <Icon aria-hidden/>
</IconButton> </IconButton>
</Tooltip> </Tooltip>
); );
+1
View File
@@ -123,6 +123,7 @@ test("does not play a sound before the call is successful", () => {
const { vm, rtcMemberships$ } = getBasicCallViewModelEnvironment( const { vm, rtcMemberships$ } = getBasicCallViewModelEnvironment(
[local, alice], [local, alice],
[localRtcMember], [localRtcMember],
undefined,
{ waitForCallPickup: true }, { waitForCallPickup: true },
); );
render(<CallEventAudioRenderer vm={vm} />); render(<CallEventAudioRenderer vm={vm} />);
+5 -8
View File
@@ -109,6 +109,7 @@ interface CreateInCallViewArgs {
function createInCallView(args: CreateInCallViewArgs = {}): RenderResult & { function createInCallView(args: CreateInCallViewArgs = {}): RenderResult & {
rtcSession: MockRTCSession; rtcSession: MockRTCSession;
} { } {
const mediaDevices = args.mediaDevices ?? mockMediaDevices({});
const muteState = mockMuteStates(); const muteState = mockMuteStates();
const livekitRoom = mockLivekitRoom( const livekitRoom = mockLivekitRoom(
{ {
@@ -121,10 +122,8 @@ function createInCallView(args: CreateInCallViewArgs = {}): RenderResult & {
const { vm, rtcSession } = getBasicCallViewModelEnvironment( const { vm, rtcSession } = getBasicCallViewModelEnvironment(
[local, alice], [local, alice],
undefined, undefined,
{ mediaDevices,
toggleScreensharing: () => {}, {},
...args.callViewModelOptions,
},
); );
rtcSession.joined = true; rtcSession.joined = true;
@@ -166,7 +165,7 @@ function createInCallView(args: CreateInCallViewArgs = {}): RenderResult & {
const renderResult = render( const renderResult = render(
<Router> <Router>
<MediaDevicesContext value={args.mediaDevices ?? mockMediaDevices({})}> <MediaDevicesContext value={mediaDevices}>
<ReactionsSenderProvider <ReactionsSenderProvider
vm={vm} vm={vm}
rtcSession={rtcSession.asMockedSession()} rtcSession={rtcSession.asMockedSession()}
@@ -263,9 +262,7 @@ describe("InCallView", () => {
}, },
}); });
const { getByRole } = createInCallView({ const { getByRole } = createInCallView({ mediaDevices });
callViewModelOptions: { mediaDeviceOverride: mediaDevices },
});
// The button should be visible. When current output is "speaker", // The button should be visible. When current output is "speaker",
// the switcher targets "earpiece", so the tooltip label is "Handset". // the switcher targets "earpiece", so the tooltip label is "Handset".
const audioOutputBtn = getByRole("switch", { name: "Handset" }); const audioOutputBtn = getByRole("switch", { name: "Handset" });
-1
View File
@@ -175,7 +175,6 @@ export interface CallViewModelOptions {
matrixRTCMode$?: Behavior<MatrixRTCMode>; matrixRTCMode$?: Behavior<MatrixRTCMode>;
/** Optional behavior overriding for the screensharing, for testing */ /** Optional behavior overriding for the screensharing, for testing */
toggleScreensharing?: () => void; toggleScreensharing?: () => void;
mediaDeviceOverride?: MediaDevices;
} }
// Do not play any sounds if the participant count has exceeded this // Do not play any sounds if the participant count has exceeded this
+3 -3
View File
@@ -34,6 +34,7 @@ import {
MockRTCSession, MockRTCSession,
testScope, testScope,
} from "./test"; } from "./test";
import { type MediaDevices } from "../state/MediaDevices";
import { aliceRtcMember, localRtcMember } from "./test-fixtures"; import { aliceRtcMember, localRtcMember } from "./test-fixtures";
import { type RaisedHandInfo, type ReactionInfo } from "../reactions"; import { type RaisedHandInfo, type ReactionInfo } from "../reactions";
import { constant } from "../state/Behavior"; import { constant } from "../state/Behavior";
@@ -131,6 +132,7 @@ export function getBasicRTCSession(
export function getBasicCallViewModelEnvironment( export function getBasicCallViewModelEnvironment(
members: RoomMember[], members: RoomMember[],
initialRtcMemberships: CallMembership[] = [localRtcMember, aliceRtcMember], initialRtcMemberships: CallMembership[] = [localRtcMember, aliceRtcMember],
mediaDevicesOverride?: MediaDevices,
callViewModelOptions: Partial<CallViewModelOptions> = {}, callViewModelOptions: Partial<CallViewModelOptions> = {},
): { ): {
vm: CallViewModel; vm: CallViewModel;
@@ -146,13 +148,11 @@ export function getBasicCallViewModelEnvironment(
const handRaisedSubject$ = new BehaviorSubject({}); const handRaisedSubject$ = new BehaviorSubject({});
const reactionsSubject$ = new BehaviorSubject({}); const reactionsSubject$ = new BehaviorSubject({});
// const remoteParticipants$ = of([aliceParticipant]);
const vm = createCallViewModel$( const vm = createCallViewModel$(
testScope(), testScope(),
rtcSession.asMockedSession(), rtcSession.asMockedSession(),
matrixRoom, matrixRoom,
callViewModelOptions.mediaDeviceOverride ?? mockMediaDevices({}), mediaDevicesOverride ?? mockMediaDevices({}),
mockMuteStates(), mockMuteStates(),
{ {
encryptionSystem: { kind: E2eeType.PER_PARTICIPANT }, encryptionSystem: { kind: E2eeType.PER_PARTICIPANT },