Move settings button out of the button bar.

User overflow button instead: at the top for mobile, bottom left for
web.
This commit is contained in:
Timo K
2026-04-08 16:05:46 +02:00
parent efd1b42da0
commit cf642aa670
5 changed files with 89 additions and 62 deletions

View File

@@ -16,7 +16,7 @@ import {
useMemo, useMemo,
useState, useState,
} from "react"; } from "react";
import { Heading, IconButton, Tooltip } from "@vector-im/compound-web"; import { Button, Heading, Tooltip } from "@vector-im/compound-web";
import { CollapseIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; import { CollapseIcon } from "@vector-im/compound-design-tokens/assets/web/icons";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
@@ -68,9 +68,12 @@ export const AppBar: FC<Props> = ({ children }) => {
> >
<LeftNav> <LeftNav>
<Tooltip label={t("common.back")}> <Tooltip label={t("common.back")}>
<IconButton onClick={onBackClick}> <Button
<CollapseIcon /> kind={"tertiary"}
</IconButton> iconOnly
Icon={CollapseIcon}
onClick={onBackClick}
/>
</Tooltip> </Tooltip>
</LeftNav> </LeftNav>
{title && ( {title && (

View File

@@ -16,10 +16,12 @@ import {
VideoCallOffSolidIcon, VideoCallOffSolidIcon,
EndCallIcon, EndCallIcon,
ShareScreenSolidIcon, ShareScreenSolidIcon,
SettingsSolidIcon, OverflowHorizontalIcon,
OverflowVerticalIcon,
} from "@vector-im/compound-design-tokens/assets/web/icons"; } from "@vector-im/compound-design-tokens/assets/web/icons";
import styles from "./Button.module.css"; import styles from "./Button.module.css";
import { platform } from "../Platform";
interface MicButtonProps extends ComponentPropsWithoutRef<"button"> { interface MicButtonProps extends ComponentPropsWithoutRef<"button"> {
enabled: boolean; enabled: boolean;
@@ -134,8 +136,10 @@ export const SettingsButton: FC<SettingsButtonProps> = (props) => {
<Tooltip label={t("common.settings")}> <Tooltip label={t("common.settings")}>
<CpdButton <CpdButton
iconOnly iconOnly
Icon={SettingsSolidIcon} Icon={
kind="secondary" platform === "android" ? OverflowVerticalIcon : OverflowHorizontalIcon
}
kind="tertiary"
{...props} {...props}
/> />
</Tooltip> </Tooltip>

View File

@@ -36,13 +36,11 @@ Please see LICENSE in the repository root for full details.
inset-block-end: 0; inset-block-end: 0;
z-index: var(--call-view-header-footer-layer); z-index: var(--call-view-header-footer-layer);
display: grid; display: grid;
grid-template-columns: grid-template-columns: 1fr auto 1fr;
minmax(0, var(--inline-content-inset)) grid-template-areas: ". buttons layout";
1fr auto 1fr minmax(0, var(--inline-content-inset));
grid-template-areas: ". logo buttons layout .";
align-items: center; align-items: center;
gap: var(--cpd-space-3x); gap: var(--cpd-space-3x);
padding-block: var(--cpd-space-10x); padding: var(--cpd-space-10x) var(--cpd-space-6x);
background: linear-gradient( background: linear-gradient(
180deg, 180deg,
rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 0%,
@@ -73,8 +71,13 @@ Please see LICENSE in the repository root for full details.
pointer-events: initial; pointer-events: initial;
} }
.settingsLogoContainer {
display: flex;
gap: var(--cpd-space-4x);
flex-direction: row;
}
.logo { .logo {
grid-area: logo;
justify-self: start; justify-self: start;
display: flex; display: flex;
align-items: center; align-items: center;
@@ -94,12 +97,23 @@ Please see LICENSE in the repository root for full details.
justify-self: end; justify-self: end;
} }
/*First hide the logo*/
@media (max-width: 660px) { @media (max-width: 660px) {
.logo {
display: none;
}
}
/*
With the logo hidden >500px is enough space to show overflow, buttons, layout.
Once we exceed 500 we hide everything except the buttons.
*/
@media (max-width: 500px) {
.footer { .footer {
grid-template-areas: ". buttons buttons buttons ."; grid-template-areas: "buttons buttons buttons";
} }
.logo { .settingsLogoContainer {
display: none; display: none;
} }

View File

@@ -42,7 +42,7 @@ import {
ReactionToggleButton, ReactionToggleButton,
} from "../button"; } from "../button";
import { Header, LeftNav, RightNav, RoomHeaderInfo } from "../Header"; import { Header, LeftNav, RightNav, RoomHeaderInfo } from "../Header";
import { type HeaderStyle, useUrlParams } from "../UrlParams"; import { HeaderStyle, useUrlParams } from "../UrlParams";
import { useCallViewKeyboardShortcuts } from "../useCallViewKeyboardShortcuts"; import { useCallViewKeyboardShortcuts } from "../useCallViewKeyboardShortcuts";
import { widget } from "../widget"; import { widget } from "../widget";
import styles from "./InCallView.module.css"; import styles from "./InCallView.module.css";
@@ -373,30 +373,6 @@ export const InCallView: FC<InCallViewProps> = ({
[vm], [vm],
); );
useAppBarSecondaryButton(
useMemo(() => {
if (audioOutputSwitcher === null) return null;
const isEarpieceTarget = audioOutputSwitcher.targetOutput === "earpiece";
const Icon = isEarpieceTarget ? VoiceCallSolidIcon : VolumeOnSolidIcon;
const label = isEarpieceTarget
? t("settings.devices.handset")
: t("settings.devices.loudspeaker");
return (
<Tooltip label={label}>
<IconButton
onClick={(e) => {
e.preventDefault();
audioOutputSwitcher.switch();
}}
>
<Icon />
</IconButton>
</Tooltip>
);
}, [t, audioOutputSwitcher]),
);
useAppBarHidden(!showHeader); useAppBarHidden(!showHeader);
let header: ReactNode = null; let header: ReactNode = null;
@@ -643,14 +619,34 @@ export const InCallView: FC<InCallViewProps> = ({
/>, />,
); );
} }
if (layout.type !== "pip")
buttons.push( // In this PR we just move the button ot the bottom bar. We do not yet update its apperance
<SettingsButton const audioOutputButton = useMemo(() => {
size={buttonSize} if (audioOutputSwitcher === null) return null;
key="settings" const isEarpieceTarget = audioOutputSwitcher.targetOutput === "earpiece";
onClick={openSettings} const Icon = isEarpieceTarget ? VoiceCallSolidIcon : VolumeOnSolidIcon;
/>, const label = isEarpieceTarget
? t("settings.devices.handset")
: t("settings.devices.loudspeaker");
return (
<Tooltip label={label}>
<IconButton
onClick={(e) => {
e.preventDefault();
audioOutputSwitcher.switch();
}}
>
<Icon />
</IconButton>
</Tooltip>
); );
}, [t, audioOutputSwitcher]);
if (audioOutputButton) buttons.push(audioOutputButton);
useAppBarSecondaryButton(
<SettingsButton key="settings" onClick={openSettings} />,
);
buttons.push( buttons.push(
<EndCallButton <EndCallButton
@@ -662,6 +658,20 @@ export const InCallView: FC<InCallViewProps> = ({
data-testid="incall_leave" data-testid="incall_leave"
/>, />,
); );
const logo = (
<div className={styles.logo}>
<LogoMark width={24} height={24} aria-hidden />
<LogoType
width={80}
height={11}
aria-label={import.meta.env.VITE_PRODUCT_NAME || "Element Call"}
/>
{/* Don't mind this odd placement, it's just a little debug label */}
{debugTileLayout ? `Tiles generation: ${tileStoreGeneration}` : undefined}
</div>
);
const footer = ( const footer = (
<div <div
ref={footerRef} ref={footerRef}
@@ -671,20 +681,16 @@ export const InCallView: FC<InCallViewProps> = ({
!showFooter || (!showControls && headerStyle === "none"), !showFooter || (!showControls && headerStyle === "none"),
})} })}
> >
{headerStyle !== "none" && ( <div className={styles.settingsLogoContainer}>
<div className={styles.logo}> {showControls &&
<LogoMark width={24} height={24} aria-hidden /> headerStyle !== HeaderStyle.AppBar &&
<LogoType layout.type !== "pip" && (
width={80} <SettingsButton key="settings" onClick={openSettings} />
height={11} )}
aria-label={import.meta.env.VITE_PRODUCT_NAME || "Element Call"}
/> {headerStyle !== "none" && logo}
{/* Don't mind this odd placement, it's just a little debug label */} </div>
{debugTileLayout
? `Tiles generation: ${tileStoreGeneration}`
: undefined}
</div>
)}
{showControls && <div className={styles.buttons}>{buttons}</div>} {showControls && <div className={styles.buttons}>{buttons}</div>}
{showControls && ( {showControls && (
<LayoutToggle <LayoutToggle

View File

@@ -228,6 +228,7 @@ export const LobbyView: FC<Props> = ({
</div> </div>
<div className={inCallStyles.footer}> <div className={inCallStyles.footer}>
{recentsButtonInFooter && recentsButton} {recentsButtonInFooter && recentsButton}
<SettingsButton onClick={openSettings} />
<div className={inCallStyles.buttons}> <div className={inCallStyles.buttons}>
<MicButton <MicButton
enabled={audioEnabled} enabled={audioEnabled}
@@ -239,7 +240,6 @@ export const LobbyView: FC<Props> = ({
onClick={toggleVideo ?? undefined} onClick={toggleVideo ?? undefined}
disabled={toggleVideo === null} disabled={toggleVideo === null}
/> />
<SettingsButton onClick={openSettings} />
{!confineToRoom && <EndCallButton onClick={onLeaveClick} />} {!confineToRoom && <EndCallButton onClick={onLeaveClick} />}
</div> </div>
</div> </div>