From cd57c107ff3b8ee7cb619bbd0fa153154c5ef173 Mon Sep 17 00:00:00 2001 From: Erwan Leboucher Date: Sat, 1 Aug 2026 10:15:13 +0200 Subject: [PATCH] feat(call): theme the call surfaces and fix the audio route picker The call canvas, tiles, control pill and menus were painted with hardcoded dark hex values, so the call ignored the active theme. They now use the same tokens as the rest of the app. The scrim over a video tile and its text stay light on dark, because they sit on video rather than on a themed surface, as does the hangup button. The route picker rendered the wire's category marker as the option name, so the list read current and input. It now shows the platform's display name and ticks the active route. --- src/app/features/call/CallView.tsx | 2 +- .../features/call/LivekitJsCallSurface.css.ts | 30 +++++++++---------- .../features/call/NativeCallSurface.css.ts | 22 +++++++------- src/app/features/call/NativeCallSurface.tsx | 7 ++++- src/app/features/call/callChrome.css.ts | 22 +++++++------- src/app/features/call/livekitMobileBridge.ts | 4 +-- 6 files changed, 46 insertions(+), 41 deletions(-) diff --git a/src/app/features/call/CallView.tsx b/src/app/features/call/CallView.tsx index ea8a82145..ae324a009 100644 --- a/src/app/features/call/CallView.tsx +++ b/src/app/features/call/CallView.tsx @@ -298,7 +298,7 @@ export function CallView({ resizable }: CallViewProps) { zIndex: 20, backgroundColor: livekitJsRoom || nativeCallForRoom - ? '#090b10' + ? color.Background.Container : currentJoined ? 'transparent' : undefined, diff --git a/src/app/features/call/LivekitJsCallSurface.css.ts b/src/app/features/call/LivekitJsCallSurface.css.ts index 50c0fc6ed..e3a48d331 100644 --- a/src/app/features/call/LivekitJsCallSurface.css.ts +++ b/src/app/features/call/LivekitJsCallSurface.css.ts @@ -1,5 +1,5 @@ import { globalStyle, style } from '@vanilla-extract/css'; -import { config, toRem } from 'folds'; +import { color, config, toRem } from 'folds'; /** * Scoped base styles for the @livekit/components-react primitives used by @@ -13,7 +13,7 @@ const surface = CallSurface; globalStyle(`${surface} .lk-participant-tile`, { position: 'relative', flexShrink: 0, - background: '#14171f', + background: color.Surface.Container, borderRadius: config.radii.R400, overflow: 'hidden', }); @@ -28,7 +28,7 @@ globalStyle(`${surface} .lk-participant-tile > video`, { globalStyle(`${surface} .lk-participant-tile[data-lk-source='screen_share'] > video`, { objectFit: 'contain', - background: '#07080c', + background: color.Background.Container, }); globalStyle(`${surface} .lk-participant-tile[data-lk-video-muted='true'] > video`, { @@ -51,7 +51,7 @@ globalStyle(`${surface} .lk-participant-placeholder`, { inset: 0, display: 'grid', placeItems: 'center', - background: '#14171f', + background: color.Surface.Container, }); globalStyle(`${surface} .lk-participant-placeholder > svg`, { @@ -130,8 +130,8 @@ globalStyle(`${surface} .lk-pagination-control`, { gap: config.space.S100, padding: config.space.S100, borderRadius: config.radii.R400, - background: 'rgba(9, 11, 16, 0.72)', - color: '#ffffff', + background: color.Surface.Container, + color: color.Surface.OnContainer, }); globalStyle(`${surface} .lk-pagination-indicator`, { @@ -172,15 +172,15 @@ globalStyle(`${surface} .lk-button`, { padding: `0 ${config.space.S200}`, border: 'none', borderRadius: config.radii.R400, - background: 'rgba(255, 255, 255, 0.08)', - color: '#ffffff', + background: color.SurfaceVariant.Container, + color: color.SurfaceVariant.OnContainer, font: 'inherit', cursor: 'pointer', transition: 'background-color 120ms ease', }); globalStyle(`${surface} .lk-button:hover:not(:disabled)`, { - background: 'rgba(255, 255, 255, 0.16)', + background: color.SurfaceVariant.ContainerHover, }); globalStyle(`${surface} .lk-button:focus-visible`, { @@ -189,7 +189,7 @@ globalStyle(`${surface} .lk-button:focus-visible`, { }); globalStyle(`${surface} .lk-button[aria-pressed='false']:not(.lk-button-menu)`, { - background: 'rgba(204, 74, 74, 0.45)', + background: color.Critical.Container, }); // MediaDeviceMenu renders an empty button and relies on the stylesheet for its @@ -227,11 +227,11 @@ globalStyle(`${surface} .lk-button-group-menu > .lk-button`, { minWidth: toRem(28), padding: `0 ${config.space.S100}`, borderRadius: `0 ${config.radii.R400} ${config.radii.R400} 0`, - background: 'rgba(255, 255, 255, 0.05)', + background: color.SurfaceVariant.Container, }); globalStyle(`${surface} .lk-button-group-menu > .lk-button:hover:not(:disabled)`, { - background: 'rgba(255, 255, 255, 0.16)', + background: color.SurfaceVariant.ContainerHover, }); globalStyle(`${surface} .lk-device-menu`, { @@ -241,9 +241,9 @@ globalStyle(`${surface} .lk-device-menu`, { padding: config.space.S100, border: '1px solid rgba(255, 255, 255, 0.1)', borderRadius: config.radii.R400, - background: '#171a22', + background: color.Surface.Container, boxShadow: '0 8px 24px rgba(0, 0, 0, 0.5)', - color: '#ffffff', + color: color.Surface.OnContainer, }); globalStyle(`${surface} .lk-device-menu > ul`, { @@ -271,7 +271,7 @@ globalStyle(`${surface} .lk-device-menu .lk-button`, { }); globalStyle(`${surface} .lk-device-menu li[data-lk-active='true'] > .lk-button`, { - color: 'var(--sable-primary-main, #7aa2ff)', + color: color.Primary.Main, }); export const AudioParticipant = style({ diff --git a/src/app/features/call/NativeCallSurface.css.ts b/src/app/features/call/NativeCallSurface.css.ts index a4ffac5bd..3047a7776 100644 --- a/src/app/features/call/NativeCallSurface.css.ts +++ b/src/app/features/call/NativeCallSurface.css.ts @@ -37,7 +37,7 @@ export const DominantTile = style({ minWidth: 0, minHeight: 0, overflow: 'hidden', - background: '#090b10', + background: color.Background.Container, }); /** Small floating local preview card (bottom-right, above controls). */ @@ -50,8 +50,8 @@ export const FloatingLocal = style({ zIndex: 3, borderRadius: config.radii.R400, overflow: 'hidden', - border: '1px solid rgba(255, 255, 255, 0.1)', - background: '#14171f', + border: `1px solid ${color.Surface.ContainerLine}`, + background: color.Surface.Container, }); /** Adaptive grid: 2 columns by default, 3 columns (compact, scrollable) at 7+ tiles. */ @@ -83,8 +83,8 @@ export const Tile = style({ minHeight: 0, overflow: 'hidden', borderRadius: config.radii.R400, - background: '#14171f', - outline: '1px solid rgba(255, 255, 255, 0.06)', + background: color.Surface.Container, + outline: `1px solid ${color.Surface.ContainerLine}`, outlineOffset: '-1px', }); @@ -113,8 +113,8 @@ export const InitialsBadge = style({ width: 'min(72px, 45%)', aspectRatio: '1 / 1', borderRadius: '50%', - background: 'rgba(255, 255, 255, 0.10)', - color: 'rgba(255, 255, 255, 0.92)', + background: color.SurfaceVariant.Container, + color: color.SurfaceVariant.OnContainer, fontSize: toRem(22), fontWeight: 600, lineHeight: 1, @@ -127,10 +127,10 @@ export const TileLabel = style({ alignItems: 'center', gap: config.space.S100, padding: `${config.space.S100} ${config.space.S200}`, - color: 'rgba(255, 255, 255, 0.9)', + color: color.Surface.OnContainer, fontSize: toRem(13), lineHeight: toRem(18), - borderTop: '1px solid rgba(255, 255, 255, 0.06)', + borderTop: `1px solid ${color.Surface.ContainerLine}`, }); export const TileLabelName = style({ @@ -152,7 +152,7 @@ export const QualityDot = style({ '&[data-quality="excellent"]': { background: color.Success.Main }, // Neutral rather than a token: it reads as "no signal yet" against the dark // video stage, where a themed surface colour would look like a real state. - '&[data-quality="unknown"]': { background: 'rgba(255,255,255,0.3)' }, + '&[data-quality="unknown"]': { background: color.Surface.ContainerLine }, }, }); @@ -175,7 +175,7 @@ export const HangupButton = style({ filter: 'brightness(1.12)', }, '&:focus-visible': { - outline: `2px solid var(--sable-primary-main, #7aa2ff)`, + outline: `2px solid ${color.Primary.Main}`, outlineOffset: '2px', }, }, diff --git a/src/app/features/call/NativeCallSurface.tsx b/src/app/features/call/NativeCallSurface.tsx index b07e3b74b..6a3f9da56 100644 --- a/src/app/features/call/NativeCallSurface.tsx +++ b/src/app/features/call/NativeCallSurface.tsx @@ -3,6 +3,7 @@ import { Box, config, Menu, MenuItem, Text, toRem } from 'folds'; import type { NativeCallSession } from '$state/nativeCall'; import { ArrowsClockwise, + Check, MicrophoneSlash, PhoneDisconnect, SpeakerHigh, @@ -424,12 +425,16 @@ function AudioRouteControl({ size="300" radii="300" variant="Surface" + aria-checked={route.current} + before={ + route.current ? sizedIcon(Check, '200') : + } onClick={() => { void session.selectAudioRoute(route.id); menu.close(); }} > - {route.label || route.name} + {route.name} ))} diff --git a/src/app/features/call/callChrome.css.ts b/src/app/features/call/callChrome.css.ts index 6b9f7969e..c5951ccd9 100644 --- a/src/app/features/call/callChrome.css.ts +++ b/src/app/features/call/callChrome.css.ts @@ -1,8 +1,8 @@ import { style } from '@vanilla-extract/css'; -import { config, toRem } from 'folds'; +import { color, config, toRem } from 'folds'; /** - * Shared call chrome styles: the dark canvas shell, the glassmorphic control + * Shared call chrome styles: the canvas shell, the glassmorphic control * pill, and the on/off media toggle button. Both call surfaces (livekit-js and * native) render into these so the chrome reads consistently across engines * while each engine keeps its own video substrate and connection logic. @@ -17,7 +17,7 @@ import { config, toRem } from 'folds'; export const callLayout = style({ minHeight: 0, overflow: 'hidden', - background: 'var(--sable-livekit-canvas, #090b10)', + background: color.Background.Container, }); /** @@ -65,9 +65,9 @@ export const controlPill = style({ gap: config.space.S200, maxWidth: '100%', padding: config.space.S100, - border: '1px solid rgba(255, 255, 255, 0.08)', + border: `1px solid ${color.Surface.ContainerLine}`, borderRadius: config.radii.R500, - background: 'rgba(9, 11, 16, 0.72)', + background: color.Surface.Container, backdropFilter: 'blur(12px)', }); @@ -90,18 +90,18 @@ export const controlButton = style({ transition: 'background-color 120ms ease', selectors: { '&[data-on="true"]': { - background: 'rgba(255, 255, 255, 0.14)', - color: '#ffffff', + background: color.SurfaceVariant.Container, + color: color.SurfaceVariant.OnContainer, }, '&[data-on="true"]:hover:not(:disabled)': { - background: 'rgba(255, 255, 255, 0.22)', + background: color.SurfaceVariant.ContainerHover, }, '&[data-on="false"]': { - background: 'rgba(204, 74, 74, 0.55)', - color: '#ffffff', + background: color.Critical.Container, + color: color.Critical.OnContainer, }, '&[data-on="false"]:hover:not(:disabled)': { - background: 'rgba(204, 74, 74, 0.7)', + background: color.Critical.ContainerHover, }, '&:focus-visible': { outline: `2px solid var(--sable-primary-main, #7aa2ff)`, diff --git a/src/app/features/call/livekitMobileBridge.ts b/src/app/features/call/livekitMobileBridge.ts index 167af5cf2..7deb0f510 100644 --- a/src/app/features/call/livekitMobileBridge.ts +++ b/src/app/features/call/livekitMobileBridge.ts @@ -168,12 +168,12 @@ export type DeclineSystemCallRequest = { reason: string; }; -/** `type` is the platform's own route vocabulary, so it stays a plain string. */ +/** `name` is display-ready; `type` is the bounded platform vocabulary. */ export type NativeCallAudioRoute = { id: string; name: string; type: string; - label: string; + current: boolean; }; export type GetAudioRoutesResponse = {