feat: mobile UI redesign: full-bleed remote, floating local preview, filmstrip, icon disconnect, quality dot

This commit is contained in:
Erwan Leboucher committed 2026-07-31 21:21:38 +02:00
1 parent 3a71e7d876
commit e77a28122c
3 files changed
+174 -37

No files matched your search

+81 -9
View File
@@ -1,5 +1,5 @@
import { style } from '@vanilla-extract/css';
import { color, config, toRem } from 'folds';
import { config, toRem } from 'folds';
/**
* Native-call-specific styles. The dark canvas shell, the control bar pill, and
@@ -18,6 +18,66 @@ export const StatusRow = style({
textAlign: 'center',
});
/** Full-bleed stage for the featured remote participant (FaceTime-style). */
export const FeaturedStage = style({
flex: 1,
minHeight: 0,
minWidth: 0,
position: 'relative',
display: 'flex',
flexDirection: 'column',
});
/** The featured remote tile — full-bleed, no rounding. */
export const FeaturedTile = style({
flex: 1,
position: 'relative',
display: 'flex',
flexDirection: 'column',
minWidth: 0,
minHeight: 0,
overflow: 'hidden',
background: '#090b10',
});
/** Small floating local preview card (bottom-right, above controls). */
export const FloatingLocal = style({
position: 'absolute',
bottom: `calc(${config.space.S200} + env(safe-area-inset-bottom, 0px))`,
right: `calc(${config.space.S200} + env(safe-area-inset-right, 0px))`,
width: '120px',
aspectRatio: '3 / 4',
zIndex: 3,
borderRadius: config.radii.R400,
overflow: 'hidden',
border: '1px solid rgba(255, 255, 255, 0.1)',
background: '#14171f',
});
/** Horizontal filmstrip for non-featured remote participants. */
export const Filmstrip = style({
display: 'flex',
gap: config.space.S200,
overflowX: 'auto',
padding: `${config.space.S100} ${config.space.S200}`,
flexShrink: 0,
});
export const FilmstripTile = style({
position: 'relative',
display: 'flex',
flexDirection: 'column',
width: '100px',
height: '100px',
flexShrink: 0,
overflow: 'hidden',
borderRadius: config.radii.R400,
background: '#14171f',
outline: '1px solid rgba(255, 255, 255, 0.06)',
outlineOffset: '-1px',
});
/** Grid layout for audio-only (no featured video). */
export const TilesStage = style({
flex: 1,
minHeight: 0,
@@ -94,21 +154,33 @@ export const TileLabelName = style({
whiteSpace: 'nowrap',
});
/** Connection quality indicator dot. */
export const QualityDot = style({
width: '8px',
height: '8px',
borderRadius: '50%',
flexShrink: 0,
selectors: {
'&[data-quality="good"]': { background: '#4ade80' },
'&[data-quality="poor"]': { background: '#fbbf24' },
'&[data-quality="lost"]': { background: '#ef4444' },
'&[data-quality="excellent"]': { background: '#4ade80' },
'&[data-quality="unknown"]': { background: 'rgba(255,255,255,0.3)' },
},
});
/** Round red disconnect button (icon-only, LiveKit mobile idiom). */
export const HangupButton = style({
display: 'inline-flex',
alignItems: 'center',
justifyContent: 'center',
gap: config.space.S100,
minWidth: toRem(44),
minHeight: toRem(44),
padding: `0 ${config.space.S400}`,
width: toRem(44),
height: toRem(44),
padding: 0,
border: 'none',
borderRadius: config.radii.R500,
borderRadius: '50%',
background: '#f54336',
color: '#ffffff',
font: 'inherit',
fontSize: toRem(14),
fontWeight: 600,
cursor: 'pointer',
transition: 'filter 120ms ease',
selectors: {
+92 -28
View File
@@ -1,5 +1,5 @@
import { useEffect, useMemo, useRef, useState } from 'react';
import { Text } from 'folds';
import { Text, config, toRem } from 'folds';
import type { NativeCallSession } from '$state/nativeCall';
import {
ArrowsClockwise,
@@ -319,6 +319,11 @@ export function NativeCallSurface({ session, onHangup }: NativeCallSurfaceProps)
const [localSlotNode, setLocalSlotNode] = useState<HTMLDivElement | null>(null);
useNativeLocalVideoOverlay(session.callId, connected, session.cameraEnabled, localSlotNode);
const hasFeatured = connected && featured !== undefined;
const otherRemotes = hasFeatured
? remoteParticipants.filter((p) => p.identity !== featured?.participantIdentity)
: remoteParticipants;
if (isError) {
return (
<CallLayout stack style={{ color: '#ffffff' }}>
@@ -339,33 +344,92 @@ export function NativeCallSurface({ session, onHangup }: NativeCallSurfaceProps)
</Text>
</div>
)}
<div className={css.TilesStage}>
<LocalTile
session={session}
slotRef={connected && session.cameraEnabled ? setLocalSlotNode : undefined}
/>
{remoteParticipants.map((participant) => (
<RemoteTile
key={participant.identity}
participant={participant}
videoBound={connected && featured?.participantIdentity === participant.identity}
slotRef={
connected && featured?.participantIdentity === participant.identity
? setSlotNode
: undefined
}
/>
))}
{connected && remoteParticipants.length === 0 && (
<div className={css.Tile} style={{ gridColumn: '1 / -1' }}>
<div className={css.TileSlot}>
<Text as="span" size="T300" className={css.SlotCaption}>
No one else is here yet
</Text>
{hasFeatured ? (
<>
<div className={css.FeaturedStage}>
<div className={css.FeaturedTile} data-video-bound>
<div className={css.TileSlot} ref={setSlotNode}>
<div className={css.InitialsBadge} aria-hidden>
{nativeParticipantInitials(featured!.participantIdentity)}
</div>
</div>
<div className={css.TileLabel}>
{featured && (
<span
className={css.QualityDot}
data-quality={
remoteParticipants.find((p) => p.identity === featured.participantIdentity)
?.connectionQuality ?? 'unknown'
}
/>
)}
<span className={css.TileLabelName}>
{nativeParticipantLabel(featured!.participantIdentity)}
</span>
</div>
</div>
{session.cameraEnabled && (
<div className={css.FloatingLocal} data-video-bound>
<div className={css.TileSlot} ref={setLocalSlotNode}>
<div
className={css.InitialsBadge}
aria-hidden
style={{ width: '40%', fontSize: toRem(14) }}
>
{sizedIcon(User, '200')}
</div>
</div>
</div>
)}
</div>
)}
</div>
{otherRemotes.length > 0 && (
<div className={css.Filmstrip}>
{otherRemotes.map((participant) => (
<div key={participant.identity} className={css.FilmstripTile}>
<div className={css.TileSlot}>
<div className={css.InitialsBadge} aria-hidden>
{nativeParticipantInitials(participant.identity)}
</div>
</div>
<div className={css.TileLabel} style={{ padding: `${config.space.S100}` }}>
<span
className={css.QualityDot}
data-quality={participant.connectionQuality ?? 'unknown'}
/>
<span className={css.TileLabelName} style={{ fontSize: toRem(11) }}>
{nativeParticipantLabel(participant.identity)}
</span>
</div>
</div>
))}
</div>
)}
</>
) : (
<div className={css.TilesStage}>
<LocalTile
session={session}
slotRef={connected && session.cameraEnabled ? setLocalSlotNode : undefined}
/>
{remoteParticipants.map((participant) => (
<RemoteTile
key={participant.identity}
participant={participant}
videoBound={false}
slotRef={undefined}
/>
))}
{connected && remoteParticipants.length === 0 && (
<div className={css.Tile} style={{ gridColumn: '1 / -1' }}>
<div className={css.TileSlot}>
<Text as="span" size="T300" className={css.SlotCaption}>
No one else is here yet
</Text>
</div>
</div>
)}
</div>
)}
<CallControlBar layout="flow">
<CallMediaControls
microphoneEnabled={session.microphoneEnabled}
@@ -385,8 +449,8 @@ export function NativeCallSurface({ session, onHangup }: NativeCallSurfaceProps)
{sizedIcon(ArrowsClockwise, '300')}
</button>
)}
<button type="button" className={css.HangupButton} onClick={onHangup}>
{sizedIcon(PhoneDisconnect, '300')} End
<button type="button" className={css.HangupButton} aria-label="End call" onClick={onHangup}>
{sizedIcon(PhoneDisconnect, '300')}
</button>
</CallControlBar>
</CallLayout>
@@ -44,6 +44,7 @@ export type NativeCallRemoteCamera = {
export type NativeCallRemoteParticipant = {
identity: string;
camera?: NativeCallRemoteCamera;
connectionQuality?: string;
};
export type NativeCallSnapshot = {