Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(settings): add live voice vendor selection UI

Steven Enamakel38e7f52a83ab
diff --git a/app/src/components/settings/panels/LiveVoiceSettingsModal.tsx b/app/src/components/settings/panels/LiveVoiceSettingsModal.tsx
index 9c925dff44..530611bcd8 100644
--- a/app/src/components/settings/panels/LiveVoiceSettingsModal.tsx
+++ b/app/src/components/settings/panels/LiveVoiceSettingsModal.tsx
@@ -14,13 +14,8 @@ import { ModalShell } from '../../ui/ModalShell';
import NativeSelect from '../../ui/NativeSelect';
import TextField from '../../ui/TextField';
import { IncludedTag } from './LiveVoiceVendorCard';
-import {
- type LiveVoiceVendor,
- readSetting,
- vendorDescKey,
- vendorIcon,
- voiceFields,
-} from './liveVoiceVendors';
+import LiveVoiceVendorLogo from './LiveVoiceVendorLogo';
+import { type LiveVoiceVendor, readSetting, vendorDescKey, voiceFields } from './liveVoiceVendors';
export type LiveVoiceTestState =
| { kind: 'testing' }
@@ -68,7 +63,6 @@ const LiveVoiceSettingsModal = ({
const { t } = useT();
const titleId = useId();
const [replacing, setReplacing] = useState<Record<string, boolean>>({});
- const Icon = vendorIcon(vendor.id);
const descKey = vendorDescKey(vendor.id);
const testLine = (providerId: string) => {
@@ -327,7 +321,7 @@ const LiveVoiceSettingsModal = ({
title={vendor.name}
titleId={titleId}
subtitle={descKey ? t(descKey) : undefined}
- icon={<Icon className="h-5 w-5" />}
+ icon={<LiveVoiceVendorLogo vendorId={vendor.id} className="h-5 w-5" />}
maxWidthClassName="max-w-lg"
contentClassName="flex flex-col gap-5 px-5 py-4"
testId="live-voice-modal"
diff --git a/app/src/components/settings/panels/LiveVoiceVendorCard.tsx b/app/src/components/settings/panels/LiveVoiceVendorCard.tsx
index f7cf5f187b..e6276d7f0e 100644
--- a/app/src/components/settings/panels/LiveVoiceVendorCard.tsx
+++ b/app/src/components/settings/panels/LiveVoiceVendorCard.tsx
@@ -4,7 +4,8 @@ import { cn } from '../../../lib/cn';
import { useT } from '../../../lib/i18n/I18nContext';
import Badge from '../../ui/Badge';
import Button from '../../ui/Button';
-import { type LiveVoiceVendor, vendorDescKey, vendorIcon } from './liveVoiceVendors';
+import LiveVoiceVendorLogo from './LiveVoiceVendorLogo';
+import { type LiveVoiceVendor, vendorDescKey } from './liveVoiceVendors';
/** The highlighted "Included with TinyHumans" tag on managed voice agents. */
export const IncludedTag = ({ className }: { className?: string }) => {
@@ -44,73 +45,74 @@ const LiveVoiceVendorCard = ({
onOpenSettings,
}: LiveVoiceVendorCardProps) => {
const { t } = useT();
- const Icon = vendorIcon(vendor.id);
const descKey = vendorDescKey(vendor.id);
const inUse = vendor.providers.some(p => p.id === defaultProvider);
const hasHosted = vendor.providers.some(p => p.kind === 'hosted');
const ready = vendor.providers.find(p => p.configured);
+ const status = inUse ? (
+ <Badge variant="primary">{t('connections.voiceAgents.badgeInUse')}</Badge>
+ ) : ready ? (
+ <Badge variant="success">{t('connections.voiceAgents.badgeReady')}</Badge>
+ ) : (
+ <Badge variant="warning">{t('connections.voiceAgents.badgeNeedsKey')}</Badge>
+ );
+
return (
<div
data-testid={`live-voice-vendor-${vendor.id}`}
data-in-use={inUse || undefined}
className={cn(
- 'flex h-full flex-col rounded-xl border p-4 transition-colors',
+ 'flex h-full flex-col gap-3 rounded-xl border p-4 transition-colors',
inUse
? 'border-primary-500 bg-primary-50 ring-1 ring-primary-500 dark:bg-primary-500/10'
: 'border-line bg-surface'
)}>
- <div className="flex items-start justify-between gap-2">
+ <div className="flex items-start gap-3">
<span
- aria-hidden
className={cn(
- 'flex h-10 w-10 shrink-0 items-center justify-center rounded-xl [&_svg]:h-5 [&_svg]:w-5',
+ 'flex h-11 w-11 shrink-0 items-center justify-center rounded-xl',
inUse ? 'bg-primary-500 text-content-inverted' : 'bg-surface-strong text-content'
)}>
- <Icon />
+ <LiveVoiceVendorLogo vendorId={vendor.id} className="h-5.5 w-5.5" />
</span>
- {inUse ? (
- <Badge variant="primary">{t('connections.voiceAgents.badgeInUse')}</Badge>
- ) : ready ? (
- <Badge variant="success">{t('connections.voiceAgents.badgeReady')}</Badge>
- ) : (
- <Badge variant="warning">{t('connections.voiceAgents.badgeNeedsKey')}</Badge>
- )}
- </div>
-
- <h4 className="mt-3 text-sm font-semibold text-content">{vendor.name}</h4>
- {descKey && <p className="mt-0.5 text-xs leading-relaxed text-content-muted">{t(descKey)}</p>}
-
- <div className="mt-3 flex flex-wrap gap-1.5">
- {hasHosted ? (
- <IncludedTag />
- ) : (
- <Badge dot={false}>{t('connections.voiceAgents.ownKeyTag')}</Badge>
- )}
+ <div className="min-w-0 flex-1">
+ <div className="flex flex-wrap items-center justify-between gap-x-2 gap-y-1">
+ <h4 className="text-sm font-semibold text-content">{vendor.name}</h4>
+ {status}
+ </div>
+ {descKey && (
+ <p className="mt-0.5 text-xs leading-relaxed text-content-muted">{t(descKey)}</p>
+ )}
+ </div>
</div>
- <div className="mt-auto flex items-center justify-end gap-2 pt-4">
- {!inUse && ready && (
+ <div className="mt-auto flex flex-wrap items-center justify-between gap-2">
+ {hasHosted ? <IncludedTag /> : <Badge>{t('connections.voiceAgents.ownKeyTag')}</Badge>}
+ <div className="ml-auto flex items-center gap-1.5">
+ {!inUse && ready && (
+ <Button
+ size="sm"
+ variant="secondary"
+ analyticsId="live-voice-use-vendor"
+ data-testid={`live-voice-use-vendor-${vendor.id}`}
+ disabled={saving}
+ onClick={() => onUse(ready.id)}>
+ {t('connections.voiceAgents.use')}
+ </Button>
+ )}
<Button
size="sm"
variant="secondary"
- analyticsId="live-voice-use-vendor"
- data-testid={`live-voice-use-vendor-${vendor.id}`}
- disabled={saving}
- onClick={() => onUse(ready.id)}>
- {t('connections.voiceAgents.use')}
+ iconOnly
+ analyticsId="live-voice-open-settings"
+ data-testid={`live-voice-settings-${vendor.id}`}
+ aria-label={t('connections.voiceAgents.settingsAria').replace('{name}', vendor.name)}
+ title={t('connections.voiceAgents.settings')}
+ onClick={onOpenSettings}>
+ <Settings2 className="h-4 w-4" aria-hidden />
</Button>
- )}
- <Button
- size="sm"
- variant="tertiary"
- analyticsId="live-voice-open-settings"
- data-testid={`live-voice-settings-${vendor.id}`}
- aria-label={t('connections.voiceAgents.settingsAria').replace('{name}', vendor.name)}
- onClick={onOpenSettings}>
- <Settings2 className="h-4 w-4" aria-hidden />
- {t('connections.voiceAgents.settings')}
- </Button>
+ </div>
</div>
</div>
);
diff --git a/app/src/components/settings/panels/LiveVoiceVendorLogo.tsx b/app/src/components/settings/panels/LiveVoiceVendorLogo.tsx
index e4cd38c067..68bcfa0a78 100644
--- a/app/src/components/settings/panels/LiveVoiceVendorLogo.tsx
+++ b/app/src/components/settings/panels/LiveVoiceVendorLogo.tsx
@@ -6,19 +6,14 @@ import sarvamLogo from '../../../assets/provider-icons/sarvam.svg';
import { cn } from '../../../lib/cn';
/** Simple Icons marks for vendors in the installed `react-icons` set. */
-const VENDOR_ICONS: Record<string, IconType> = {
- gemini: SiGooglegemini,
- elevenlabs: SiElevenlabs,
-};
+const VENDOR_ICONS: Record<string, IconType> = { gemini: SiGooglegemini, elevenlabs: SiElevenlabs };
/**
* Bundled single-colour marks for vendors Simple Icons lacks, drawn as a CSS
* mask so they take the surrounding text colour in both themes. Sarvam's is
* its published brand mark (assets.sarvam.ai/assets/brand/logos).
*/
-const VENDOR_MASKS: Record<string, string> = {
- sarvam: sarvamLogo,
-};
+const VENDOR_MASKS: Record<string, string> = { sarvam: sarvamLogo };
/** A voice vendor's brand mark, falling back to a microphone for unknown vendors. */
const LiveVoiceVendorLogo = ({ vendorId, className }: { vendorId: string; className?: string }) => {