feat(voice): add session provider selection to the frontend
Pin provider choices to creation attempts, confirm session closure before switching and handle unavailable providers without fallback. Restore Settings navigation for non-admin users while preserving operation-level authorization.
This commit is contained in:
@@ -17,6 +17,7 @@ import { Subscription } from 'rxjs';
|
||||
import { AiChatInputComponent } from '../../shared/ui/ai-chat-input/ai-chat-input.component';
|
||||
import { VoiceStreamPanelComponent } from '../../shared/ui/voice-stream-panel/voice-stream-panel.component';
|
||||
import { VoiceTranscriptComponent } from '../../shared/ui/voice-transcript/voice-transcript.component';
|
||||
import { VoiceProvider } from '../../services/voice-stream/voice-api.service';
|
||||
import { VoiceStreamService } from '../../services/voice-stream/voice-stream.service';
|
||||
import { ThemeService } from '../../services/theme/theme.service';
|
||||
|
||||
@@ -60,6 +61,16 @@ export class HomePage implements OnInit, OnDestroy {
|
||||
readonly hasMessages = signal(false);
|
||||
readonly callOpen = this.voiceStream.isOpen;
|
||||
readonly voiceMessages = this.voiceStream.messages;
|
||||
readonly providerOptions = this.voiceStream.providerOptions;
|
||||
readonly selectedProvider = this.voiceStream.selectedProvider;
|
||||
readonly providerSwitching = this.voiceStream.providerSwitching;
|
||||
readonly providerChoiceError = this.voiceStream.providerChoiceError;
|
||||
|
||||
async onProviderChange(event: Event): Promise<void> {
|
||||
const select = event.target as HTMLSelectElement;
|
||||
await this.voiceStream.selectProvider(select.value as VoiceProvider);
|
||||
select.value = this.selectedProvider() ?? "";
|
||||
}
|
||||
|
||||
/** Anything on screen that belongs in the chat column: text sent, a live call, or a finished call's transcript. */
|
||||
readonly hasConversation = computed(
|
||||
@@ -83,6 +94,7 @@ export class HomePage implements OnInit, OnDestroy {
|
||||
private routerSubscription?: Subscription;
|
||||
|
||||
constructor() {
|
||||
void this.voiceStream.loadProviders();
|
||||
this.routerSubscription = this.router.events
|
||||
.pipe(filter((event) => event instanceof NavigationEnd))
|
||||
.subscribe((event: NavigationEnd) => {
|
||||
|
||||
Reference in New Issue
Block a user