Files
faq_chatbot_frontend/src/app/shared/ui/voice-stream-panel/voice-stream-panel.component.html
T
PeymanHonarjoo 28590c6dce refactor: overhaul home UI and audio playback reliability
Redesign the home page and voice stream panel into a compact dock
layout to improve the chat experience. Implement a flush mechanism in
the PCM playback worklet to handle the resampler tail, preventing
premature session termination due to phantom outstanding playback.
Fix document filter visibility in settings to ensure controls remain
accessible when no results match, and refactor transcript insertion
to maintain correct user/assistant ordering.
2026-10-10 17:47:51 +03:30

71 lines
2.8 KiB
HTML

<div
class="call-dock"
role="region"
aria-label="گفتگوی صوتی"
[attr.data-state]="state()"
>
<div class="sr-only" role="status" aria-live="polite">{{ statusText() }}</div>
<div class="dock-row">
<div class="orb-container" #orbContainer aria-hidden="true">
@if (!orbAvailable()) {
<div class="orb-fallback"></div>
}
</div>
<div class="dock-info" aria-hidden="true">
<span class="status-dot" [attr.data-state]="state()"></span>
<p class="status-text" [attr.title]="statusText()">{{ statusText() }}</p>
</div>
<div class="dock-actions">
<button
type="button"
class="dock-btn"
[class.is-active]="muted()"
[attr.aria-pressed]="muted()"
[attr.aria-label]="muteLabel()"
[attr.title]="muteLabel()"
[disabled]="connection() !== 'connected'"
(click)="toggleMute()"
>
@if (muted()) {
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<line x1="2" x2="22" y1="2" y2="22" />
<path d="M18.89 13.23A7.12 7.12 0 0 0 19 12v-2" />
<path d="M5 10v2a7 7 0 0 0 12 5" />
<path d="M15 9.34V5a3 3 0 0 0-5.68-1.33" />
<path d="M9 9v3a3 3 0 0 0 5.12 2.12" />
<line x1="12" x2="12" y1="19" y2="22" />
</svg>
} @else {
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z" />
<path d="M19 10v2a7 7 0 0 1-14 0v-2" />
<line x1="12" x2="12" y1="19" y2="22" />
</svg>
}
</button>
<button type="button" class="dock-btn is-end" aria-label="پایان گفتگوی صوتی" (click)="endCall()">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<line x1="18" x2="6" y1="6" y2="18" />
<line x1="6" x2="18" y1="6" y2="18" />
</svg>
<span class="dock-btn-label">پایان</span>
</button>
</div>
</div>
@if (streamError(); as errorText) {
<div class="dock-error" role="alert">
<span>{{ errorText }}</span>
<button type="button" class="dock-error-close" aria-label="بستن پیام" (click)="dismissError()">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<line x1="18" x2="6" y1="6" y2="18" />
<line x1="6" x2="18" y1="6" y2="18" />
</svg>
</button>
</div>
}
</div>