Skip to content

AI media harness for planning, generating, and editing locally

TypeScript

Show background weight download progress

Bittid8a00e0122a5
diff --git a/docs/generator-weights.md b/docs/generator-weights.md
index 8c23a59..156eba1 100644
--- a/docs/generator-weights.md
+++ b/docs/generator-weights.md
@@ -14,7 +14,12 @@ Memory tiers account for the small amount of VRAM reserved by the driver.
Click the template's download icon or **Download weights** in its editor to
download missing weights. Files go into `weights` beside `Slopus.exe`. If that
location cannot be written, Slopus uses a `weights` subfolder beside its log file.
-Progress and cancellation remain available in Settings if the editor is closed.
+Downloads continue in the background when Settings is closed. Reopening Settings
+shows the current progress as a color fill across the generator's template row.
+The fill tracks completed files plus progress through the current file.
+Downloads also appear in Work Queue with progress and cancellation controls.
+They run separately from the generation queue and do not occupy a generation slot.
+Progress details and cancellation remain available in Settings if the editor is closed.
Failed transfers can be retried; completed files are retained, while an interrupted
file starts again. No full model file is buffered in memory.
diff --git a/src/App.tsx b/src/App.tsx
index 4d964f1..a2f33e3 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -3,6 +3,7 @@ import { WorkQueuePanel } from "./components/WorkQueuePanel";
import { ReferenceIconGenerationDialog } from "./components/ReferenceIconGenerationDialog";
import { CudaSetupDialog } from "./components/CudaSetupDialog";
import { missingCudaDownload } from "./lib/cudaSupport";
+import { getWeightDownloadState, subscribeWeightDownloads } from "./lib/weightDownloads";
import { invoke } from "@tauri-apps/api/core";
import { listen } from "@tauri-apps/api/event";
import { FolderOpen, Grid2X2, List, ListTodo, Plus, Search, Settings } from "lucide-react";
@@ -41,6 +42,7 @@ function App() {
return saved;
}));
const workItems = useSyncExternalStore(workQueue.subscribe, workQueue.getSnapshot);
+ const weightDownloadActive = useSyncExternalStore(subscribeWeightDownloads, () => getWeightDownloadState()?.active ?? false);
const iconConfirmationCount = useSyncExternalStore(workQueue.subscribe, workQueue.getIconConfirmationCount);
const [workQueueOpen, setWorkQueueOpen] = useState(false);
useEffect(() => workQueue.start(), [workQueue]);
@@ -244,7 +246,7 @@ function App() {
);
const queueLauncher = <button className="settings-launcher work-queue-launcher" type="button" onClick={() => setWorkQueueOpen(true)} title="Work Queue" aria-label="Work Queue" aria-haspopup="dialog" aria-expanded={workQueueOpen}>
- <ListTodo size={22} aria-hidden="true" />{ongoingGenerations.length > 0 && <b>{ongoingGenerations.length}</b>}
+ <ListTodo size={22} aria-hidden="true" />{ongoingGenerations.length + Number(weightDownloadActive) > 0 && <b>{ongoingGenerations.length + Number(weightDownloadActive)}</b>}
</button>;
const queuePanel = workQueueOpen ? <WorkQueuePanel queue={workQueue} items={workItems} onClose={() => setWorkQueueOpen(false)} /> : null;
const cudaNotice = cudaDownload && !settingsOpen && !workQueueOpen && !closeRequested && !projectToDelete && !newProjectOpen
diff --git a/src/components/SettingsView.downloads.test.tsx b/src/components/SettingsView.downloads.test.tsx
index 3bae8e2..31b371a 100644
--- a/src/components/SettingsView.downloads.test.tsx
+++ b/src/components/SettingsView.downloads.test.tsx
@@ -1,10 +1,14 @@
// @vitest-environment jsdom
import "@testing-library/jest-dom/vitest";
-import { cleanup, fireEvent, render, screen, waitFor, within } from "@testing-library/react";
+import { act, cleanup, fireEvent, render, screen, waitFor, within } from "@testing-library/react";
import { invoke } from "@tauri-apps/api/core";
+import { listen } from "@tauri-apps/api/event";
import { afterEach, beforeEach, expect, it, vi } from "vitest";
import { SettingsView } from "./SettingsView";
import { loadGeneratorTemplateSettings } from "../lib/settings";
+import { getWeightDownloadState } from "../lib/weightDownloads";
+import { WorkQueuePanel } from "./WorkQueuePanel";
+import { WorkQueue } from "../lib/workQueue";
vi.mock("@tauri-apps/api/core", () => ({ invoke: vi.fn() }));
vi.mock("@tauri-apps/api/event", () => ({ listen: vi.fn(async () => () => undefined) }));
@@ -26,6 +30,50 @@ beforeEach(() => {
});
afterEach(() => { cleanup(); delete (window as Window & { __TAURI_INTERNALS__?: unknown }).__TAURI_INTERNALS__; });
+it("keeps downloading with Settings closed and restores progress in the template row and Work Queue", async () => {
+ let progress: (event: { payload: { requestId: string; downloaded: number; total: number | null } }) => void = () => undefined;
+ vi.mocked(listen).mockImplementation((async (_name, callback) => { progress = callback as typeof progress; return () => undefined; }) as typeof listen);
+ const original = vi.mocked(invoke).getMockImplementation()!;
+ const pending: { requestId: string; finish: () => void }[] = [];
+ vi.mocked(invoke).mockImplementation(async (command, args) => {
+ if (command !== "download_weight") return original(command, args);
+ const request = args as { requestId: string; url: string };
+ return new Promise<string>((resolve) => pending.push({ requestId: request.requestId, finish: () => {
+ const path = `C:/Slopus/weights/${request.url.split('/').at(-1)}`;
+ files.add(path); resolve(path);
+ } }));
+ });
+ const settings = render(<SettingsView onClose={() => settings.unmount()} />);
+ fireEvent.click(screen.getByRole("button", { name: "Download generator Minimax H3 Original" }));
+ await waitFor(() => expect(pending).toHaveLength(1));
+ act(() => progress({ payload: { requestId: pending[0].requestId, downloaded: 50, total: 100 } }));
+ const fill = screen.getByRole("progressbar", { name: "Downloading Minimax H3 Original weights" });
+ expect(fill.closest(".generator-template-item")).not.toBeNull();
+ expect(fill).toHaveStyle({ width: "12.5%" });
+ fireEvent.click(screen.getByRole("button", { name: "Close settings" }));
+ await act(async () => pending[0].finish());
+ await waitFor(() => expect(pending).toHaveLength(2));
+ act(() => progress({ payload: { requestId: pending[1].requestId, downloaded: 50, total: 100 } }));
+ const queue = new WorkQueue(async (record) => record);
+ const panel = render(<WorkQueuePanel queue={queue} items={[]} onClose={() => panel.unmount()} />);
+ expect(screen.getByRole("region", { name: "Weight downloads" })).toHaveTextContent("Minimax H3 Original");
+ expect(screen.getByRole("progressbar", { name: "Minimax H3 Original download progress" })).toHaveAttribute("value", "37.5");
+ expect(screen.queryByText("No work yet")).toBeNull();
+ fireEvent.click(screen.getByRole("button", { name: "Close work queue" }));
+ const reopened = render(<SettingsView onClose={() => reopened.unmount()} />);
+ expect(screen.getByRole("progressbar", { name: "Downloading Minimax H3 Original weights" })).toHaveStyle({ width: "37.5%" });
+ reopened.unmount();
+ for (let index = 1; index < 4; index++) {
+ await waitFor(() => expect(pending.length).toBe(index + 1));
+ await act(async () => pending[index].finish());
+ }
+ await waitFor(() => expect(getWeightDownloadState()?.active).toBe(false));
+ expect(getWeightDownloadState()).toMatchObject({ completed: 4, error: null });
+ expect(vi.mocked(invoke).mock.calls.some(([command]) => command === "cancel_weight_download")).toBe(false);
+ render(<WorkQueuePanel queue={queue} items={[]} onClose={() => undefined} />);
+ expect(screen.getByRole("region", { name: "Weight downloads" })).toHaveTextContent("Download complete");
+});
+
it("downloads the sample, enables its default choice, and removes only weights to restore the download action", async () => {
render(<SettingsView onClose={() => undefined} />);
const radio = () => screen.getByRole("radio", { name: "Use Minimax H3 Original as the default generator" });
diff --git a/src/components/SettingsView.tsx b/src/components/SettingsView.tsx
index c183671..8f4fb5b 100644
--- a/src/components/SettingsView.tsx
+++ b/src/components/SettingsView.tsx
@@ -3,7 +3,7 @@ import { useCallback, useEffect, useRef, useState, useSyncExternalStore, type Re
import { revealDiagnosticLog } from "../lib/diagnostics";
import { isTauri } from "../lib/persistence";
import { WeightSourcesEditor } from "./WeightSourcesEditor";
-import { cancelWeightDownload, downloadTemplateWeights, getWeightDownloadState, refreshDownloadedWeights, removeTemplateWeights, subscribeWeightDownloads, updateWeightPath } from "../lib/weightDownloads";
+import { cancelWeightDownload, downloadTemplateWeights, getWeightDownloadState, refreshDownloadedWeights, removeTemplateWeights, subscribeWeightDownloads, updateWeightPath, weightDownloadProgress } from "../lib/weightDownloads";
import { chooseEnginePath, getAgentModels, getEngineStatus, type ModelStatus, type SlopfabStatus } from "../lib/runtime";
import {
EMPTY_ENGINE_SETTINGS, ENGINE_PATH_FIELDS,
@@ -259,6 +259,7 @@ export function SettingsView({ onClose, updates, initialTab = "engine" }: { onCl
const [tab, setTab] = useState<TabId>(initialTab);
const [templateSettings, setTemplateSettings] = useState<GeneratorTemplateSettings>(() => loadGeneratorTemplateSettings());
const downloadState = useSyncExternalStore(subscribeWeightDownloads, getWeightDownloadState);
+ const downloadPercent = downloadState ? weightDownloadProgress(downloadState) : 0;
const [editingTemplateId, setEditingTemplateId] = useState<string | null>(null);
const [status, setStatus] = useState<SlopfabStatus | null>(null);
const probeRevision = useRef(0);
@@ -490,11 +491,21 @@ export function SettingsView({ onClose, updates, initialTab = "engine" }: { onCl
<div className="generator-template-list" role="list" aria-label="Generators">
{templateSettings.templates.map((template) => (
<div className={`generator-template-item${template.id === templateSettings.defaultTemplateId ? " generator-template-item--selected" : ""}`} role="listitem" key={template.id}>
+ {downloadState?.active && downloadState.templateId === template.id && <span
+ className="generator-template-item__progress"
+ role="progressbar"
+ aria-label={`Downloading ${template.name} weights`}
+ aria-valuemin={0}
+ aria-valuemax={100}
+ aria-valuenow={Math.floor(downloadPercent)}
+ aria-valuetext={`${downloadState.completed} of ${downloadState.files} files complete${downloadState.total ? `; current file ${Math.floor(100 * downloadState.downloaded / downloadState.total)}%` : "; downloading"}`}
+ style={{ width: `${downloadPercent}%` }}
+ />}
<label className="generator-template-item__default" title="Use this generator for generation by default">
<input type="radio" name="default-generator-template" checked={template.id === templateSettings.defaultTemplateId && !templateNeedsDownload(template)} disabled={templateNeedsDownload(template)} onChange={() => makeDefault(template.id)} aria-label={`Use ${template.name} as the default generator`} />
</label>
<button type="button" className="generator-template-item__open" onClick={() => setEditingTemplateId(template.id)} aria-label={`Edit ${template.name} generator`}>
- <b>{template.name}</b><small>{template.defaultSteps} steps</small>
+ <b>{template.name}</b><small>{downloadState?.active && downloadState.templateId === template.id ? `Downloading · ${Math.floor(downloadPercent)}%` : `${template.defaultSteps} steps`}</small>
</button>
{templateNeedsDownload(template)
? <button type="button" className="icon-button" disabled={!desktop || downloadState?.active} onClick={() => void downloadTemplateWeights(template.id)} aria-label={`Download generator ${template.name}`} title={`Download ${template.name} weights`}>
@@ -578,7 +589,7 @@ export function SettingsView({ onClose, updates, initialTab = "engine" }: { onCl
{tab === "engine" && downloadState && <div className="weight-download-status" role="status">
<span>{templateSettings.templates.find((template) => template.id === downloadState.templateId)?.name}: {downloadState.error ?? (downloadState.active ? `${downloadState.completed}/${downloadState.files} files · ${(downloadState.downloaded / 1024 ** 3).toFixed(2)} GB${downloadState.total ? ` / ${(downloadState.total / 1024 ** 3).toFixed(2)} GB` : ""}` : "Download complete")}</span>
- {downloadState.active && <><progress aria-label="Weight download progress" value={downloadState.total ? downloadState.downloaded : undefined} max={downloadState.total ?? 1} /><button type="button" className="secondary-button" onClick={() => void cancelWeightDownload().catch((reason) => setError(String(reason)))}>Cancel download</button></>}
+ {downloadState.active && <button type="button" className="secondary-button" onClick={() => void cancelWeightDownload().catch((reason) => setError(String(reason)))}>Cancel download</button>}
</div>}
{tab === "engine" && editingTemplateId && <footer className="settings-view__foot">
{/* Clearing the paths is an engine action, so it is only offered
diff --git a/src/components/WorkQueuePanel.tsx b/src/components/WorkQueuePanel.tsx
index 2d97214..3d4f82e 100644
--- a/src/components/WorkQueuePanel.tsx
+++ b/src/components/WorkQueuePanel.tsx
@@ -1,10 +1,16 @@
-import { Check, Clock3, ListTodo, LoaderCircle, TriangleAlert, X } from "lucide-react";
-import { useEffect, useRef } from "react";
+import { Check, Clock3, Download, ListTodo, LoaderCircle, TriangleAlert, X } from "lucide-react";
+import { useEffect, useRef, useState, useSyncExternalStore } from "react";
import { createPortal } from "react-dom";
import { GENERATION_FRAME_RATE } from "../lib/project";
import { isWorkActive, type WorkItem, type WorkQueue } from "../lib/workQueue";
+import { loadGeneratorTemplateSettings } from "../lib/settings";
+import { cancelWeightDownload, downloadTemplateWeights, getWeightDownloadState, subscribeWeightDownloads, weightDownloadProgress } from "../lib/weightDownloads";
export function WorkQueuePanel({ queue, items, onClose }: { queue: WorkQueue; items: readonly WorkItem[]; onClose: () => void }) {
+ // Downloads are observed here, never enqueued in the GPU generation scheduler.
+ const download = useSyncExternalStore(subscribeWeightDownloads, getWeightDownloadState);
+ const [downloadError, setDownloadError] = useState<string | null>(null);
+ const downloadName = download ? loadGeneratorTemplateSettings().templates.find((template) => template.id === download.templateId)?.name ?? "Generator weights" : "";
const panel = useRef<HTMLElement>(null);
const close = useRef<HTMLButtonElement>(null);
useEffect(() => {
@@ -49,8 +55,27 @@ export function WorkQueuePanel({ queue, items, onClose }: { queue: WorkQueue; it
<header className="work-queue__header"><div><ListTodo size={20} /><h2 id="work-queue-title">Work Queue</h2></div><button ref={close} type="button" className="icon-button icon-button--strong" aria-label="Close work queue" onClick={onClose}><X size={18} /></button></header>
<p className="work-queue__intro">Work continues across projects, using the settings from when it was added.</p>
<div className="work-queue__list">
- {items.length === 0 && <div className="work-queue__empty"><ListTodo size={28} /><strong>No work yet</strong><p>Generate a scene to add it to the queue.</p></div>}
+ {items.length === 0 && !download && <div className="work-queue__empty"><ListTodo size={28} /><strong>No work yet</strong><p>Generate a scene to add it to the queue.</p></div>}
{current.length > 0 && <section aria-label="In progress"><h3>In progress</h3><ul>{current.map(row)}</ul></section>}
+ {download && <section aria-label="Weight downloads"><h3>Downloads</h3><ul><li className="work-queue__item">
+ <div className="work-queue__item-heading">
+ <span className={`work-queue__state work-queue__state--${download.active ? "preparing" : download.error ? "failed" : "completed"}`} aria-hidden="true">
+ {download.active ? <Download size={17} /> : download.error ? <TriangleAlert size={17} /> : <Check size={17} />}
+ </span>
+ <div><strong>{downloadName}</strong><span>Weight download</span></div>
+ {download.active && <button type="button" className="icon-button" aria-label={`Cancel ${downloadName} download`} onClick={() => {
+ setDownloadError(null);
+ void cancelWeightDownload().catch((reason) => setDownloadError(String(reason)));
+ }}><X size={16} /></button>}
+ </div>
+ <div className="work-queue__detail"><span>{download.active ? `${download.completed}/${download.files} files · ${(download.downloaded / 1024 ** 3).toFixed(2)} GB${download.total ? ` / ${(download.total / 1024 ** 3).toFixed(2)} GB` : ""}` : download.error ?? "Download complete"}</span>
+ {download.active && <b>{Math.floor(weightDownloadProgress(download))}%</b>}
+ </div>
+ {download.active && <progress max={100} value={weightDownloadProgress(download)} aria-label={`${downloadName} download progress`} />}
+ {download.active && <p className="work-queue__settings">Generations can continue during this download.</p>}
+ {download.error && <button type="button" className="secondary-button" onClick={() => { setDownloadError(null); void downloadTemplateWeights(download.templateId); }}>Retry download</button>}
+ {downloadError && <p className="work-queue__error" role="alert">{downloadError}</p>}
+ </li></ul></section>}
{upcoming.length > 0 && <section aria-label="Upcoming work"><h3>Up next <span>{upcoming.length}</span></h3><ul>{upcoming.map(row)}</ul></section>}
{finished.length > 0 && <section aria-label="Finished work"><h3>Finished <button type="button" onClick={() => queue.clearFinished()}>Clear</button></h3><ul>{finished.map(row)}</ul></section>}
</div>
diff --git a/src/lib/weightDownloads.test.ts b/src/lib/weightDownloads.test.ts
index c827cb8..40078b2 100644
--- a/src/lib/weightDownloads.test.ts
+++ b/src/lib/weightDownloads.test.ts
@@ -1,7 +1,7 @@
// @vitest-environment jsdom
import { invoke } from "@tauri-apps/api/core";
import { beforeEach, expect, it, vi } from "vitest";
-import { chooseWeightSource, downloadTemplateWeights, getWeightDownloadState, refreshDownloadedWeights, removeTemplateWeights, updateWeightPath } from "./weightDownloads";
+import { chooseWeightSource, downloadTemplateWeights, getWeightDownloadState, refreshDownloadedWeights, removeTemplateWeights, updateWeightPath, weightDownloadProgress, type DownloadState } from "./weightDownloads";
import { createGeneratorTemplate, defaultGeneratorTemplate, isDownloadUrl, loadGeneratorTemplateSettings, minimaxOriginalTemplate, saveGeneratorTemplateSettings, templateNeedsDownload, type WeightSource } from "./settings";
vi.mock("@tauri-apps/api/core", () => ({ invoke: vi.fn() }));
@@ -11,6 +11,17 @@ const files = new Set<string>();
const source = (url: string, gpuModel = "", minVramGb = 0): WeightSource => ({ url, gpuModel, minVramGb });
const saved = () => loadGeneratorTemplateSettings().templates.find((template) => template.id === "minimax-h3-original")!;
+it("keeps overall progress continuous across files and below 100 until completion", () => {
+ const download: DownloadState = { templateId: "sample", field: "transformer", downloaded: 100, total: 100, completed: 0, files: 4, active: true, error: null };
+ expect(weightDownloadProgress(download)).toBe(25);
+ expect(weightDownloadProgress({ ...download, completed: 1, field: null, downloaded: 0, total: null })).toBe(25);
+ expect(weightDownloadProgress({ ...download, completed: 1, downloaded: 50 })).toBe(37.5);
+ expect(weightDownloadProgress({ ...download, completed: 1, total: null })).toBe(25);
+ expect(weightDownloadProgress({ ...download, files: 0 })).toBe(0);
+ expect(weightDownloadProgress({ ...download, completed: 3 })).toBe(99);
+ expect(weightDownloadProgress({ ...download, completed: 4, field: null, active: false })).toBe(100);
+});
+
beforeEach(() => {
localStorage.clear(); files.clear(); vi.clearAllMocks();
vi.mocked(invoke).mockImplementation(async (command, args) => {
diff --git a/src/lib/weightDownloads.ts b/src/lib/weightDownloads.ts
index 2ab6905..2283eb7 100644
--- a/src/lib/weightDownloads.ts
+++ b/src/lib/weightDownloads.ts
@@ -18,11 +18,20 @@ export interface DownloadState {
let state: DownloadState | null = null;
let requestId: string | null = null;
let cancelled = false;
+// The download and native event subscription belong to this module. Settings
+// only observes progress; unmounting its UI must not stop the transfer or queue.
const subscribers = new Set<() => void>();
export const getWeightDownloadState = () => state;
export const subscribeWeightDownloads = (listener: () => void) => { subscribers.add(listener); return () => { subscribers.delete(listener); }; };
const publish = (next: DownloadState | null) => { state = next; subscribers.forEach((listener) => listener()); };
+export function weightDownloadProgress(download: DownloadState): number {
+ if (!download.files) return 0;
+ const current = download.field && download.total && download.total > 0
+ ? Math.min(1, Math.max(0, download.downloaded / download.total)) : 0;
+ return Math.min(download.active ? 99 : 100, 100 * (download.completed + current) / download.files);
+}
+
export function chooseWeightSource(sources: WeightSource[], devices: WeightGpu[]): WeightSource | null {
// Prefer an explicit GPU match, then the highest memory tier that fits.
// Equal-ranked alternatives keep the author's order. Unknown hardware only
@@ -120,7 +129,7 @@ export async function downloadTemplateWeights(templateId: string): Promise<void>
};
});
saveGeneratorTemplateSettings({ ...current, templates });
- publish({ ...state!, completed: state!.completed + 1 });
+ publish({ ...state!, completed: state!.completed + 1, field: null, downloaded: 0, total: null });
}
publish({ ...state!, active: false });
} catch (reason) {
diff --git a/src/lib/workQueue.test.ts b/src/lib/workQueue.test.ts
index 75d49ec..c61cf34 100644
--- a/src/lib/workQueue.test.ts
+++ b/src/lib/workQueue.test.ts
@@ -1,6 +1,7 @@
// @vitest-environment jsdom
import { waitFor } from "@testing-library/react";
import { listen } from "@tauri-apps/api/event";
+import { invoke } from "@tauri-apps/api/core";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { releaseRendered, saveGeneratedScene } from "./generatedVideo";
import { createProjectConfig, parseProjectConfig, type ProjectRecord } from "./project";
@@ -8,6 +9,7 @@ import { ProjectSession } from "./projectSession";
import { cancelSlopfabGeneration, enqueueSlopfabGeneration, resolveSlopfabPlan } from "./runtime";
import { saveEngineSettings, EMPTY_ENGINE_SETTINGS } from "./settings";
import { WorkQueue, type GenerationSubmission } from "./workQueue";
+import { downloadTemplateWeights, getWeightDownloadState } from "./weightDownloads";
vi.mock("@tauri-apps/api/core", () => ({ invoke: vi.fn() }));
vi.mock("@tauri-apps/api/event", () => ({ listen: vi.fn() }));
@@ -47,6 +49,30 @@ const finish = async (queue: WorkQueue, id: string) => {
};
describe("application work queue", () => {
+ it("starts and advances generations while a weight download remains in progress", async () => {
+ let finishDownload: () => void = () => undefined;
+ vi.mocked(invoke).mockImplementation(async (command) => {
+ if (command === "weight_download_hardware") return [];
+ if (command === "download_weight") return new Promise<string>((resolve) => { finishDownload = () => resolve("C:/weights/model"); });
+ });
+ const downloading = downloadTemplateWeights("minimax-h3-original");
+ try {
+ await waitFor(() => expect(invoke).toHaveBeenCalledWith("download_weight", expect.anything()));
+ const { queue, first, second } = setup();
+ queue.enqueue(first, [submission(first)]);
+ queue.enqueue(second, [submission(second)]);
+ await waitFor(() => expect(enqueueSlopfabGeneration).toHaveBeenCalledTimes(1));
+ expect(getWeightDownloadState()?.active).toBe(true);
+ expect(queue.getSnapshot()).toHaveLength(2);
+ await finish(queue, queue.getSnapshot()[0].id);
+ await waitFor(() => expect(enqueueSlopfabGeneration).toHaveBeenCalledTimes(2));
+ expect(getWeightDownloadState()?.active).toBe(true);
+ } finally {
+ vi.mocked(invoke).mockResolvedValue("C:/weights/model");
+ finishDownload();
+ await downloading;
+ }
+ });
it("blocks app updates for unsaved sessions and allows them after a successful save", async () => {
const { queue, first } = setup();
expect(queue.updateBlockReason()).toBeNull();
diff --git a/src/styles/shell.css b/src/styles/shell.css
index b0bc8e7..f12f271 100644
--- a/src/styles/shell.css
+++ b/src/styles/shell.css
@@ -256,6 +256,9 @@
}
.generator-template-item {
+ position: relative;
+ isolation: isolate;
+ overflow: hidden;
display: grid;
grid-template-columns: var(--control-sm) minmax(0, 1fr) var(--control-sm);
align-items: center;
@@ -266,6 +269,20 @@
background: var(--field-bg);
}
+.generator-template-item__progress {
+ position: absolute;
+ inset: 0 auto 0 0;
+ z-index: -1;
+ background: var(--accent-bright);
+ opacity: 0.22;
+ pointer-events: none;
+ transition: width 0.2s linear;
+}
+
+@media (prefers-reduced-motion: reduce) {
+ .generator-template-item__progress { transition: none; }
+}
+
.generator-template-item--selected {
border-color: var(--accent-line-strong);
background: var(--accent-soft);
@@ -740,7 +757,6 @@
.weight-source-add input { flex: 1; }
.weight-download-status { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-3) 0; color: var(--text-secondary); font-size: var(--text-sm); }
.weight-download-status span { flex: 1 1 100%; }
-.weight-download-status progress { flex: 1; accent-color: var(--accent-bright); }
.settings-path__row .secondary-button {
flex: 0 0 auto;