feat(call): Details card for the call-ended toast (#253)
The call-ended toast gets a Details button (and stays 10 s) that opens a card with who was in the call and the peak, connection verdict and reconnects, how long your / each person's / everyone's connection was poor (likely the server when everyone), RTT, packet loss and jitter, and your talk, mute, deafen and screenshare time, in technical wording. Deafened time is tracked by CallEmbed; the rest comes from the fork's new io.lotus.call_summary `details` (lotus.29). Settings → Calls gets "Summary After Calls" (on by default). Fixes #253 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
8784a8158c
commit
8645a55769
@@ -1,6 +1,11 @@
|
||||
import { describe, it } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { describeCallDuration, describeCallEnd } from './callSummary';
|
||||
import {
|
||||
describeCallDuration,
|
||||
describeCallEnd,
|
||||
describeCallDetails,
|
||||
parseCallSummaryDetails,
|
||||
} from './callSummary';
|
||||
|
||||
describe('describeCallDuration', () => {
|
||||
it('picks the unit', () => {
|
||||
@@ -65,3 +70,97 @@ describe('describeCallEnd', () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it('[#253] parseCallSummaryDetails keeps well-formed fields and drops the rest', () => {
|
||||
const d = parseCallSummaryDetails({
|
||||
participants: ['@bob:x', 7, '@carol:x'],
|
||||
peakParticipants: 3,
|
||||
quality: {
|
||||
youPoorMs: 1000,
|
||||
othersPoorMs: { '@bob:x': 500, evil: 9, '@c:x': -1 },
|
||||
everyonePoorMs: 0,
|
||||
},
|
||||
network: { rttMedianMs: 38, rttP95Ms: 'fast', inboundLossPct: 0.5 },
|
||||
activity: { speakingMs: 60_000, mutedMs: 'x', screenshareMs: 0 },
|
||||
});
|
||||
assert.deepEqual(d, {
|
||||
participants: ['@bob:x', '@carol:x'],
|
||||
peakParticipants: 3,
|
||||
quality: { youPoorMs: 1000, othersPoorMs: { '@bob:x': 500 }, everyonePoorMs: 0 },
|
||||
network: { rttMedianMs: 38, inboundLossPct: 0.5 },
|
||||
activity: { speakingMs: 60_000, mutedMs: 0, screenshareMs: 0 },
|
||||
});
|
||||
assert.equal(parseCallSummaryDetails(undefined), undefined);
|
||||
assert.equal(parseCallSummaryDetails('details'), undefined);
|
||||
});
|
||||
|
||||
it('[#253] describeCallDetails: technical sections with names, blame and numbers', () => {
|
||||
const names: Record<string, string> = { '@bob:x': 'Bob', '@carol:x': 'Carol' };
|
||||
const sections = describeCallDetails(
|
||||
{
|
||||
durationMs: 2_460_000,
|
||||
reconnects: 2,
|
||||
poorMs: 120_000,
|
||||
verdict: 'fair',
|
||||
details: {
|
||||
participants: ['@bob:x', '@carol:x'],
|
||||
peakParticipants: 3,
|
||||
quality: {
|
||||
youPoorMs: 120_000,
|
||||
othersPoorMs: { '@carol:x': 30_000 },
|
||||
everyonePoorMs: 10_000,
|
||||
},
|
||||
network: {
|
||||
rttMedianMs: 38,
|
||||
rttP95Ms: 310,
|
||||
outboundLossPct: 4.1,
|
||||
inboundLossPct: 0.5,
|
||||
jitterMs: 6,
|
||||
},
|
||||
activity: { speakingMs: 600_000, mutedMs: 1_200_000, screenshareMs: 300_000 },
|
||||
},
|
||||
},
|
||||
2_460_000,
|
||||
90_000,
|
||||
(u) => names[u] ?? u,
|
||||
);
|
||||
assert.deepEqual(sections, [
|
||||
{ title: 'Call', lines: ['Duration 41 min · peak 3 in the call', 'With Bob, Carol'] },
|
||||
{
|
||||
title: 'Connection',
|
||||
lines: [
|
||||
'Verdict: fair · 2 reconnects',
|
||||
'Your connection poor/lost: 2 min',
|
||||
'Carol poor/lost: 30 s',
|
||||
'Everyone poor at once: 10 s (likely server or SFU side)',
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Network',
|
||||
lines: [
|
||||
'RTT median 38 ms · p95 310 ms',
|
||||
'Outbound packet loss 4.1%',
|
||||
'Inbound packet loss 0.5%',
|
||||
'Jitter 6 ms',
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'You',
|
||||
lines: ['Talking 10 min · muted 20 min · deafened 2 min', 'Screensharing 5 min'],
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it('[#253] describeCallDetails without fork details (older fork) still says something useful', () => {
|
||||
const sections = describeCallDetails(
|
||||
{ durationMs: 60_000, reconnects: 0, poorMs: 0, verdict: 'good' },
|
||||
60_000,
|
||||
0,
|
||||
(u) => u,
|
||||
);
|
||||
assert.deepEqual(
|
||||
sections.map((s) => s.title),
|
||||
['Call', 'Connection'],
|
||||
);
|
||||
assert.deepEqual(sections[0].lines, ['Duration 1 min', 'Participants unknown']);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user