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

View File

@@ -71,8 +71,8 @@ export const AppBar: FC<Props> = ({ children }) => {
>
<LeftNav>
<Tooltip label={t("common.back")}>
<IconButton onClick={onBackClick}>
<CollapseIcon />
<IconButton size="24px" onClick={onBackClick}>
<CollapseIcon aria-hidden />
</IconButton>
</Tooltip>
</LeftNav>

View File

@@ -193,7 +193,7 @@ export const SettingsIconButton: FC<SettingsIconButtonProps> = ({
className={classNamesForScrrenWidth(className, showForScreenWidth)}
{...props}
>
<Icon />
<Icon aria-hidden/>
</IconButton>
</Tooltip>
);

View File

@@ -123,6 +123,7 @@ test("does not play a sound before the call is successful", () => {
const { vm, rtcMemberships$ } = getBasicCallViewModelEnvironment(
[local, alice],
[localRtcMember],
undefined,
{ waitForCallPickup: true },
);
render(<CallEventAudioRenderer vm={vm} />);

View File

@@ -109,6 +109,7 @@ interface CreateInCallViewArgs {
function createInCallView(args: CreateInCallViewArgs = {}): RenderResult & {
rtcSession: MockRTCSession;
} {
const mediaDevices = args.mediaDevices ?? mockMediaDevices({});
const muteState = mockMuteStates();
const livekitRoom = mockLivekitRoom(
{
@@ -121,10 +122,8 @@ function createInCallView(args: CreateInCallViewArgs = {}): RenderResult & {
const { vm, rtcSession } = getBasicCallViewModelEnvironment(
[local, alice],
undefined,
{
toggleScreensharing: () => {},
...args.callViewModelOptions,
},
mediaDevices,
{},
);
rtcSession.joined = true;
@@ -166,7 +165,7 @@ function createInCallView(args: CreateInCallViewArgs = {}): RenderResult & {
const renderResult = render(
<Router>
<MediaDevicesContext value={args.mediaDevices ?? mockMediaDevices({})}>
<MediaDevicesContext value={mediaDevices}>
<ReactionsSenderProvider
vm={vm}
rtcSession={rtcSession.asMockedSession()}
@@ -263,9 +262,7 @@ describe("InCallView", () => {
},
});
const { getByRole } = createInCallView({
callViewModelOptions: { mediaDeviceOverride: mediaDevices },
});
const { getByRole } = createInCallView({ mediaDevices });
// The button should be visible. When current output is "speaker",
// the switcher targets "earpiece", so the tooltip label is "Handset".
const audioOutputBtn = getByRole("switch", { name: "Handset" });

View File

@@ -175,7 +175,6 @@ export interface CallViewModelOptions {
matrixRTCMode$?: Behavior<MatrixRTCMode>;
/** Optional behavior overriding for the screensharing, for testing */
toggleScreensharing?: () => void;
mediaDeviceOverride?: MediaDevices;
}
// Do not play any sounds if the participant count has exceeded this

View File

@@ -34,6 +34,7 @@ import {
MockRTCSession,
testScope,
} from "./test";
import { type MediaDevices } from "../state/MediaDevices";
import { aliceRtcMember, localRtcMember } from "./test-fixtures";
import { type RaisedHandInfo, type ReactionInfo } from "../reactions";
import { constant } from "../state/Behavior";
@@ -131,6 +132,7 @@ export function getBasicRTCSession(
export function getBasicCallViewModelEnvironment(
members: RoomMember[],
initialRtcMemberships: CallMembership[] = [localRtcMember, aliceRtcMember],
mediaDevicesOverride?: MediaDevices,
callViewModelOptions: Partial<CallViewModelOptions> = {},
): {
vm: CallViewModel;
@@ -146,13 +148,11 @@ export function getBasicCallViewModelEnvironment(
const handRaisedSubject$ = new BehaviorSubject({});
const reactionsSubject$ = new BehaviorSubject({});
// const remoteParticipants$ = of([aliceParticipant]);
const vm = createCallViewModel$(
testScope(),
rtcSession.asMockedSession(),
matrixRoom,
callViewModelOptions.mediaDeviceOverride ?? mockMediaDevices({}),
mediaDevicesOverride ?? mockMediaDevices({}),
mockMuteStates(),
{
encryptionSystem: { kind: E2eeType.PER_PARTICIPANT },