Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.
JavaScript aianthropiccross-platformgeminigroqlinuxmacosnvidiaopen-sourceopenaiparakeetspeech-to-texttranscribewhisperwindows
fix(downloads): say Installing in the download tray once extraction starts (#2137)
Joshua7bb46ebf4a78
diff --git a/src/components/onboarding/BackgroundModelDownloadTray.tsx b/src/components/onboarding/BackgroundModelDownloadTray.tsxindex 4f0f5215e..a5871a23e 100644--- a/src/components/onboarding/BackgroundModelDownloadTray.tsx+++ b/src/components/onboarding/BackgroundModelDownloadTray.tsx@@ -23,7 +23,7 @@ import type {ParakeetDownloadProgressData,WhisperDownloadProgressData,} from "../../types/electron";-import { mergeHydratedDownloads } from "./localDownloadState";+import { ellipsisFrame, isTrayInstalling, mergeHydratedDownloads } from "./localDownloadState";import { ONBOARDING_SESSION_KEY, isRequiredModelsOnboardingStepActive } from "./flow";import { getPlatform } from "../../utils/platform";@@ -124,6 +124,24 @@ function CancelGlyph() {);}+// One frame every 400ms, so a full stop-to-three-dots cycle takes 1.6s.+const ELLIPSIS_FRAME_MS = 400;++// Installation reports no byte progress, so without this the header sits on a+// full bar and reads as a stalled download. aria-hidden because the tray is an+// aria-live region: an announced dot would re-read the whole strip every frame.+function AnimatedEllipsis() {+ const [tick, setTick] = useState(0);++ useEffect(() => {+ if (window.matchMedia?.("(prefers-reduced-motion: reduce)").matches) return;+ const timer = setInterval(() => setTick((current) => current + 1), ELLIPSIS_FRAME_MS);+ return () => clearInterval(timer);+ }, []);++ return <span aria-hidden="true">{ellipsisFrame(tick)}</span>;+}+export default function BackgroundModelDownloadTray({placement = "control-panel",}: {@@ -388,6 +406,8 @@ export default function BackgroundModelDownloadTray({if (activeDownloads.length === 0) return null;+ const installing = isTrayInstalling(activeDownloads);+return (// Figma "Onboarding / Frame 2147259036": 341 wide, radius 12, #E3E3E3// stroke, no shadow. Colours bind to the app's standard theme tokens@@ -408,7 +428,14 @@ export default function BackgroundModelDownloadTray({{/* Frame 2147259037: #F7F7F7 strip, 7/8 padding, gap 5, 12/140% label. */}<div className="flex items-center gap-[5px] bg-muted px-2 py-[7px] text-xs leading-[1.4] text-muted-foreground"><BrandMark className="size-[11.2px] shrink-0 text-primary" />- {t("onboarding.rehaul.local.downloadInProgress")}+ {installing ? (+ <span>+ {t("onboarding.rehaul.local.installing")}+ <AnimatedEllipsis />+ </span>+ ) : (+ <span>{t("onboarding.rehaul.local.downloadInProgress")}</span>+ )}</div>{activeDownloads.map((download, index) => (// Frame 2147258983: a row of 8/10 padding and gap 10, holding the growing@@ -433,8 +460,14 @@ export default function BackgroundModelDownloadTray({{downloadDisplay(download).name}</span></span>+ {/* Extraction pins the percentage at 100, so the number stops+ carrying information exactly when the bar stops moving. Naming+ the phase per row — as the setup step and the settings picker+ already do — keeps that readable whatever the other rows do. */}<span className="shrink-0 font-medium tabular-nums text-muted-foreground">- {Math.round(download.percentage)}%+ {download.installing+ ? t("onboarding.rehaul.local.installing")+ : `${Math.round(download.percentage)}%`}</span></div>{download.error ? (diff --git a/src/components/onboarding/localDownloadState.ts b/src/components/onboarding/localDownloadState.tsindex ef7b56b41..5b817ab65 100644--- a/src/components/onboarding/localDownloadState.ts+++ b/src/components/onboarding/localDownloadState.ts@@ -27,3 +27,21 @@ export function mergeHydratedDownloads<T>() as Record<string, T>;return { ...recoverable, ...current };}++/**+ * Extraction is the last phase of a transfer, so the tray header only claims it+ * once every row has reached it — a mixed tray is still, truthfully, downloading.+ * A failed row is not one of those transfers: it has already stopped, so waiting+ * on it would keep the header describing a download that is no longer running.+ */+export function isTrayInstalling(+ downloads: readonly { installing?: boolean; error?: string }[]+): boolean {+ const running = downloads.filter((download) => !download.error);+ return running.length > 0 && running.every((download) => download.installing === true);+}++/** Cycles "" → "." → ".." → "..." so an installing header reads as live work. */+export function ellipsisFrame(tick: number): string {+ return ".".repeat(tick % 4);+}diff --git a/src/locales/ar/translation.json b/src/locales/ar/translation.jsonindex f47768002..62a3146d9 100644--- a/src/locales/ar/translation.json+++ b/src/locales/ar/translation.json@@ -2145,7 +2145,7 @@"cancelDownload": "إلغاء تنزيل {{model}}","downloads": "تنزيلات النماذج","downloading": "جاري التنزيل... {{progress}}%",- "installing": "جاري التثبيت..."+ "installing": "جاري التثبيت"}},"steps": {diff --git a/test/components/localDownloadState.test.js b/test/components/localDownloadState.test.jsindex 9016f4eba..b21dd8895 100644--- a/test/components/localDownloadState.test.js+++ b/test/components/localDownloadState.test.js@@ -29,10 +29,9 @@ test("hydration cannot resurrect a download removed by a live terminal event", a"llm:qwen": { percentage: 40 },};- assert.deepEqual(- mergeHydratedDownloads(staleInventory, {}, new Set(["whisper:base"])),- { "llm:qwen": { percentage: 40 } }- );+ assert.deepEqual(mergeHydratedDownloads(staleInventory, {}, new Set(["whisper:base"])), {+ "llm:qwen": { percentage: 40 },+ });});test("live download state takes precedence over the hydration snapshot", async () => {@@ -47,3 +46,28 @@ test("live download state takes precedence over the hydration snapshot", async ({ "llm:qwen": { percentage: 55 } });});++test("the tray header only claims installation once every row is installing", async () => {+ const { isTrayInstalling } = await load();++ assert.equal(isTrayInstalling([{ installing: true }]), true);+ assert.equal(isTrayInstalling([{ installing: true }, { installing: true }]), true);+ assert.equal(isTrayInstalling([{ installing: true }, { installing: false }]), false);+ assert.equal(isTrayInstalling([]), false);+});++test("a failed row is not a transfer the header has to wait for", async () => {+ const { isTrayInstalling } = await load();++ // An error row has already stopped, so holding the header on "downloading"+ // for it would describe a transfer that is no longer running.+ assert.equal(isTrayInstalling([{ installing: true }, { error: "boom" }]), true);+ assert.equal(isTrayInstalling([{ error: "boom" }]), false);+ assert.equal(isTrayInstalling([{ installing: false }, { error: "boom" }]), false);+});++test("the installing ellipsis cycles nothing, one, two, three dots and restarts", async () => {+ const { ellipsisFrame } = await load();++ assert.deepEqual([0, 1, 2, 3, 4, 5].map(ellipsisFrame), ["", ".", "..", "...", "", "."]);+});diff --git a/test/components/localModelSetupStep.test.js b/test/components/localModelSetupStep.test.jsindex 5296580e6..377ae0b22 100644--- a/test/components/localModelSetupStep.test.js+++ b/test/components/localModelSetupStep.test.js@@ -10,6 +10,7 @@ const {const FIRST_LLM = "qwen3.5-4b-q4_k_m";const SECOND_LLM = "qwen3.5-2b-q4_k_m";+const PARAKEET = "parakeet-tdt-0.6b-v3";function findElement(node, predicate) {if (Array.isArray(node)) {@@ -184,6 +185,11 @@ async function createSetupHarness(assert.ok(button, `${action} is available for ${modelId}: ${textContent(row(modelId))}`);await React.act(async () => button.props.onClick());};+ const emit = async (family, event) => {+ await React.act(async () => {+ for (const listener of listeners[family]) listener({}, event);+ });+ };const progress = async (modelId, percentage, phase = "progress") => {const family = requests.get(modelId).family;const event =@@ -196,9 +202,7 @@ async function createSetupHarness(downloaded_bytes: percentage,total_bytes: 100,};- await React.act(async () => {- for (const listener of listeners[family]) listener({}, event);- });+ await emit(family, event);};const complete = async (modelId) => {const request = requests.get(modelId);@@ -216,6 +220,11 @@ async function createSetupHarness(request.resolve({ success: true });});};+ const trayRow = (key) => {+ const element = findElement(trayTree, (node) => node.type === "div" && node.key === key);+ assert.ok(element, `tray row ${key} is visible`);+ return element;+ };const actionButton = (label) =>findElement(tree,@@ -228,14 +237,19 @@ async function createSetupHarness(click,progress,complete,+ emit,+ trayRow,cancel: async (modelId) => {- const trayRow = findElement(+ const button = findElement(trayRow(`llm:${modelId}`), (node) => node.type === "button");+ await React.act(async () => button.props.onClick());+ },+ trayHeader: () => {+ const header = findElement(trayTree,- (node) => node.type === "div" && node.key === `llm:${modelId}`+ (node) => node.type === "div" && String(node.props?.className).includes("gap-[5px]"));- assert.ok(trayRow, `tray row ${modelId} is visible`);- const button = findElement(trayRow, (node) => node.type === "button");- await React.act(async () => button.props.onClick());+ assert.ok(header, "tray header is visible");+ return textContent(header);},chooseProvider: async (providerId) => {const select = findElement(tree, (node) => typeof node.props?.onValueChange === "function");@@ -479,3 +493,35 @@ test("unsupported Macs cannot choose Oruk or NVIDIA during local onboarding", asassert.equal(setup.ready(), false);}});++test("the tray header follows the transfer into its installing phase", async (t) => {+ const modelId = "parakeet-tdt-0.6b-v3";+ const setup = await createSetupHarness(t, { provider: "nvidia" });++ await setup.click(modelId, "onboarding.rehaul.local.download");+ await setup.progress(modelId, 100);+ assert.equal(setup.trayHeader(), "onboarding.rehaul.local.downloadInProgress");++ // Extraction reports no further bytes, so the header is the only thing left+ // that can tell a full bar apart from a stalled one.+ await setup.progress(modelId, 100, "installing");+ assert.equal(setup.trayHeader(), "onboarding.rehaul.local.installing");+});++test("an extracting row says so while another model is still downloading", async (t) => {+ const setup = await createSetupHarness(t, { assistant: true });+ await setup.click(FIRST_LLM, "onboarding.rehaul.local.download");+ await setup.progress(FIRST_LLM, 40);++ // The tray outlives the step that started a transfer, so a dictation model+ // picked earlier keeps extracting behind the assistant step.+ await setup.emit("parakeet", { model: PARAKEET, type: "installing", percentage: 100 });++ assert.match(+ textContent(setup.trayRow(`parakeet:${PARAKEET}`)),+ /onboarding\.rehaul\.local\.installing/+ );+ assert.match(textContent(setup.trayRow(`llm:${FIRST_LLM}`)), /40%/);+ // Not every row has reached extraction, so the strip stays on downloading.+ assert.equal(setup.trayHeader(), "onboarding.rehaul.local.downloadInProgress");+});