Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Studio: show the running step on the Hub card's download bar (#14171)

Michael Han93bd68f616b4
diff --git a/studio/frontend/src/features/hub/download-manager/hub-plan-progress.tsx b/studio/frontend/src/features/hub/download-manager/hub-plan-progress.tsx
index 02ef02ac4df..2a776089f46 100644
--- a/studio/frontend/src/features/hub/download-manager/hub-plan-progress.tsx
+++ b/studio/frontend/src/features/hub/download-manager/hub-plan-progress.tsx
@@ -5,8 +5,25 @@ import {
downloadManager,
useDownloadManagerStore,
} from "./download-manager-controller";
+import { presentedProgress } from "./download-presentation";
import { DownloadProgressBar } from "./download-progress-bar";
+import { assetLabel } from "./required-assets";
import type { Plan } from "./use-hub-download-queue";
+
+/** "Model file · 1 of 2" while a step runs, "Queued" before. */
+export function hubPlanStepLabel(plan: Plan, running: boolean): string {
+ const entry = plan.remaining[0];
+ if (!entry || !running) return "Queued";
+ const what =
+ entry.checkpoint !== false ? "Model file" : assetLabel(entry, "Required assets");
+ const steps = plan.entries.length;
+ return steps > 1
+ ? `${what} · ${steps - plan.remaining.length + 1} of ${steps}`
+ : what;
+}
+
+// The bar is the running step's, with the same numbers as its row in the downloads panel: a
+// plan-wide total beside that row read as the two disagreeing (#14061).
export function HubPlanProgress({ plan }: { plan: Plan }) {
const entry = plan.remaining[0];
const job = useDownloadManagerStore((s) =>
@@ -19,23 +36,10 @@ export function HubPlanProgress({ plan }: { plan: Plan }) {
entry.files.every((f) => j.scopedFiles?.includes(f)),
),
);
- const total = plan.entries.reduce((n, e) => n + Math.max(0, e.bytes), 0);
- const remaining = plan.remaining.reduce(
- (n, e) => n + Math.max(0, e.bytes),
- 0,
- );
- const downloaded =
- total - remaining + Math.min(entry?.bytes ?? 0, job?.downloadedBytes ?? 0);
return (
<div className="px-3">
<div className="mb-2 flex justify-between text-ui-11 text-muted-foreground">
- <span>
- {job
- ? entry.checkpoint !== false
- ? "Downloading model file"
- : "Downloading required files"
- : "Queued"}
- </span>
+ <span>{hubPlanStepLabel(plan, Boolean(job))}</span>
{job && (
<button
type="button"
@@ -47,13 +51,15 @@ export function HubPlanProgress({ plan }: { plan: Plan }) {
)}
</div>
<DownloadProgressBar
- progress={{
- expectedBytes: total,
- downloadedBytes: downloaded,
- fraction: total > 0 ? downloaded / total : 0,
- }}
+ progress={
+ job
+ ? presentedProgress(job)
+ : { expectedBytes: Math.max(0, entry?.bytes ?? 0), downloadedBytes: 0, fraction: 0 }
+ }
bytesPerSec={job?.bytesPerSec ?? 0}
cancelling={job?.state === "cancelling"}
+ etaSeconds={job?.etaSeconds}
+ activity={job?.activity}
/>
</div>
);
diff --git a/studio/frontend/tests/hub-plan-progress.test.ts b/studio/frontend/tests/hub-plan-progress.test.ts
new file mode 100644
index 00000000000..4e045d49e1f
--- /dev/null
+++ b/studio/frontend/tests/hub-plan-progress.test.ts
@@ -0,0 +1,41 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import assert from "node:assert/strict";
+import test from "node:test";
+
+import { readSrc } from "./helpers/kit.ts";
+import { loadWithStubs } from "./helpers/module-stubs.ts";
+
+const { assetLabel } = await import("../src/features/hub/download-manager/required-assets.ts");
+const { hubPlanStepLabel } = loadWithStubs<{
+ hubPlanStepLabel: (plan: unknown, running: boolean) => string;
+}>(new URL("../src/features/hub/download-manager/hub-plan-progress.tsx", import.meta.url), {
+ "react/jsx-runtime": {},
+ "./download-manager-controller": {},
+ "./download-presentation": {},
+ "./download-progress-bar": {},
+ "./required-assets": { assetLabel },
+});
+
+const model = { repoId: "unsloth/Z-Image-Turbo-GGUF", files: ["z-image-turbo-Q8_0.gguf"], bytes: 7, checkpoint: true };
+const companions = {
+ repoId: "unsloth/Z-Image-Turbo",
+ files: ["text_encoder/model.safetensors", "vae/diffusion_pytorch_model.safetensors"],
+ bytes: 8,
+ checkpoint: false,
+};
+
+test("the card names the running step and where it is in the plan", () => {
+ const plan = { id: 1, entries: [model, companions], remaining: [model, companions] };
+ assert.equal(hubPlanStepLabel(plan, true), "Model file · 1 of 2");
+ assert.equal(hubPlanStepLabel({ ...plan, remaining: [companions] }, true), "Encoder & decoder · 2 of 2");
+ assert.equal(hubPlanStepLabel({ ...plan, entries: [companions], remaining: [companions] }, true), "Encoder & decoder");
+ assert.equal(hubPlanStepLabel(plan, false), "Queued");
+});
+
+test("the card's bar is the running job's, as its downloads panel row shows it (#14061)", () => {
+ const source = readSrc("features/hub/download-manager/hub-plan-progress.tsx");
+ assert.match(source, /presentedProgress\(job\)/);
+ assert.doesNotMatch(source, /plan\.entries\.reduce/, "a plan-wide total is back on the card");
+});