Add the Translate transcript panel with its own exports

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Lucas Winther
2026-10-29 22:10:51 +01:00
co-authored by Claude Opus 5.5
parent a0748b5fa6
commit c110c9203f
6 changed files with 501 additions and 7 deletions
+10 -2
View File
@@ -5,6 +5,7 @@ import {
type ModelStorageInfo,
} from "../lib/modelCache";
import { MODELS, getModel } from "../lib/models";
import { TRANSLATION_MODEL_IDS, getTranslationModelById } from "../lib/translation";
interface StorageManagerProps {
/** Downloaded-badge set from App — changes re-measure an open panel. */
@@ -15,7 +16,14 @@ interface StorageManagerProps {
onChanged: () => void;
}
const MODEL_IDS = MODELS.map((model) => model.id);
// Whisper weights plus the Opus-MT translation models (D-WS4b).
const MODEL_IDS = [...MODELS.map((model) => model.id), ...TRANSLATION_MODEL_IDS];
function displayName(modelId: string): string {
const translation = getTranslationModelById(modelId);
if (translation) return `Translation, ${translation.label}`;
return getModel(modelId)?.displayName ?? modelId;
}
function formatBytes(bytes: number): string {
if (bytes >= 1e9) return `${(bytes / 1e9).toFixed(2)} GB`;
@@ -82,7 +90,7 @@ export function StorageManager({ downloaded, disabled, onChanged }: StorageManag
<li key={entry.modelId} className="storage-row">
<div className="storage-model">
<span className="storage-name">
{getModel(entry.modelId)?.displayName ?? entry.modelId}
{displayName(entry.modelId)}
</span>
<code className="storage-id">{entry.modelId}</code>
</div>