Skip to content

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

fix(settings): correct i18n key for search placeholder in SearchPanel

Steven Enamakel768e177cf016
diff --git a/app/src/components/dashboard/ModelCostTable.tsx b/app/src/components/dashboard/ModelCostTable.tsx
index d469fee3d7..7ce50a619a 100644
--- a/app/src/components/dashboard/ModelCostTable.tsx
+++ b/app/src/components/dashboard/ModelCostTable.tsx
@@ -1,5 +1,7 @@
import type { CostDashboardModelStats } from '../../hooks/useCostDashboard';
import { useT } from '../../lib/i18n/I18nContext';
+import { Badge, EmptyState, Progress } from '../ui';
+import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '../ui/Table';
import { formatCurrency, formatTokens } from './formatCurrency';
interface ModelCostTableProps {
@@ -7,121 +9,73 @@ interface ModelCostTableProps {
currency: string;
}
-const PROVIDER_PALETTE: Record<string, string> = {
- anthropic:
- 'bg-[#D97757]/15 text-[#D97757] dark:bg-[#D97757]/20 dark:text-[#F5A584] ring-[#D97757]/30',
- openai: 'bg-sage-500/15 text-sage-700 dark:bg-sage-500/20 dark:text-sage-300 ring-sage-500/30',
- google:
- 'bg-primary-500/15 text-primary-700 dark:bg-primary-500/20 dark:text-primary-300 ring-primary-500/30',
- fireworks:
- 'bg-coral-500/15 text-coral-700 dark:bg-coral-500/20 dark:text-coral-300 ring-coral-500/30',
- groq: 'bg-amber-500/15 text-amber-700 dark:bg-amber-500/20 dark:text-amber-300 ring-amber-500/30',
-};
-
-const PROVIDER_FALLBACK = 'bg-surface-strong text-content-secondary ring-line-strong';
-
-function providerChipClass(provider: string | null): string {
- if (!provider) return PROVIDER_FALLBACK;
- return PROVIDER_PALETTE[provider.toLowerCase()] ?? PROVIDER_FALLBACK;
-}
-
+/** Per-model spend for the window: model, provider chip, volume, cost, share. */
const ModelCostTable = ({ models, currency }: ModelCostTableProps) => {
const { t } = useT();
if (models.length === 0) {
return (
- <div data-testid="model-cost-table-empty" className="text-xs text-content-muted italic py-2">
- {t('settings.costDashboard.noModels')}
+ <div data-testid="model-cost-table-empty" className="p-4">
+ <EmptyState label={t('settings.costDashboard.noModels')} />
</div>
);
}
return (
- <div className="overflow-x-auto -mx-1" data-testid="model-cost-table">
- <table className="w-full text-xs">
- <thead>
- <tr className="text-left text-[10px] uppercase tracking-wide text-content-muted border-b border-line">
- <Th>{t('settings.costDashboard.model')}</Th>
- <Th>{t('settings.costDashboard.provider')}</Th>
- <Th align="right">{t('settings.costDashboard.tokens')}</Th>
- <Th align="right">{t('settings.costDashboard.requests')}</Th>
- <Th align="right">{t('settings.costDashboard.cost')}</Th>
- <Th align="right">{t('settings.costDashboard.percentOfTotal')}</Th>
- </tr>
- </thead>
- <tbody>
+ <div data-testid="model-cost-table">
+ <Table>
+ <TableHeader>
+ <TableRow className="hover:bg-transparent">
+ <TableHead className="w-full">{t('settings.costDashboard.model')}</TableHead>
+ <TableHead>{t('settings.costDashboard.provider')}</TableHead>
+ <TableHead className="text-right">{t('settings.costDashboard.tokens')}</TableHead>
+ <TableHead className="text-right">{t('settings.costDashboard.requests')}</TableHead>
+ <TableHead className="text-right">{t('settings.costDashboard.cost')}</TableHead>
+ <TableHead className="text-right">
+ {t('settings.costDashboard.percentOfTotal')}
+ </TableHead>
+ </TableRow>
+ </TableHeader>
+ <TableBody>
{models.map(row => {
const modelName = row.model.includes('/')
? row.model.split('/').slice(1).join('/')
: row.model;
const sharePct = Math.max(0, Math.min(100, row.percent_of_total));
return (
- <tr
- key={row.model}
- data-testid={`model-row-${row.model}`}
- className="group border-b border-line-subtle dark:border-line/60 last:border-0 hover:bg-surface-muted/60 dark:hover:bg-surface-muted/40 transition-colors">
- <Td>
- <div
- className="font-medium text-content truncate max-w-[16rem]"
- title={row.model}>
+ <TableRow key={row.model} data-testid={`model-row-${row.model}`}>
+ {/* `w-full max-w-0` lets the name truncate instead of widening the table. */}
+ <TableCell className="w-full max-w-0">
+ <div className="truncate font-medium text-content" title={row.model}>
{modelName}
</div>
- </Td>
- <Td>
- <span
- className={`inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium ring-1 ring-inset ${providerChipClass(row.provider)}`}>
- {row.provider ?? t('settings.costDashboard.unknownProvider')}
- </span>
- </Td>
- <Td align="right">
- <span className="tabular-nums text-content-secondary">
- {formatTokens(row.total_tokens)}
- </span>
- </Td>
- <Td align="right">
- <span className="tabular-nums text-content-secondary">{row.request_count}</span>
- </Td>
- <Td align="right">
- <span className="tabular-nums font-medium text-content">
- {formatCurrency(row.cost_usd, currency)}
- </span>
- </Td>
- <Td align="right">
+ </TableCell>
+ <TableCell className="whitespace-nowrap">
+ <Badge>{row.provider ?? t('settings.costDashboard.unknownProvider')}</Badge>
+ </TableCell>
+ <TableCell className="whitespace-nowrap text-right tabular-nums text-content-secondary">
+ {formatTokens(row.total_tokens)}
+ </TableCell>
+ <TableCell className="whitespace-nowrap text-right tabular-nums text-content-secondary">
+ {row.request_count}
+ </TableCell>
+ <TableCell className="whitespace-nowrap text-right font-medium tabular-nums text-content">
+ {formatCurrency(row.cost_usd, currency)}
+ </TableCell>
+ <TableCell className="whitespace-nowrap">
<div className="flex items-center justify-end gap-2">
- <div
- aria-hidden
- className="h-1 w-12 rounded-full bg-surface-strong overflow-hidden">
- <div
- className="h-full rounded-full bg-primary-500"
- style={{ width: `${sharePct}%` }}
- />
- </div>
- <span className="tabular-nums w-10 text-right text-content-secondary">
+ <Progress value={sharePct} className="h-1 w-14" />
+ <span className="w-11 text-right tabular-nums text-content-secondary">
{`${sharePct.toFixed(1)}%`}
</span>
</div>
- </Td>
- </tr>
+ </TableCell>
+ </TableRow>
);
})}
- </tbody>
- </table>
+ </TableBody>
+ </Table>
</div>
);
};
-interface CellProps {
- children: React.ReactNode;
- align?: 'left' | 'right';
-}
-
-const Th = ({ children, align = 'left' }: CellProps) => (
- <th className={`py-2 px-2 font-medium ${align === 'right' ? 'text-right' : 'text-left'}`}>
- {children}
- </th>
-);
-
-const Td = ({ children, align = 'left' }: CellProps) => (
- <td className={`py-2 px-2 ${align === 'right' ? 'text-right' : 'text-left'}`}>{children}</td>
-);
-
export default ModelCostTable;
diff --git a/app/src/components/settings/panels/SearchPanel.tsx b/app/src/components/settings/panels/SearchPanel.tsx
index 6b278e8a48..a882849bfd 100644
--- a/app/src/components/settings/panels/SearchPanel.tsx
+++ b/app/src/components/settings/panels/SearchPanel.tsx
@@ -1,3 +1,4 @@
+import { Save } from 'lucide-react';
import { useEffect, useRef, useState } from 'react';
import { useT } from '../../../lib/i18n/I18nContext';
@@ -13,6 +14,7 @@ import {
import PanelPage from '../../layout/PanelPage';
import { Alert, AlertDescription } from '../../ui/Alert';
import Button from '../../ui/Button';
+import Card from '../../ui/Card';
import { CenteredLoadingState } from '../../ui/LoadingState';
import StatusLine from '../../ui/StatusLine';
import TextArea from '../../ui/TextArea';
@@ -253,6 +255,77 @@ const SearchPanel = ({ embedded = false }: { embedded?: boolean }) => {
return false;
};
+ // One row per BYOK engine in the API keys card.
+ const KEY_ROWS: {
+ engine: ByokEngine;
+ labelKey: string;
+ placeholderKey: string;
+ configured: boolean;
+ value: string;
+ setValue: (v: string) => void;
+ show: boolean;
+ toggleShow: () => void;
+ docUrl: string;
+ }[] = settings
+ ? [
+ {
+ engine: 'parallel',
+ labelKey: 'settings.search.parallelKeyLabel',
+ placeholderKey: 'settings.search.placeholderParallel',
+ configured: settings.parallel_configured,
+ value: parallelKey,
+ setValue: setParallelKey,
+ show: showParallel,
+ toggleShow: () => setShowParallel(s => !s),
+ docUrl: 'https://parallel.ai/',
+ },
+ {
+ engine: 'brave',
+ labelKey: 'settings.search.braveKeyLabel',
+ placeholderKey: 'settings.search.placeholderBrave',
+ configured: settings.brave_configured,
+ value: braveKey,
+ setValue: setBraveKey,
+ show: showBrave,
+ toggleShow: () => setShowBrave(s => !s),
+ docUrl: 'https://brave.com/search/api/',
+ },
+ {
+ engine: 'querit',
+ labelKey: 'settings.search.queritKeyLabel',
+ placeholderKey: 'settings.search.placeholderQuerit',
+ configured: settings.querit_configured,
+ value: queritKey,
+ setValue: setQueritKey,
+ show: showQuerit,
+ toggleShow: () => setShowQuerit(s => !s),
+ docUrl: 'https://www.querit.ai/en/docs/reference/post',
+ },
+ {
+ engine: 'exa',
+ labelKey: 'settings.search.exaKeyLabel',
+ placeholderKey: 'settings.search.placeholderExa',
+ configured: settings.exa_configured,
+ value: exaKey,
+ setValue: setExaKey,
+ show: showExa,
+ toggleShow: () => setShowExa(s => !s),
+ docUrl: 'https://exa.ai',
+ },
+ {
+ engine: 'tavily',
+ labelKey: 'settings.search.tavilyKeyLabel',
+ placeholderKey: 'settings.search.placeholderTavily',
+ configured: settings.tavily_configured,
+ value: tavilyKey,
+ setValue: setTavilyKey,
+ show: showTavily,
+ toggleShow: () => setShowTavily(s => !s),
+ docUrl: 'https://tavily.com',
+ },
+ ]
+ : [];
+
return (
<PanelPage
className="z-10"
@@ -260,11 +333,7 @@ const SearchPanel = ({ embedded = false }: { embedded?: boolean }) => {
contentClassName=""
description={embedded ? undefined : t('settings.search.menuDesc')}
leading={embedded ? undefined : <SettingsBackButton onBack={navigateBack} />}>
- <div className={embedded ? 'space-y-5' : 'p-4 space-y-5'}>
- <p className="text-xs text-content-muted leading-relaxed">
- {t('settings.search.description')}
- </p>
-
+ <div className={embedded ? 'space-y-5' : 'space-y-5 p-4'}>
{isLocalSession && (
<Alert variant="info">
<AlertDescription>{t('settings.search.localManagedUnavailable')}</AlertDescription>
@@ -275,167 +344,109 @@ const SearchPanel = ({ embedded = false }: { embedded?: boolean }) => {
{settings && (
<>
- <SearchPanelEngineList
- engines={visibleEngines}
- selectedEngine={selectedEngine}
- ariaLabel={t('settings.search.engineAria')}
- isConfigured={isConfigured}
- onSelect={engine => void persistEngine(engine)}
- t={t}
- />
-
- {/* BYO API keys */}
- <div className="space-y-3">
- <KeyEditor
- label={t('settings.search.parallelKeyLabel')}
- placeholder={
- settings.parallel_configured
- ? t('settings.search.placeholderStored')
- : t('settings.search.placeholderParallel')
- }
- show={showParallel}
- onToggleShow={() => setShowParallel(s => !s)}
- value={parallelKey}
- onChange={setParallelKey}
- onSave={() => void persistKey('parallel', parallelKey)}
- onClear={() => void persistKey('parallel', '')}
- configured={settings.parallel_configured}
- docUrl="https://parallel.ai/"
- t={t}
- />
- <KeyEditor
- label={t('settings.search.braveKeyLabel')}
- placeholder={
- settings.brave_configured
- ? t('settings.search.placeholderStored')
- : t('settings.search.placeholderBrave')
- }
- show={showBrave}
- onToggleShow={() => setShowBrave(s => !s)}
- value={braveKey}
- onChange={setBraveKey}
- onSave={() => void persistKey('brave', braveKey)}
- onClear={() => void persistKey('brave', '')}
- configured={settings.brave_configured}
- docUrl="https://brave.com/search/api/"
- t={t}
- />
- <KeyEditor
- label={t('settings.search.queritKeyLabel')}
- placeholder={
- settings.querit_configured
- ? t('settings.search.placeholderStored')
- : t('settings.search.placeholderQuerit')
- }
- show={showQuerit}
- onToggleShow={() => setShowQuerit(s => !s)}
- value={queritKey}
- onChange={setQueritKey}
- onSave={() => void persistKey('querit', queritKey)}
- onClear={() => void persistKey('querit', '')}
- configured={settings.querit_configured}
- docUrl="https://www.querit.ai/en/docs/reference/post"
- t={t}
- />
- <KeyEditor
- label={t('settings.search.exaKeyLabel')}
- placeholder={
- settings.exa_configured
- ? t('settings.search.placeholderStored')
- : t('settings.search.placeholderExa')
- }
- show={showExa}
- onToggleShow={() => setShowExa(s => !s)}
- value={exaKey}
- onChange={setExaKey}
- onSave={() => void persistKey('exa', exaKey)}
- onClear={() => void persistKey('exa', '')}
- configured={settings.exa_configured}
- docUrl="https://exa.ai"
+ {/* ── Engine ─────────────────────────────────────────────── */}
+ <Card
+ title={t('settings.search.engineAria')}
+ description={t('settings.search.description')}>
+ <SearchPanelEngineList
+ engines={visibleEngines}
+ selectedEngine={selectedEngine}
+ ariaLabel={t('settings.search.engineAria')}
+ isConfigured={isConfigured}
+ onSelect={engine => void persistEngine(engine)}
t={t}
/>
- <KeyEditor
- label={t('settings.search.tavilyKeyLabel')}
- placeholder={
- settings.tavily_configured
- ? t('settings.search.placeholderStored')
- : t('settings.search.placeholderTavily')
- }
- show={showTavily}
- onToggleShow={() => setShowTavily(s => !s)}
- value={tavilyKey}
- onChange={setTavilyKey}
- onSave={() => void persistKey('tavily', tavilyKey)}
- onClear={() => void persistKey('tavily', '')}
- configured={settings.tavily_configured}
- docUrl="https://tavily.com"
- t={t}
- />
- </div>
+ </Card>
+
+ {/* ── BYO API keys, one row per direct provider ───────────── */}
+ <Card
+ title={t('settings.search.apiKeysHeading')}
+ description={t('settings.search.apiKeysDesc')}>
+ {KEY_ROWS.map(row => (
+ <KeyEditor
+ key={row.engine}
+ label={t(row.labelKey)}
+ placeholder={
+ row.configured ? t('settings.search.placeholderStored') : t(row.placeholderKey)
+ }
+ show={row.show}
+ onToggleShow={row.toggleShow}
+ value={row.value}
+ onChange={row.setValue}
+ onSave={() => void persistKey(row.engine, row.value)}
+ onClear={() => void persistKey(row.engine, '')}
+ configured={row.configured}
+ docUrl={row.docUrl}
+ t={t}
+ />
+ ))}
+ </Card>
- {/* Allowed websites — unified host allowlist shared by web_fetch /
- curl and (when enabled) the browser tool. Web search is not
- gated by this list. */}
- <div className="rounded-xl border border-line bg-surface p-3 space-y-2">
- {/* Section heading, not a form label — use a <p> so screen
- readers don't announce an orphan <label> with no htmlFor. */}
- <p className="text-xs font-semibold text-content-secondary">
- {t('settings.search.allowedSitesLabel')}
- </p>
- <ToggleGroupRoot
- type="single"
- aria-label={t('settings.search.accessModeAria')}
- value={mode}
- onValueChange={value => {
- if (value) selectMode(value as AccessMode);
- }}
- disabled={status.kind === 'saving'}
- className="flex w-full rounded-lg border border-line overflow-hidden gap-0">
- {(
- [
- ['all', 'settings.search.accessAllowAll'],
- ['custom', 'settings.search.accessCustom'],
- ['block', 'settings.search.accessBlockAll'],
- ] as const
- ).map(([value, labelKey]) => (
- <ToggleGroupItem
- key={value}
- value={value}
- variant="tertiary"
- className="flex-1 rounded-none border-0 border-l border-line first:border-l-0 px-3 py-1.5 text-xs data-[state=on]:bg-primary-500 data-[state=on]:text-content-inverted">
- {t(labelKey)}
- </ToggleGroupItem>
- ))}
- </ToggleGroupRoot>
- <p className="text-[11px] text-content-muted leading-relaxed">
- {mode === 'all'
+ {/* ── Allowed websites: the unified host allowlist shared by
+ web_fetch / curl and (when enabled) the browser tool. Web
+ search is not gated by this list. ────────────────────── */}
+ <Card
+ title={t('settings.search.allowedSitesLabel')}
+ description={
+ mode === 'all'
? t('settings.search.allowedSitesAllOn')
: mode === 'block'
? t('settings.search.accessBlockAllHint')
- : t('settings.search.allowedSitesHint')}
- </p>
+ : t('settings.search.allowedSitesHint')
+ }
+ headerRight={
+ <ToggleGroupRoot
+ type="single"
+ variant="secondary"
+ size="xs"
+ aria-label={t('settings.search.accessModeAria')}
+ value={mode}
+ onValueChange={value => {
+ if (value) selectMode(value as AccessMode);
+ }}
+ disabled={status.kind === 'saving'}
+ className="gap-0 overflow-hidden rounded-lg border border-line *:rounded-none *:border-0">
+ {(
+ [
+ ['all', 'settings.search.accessAllowAll'],
+ ['custom', 'settings.search.accessCustom'],
+ ['block', 'settings.search.accessBlockAll'],
+ ] as const
+ ).map(([value, labelKey]) => (
+ <ToggleGroupItem
+ key={value}
+ value={value}
+ className="h-auto px-2.5 py-1 text-xs font-medium data-[state=on]:bg-primary-500 data-[state=on]:text-content-inverted">
+ {t(labelKey)}
+ </ToggleGroupItem>
+ ))}
+ </ToggleGroupRoot>
+ }>
{mode === 'custom' && (
- <>
+ <div className="space-y-3 p-4">
<TextArea
value={allowedText}
onChange={e => setAllowedText(e.target.value)}
- rows={4}
+ rows={5}
spellCheck={false}
placeholder={t('settings.search.allowedSitesPlaceholder')}
className="font-mono text-xs"
aria-label={t('settings.search.allowedSitesLabel')}
/>
- <Button
- type="button"
- variant="primary"
- size="xs"
- onClick={() => persistAllowedDomains()}
- disabled={status.kind === 'saving'}>
- {t('settings.search.allowedSitesSave')}
- </Button>
- </>
+ <div className="flex justify-end">
+ <Button
+ type="button"
+ variant="primary"
+ size="sm"
+ leadingIcon={<Save className="h-3.5 w-3.5" aria-hidden />}
+ onClick={() => persistAllowedDomains()}
+ disabled={status.kind === 'saving'}>
+ {t('settings.search.allowedSitesSave')}
+ </Button>
+ </div>
+ </div>
)}
- </div>
+ </Card>
<StatusLine
saving={status.kind === 'saving'}
diff --git a/app/src/components/settings/panels/VoicePanelRoutingSection.tsx b/app/src/components/settings/panels/VoicePanelRoutingSection.tsx
index ec9e57a3e5..3bacdd7fdd 100644
--- a/app/src/components/settings/panels/VoicePanelRoutingSection.tsx
+++ b/app/src/components/settings/panels/VoicePanelRoutingSection.tsx
@@ -1,10 +1,11 @@
-import { useState } from 'react';
+import { Mic, Play, Volume2 } from 'lucide-react';
+import { type ReactNode, useState } from 'react';
import { installPiper } from '../../../services/api/voiceInstallApi';
import { testVoiceProvider, type VoiceProviderView } from '../../../services/api/voiceSettingsApi';
import type { VoiceStatus } from '../../../utils/tauriCommands';
-import { Button } from '../../ui';
-import { SettingsRow, SettingsSection, SettingsSelect, SettingsTextField } from '../controls';
+import { Badge, Button, Card, Field, NativeSelect, TextField } from '../../ui';
+import { Spinner } from '../../ui/icons';
import { ELEVENLABS_VOICE_PRESETS, isCuratedVoicePreset } from './elevenlabsVoicePresets';
interface VoicePanelRoutingSectionProps {
@@ -31,6 +32,31 @@ interface VoicePanelRoutingSectionProps {
saveRouting: () => Promise<void>;
}
+type TestResult = { ok: boolean; detail: string } | null;
+
+/** Label with a small leading icon, for the two workload rows. */
+const WorkloadLabel = ({ icon, children }: { icon: ReactNode; children: ReactNode }) => (
+ <span className="flex items-center gap-2">
+ <span className="flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-surface-muted text-content-secondary">
+ {icon}
+ </span>
+ {children}
+ </span>
+);
+
+/** Outcome of a Test click: a status chip plus the provider's detail text. */
+const TestResultLine = ({ result, t }: { result: TestResult; t: (key: string) => string }) =>
+ result ? (
+ <div className="flex items-center gap-2 px-4 pb-3 text-xs text-content-muted">
+ <Badge variant={result.ok ? 'success' : 'danger'}>
+ {result.ok ? t('voice.routing.testOk') : t('voice.routing.testFailed')}
+ </Badge>
+ <span className="min-w-0 truncate" title={result.detail}>
+ {result.detail}
+ </span>
+ </div>
+ ) : null;
+
/** STT/TTS provider routing pickers + per-workload test buttons. */
const VoicePanelRoutingSection = ({
t,
diff --git a/app/src/lib/i18n/en.ts b/app/src/lib/i18n/en.ts
index ff2541005c..1d982cfeb6 100644
--- a/app/src/lib/i18n/en.ts
+++ b/app/src/lib/i18n/en.ts
@@ -1732,6 +1732,10 @@ const en: TranslationMap = {
'settings.search.fallbackToManaged':
'No key configured: search will fall back to Managed until a key is saved.',
'settings.search.getApiKey': 'Get API key',
+ 'settings.search.keyStored': 'Stored',
+ 'settings.search.apiKeysHeading': 'API keys',
+ 'settings.search.apiKeysDesc':
+ 'Keys for the direct providers. They stay on this device and are used only when that engine is selected.',
'settings.search.save': 'Save',
'settings.search.clear': 'Clear',
'settings.search.show': 'Show',