mirror of
https://github.com/dartdavros/chatballs.git
synced 2026-10-05 09:14:58 +03:00
🚑 fix(calls): show Accept button for incoming audio call + load DS tokens on call page
On the client call page an incoming invite never showed Принять — only Отменить. resolveAudioCallViewMode returned "ringing" for REQUESTED/RINGING before start, but ringing renders a single Отменить button. An invite is an incoming call for the client (the staff initiates it), so it must be incoming which renders the Принять/Отклонить pair. AudioCallStage now also passes onDecline, which the incoming PairBar needs. The call page also missed the design tokens that audio-call.css consumes (--font-sans, --radius-4xl/pill/lg, --success/--error): web-chat never defined them, so the audio scene fell back to inherited system font and a 28px radius. Added the tokens to web-chat styles.css :root straight from the baseline (typography/effects tokens); no external webfont per ADR-HUB-0013.
This commit is contained in:
1 parent
c34b181681
commit
7db1a3de88
3 files changed
+24
-1
No files matched your search
@@ -102,6 +102,7 @@ export function AudioCallStage({ call, accessToken, iceServers, loading, invalid
|
||||
subCaption={mode === "active" ? (rtc.micOn ? "Говорите" : "Ваш микрофон выключен") : undefined}
|
||||
onToggleMic={rtc.toggleMic}
|
||||
onAccept={() => void join()}
|
||||
onDecline={() => void onCancel()}
|
||||
onCancel={() => void onCancel()}
|
||||
onEnd={rtc.end}
|
||||
onClose={close}
|
||||
|
||||
@@ -49,7 +49,10 @@ export function resolveAudioCallViewMode(state: { loading: boolean; invalid: boo
|
||||
if (state.loading || state.invalid || !state.call) return "status";
|
||||
if (state.mediaIssue === "devices" || state.mediaIssue === "unsupported") return "status";
|
||||
if (isTerminalCall(state.call.status) || state.connection === "failed") return "status";
|
||||
if (!state.started) return state.call.status === "RINGING" || state.call.status === "REQUESTED" ? "ringing" : "incoming";
|
||||
// Приглашение для клиента — входящий звонок: он решает принять или отклонить
|
||||
// (звонок всегда инициирует сотрудник, поэтому «исходящего» для клиента нет).
|
||||
// REQUESTED/RINGING до старта → incoming (парные Принять/Отклонить).
|
||||
if (!state.started) return "incoming";
|
||||
if (state.connection === "reconnecting") return "reconnecting";
|
||||
if (state.connection === "connected" || state.call.status === "ACTIVE") return "active";
|
||||
return "connecting";
|
||||
|
||||
@@ -9,6 +9,25 @@ body,
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/*
|
||||
Дизайн-токены для страницы звонка /calls/<invite> (baseline Edevs Hub DS).
|
||||
На основной странице виджета (встраиваемого) эти переменные не нужны, но экран
|
||||
аудиозвонка из @edevs/ui (audio-call.css) использует var(--font-sans) и радиусы,
|
||||
которых в web-chat нет. Значения — системный font stack Ant Design и токены
|
||||
радиусов из baseline tokens/typography.css + tokens/effects.css (ADR-HUB-0013:
|
||||
внешние веб-шрифты не подключаются).
|
||||
*/
|
||||
:root {
|
||||
--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||
|
||||
--radius-lg: 9px;
|
||||
--radius-4xl: 14px;
|
||||
--radius-pill: 999px;
|
||||
|
||||
--success: #52c41a;
|
||||
--error: #ff4d4f;
|
||||
}
|
||||
|
||||
@keyframes wcTyping {
|
||||
0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
|
||||
40% { opacity: 1; transform: translateY(-2px); }
|
||||
|
||||
Reference in new issue
Block a user