AI media harness for planning, generating, and editing locally
TypeScript
Show selected compute platform
Bitti4d28a7e55202
diff --git a/docs/architecture.md b/docs/architecture.mdindex fb8f692..6127f79 100644--- a/docs/architecture.md+++ b/docs/architecture.md@@ -45,6 +45,7 @@ Shots are sequential, later shots carry increasing cut timestamps, camera movesThe vidfab C API is loaded dynamically by the Rust backend. It resolves requests immediately, runs asynchronously, permits only one active generation per process, reports progress from a worker thread, and returns raw planar RGB frames plus interleaved audio. PolStudio therefore owns:+- compute-platform selection: CUDA 13 when usable, then CUDA 12, then Vulkan with exact attention;- a serial generation queue and cancellation;- thread-safe progress marshaling into Tauri events;- safe lifetime management for request and generation handles;diff --git a/src/components/SettingsView.test.tsx b/src/components/SettingsView.test.tsxindex f8448ad..a7ee848 100644--- a/src/components/SettingsView.test.tsx+++ b/src/components/SettingsView.test.tsx@@ -1,14 +1,22 @@// @vitest-environment jsdomimport { cleanup, fireEvent, render, screen, waitFor, within } from "@testing-library/react";+import { invoke } from "@tauri-apps/api/core";import { readFileSync } from "node:fs";import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";import { SettingsView } from "./SettingsView";vi.mock("@tauri-apps/api/core", () => ({ invoke: vi.fn() }));-beforeEach(() => localStorage.clear());-afterEach(cleanup);+beforeEach(() => {+ localStorage.clear();+ vi.clearAllMocks();+ delete (window as Window & { __TAURI_INTERNALS__?: unknown }).__TAURI_INTERNALS__;+});+afterEach(() => {+ cleanup();+ delete (window as Window & { __TAURI_INTERNALS__?: unknown }).__TAURI_INTERNALS__;+});const open = () => render(<SettingsView onClose={() => undefined} />);const tab = (name: string) => screen.getByRole("tab", { name: new RegExp(`^${name}`) });@@ -37,6 +45,21 @@ describe("the settings screen", () => {await waitFor(() => expect(screen.getByRole("status").textContent).toContain("Browser preview"));});+ it("shows the compute platform selected by the desktop engine probe", async () => {+ Object.defineProperty(window, "__TAURI_INTERNALS__", { configurable: true, value: {} });+ vi.mocked(invoke).mockResolvedValue({+ state: "ready",+ dllPath: "C:\\PolStudio\\vidfab.dll",+ version: "1.4.0",+ platform: "CUDA 13",+ detail: "Ready.",+ models: [],+ });+ open();+ await waitFor(() => expect(screen.getByText("CUDA 13")).toBeTruthy());+ expect(screen.getByText("Platform")).toBeTruthy();+ });+it("swaps panels when a tab is chosen, and follows the arrow keys", () => {open();fireEvent.click(tab("Appearance"));diff --git a/src/components/SettingsView.tsx b/src/components/SettingsView.tsxindex be9fde6..61a1fc2 100644--- a/src/components/SettingsView.tsx+++ b/src/components/SettingsView.tsx@@ -307,6 +307,7 @@ export function SettingsView({ onClose }: { onClose: () => void }) {<div className={`settings-status settings-status--${status?.state ?? "checking"}`} role="status"><span><i />{engineHeadline(status, desktop)}</span><p>{engineDetail(status, desktop, missing.length)}</p>+ {status?.platform && <small className="settings-status__platform"><b>Platform</b>{status.platform}</small>}</div>{ENGINE_PATH_FIELDS.map((field) => {const value = settings[field.id];diff --git a/src/lib/runtime.ts b/src/lib/runtime.tsindex b4599ed..59ef77a 100644--- a/src/lib/runtime.ts+++ b/src/lib/runtime.ts@@ -25,6 +25,7 @@ export interface VidfabStatus {state: "ready" | "modelsMissing" | "runtimeMissing" | "incompatible" | "demo";dllPath: string;version: string | null;+ platform: string | null;detail: string;models: ModelStatus[];}@@ -84,7 +85,7 @@ const DEMO_STATUS: RuntimeStatus = {{ id: "claude", label: "Claude Code", state: "ready", executable: null, version: "Browser demo", detail: "Deterministic local demo provider." },{ id: "codex", label: "Codex", state: "ready", executable: null, version: "Browser demo", detail: "Deterministic local demo provider." },],- vidfab: { state: "demo", dllPath: "Browser demo", version: null, detail: "Deterministic plans only. No model runs or media files are created in the browser.", models: [] },+ vidfab: { state: "demo", dllPath: "Browser demo", version: null, platform: null, detail: "Deterministic plans only. No model runs or media files are created in the browser.", models: [] },};/* Every vidfab command is handed the project config with THIS machine's enginediff --git a/src/styles/shell.css b/src/styles/shell.cssindex 8574e33..4ba8d51 100644--- a/src/styles/shell.css+++ b/src/styles/shell.css@@ -395,6 +395,22 @@line-height: var(--leading-normal);}+.settings-status__platform {+ display: flex;+ align-items: baseline;+ gap: var(--space-2);+ margin-top: var(--space-3);+ color: var(--text-muted);+ font-size: var(--text-sm);+}++.settings-status__platform b {+ color: var(--text-primary);+ font-size: var(--text-xs);+ letter-spacing: 0.04em;+ text-transform: uppercase;+}+.settings-status--ready {border-color: var(--success-line);background: var(--success-soft);