Skip to content

AI media harness for planning, generating, and editing locally

TypeScript

Put the tabs in the topbar and give the engine paths a home

Bitti52f4e9ed2b72
diff --git a/README.md b/README.md
index 034ea86..323852f 100644
--- a/README.md
+++ b/README.md
@@ -29,13 +29,13 @@ Each project is a normal folder owned by the user:
```text
My project/
-├── polstudio.project.json
+├── pols.json
├── assets/
├── generated/
├── exports/
└── cache/
```
-`polstudio.project.json` is schema-versioned and contains the creative brief, render settings, asset metadata, and timeline structure. The Rust shell validates it before reads and writes; the web build uses validated local-storage records as a development fallback.
+`pols.json` is schema-versioned and contains the creative brief, render settings, asset metadata, and timeline structure. The Rust shell validates it before reads and writes; the web build uses validated local-storage records as a development fallback.
The web fallback seeds three deterministic showcase projects on first launch. Remove the `polstudio.web-projects.v1` local-storage entry to restore that initial demo library.
diff --git a/docs/architecture.md b/docs/architecture.md
index d88e5d1..b948c95 100644
--- a/docs/architecture.md
+++ b/docs/architecture.md
@@ -6,11 +6,11 @@ In a blind side-by-side evaluation, a first-time creator should pick PolStudio o
## Project boundary
-A project is a portable folder. Its source of truth is `polstudio.project.json`; every path stored in that file is relative to the project root. Generated and imported content lives below that root so moving or archiving the folder does not break it.
+A project is a portable folder. Its source of truth is `pols.json`; every path stored in that file is relative to the project root. Generated and imported content lives below that root so moving or archiving the folder does not break it.
```text
project-folder/
- polstudio.project.json
+ pols.json
media/imported/
media/generated/
references/
diff --git a/src-tauri/src/agent.rs b/src-tauri/src/agent.rs
index d3123f0..3abdb6d 100644
--- a/src-tauri/src/agent.rs
+++ b/src-tauri/src/agent.rs
@@ -1,6 +1,6 @@
use crate::{
read_project, validate_and_normalize_config, write_project, AgentMessage, ProjectConfig,
- ProjectRecord, ProviderSetting, PROJECT_FILE_NAME,
+ ProjectRecord, ProviderSetting, LEGACY_PROJECT_FILE_NAME, PROJECT_FILE_NAME,
};
use serde::{Deserialize, Serialize};
use serde_json::Value;
@@ -274,7 +274,10 @@ fn confined_project_root(folder: &Path) -> Result<PathBuf, String> {
let canonical = folder
.canonicalize()
.map_err(|error| format!("Could not resolve project root: {error}"))?;
- if !canonical.is_dir() || !canonical.join(PROJECT_FILE_NAME).is_file() {
+ if !canonical.is_dir()
+ || !(canonical.join(PROJECT_FILE_NAME).is_file()
+ || canonical.join(LEGACY_PROJECT_FILE_NAME).is_file())
+ {
return Err("Agent turns require a valid PolStudio project root.".into());
}
Ok(canonical)
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs
index accd861..0bc54b7 100644
--- a/src-tauri/src/lib.rs
+++ b/src-tauri/src/lib.rs
@@ -11,7 +11,10 @@ use tauri_plugin_dialog::DialogExt;
mod agent;
mod vidfab;
-const PROJECT_FILE_NAME: &str = "polstudio.project.json";
+const PROJECT_FILE_NAME: &str = "pols.json";
+/// What the file was called before. Folders written by earlier builds still
+/// open; the next save writes `pols.json` and leaves the old file alone.
+const LEGACY_PROJECT_FILE_NAME: &str = "polstudio.project.json";
const PROJECT_DIRECTORIES: [&str; 6] = [
"media/imported",
"media/generated",
@@ -696,6 +699,12 @@ fn read_project(folder: &Path) -> Result<ProjectRecord, String> {
.canonicalize()
.map_err(|error| format!("Could not resolve project folder: {error}"))?;
let config_path = canonical_folder.join(PROJECT_FILE_NAME);
+ let legacy_path = canonical_folder.join(LEGACY_PROJECT_FILE_NAME);
+ let config_path = if !config_path.is_file() && legacy_path.is_file() {
+ legacy_path
+ } else {
+ config_path
+ };
let json = fs::read_to_string(&config_path)
.map_err(|error| format!("Could not read {}: {error}", config_path.to_string_lossy()))?;
let config: ProjectConfig = serde_json::from_str(&json)
@@ -1054,6 +1063,43 @@ struct RuntimeStatus {
vidfab: vidfab::VidfabStatus,
}
+/// Probes the video engine from provider settings alone. The settings screen
+/// has no project in hand — engine paths belong to the machine, not to a
+/// project file — so it cannot go through `runtime_status`.
+#[tauri::command]
+fn vidfab_status(settings: BTreeMap<String, ProviderSetting>) -> vidfab::VidfabStatus {
+ vidfab::status(&settings)
+}
+
+/// One OS picker for one engine path. `directory` picks a folder (the
+/// tokenizer is one); `extensions` filters the file picker and an empty list
+/// means any file.
+#[tauri::command]
+fn choose_engine_path(
+ app: AppHandle,
+ title: String,
+ directory: bool,
+ extensions: Vec<String>,
+) -> Result<Option<String>, String> {
+ let mut dialog = app.dialog().file().set_title(title);
+ if !directory && !extensions.is_empty() {
+ let filters = extensions.iter().map(String::as_str).collect::<Vec<_>>();
+ dialog = dialog.add_filter("Supported files", &filters);
+ }
+ let selected = if directory {
+ dialog.blocking_pick_folder()
+ } else {
+ dialog.blocking_pick_file()
+ };
+ let Some(selected) = selected else {
+ return Ok(None);
+ };
+ let path = selected
+ .into_path()
+ .map_err(|error| format!("Could not access the selected path: {error}"))?;
+ Ok(Some(path.to_string_lossy().into_owned()))
+}
+
#[tauri::command]
fn runtime_status(config: ProjectConfig) -> Result<RuntimeStatus, String> {
let config = validate_and_normalize_config(config)?;
@@ -1121,6 +1167,8 @@ pub fn run() {
create_project,
save_project,
runtime_status,
+ vidfab_status,
+ choose_engine_path,
run_agent_turn,
cancel_agent_turn,
resolve_vidfab_plan,
diff --git a/src/App.tsx b/src/App.tsx
index 67352e4..eeb2415 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -1,15 +1,15 @@
-import { BookImage, FolderOpen, Grid2X2, List, Search, Sparkles } from "lucide-react";
+import { FolderOpen, Grid2X2, List, Search, Settings } from "lucide-react";
import { useEffect, useMemo, useRef, useState } from "react";
-import { EmptyPlaceholder } from "./components/EmptyPlaceholder";
+import { Brand } from "./components/Brand";
import { ProjectCard } from "./components/ProjectCard";
import { ProjectWorkspace, type ProjectView } from "./components/ProjectWorkspace";
import { PromptComposer } from "./components/PromptComposer";
-import { Sidebar, type WorkspaceView } from "./components/Sidebar";
+import { SettingsView } from "./components/SettingsView";
import { chooseAndOpenProject, createProject, listRecentProjects, saveProject } from "./lib/persistence";
import type { CreateProjectInput, ProjectRecord } from "./lib/project";
interface LibraryError {
- /** What failed, in the user's terms. */
+ /** What failed, in the user’s terms. */
title: string;
/** The underlying message, kept verbatim so it stays diagnosable. */
detail: string;
@@ -17,15 +17,7 @@ interface LibraryError {
const describe = (reason: unknown) => (reason instanceof Error ? reason.message : String(reason));
-function greeting(): string {
- const hour = new Date().getHours();
- if (hour < 12) return "Good morning.";
- if (hour < 18) return "Good afternoon.";
- return "Good evening.";
-}
-
function App() {
- const [view, setView] = useState<WorkspaceView>("library");
const [projects, setProjects] = useState<ProjectRecord[]>([]);
const [activeProject, setActiveProject] = useState<ProjectRecord | null>(null);
const [activeProjectInitialView, setActiveProjectInitialView] = useState<ProjectView>("timeline");
@@ -34,6 +26,15 @@ function App() {
const [query, setQuery] = useState("");
const [projectLayout, setProjectLayout] = useState<"grid" | "list">("grid");
const [error, setError] = useState<LibraryError | null>(null);
+ /* Settings is an overlay rather than a view of its own so opening it from
+ inside a project cannot unmount the editor and throw away unsaved edits.
+ Closing it bumps `settingsRevision`, which is what tells an open project to
+ look for the video engine again — the whole point of the screen is fixing
+ the engine paths, and the Generator would otherwise go on reporting the
+ missing weights the user just pointed it at until they reopened it. */
+ const [settingsOpen, setSettingsOpen] = useState(false);
+ const [settingsRevision, setSettingsRevision] = useState(0);
+ const closeSettings = () => { setSettingsOpen(false); setSettingsRevision((value) => value + 1); };
const searchInput = useRef<HTMLInputElement>(null);
useEffect(() => {
@@ -101,87 +102,74 @@ function App() {
}
};
- const navigate = (nextView: WorkspaceView) => {
- // Generating and references only exist inside a project. Rather than
- // dead-ending on a placeholder, open the most recent project on that tab.
- // With no projects yet, the placeholder is the honest answer.
- const projectTab = nextView === "generate" ? "generator" : nextView === "references" ? "references" : null;
- if (projectTab && projects.length > 0) {
- setActiveProjectInitialView(projectTab);
- setActiveProject(projects[0]);
- setView("library");
- return;
- }
- setActiveProject(null);
- setView(nextView);
- };
+ /* Anchored bottom-left in every view, project editor included: the engine
+ paths it holds are what makes generation work at all, and finding out they
+ are wrong happens inside a project, not in the library. */
+ const settingsLauncher = (
+ <button className="settings-launcher" type="button" onClick={() => setSettingsOpen(true)} title="Settings">
+ <Settings size={18} aria-hidden="true" /> <span>Settings</span>
+ </button>
+ );
if (activeProject) {
- return <ProjectWorkspace project={activeProject} initialView={activeProjectInitialView} onBack={() => setActiveProject(null)} onSave={async (project) => {
- const saved = await saveProject(project);
- setActiveProject(saved);
- setProjects((current) => [saved, ...current.filter((item) => item.config.id !== saved.config.id)]);
- }} />;
+ return <>
+ <ProjectWorkspace project={activeProject} initialView={activeProjectInitialView} settingsRevision={settingsRevision} onBack={() => setActiveProject(null)} onSave={async (project) => {
+ const saved = await saveProject(project);
+ setActiveProject(saved);
+ setProjects((current) => [saved, ...current.filter((item) => item.config.id !== saved.config.id)]);
+ }} />
+ {settingsLauncher}
+ {settingsOpen && <SettingsView onClose={closeSettings} />}
+ </>;
}
return (
<div className="app-shell">
- <Sidebar view={view} onNavigate={navigate} />
- {view === "generate" && <EmptyPlaceholder title="Generation workspace" copy="Generating shots happens inside a project, so every clip, prompt, and setting stays with the footage it belongs to." icon={Sparkles} onBack={() => navigate("library")} />}
- {view === "references" && <EmptyPlaceholder title="Reference library" copy="References live inside a project, keeping characters, products, and style consistent across every shot in it." icon={BookImage} onBack={() => navigate("library")} />}
- {view === "library" && (
- <main className="library">
- <header className="library__topbar">
- <div className="search-field"><Search size={17} /><input ref={searchInput} value={query} onChange={(event) => setQuery(event.target.value)} placeholder="Search projects" aria-label="Search projects" /><kbd>Ctrl K</kbd></div>
- <button className="secondary-button" onClick={() => void openFromFolder()}><FolderOpen size={17} /> Open project folder</button>
- </header>
- <div className="library__content">
- <div className="library__intro">
+ <main className="library">
+ <header className="library__topbar">
+ <Brand />
+ <div className="search-field"><Search size={17} /><input ref={searchInput} value={query} onChange={(event) => setQuery(event.target.value)} placeholder="Search projects" aria-label="Search projects" /><kbd>Ctrl K</kbd></div>
+ <button className="secondary-button" onClick={() => void openFromFolder()}><FolderOpen size={17} /> Open project folder</button>
+ </header>
+ <div className="library__content">
+ <PromptComposer busy={busy} onCreate={createFromPrompt} />
+
+ <section className="recent-projects" aria-labelledby="recent-heading">
+ <div className="section-heading">
<div>
- <p className="eyebrow">Project library</p>
- <h1>{greeting()}</h1>
- <p>Describe the video you want below. PolStudio sets up a project you can edit, and keeps every file in a folder you own.</p>
+ <h2 id="recent-heading">Your projects</h2>
+ <span>{filteredProjects.length} {filteredProjects.length === 1 ? "project" : "projects"}</span>
+ </div>
+ <div className="view-controls" aria-label="Project layout">
+ <button className={`icon-button ${projectLayout === "grid" ? "icon-button--active" : ""}`} aria-label="Grid view" aria-pressed={projectLayout === "grid"} onClick={() => setProjectLayout("grid")}><Grid2X2 size={17} /></button>
+ <button className={`icon-button ${projectLayout === "list" ? "icon-button--active" : ""}`} aria-label="List view" aria-pressed={projectLayout === "list"} onClick={() => setProjectLayout("list")}><List size={17} /></button>
</div>
- <span className="storage-pill"><i /> Saved on this computer</span>
</div>
- <PromptComposer busy={busy} onCreate={createFromPrompt} />
-
- <section className="recent-projects" aria-labelledby="recent-heading">
- <div className="section-heading">
- <div>
- <h2 id="recent-heading">Your projects</h2>
- <span>{filteredProjects.length} {filteredProjects.length === 1 ? "project" : "projects"}</span>
- </div>
- <div className="view-controls" aria-label="Project layout">
- <button className={`icon-button ${projectLayout === "grid" ? "icon-button--active" : ""}`} aria-label="Grid view" aria-pressed={projectLayout === "grid"} onClick={() => setProjectLayout("grid")}><Grid2X2 size={17} /></button>
- <button className={`icon-button ${projectLayout === "list" ? "icon-button--active" : ""}`} aria-label="List view" aria-pressed={projectLayout === "list"} onClick={() => setProjectLayout("list")}><List size={17} /></button>
- </div>
+ {loading ? (
+ <div className="project-grid">{[0, 1, 2].map((item) => <div className="project-skeleton" key={item}><i /><span /><small /></div>)}</div>
+ ) : filteredProjects.length ? (
+ <div className={`project-grid project-grid--${projectLayout}`}>{filteredProjects.map((project, index) => <ProjectCard key={`${project.config.id}-${project.folderPath}`} project={project} index={index} onOpen={(selected) => { setActiveProjectInitialView("timeline"); setActiveProject(selected); }} />)}</div>
+ ) : query ? (
+ <div className="library-empty">
+ <FolderOpen size={28} />
+ <h3>Nothing matches “{query}”</h3>
+ <p>Search looks at project names, descriptions, and folder paths. Try a shorter word, or clear the search to see everything.</p>
+ <button className="secondary-button" onClick={() => setQuery("")}>Clear search</button>
+ </div>
+ ) : (
+ <div className="library-empty">
+ <FolderOpen size={28} />
+ <h3>No projects yet</h3>
+ <p>Describe your video in the box above and press <strong>Create project</strong>. PolStudio makes the folder, the settings, and a first scene for you.</p>
+ <p className="library-empty__aside">Already made one on this computer?</p>
+ <button className="secondary-button" onClick={() => void openFromFolder()}><FolderOpen size={17} /> Open project folder</button>
</div>
- {loading ? (
- <div className="project-grid">{[0, 1, 2].map((item) => <div className="project-skeleton" key={item}><i /><span /><small /></div>)}</div>
- ) : filteredProjects.length ? (
- <div className={`project-grid project-grid--${projectLayout}`}>{filteredProjects.map((project, index) => <ProjectCard key={`${project.config.id}-${project.folderPath}`} project={project} index={index} onOpen={(selected) => { setActiveProjectInitialView("timeline"); setActiveProject(selected); }} />)}</div>
- ) : query ? (
- <div className="library-empty">
- <FolderOpen size={28} />
- <h3>Nothing matches “{query}”</h3>
- <p>Search looks at project names, descriptions, and folder paths. Try a shorter word, or clear the search to see everything.</p>
- <button className="secondary-button" onClick={() => setQuery("")}>Clear search</button>
- </div>
- ) : (
- <div className="library-empty">
- <FolderOpen size={28} />
- <h3>No projects yet</h3>
- <p>Describe your video in the box above and press <strong>Create project</strong>. PolStudio makes the folder, the settings, and a first scene for you.</p>
- <p className="library-empty__aside">Already made one on this computer?</p>
- <button className="secondary-button" onClick={() => void openFromFolder()}><FolderOpen size={17} /> Open project folder</button>
- </div>
- )}
- </section>
- <footer className="library__footer">Every project is an ordinary folder on this computer — you can move, copy, or back it up like any other files.</footer>
- </div>
- </main>
- )}
+ )}
+ </section>
+ </div>
+ </main>
+ {settingsLauncher}
+ {settingsOpen && <SettingsView onClose={closeSettings} />}
{error && <div className="toast" role="alert"><strong>{error.title}</strong><span>{error.detail}</span><button onClick={() => setError(null)}>Dismiss</button></div>}
</div>
);
diff --git a/src/components/EmptyPlaceholder.tsx b/src/components/EmptyPlaceholder.tsx
deleted file mode 100644
index dcedc32..0000000
--- a/src/components/EmptyPlaceholder.tsx
+++ /dev/null
@@ -1,31 +0,0 @@
-import type { LucideIcon } from "lucide-react";
-import { ArrowLeft, Construction } from "lucide-react";
-
-export function EmptyPlaceholder({ title, copy, icon: Icon = Construction, onBack }: {
- title: string; copy: string; icon?: LucideIcon; onBack: () => void;
-}) {
- return (
- <main className="placeholder-view">
- <button className="back-link" type="button" onClick={onBack}>
- <ArrowLeft size={16} aria-hidden="true" /> Project library
- </button>
- <div className="placeholder-view__card">
- <span aria-hidden="true"><Icon size={28} /></span>
- <p className="eyebrow">Lives inside a project</p>
- <h1>{title}</h1>
- <p>{copy}</p>
- <ol className="placeholder-view__steps">
- <li>
- <b>Open or create a project</b>
- <span>Describe the video you want in the project library, or open a project folder you already have.</span>
- </li>
- <li>
- <b>Work from the project tabs</b>
- <span>Timeline, Generator, and References all open along the top of a project, with your files kept together in its folder.</span>
- </li>
- </ol>
- <button className="primary-button" type="button" onClick={onBack}>Go to Projects</button>
- </div>
- </main>
- );
-}
diff --git a/src/components/ProjectWorkspace.test.ts b/src/components/ProjectWorkspace.test.ts
index a24fb8e..4d99008 100644
--- a/src/components/ProjectWorkspace.test.ts
+++ b/src/components/ProjectWorkspace.test.ts
@@ -43,6 +43,10 @@ describe("project workspace timecode", () => {
onBack: () => undefined,
onSave: async () => { throw new Error("The original project file is locked."); },
}));
+ // Save is the only save state left in the topbar — the standing "All
+ // changes saved" pill is gone — so it is off until there is something to
+ // write. Make an edit first, or the click lands on a disabled button.
+ fireEvent.change(screen.getByLabelText("Name"), { target: { value: "Opening shot, retimed" } });
fireEvent.click(screen.getByRole("button", { name: "Save" }));
const alert = await screen.findByRole("alert");
expect(alert.textContent).toContain("Couldn’t save project");
diff --git a/src/components/ProjectWorkspace.tsx b/src/components/ProjectWorkspace.tsx
index 7777760..fe80ac4 100644
--- a/src/components/ProjectWorkspace.tsx
+++ b/src/components/ProjectWorkspace.tsx
@@ -1,7 +1,7 @@
import { ArrowLeft, BookOpen, Cloud, Download, Film, Save, Sparkles } from "lucide-react";
import { useEffect, useState } from "react";
import type { ProjectConfig, ProjectRecord } from "../lib/project";
-import { getRuntimeStatus, type ProviderId, type RuntimeStatus } from "../lib/runtime";
+import { getRuntimeStatus, type RuntimeStatus } from "../lib/runtime";
import { AgentDock } from "./workspace/AgentDock";
import { GeneratorView } from "./workspace/GeneratorView";
import { ReferencesView } from "./workspace/ReferencesView";
@@ -17,9 +17,13 @@ export function formatDurationTimecode(totalSeconds: number): string {
return [hours, minutes, remainder].map((value) => String(value).padStart(2, "0")).join(":");
}
-export function ProjectWorkspace({ project, initialView = "timeline", onBack, onSave }: {
+export function ProjectWorkspace({ project, initialView = "timeline", settingsRevision = 0, onBack, onSave }: {
project: ProjectRecord;
initialView?: ProjectView;
+ /** Bumped when the settings overlay closes, so edits to this machine's
+ * engine paths reach an already-open project instead of waiting for a
+ * reopen. */
+ settingsRevision?: number;
onBack: () => void;
onSave: (project: ProjectRecord) => Promise<void>;
}) {
@@ -36,9 +40,10 @@ export function ProjectWorkspace({ project, initialView = "timeline", onBack, on
useEffect(() => {
void getRuntimeStatus(config).then(setRuntime).catch(() => setRuntime(null));
- // Runtime configuration only needs reprobe when provider settings change.
+ // Reprobe when the project's own provider settings change, and when the
+ // machine's engine paths have just been edited.
// eslint-disable-next-line react-hooks/exhaustive-deps
- }, [config.providerSettings]);
+ }, [config.providerSettings, settingsRevision]);
const changeConfig = (next: ProjectConfig) => {
setConfig(next);
@@ -58,40 +63,39 @@ export function ProjectWorkspace({ project, initialView = "timeline", onBack, on
}
};
- const selectProvider = (provider: ProviderId) => {
- changeConfig({ ...config, providerSettings: {
- ...config.providerSettings,
- agent: { enabled: true, model: null, options: { ...(config.providerSettings.agent?.options ?? {}), selectedProvider: provider } },
- } });
- };
-
return <div className="project-shell">
<header className="project-topbar">
- <button className="icon-button icon-button--strong" onClick={onBack} aria-label="Back to project library"><ArrowLeft size={18} /></button>
- {/* The name column is the topbar's elastic column and truncates on narrow
- windows, so the full name stays available on hover. */}
- <div className="project-title"><strong title={config.name}>{config.name}</strong><span><Cloud size={13} aria-hidden="true" /> Local project</span></div>
- <p className={`save-state save-state--${dirty ? "dirty" : "saved"}`} aria-live="polite"><i aria-hidden="true" />{dirty ? "Unsaved changes" : "All changes saved"}</p>
+ <div className="project-topbar__lead">
+ <button className="icon-button icon-button--strong" onClick={onBack} aria-label="Back to project library"><ArrowLeft size={18} /></button>
+ {/* The name column is the topbar's elastic column and truncates on narrow
+ windows, so the full name stays available on hover. */}
+ <div className="project-title"><strong title={config.name}>{config.name}</strong><span><Cloud size={13} aria-hidden="true" /> Local project</span></div>
+ </div>
+
+ <nav className="project-nav" aria-label="Project views">
+ {([ ["timeline", Film, "Timeline"], ["generator", Sparkles, "Generator"], ["references", BookOpen, "References"] ] as const).map(([id, Icon, label]) => {
+ const running = id === "generator" ? config.generationJobs.filter((job) => job.status === "generating" || job.status === "queued").length : 0;
+ return <button key={id} type="button" className={view === id ? "active" : ""} aria-current={view === id ? "page" : undefined} onClick={() => setView(id)}>
+ <Icon size={18} aria-hidden="true" /> {label}
+ {running > 0 && <span title={`${running} generation${running === 1 ? "" : "s"} running or queued`}>{running}</span>}
+ </button>;
+ })}
+ </nav>
+
<div className="project-topbar__actions">
{/* Export is not wired to anything yet, so it must not look like a working action. */}
<button className="secondary-button" type="button" disabled title="Export isn’t available yet. PolStudio can’t save generated shots as video files yet, so there is nothing to export.">
<Download size={16} aria-hidden="true" /> Export <span className="project-topbar__soon">Soon</span>
</button>
- <button className="primary-button" onClick={() => void save()} disabled={saving}><Save size={16} aria-hidden="true" /> {saving ? "Saving…" : "Save"}</button>
+ {/* The standing "All changes saved" pill is gone; the button itself is
+ now the only save state there is, so it has to carry it. Off means
+ the file on disk already matches what is on screen. */}
+ <button className="primary-button" onClick={() => void save()} disabled={saving || !dirty} title={saving ? "Saving…" : dirty ? "Save your changes to this project folder" : "Everything is already saved"}>
+ <Save size={16} aria-hidden="true" /> {saving ? "Saving…" : "Save"}
+ </button>
</div>
</header>
- <nav className="project-nav" aria-label="Project views">
- <div>{([ ["timeline", Film, "Timeline"], ["generator", Sparkles, "Generator"], ["references", BookOpen, "References"] ] as const).map(([id, Icon, label]) => {
- const running = id === "generator" ? config.generationJobs.filter((job) => job.status === "generating" || job.status === "queued").length : 0;
- return <button key={id} type="button" className={view === id ? "active" : ""} aria-current={view === id ? "page" : undefined} onClick={() => setView(id)}>
- <Icon size={18} aria-hidden="true" /> {label}
- {running > 0 && <span title={`${running} generation${running === 1 ? "" : "s"} running or queued`}>{running}</span>}
- </button>;
- })}</div>
- <span className="project-nav__meta" title="Aspect ratio, resolution, and frame rate for this project">{config.settings.aspectRatio} · {config.settings.resolution.toUpperCase()} · {config.settings.frameRate} FPS</span>
- </nav>
-
<div className={`project-content project-content--${view}`}>
{view === "timeline" && <TimelineView config={config} onChange={changeConfig} onOpenGenerator={(jobId) => { setSelectedGenerationJobId(jobId); setView("generator"); }} />}
{view === "generator" && <GeneratorView config={config} folderPath={project.folderPath} runtime={runtime?.vidfab ?? null} onChange={changeConfig} selectedJobId={selectedGenerationJobId} onOpenTimeline={() => setView("timeline")} draftPrompt={generatorPrompt} onDraftPromptChange={setGeneratorPrompt} />}
@@ -104,9 +108,8 @@ export function ProjectWorkspace({ project, initialView = "timeline", onBack, on
{ id: "claude", label: "Claude Code", state: "unavailable", executable: null, version: null, detail: "Checking provider…" },
{ id: "codex", label: "Codex", state: "unavailable", executable: null, version: null, detail: "Checking provider…" },
]}
- onProviderChange={selectProvider}
/* Routed through the same save() as the Save button. Clearing `dirty`
- up front showed "All changes saved" even when the write then failed,
+ up front reported a saved project even when the write then failed,
and swallowed the reason; save() clears only on success and surfaces
the failure in the toast. */
onRecord={(record) => { setConfig(record.config); void save(record); }}
diff --git a/src/components/PromptComposer.tsx b/src/components/PromptComposer.tsx
index d014ee1..3d6f6a5 100644
--- a/src/components/PromptComposer.tsx
+++ b/src/components/PromptComposer.tsx
@@ -114,7 +114,6 @@ export function PromptComposer({ busy, onCreate }: PromptComposerProps) {
<div className="composer-heading">
<span className="eyebrow"><Sparkles size={14} /> New project</span>
<h2 id="create-heading">What do you want to make?</h2>
- <p>Write it the way you would say it out loud. PolStudio turns your description into a real project you can edit — nothing here is final.</p>
</div>
<div className="composer">
@@ -183,8 +182,9 @@ export function PromptComposer({ busy, onCreate }: PromptComposerProps) {
>
<ImagePlus size={16} /> Add reference images{referenceImages.length > 0 && <b>{referenceImages.length}</b>}
</button>
- <span className="composer__hint">Or press <kbd>{modifierKey}</kbd><kbd>Enter</kbd></span>
- <button className="primary-button composer__submit" disabled={!prompt.trim() || busy} aria-busy={busy} onClick={() => void submit()}>
+ {/* The shortcut rides on the button it triggers rather than holding a
+ permanent line of its own in the action row. */}
+ <button className="primary-button composer__submit" disabled={!prompt.trim() || busy} aria-busy={busy} onClick={() => void submit()} title={`Create project — or press ${modifierKey}+Enter`}>
{busy ? <span className="spinner" /> : <WandSparkles size={18} />}
Create project
</button>
diff --git a/src/components/SettingsView.tsx b/src/components/SettingsView.tsx
new file mode 100644
index 0000000..da3f79e
--- /dev/null
+++ b/src/components/SettingsView.tsx
@@ -0,0 +1,174 @@
+import { AlertCircle, Check, FolderSearch, RotateCcw, X } from "lucide-react";
+import { useCallback, useEffect, useState } from "react";
+import { isTauri } from "../lib/persistence";
+import { chooseEnginePath, getEngineStatus, type ModelStatus, type VidfabStatus } from "../lib/runtime";
+import {
+ EMPTY_ENGINE_SETTINGS, ENGINE_PATH_FIELDS,
+ loadEngineSettings, saveEngineSettings,
+ type EnginePathField, type EnginePathId, type EngineSettings,
+} from "../lib/settings";
+
+type PathState = "unset" | "checking" | "found" | "missing";
+
+/* The backend reports the DLL separately from the five model paths, so one
+ lookup answers "is this path actually there?" for either kind. */
+function pathState(field: EnginePathField, value: string, status: VidfabStatus | null): PathState {
+ if (!value.trim()) return "unset";
+ if (!status) return "checking";
+ if (field.id === "dllPath") return status.state === "runtimeMissing" ? "missing" : "found";
+ const model: ModelStatus | undefined = status.models.find((item) => item.id === field.id);
+ if (!model) return "checking";
+ /* `available` is a file test on the Rust side, so a tokenizer FOLDER reads
+ as unavailable even when it is perfectly fine. Don't call that missing. */
+ if (!model.available && field.directory) return "found";
+ return model.available ? "found" : "missing";
+}
+
+const stateLabel: Record<PathState, string> = {
+ unset: "Not set",
+ checking: "Checking…",
+ found: "Found",
+ missing: "Not found on disk",
+};
+
+export function SettingsView({ onClose }: { onClose: () => void }) {
+ const [settings, setSettings] = useState<EngineSettings>(() => loadEngineSettings());
+ const [status, setStatus] = useState<VidfabStatus | null>(null);
+ const [error, setError] = useState<string | null>(null);
+ const desktop = isTauri();
+
+ const probe = useCallback(() => {
+ setStatus(null);
+ void getEngineStatus().then(setStatus).catch(() => setStatus(null));
+ }, []);
+
+ /* Saved on every keystroke — there is no Save button here, so a half-typed
+ path must never be the reason generation is still broken after a restart.
+ The probe is deliberately NOT per keystroke: it touches the disk and loads
+ the engine library. It runs when a field is left or a path is picked. */
+ const update = (id: EnginePathId, value: string) => {
+ setSettings((current) => {
+ const next = { ...current, [id]: value };
+ saveEngineSettings(next);
+ return next;
+ });
+ };
+
+ useEffect(probe, [probe]);
+
+ useEffect(() => {
+ const close = (event: KeyboardEvent) => { if (event.key === "Escape") onClose(); };
+ window.addEventListener("keydown", close);
+ return () => window.removeEventListener("keydown", close);
+ }, [onClose]);
+
+ const browse = async (field: EnginePathField) => {
+ setError(null);
+ try {
+ const picked = await chooseEnginePath(field);
+ if (!picked) return;
+ update(field.id, picked);
+ probe();
+ } catch (reason) {
+ setError(reason instanceof Error ? reason.message : String(reason));
+ }
+ };
+
+ const clearAll = () => {
+ setSettings({ ...EMPTY_ENGINE_SETTINGS });
+ saveEngineSettings({ ...EMPTY_ENGINE_SETTINGS });
+ probe();
+ };
+
+ const missing = ENGINE_PATH_FIELDS.filter((field) => field.required && pathState(field, settings[field.id], status) !== "found");
+
+ return (
+ <div className="settings-overlay" role="dialog" aria-modal="true" aria-labelledby="settings-heading">
+ <div className="settings-view">
+ <header className="settings-view__head">
+ <div>
+ <p className="eyebrow">Settings</p>
+ <h1 id="settings-heading">Video engine</h1>
+ </div>
+ <button className="icon-button icon-button--strong" onClick={onClose} aria-label="Close settings"><X size={18} /></button>
+ </header>
+
+ <p className="settings-view__lead">
+ PolStudio needs the engine library and its model files to render a shot. These paths belong to
+ this computer, not to a project — they are remembered here and used by every project you open.
+ </p>
+
+ <div className={`settings-status settings-status--${status?.state ?? "checking"}`} role="status">
+ <span><i />{engineHeadline(status, desktop)}</span>
+ <p>{engineDetail(status, desktop, missing.length)}</p>
+ </div>
+
+ <section className="settings-section" aria-labelledby="paths-heading">
+ <h2 id="paths-heading">Engine and model paths</h2>
+ {ENGINE_PATH_FIELDS.map((field) => {
+ const value = settings[field.id];
+ const state = pathState(field, value, status);
+ return (
+ <div className={`settings-path settings-path--${state}`} key={field.id}>
+ <label htmlFor={`engine-${field.id}`}>
+ <b>{field.label}{!field.required && <em>Optional</em>}</b>
+ <small>{field.hint}</small>
+ </label>
+ <div className="settings-path__row">
+ <input
+ id={`engine-${field.id}`}
+ value={value}
+ spellCheck={false}
+ placeholder={field.directory ? "Folder on this computer" : "File on this computer"}
+ onChange={(event) => update(field.id, event.target.value)}
+ onBlur={probe}
+ />
+ <button
+ type="button"
+ className="secondary-button"
+ onClick={() => void browse(field)}
+ disabled={!desktop}
+ title={desktop ? `Browse for ${field.label}` : "Browsing for files is available in the desktop app"}
+ >
+ <FolderSearch size={16} /> Browse
+ </button>
+ </div>
+ <span className="settings-path__state">
+ {state === "found" ? <Check size={14} aria-hidden="true" /> : state === "missing" ? <AlertCircle size={14} aria-hidden="true" /> : null}
+ {stateLabel[state]}
+ </span>
+ </div>
+ );
+ })}
+ </section>
+
+ <footer className="settings-view__foot">
+ <button className="secondary-button" onClick={clearAll}><RotateCcw size={16} /> Clear all paths</button>
+ <span>Changes are saved as you type.</span>
+ </footer>
+
+ {error && <div className="toast" role="alert"><strong>Couldn’t open the file picker</strong><span>{error}</span><button onClick={() => setError(null)}>Dismiss</button></div>}
+ </div>
+ </div>
+ );
+}
+
+const engineHeadline = (status: VidfabStatus | null, desktop: boolean) => {
+ if (!desktop) return "Browser preview";
+ if (!status) return "Checking this computer…";
+ switch (status.state) {
+ case "ready": return "Engine ready";
+ case "modelsMissing": return "Model files missing";
+ case "runtimeMissing": return "Engine not found";
+ case "incompatible": return "Engine version not supported";
+ case "demo": return "Browser preview";
+ }
+};
+
+const engineDetail = (status: VidfabStatus | null, desktop: boolean, missing: number) => {
+ if (!desktop) return "Paths are saved here, but only the desktop app can check them or render with them.";
+ if (!status) return "Looking for the engine library and the model files.";
+ if (status.state === "ready") return "Everything PolStudio needs to render a shot is in place.";
+ if (missing > 0) return `${status.detail} ${missing === 1 ? "One path" : `${missing} paths`} still need setting below.`;
+ return status.detail;
+};
diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx
deleted file mode 100644
index 73455f8..0000000
--- a/src/components/Sidebar.tsx
+++ /dev/null
@@ -1,78 +0,0 @@
-import type { LucideIcon } from "lucide-react";
-import {
- Aperture,
- BookImage,
- CircleHelp,
- FolderKanban,
- Settings,
- Sparkles,
-} from "lucide-react";
-import { Brand } from "./Brand";
-
-export type WorkspaceView = "library" | "generate" | "references";
-
-interface SidebarProps {
- view: WorkspaceView;
- onNavigate: (view: WorkspaceView) => void;
-}
-
-const navItems: Array<{ id: WorkspaceView; label: string; icon: LucideIcon }> = [
- { id: "library", label: "Projects", icon: FolderKanban },
- { id: "generate", label: "Generate", icon: Sparkles },
- { id: "references", label: "References", icon: BookImage },
-];
-
-/* These two are not built yet. They stay visible so the shape of the app is
- honest, but they are disabled and labelled so nobody clicks a dead control. */
-const notBuiltYet: Array<{ label: string; icon: LucideIcon; title: string }> = [
- { label: "Help & shortcuts", icon: CircleHelp, title: "Help & shortcuts isn’t available yet." },
- { label: "Settings", icon: Settings, title: "Settings aren’t available yet." },
-];
-
-export function Sidebar({ view, onNavigate }: SidebarProps) {
- return (
- <aside className="sidebar">
- <Brand />
- <nav className="sidebar__nav" aria-label="Workspace">
- <p className="sidebar__label">Workspace</p>
- {navItems.map((item) => {
- const Icon = item.icon;
- return (
- <button
- className={`nav-item ${view === item.id ? "nav-item--active" : ""}`}
- key={item.id}
- type="button"
- onClick={() => onNavigate(item.id)}
- aria-current={view === item.id ? "page" : undefined}
- >
- <Icon size={20} strokeWidth={1.8} aria-hidden="true" />
- <span>{item.label}</span>
- {item.id === "generate" && <span className="nav-item__badge">AI</span>}
- </button>
- );
- })}
- </nav>
-
- <div className="sidebar__status">
- <div className="sidebar__status-icon" aria-hidden="true"><Aperture size={20} /></div>
- <div>
- <strong>Local workspace</strong>
- <span>Files stay on this device</span>
- </div>
- </div>
-
- <div className="sidebar__bottom">
- {notBuiltYet.map((item) => {
- const Icon = item.icon;
- return (
- <button className="utility-button" key={item.label} type="button" disabled title={item.title}>
- <Icon size={18} aria-hidden="true" />
- <span>{item.label}</span>
- <span className="utility-button__soon">Soon</span>
- </button>
- );
- })}
- </div>
- </aside>
- );
-}
diff --git a/src/components/workspace/AgentDock.tsx b/src/components/workspace/AgentDock.tsx
index 91615ad..e65390b 100644
--- a/src/components/workspace/AgentDock.tsx
+++ b/src/components/workspace/AgentDock.tsx
@@ -1,17 +1,21 @@
-import { ArrowUp, CornerDownLeft, LoaderCircle, Square, TriangleAlert } from "lucide-react";
+import { ArrowUp, LoaderCircle, Square, TriangleAlert } from "lucide-react";
import { useMemo, useState } from "react";
import { cancelAgentTurn, runAgentTurn, type ProviderId, type ProviderStatus } from "../../lib/runtime";
+import { loadAgentProvider, saveAgentProvider } from "../../lib/settings";
import type { ProjectRecord } from "../../lib/project";
import { PolStudioLogo } from "../PolStudioLogo";
-export function AgentDock({ context, record, providers, onRecord, onProviderChange }: {
+export function AgentDock({ context, record, providers, onRecord }: {
context: string;
record: ProjectRecord;
providers: ProviderStatus[];
onRecord: (record: ProjectRecord) => void;
- onProviderChange: (provider: ProviderId) => void;
}) {
- const configured = record.config.providerSettings.agent?.options.selectedProvider;
+ /* Which agent drives Pol depends on what is installed and signed in on THIS
+ computer, so the choice is remembered per machine and survives a restart.
+ Projects written before that existed still carry their own choice; it is
+ read once as a seed and the stored preference takes over from there. */
+ const configured = loadAgentProvider() ?? record.config.providerSettings.agent?.options.selectedProvider;
const initial = configured === "codex" || configured === "claude" ? configured : providers.find((item) => item.state === "ready")?.id ?? "claude";
const [provider, setProvider] = useState<ProviderId>(initial);
const [prompt, setPrompt] = useState("");
@@ -60,7 +64,7 @@ export function AgentDock({ context, record, providers, onRecord, onProviderChan
<span className="agent-dock__identity"><PolStudioLogo compact decorative /><b>Pol</b></span>
<label className={`agent-provider agent-provider--${selected?.state ?? "unknown"}`} title={blockedDetail ?? selected?.detail}>
<i />
- <select aria-label="Agent provider" value={provider} onChange={(event) => { const next = event.target.value as ProviderId; setProvider(next); onProviderChange(next); }}>
+ <select aria-label="Agent provider" value={provider} onChange={(event) => { const next = event.target.value as ProviderId; setProvider(next); saveAgentProvider(next); }}>
{providers.map((item) => <option value={item.id} key={item.id}>{item.label} · {providerStateLabel(item.state)}</option>)}
</select>
</label>
@@ -73,10 +77,12 @@ export function AgentDock({ context, record, providers, onRecord, onProviderChan
disabled={!ready || Boolean(requestId)}
/>
{requestId ? <button type="button" className="agent-cancel" onClick={() => void cancelAgentTurn(requestId)} aria-label="Cancel agent turn"><Square size={14} /></button> : <>
- {ready
- ? <span className="agent-dock__hint"><CornerDownLeft size={14} aria-hidden="true" /> Enter to send</span>
- : <span className="agent-dock__blocked"><TriangleAlert size={14} aria-hidden="true" /> {selected ? providerStateLabel(selected.state) : "Unavailable"}</span>}
- <button type="submit" disabled={!prompt.trim() || !ready} aria-label="Send to Pol"><ArrowUp size={16} /></button>
+ {/* The keyboard shortcut is a hint, not news: it lives on the button
+ it describes rather than taking a permanent slice of a one-line
+ dock. Why Pol CANNOT run still gets its own visible label — that
+ is a state the user has to act on. */}
+ {!ready && <span className="agent-dock__blocked"><TriangleAlert size={14} aria-hidden="true" /> {selected ? providerStateLabel(selected.state) : "Unavailable"}</span>}
+ <button type="submit" disabled={!prompt.trim() || !ready} aria-label="Send to Pol" title={ready ? "Send to Pol — or press Enter" : blockedDetail ?? "No agent provider is available"}><ArrowUp size={16} /></button>
</>}
{requestId && <LoaderCircle className="agent-busy" size={16} />}
</form>
diff --git a/src/components/workspace/ReferencesView.tsx b/src/components/workspace/ReferencesView.tsx
index 0dfcbb6..0882905 100644
--- a/src/components/workspace/ReferencesView.tsx
+++ b/src/components/workspace/ReferencesView.tsx
@@ -116,7 +116,7 @@ export function ReferencesView({ config, folderPath, onChange }: { config: Proje
<h3>Used by <span>{jobs.length}</span></h3>
{jobs.length ? jobs.map((job) => <div key={job.id}><span className={`job-link-dot job-link-dot--${job.status}`} /><div><b>{job.title}</b><small>{job.status} · {job.stage}</small></div><Link2 size={16} /></div>) : <p>No shots use this reference yet. Each new shot picks up the first two it can use from this list, so it will be used once it reaches the top two of those.</p>}
</section>
- <section className="portable-path"><BookOpen size={16} /><div><b>Where this lives</b><code>{selected.relativePath ?? "Stored in polstudio.project.json"}</code></div></section>
+ <section className="portable-path"><BookOpen size={16} /><div><b>Where this lives</b><code>{selected.relativePath ?? "Stored in pols.json"}</code></div></section>
</> : <div className="reference-empty"><BookOpen size={26} /><b>Select a reference</b><p>Pick one from the library, or add a new one, to edit its definition and see which generations use it.</p></div>}
</aside>
</div>
diff --git a/src/components/workspace/TimelineView.tsx b/src/components/workspace/TimelineView.tsx
index add9378..49fb49e 100644
--- a/src/components/workspace/TimelineView.tsx
+++ b/src/components/workspace/TimelineView.tsx
@@ -3,7 +3,7 @@ import {
Pause, Play, Plus, Scissors, SkipBack, SkipForward, Trash2, Upload, Video,
Volume2, VolumeX,
} from "lucide-react";
-import { useEffect, useMemo, useState } from "react";
+import { useEffect, useMemo, useRef, useState } from "react";
import type { ProjectConfig, TimelineClip } from "../../lib/project";
const MIN_DURATION = 10_000;
@@ -41,6 +41,7 @@ export function TimelineView({ config, onChange, onOpenGenerator }: { config: Pr
const [playhead, setPlayhead] = useState(firstClip?.startMs ?? 0);
const [playing, setPlaying] = useState(false);
const [panelTab, setPanelTab] = useState<"scenes" | "media">("scenes");
+ const timelineGrid = useRef<HTMLDivElement>(null);
const tracks = config.timeline.tracks;
const selected = useMemo(() => tracks.flatMap((track) => track.clips).find((clip) => clip.id === selectedId), [tracks, selectedId]);
const selectedTrack = tracks.find((track) => track.id === selected?.trackId);
@@ -61,6 +62,30 @@ export function TimelineView({ config, onChange, onOpenGenerator }: { config: Pr
useEffect(() => { if (clipCount === 0 && playing) setPlaying(false); }, [clipCount, playing]);
+ /* Wheel over the timeline scrubs it. Registered by hand rather than with
+ React's onWheel because React attaches wheel listeners passively, and a
+ passive listener cannot preventDefault — without that the project content
+ scrolls away under the pointer while the playhead moves.
+
+ A notch is one second; hold Shift for one frame. deltaMode says what the
+ browser's numbers mean (pixels, lines, or pages), so normalise to notches
+ instead of treating a trackpad's pixel deltas as a thousand of them. */
+ useEffect(() => {
+ const grid = timelineGrid.current;
+ if (!grid) return;
+ const onWheel = (event: WheelEvent) => {
+ const raw = Math.abs(event.deltaY) >= Math.abs(event.deltaX) ? event.deltaY : event.deltaX;
+ if (raw === 0) return;
+ event.preventDefault();
+ const notches = event.deltaMode === 0 ? raw / 100 : event.deltaMode === 1 ? raw / 3 : raw;
+ const stepMs = event.shiftKey ? 1000 / config.settings.frameRate : 1000;
+ setPlaying(false);
+ setPlayhead((current) => Math.round(Math.max(0, Math.min(duration, current + notches * stepMs))));
+ };
+ grid.addEventListener("wheel", onWheel, { passive: false });
+ return () => grid.removeEventListener("wheel", onWheel);
+ }, [duration, config.settings.frameRate]);
+
const updateTracks = (nextTracks: ProjectConfig["timeline"]["tracks"]) => onChange({ ...config, timeline: { tracks: nextTracks } });
const updateClip = (clipId: string, updates: Partial<TimelineClip>) => updateTracks(tracks.map((track) => ({ ...track, clips: track.clips.map((clip) => clip.id === clipId ? { ...clip, ...updates } : clip) })));
const toggleTrack = (trackId: string, key: "muted" | "locked") => updateTracks(tracks.map((track) => track.id === trackId ? { ...track, [key]: !track[key] } : track));
@@ -176,13 +201,6 @@ export function TimelineView({ config, onChange, onOpenGenerator }: { config: Pr
</div>
<span>{config.settings.resolution.toUpperCase()} · {config.settings.frameRate} fps</span>
</div>
- {/* Measured in Chromium (the engine behind the WebView2 runtime this
- ships in): a disabled button DOES receive hover and DOES paint its
- title tooltip, so the titles above are not dead. But a tooltip is
- mouse-only — a disabled button cannot take focus, so keyboard and
- touch users have no way to reach it. The reason the transport is
- dead is stated here so it needs no pointer at all. */}
- {clipCount === 0 && <p className="transport-note">These controls stay off until there is a scene to play.</p>}
</main>
<aside className="clip-inspector">
@@ -229,7 +247,7 @@ export function TimelineView({ config, onChange, onOpenGenerator }: { config: Pr
<button onClick={removeSelected} disabled={deleteBlockedBy !== null} title={deleteBlockedBy ?? "Delete selected clip"}><Trash2 size={16} /> Delete</button>
</div>
</header>
- <div className="timeline-grid">
+ <div className="timeline-grid" ref={timelineGrid} title="Scroll to scrub. Hold Shift for one frame at a time.">
<div className="track-corner"><span>Tracks</span></div>
<div className="time-ruler" onPointerDown={(event) => { const rect = event.currentTarget.getBoundingClientRect(); setPlayhead(Math.round(Math.max(0, Math.min(1, (event.clientX - rect.left) / rect.width)) * duration)); }}>
{ticks.map((second) => <span key={second} style={{ left: `${second * 1000 / duration * 100}%` }}><i />{rulerLabel(second)}</span>)}
diff --git a/src/lib/project.ts b/src/lib/project.ts
index 47bcdd9..73ed6e6 100644
--- a/src/lib/project.ts
+++ b/src/lib/project.ts
@@ -1,6 +1,6 @@
import { z } from "zod";
-export const PROJECT_FILE_NAME = "polstudio.project.json";
+export const PROJECT_FILE_NAME = "pols.json";
export const CURRENT_SCHEMA_VERSION = 1 as const;
const idSchema = z.string().min(1);
diff --git a/src/lib/runtime.ts b/src/lib/runtime.ts
index 77b1986..d0c5b6d 100644
--- a/src/lib/runtime.ts
+++ b/src/lib/runtime.ts
@@ -1,6 +1,7 @@
import { invoke } from "@tauri-apps/api/core";
import { isTauri, saveProject } from "./persistence";
import { compileMiniMaxH3Prompt, parseProjectConfig, type GenerationJob, type ProjectConfig, type ProjectRecord } from "./project";
+import { engineProviderSetting, loadEngineSettings, withEngineSettings, type EnginePathField } from "./settings";
export type ProviderId = "claude" | "codex";
export interface ProviderStatus {
@@ -64,8 +65,28 @@ const DEMO_STATUS: RuntimeStatus = {
vidfab: { state: "demo", dllPath: "Browser demo", version: 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 engine
+ paths merged in (see lib/settings.ts). The merged copy is passed straight to
+ the command and dropped; it is never the config that gets saved. */
export async function getRuntimeStatus(config: ProjectConfig): Promise<RuntimeStatus> {
- return isTauri() ? invoke<RuntimeStatus>("runtime_status", { config }) : DEMO_STATUS;
+ return isTauri() ? invoke<RuntimeStatus>("runtime_status", { config: withEngineSettings(config) }) : DEMO_STATUS;
+}
+
+/** Probes the engine paths on their own, with no project in hand — what the
+ * settings screen shows. */
+export async function getEngineStatus(): Promise<VidfabStatus> {
+ if (!isTauri()) return DEMO_STATUS.vidfab;
+ return invoke<VidfabStatus>("vidfab_status", { settings: { vidfab: engineProviderSetting(loadEngineSettings()) } });
+}
+
+/** Opens the OS picker for one engine path. Returns null when the user cancels. */
+export async function chooseEnginePath(field: EnginePathField): Promise<string | null> {
+ if (!isTauri()) return null;
+ return invoke<string | null>("choose_engine_path", {
+ title: `Select ${field.label}`,
+ directory: field.directory,
+ extensions: field.extensions,
+ });
}
export async function runAgentTurn(record: ProjectRecord, provider: ProviderId, prompt: string, requestId: string): Promise<AgentTurnResponse> {
@@ -98,7 +119,7 @@ export async function cancelAgentTurn(requestId: string): Promise<boolean> {
}
export async function resolveVidfabPlan(request: VidfabGenerationRequest, config: ProjectConfig): Promise<ResolvedPlan> {
- if (isTauri()) return invoke<ResolvedPlan>("resolve_vidfab_plan", { request, config });
+ if (isTauri()) return invoke<ResolvedPlan>("resolve_vidfab_plan", { request, config: withEngineSettings(config) });
const [ratioWidth, ratioHeight] = request.aspectRatio.split(":").map(Number);
const vertical = ratioHeight > ratioWidth;
const alignedFrames = Math.ceil(Math.max(5, request.frames - 5) / 17) * 17 + 5;
@@ -116,7 +137,7 @@ export async function resolveVidfabPlan(request: VidfabGenerationRequest, config
}
export async function enqueueVidfabGeneration(request: VidfabGenerationRequest, config: ProjectConfig): Promise<void> {
- if (isTauri()) await invoke("enqueue_vidfab_generation", { request, config });
+ if (isTauri()) await invoke("enqueue_vidfab_generation", { request, config: withEngineSettings(config) });
}
export async function cancelVidfabGeneration(jobId: string): Promise<boolean> {
diff --git a/src/lib/settings.ts b/src/lib/settings.ts
new file mode 100644
index 0000000..df4997a
--- /dev/null
+++ b/src/lib/settings.ts
@@ -0,0 +1,126 @@
+/* Machine-level settings.
+ *
+ * The video engine and its weights are a property of THIS computer, not of a
+ * project: a project folder copied from another machine carries paths that do
+ * not exist here. They therefore live in localStorage rather than in
+ * pols.json, and are merged into `providerSettings.vidfab` only
+ * on the way into a Tauri command — never on the way into a saved config.
+ * Keep it that way: writing them into a project file would put one machine's
+ * disk layout into a file the user is invited to move, copy, and share.
+ *
+ * The option names below are the contract with `Configuration::from_settings`
+ * in src-tauri/src/vidfab.rs. Renaming one here without renaming it there
+ * silently drops that path.
+ */
+import type { ProjectConfig, ProviderSetting } from "./project";
+// Type-only: erased at build time, so this does not close a cycle with runtime.ts.
+import type { ProviderId } from "./runtime";
+
+export type EnginePathId = "dllPath" | "transformer" | "textEncoder" | "tokenizer" | "videoVae" | "audioVae";
+
+export interface EnginePathField {
+ id: EnginePathId;
+ label: string;
+ /** What this file is, in the user's terms — not in the model's. */
+ hint: string;
+ /** A directory picker rather than a file picker. */
+ directory: boolean;
+ /** File extensions offered by the picker; empty means "any file". */
+ extensions: string[];
+ /** Generation cannot run without it. */
+ required: boolean;
+}
+
+export const ENGINE_PATH_FIELDS: EnginePathField[] = [
+ { id: "dllPath", label: "Video engine (vidfab_c.dll)", hint: "The engine library PolStudio loads to render shots.", directory: false, extensions: ["dll"], required: true },
+ { id: "transformer", label: "Transformer weights", hint: "The main model that turns your description into moving pictures.", directory: false, extensions: ["safetensors", "gguf", "bin"], required: true },
+ { id: "textEncoder", label: "Text encoder weights", hint: "Reads your prompt so the transformer can act on it.", directory: false, extensions: ["safetensors", "gguf", "bin"], required: true },
+ { id: "tokenizer", label: "Tokenizer", hint: "Splits your prompt into pieces the text encoder understands. Usually a folder.", directory: true, extensions: [], required: false },
+ { id: "videoVae", label: "Video VAE weights", hint: "Turns the model's internal picture into real video frames.", directory: false, extensions: ["safetensors", "gguf", "bin"], required: true },
+ { id: "audioVae", label: "Audio VAE weights", hint: "Turns the model's internal sound into real audio.", directory: false, extensions: ["safetensors", "gguf", "bin"], required: true },
+];
+
+export type EngineSettings = Record<EnginePathId, string>;
+
+export const EMPTY_ENGINE_SETTINGS: EngineSettings = {
+ dllPath: "", transformer: "", textEncoder: "", tokenizer: "", videoVae: "", audioVae: "",
+};
+
+const ENGINE_KEY = "polstudio.engine-paths.v1";
+
+/** Reads what is stored, ignoring anything that is not a string: a hand-edited
+ * or half-written entry must not take the whole settings screen down. */
+export function loadEngineSettings(): EngineSettings {
+ try {
+ const raw = localStorage.getItem(ENGINE_KEY);
+ if (!raw) return { ...EMPTY_ENGINE_SETTINGS };
+ const parsed = JSON.parse(raw) as Partial<Record<EnginePathId, unknown>>;
+ const settings = { ...EMPTY_ENGINE_SETTINGS };
+ for (const field of ENGINE_PATH_FIELDS) {
+ const value = parsed?.[field.id];
+ if (typeof value === "string") settings[field.id] = value;
+ }
+ return settings;
+ } catch {
+ return { ...EMPTY_ENGINE_SETTINGS };
+ }
+}
+
+export function saveEngineSettings(settings: EngineSettings): void {
+ try {
+ localStorage.setItem(ENGINE_KEY, JSON.stringify(settings));
+ } catch {
+ /* A full or disabled localStorage costs the user the saved paths, not the
+ session: the values they just typed are still in the fields. */
+ }
+}
+
+/** The `vidfab` provider setting these paths describe, with blanks dropped so
+ * an unset field falls through to whatever the project (or the Rust default)
+ * already had rather than overwriting it with "". */
+export function engineProviderSetting(settings: EngineSettings, base?: ProviderSetting): ProviderSetting {
+ const options: ProviderSetting["options"] = { ...(base?.options ?? {}) };
+ for (const field of ENGINE_PATH_FIELDS) {
+ const value = settings[field.id].trim();
+ if (value) options[field.id] = value;
+ }
+ return { enabled: base?.enabled ?? true, model: base?.model ?? null, options };
+}
+
+/** A copy of `config` carrying this machine's engine paths. For passing to a
+ * Tauri command only — never store or save the result. */
+export function withEngineSettings(config: ProjectConfig): ProjectConfig {
+ return {
+ ...config,
+ providerSettings: {
+ ...config.providerSettings,
+ vidfab: engineProviderSetting(loadEngineSettings(), config.providerSettings.vidfab),
+ },
+ };
+}
+
+/* --- Agent provider -------------------------------------------------------- */
+
+/* Which coding agent drives Pol is a property of the computer — it depends on
+ * what is installed and signed in here — so it is remembered across restarts
+ * next to the engine paths, not inside a project file. Projects written before
+ * this existed still carry their own choice; that is read as a seed the first
+ * time and then this preference takes over. */
+const AGENT_PROVIDER_KEY = "polstudio.agent-provider.v1";
+
+export function loadAgentProvider(): ProviderId | null {
+ try {
+ const value = localStorage.getItem(AGENT_PROVIDER_KEY);
+ return value === "claude" || value === "codex" ? value : null;
+ } catch {
+ return null;
+ }
+}
+
+export function saveAgentProvider(provider: ProviderId): void {
+ try {
+ localStorage.setItem(AGENT_PROVIDER_KEY, provider);
+ } catch {
+ /* Losing the preference costs a dropdown click next launch, nothing more. */
+ }
+}
diff --git a/src/styles/controls.css b/src/styles/controls.css
index 8cff181..e9e2962 100644
--- a/src/styles/controls.css
+++ b/src/styles/controls.css
@@ -170,26 +170,6 @@
letter-spacing: var(--tracking-label);
}
-.storage-pill {
- display: inline-flex;
- gap: var(--space-2);
- align-items: center;
- min-height: var(--control-sm);
- color: var(--text-muted);
- font: var(--weight-medium) var(--text-xs) / var(--leading-snug) var(--font-sans);
- border: 1px solid var(--line);
- border-radius: var(--radius-pill);
- padding: var(--space-2) var(--space-3);
-}
-
-.storage-pill i {
- width: 6px;
- height: 6px;
- border-radius: 50%;
- background: var(--success);
- box-shadow: 0 0 8px rgba(110, 207, 149, 0.6);
-}
-
/* --- Back link ------------------------------------------------------------- */
.back-link {
diff --git a/src/styles/library.css b/src/styles/library.css
index 2023af8..3b13d31 100644
--- a/src/styles/library.css
+++ b/src/styles/library.css
@@ -9,15 +9,15 @@
========================================================================== */
.library {
- grid-column: 2;
min-width: 0;
}
+/* The brand sits at the left of this row now that there is no rail to hold it.
+ The gap between it and the controls is where the row's spare width goes. */
.library__topbar {
height: var(--topbar-height);
display: flex;
align-items: center;
- justify-content: flex-end;
gap: var(--space-3);
padding: 0 var(--space-6);
border-bottom: 1px solid var(--line);
@@ -25,45 +25,15 @@
backdrop-filter: blur(16px);
}
+.library__topbar .search-field {
+ margin-left: auto;
+}
+
.library__content {
width: min(var(--content-max), calc(100% - var(--space-9)));
margin: 0 auto;
- padding: var(--space-8) 0;
-}
-
-.library__intro {
- display: flex;
- justify-content: space-between;
- align-items: flex-end;
- gap: var(--space-5);
- margin-bottom: var(--space-6);
-}
-
-.library__intro h1 {
- margin: var(--space-2) 0 var(--space-3);
- font-size: var(--text-3xl);
- font-weight: var(--weight-medium);
- line-height: var(--leading-tight);
- letter-spacing: var(--tracking-hero);
-}
-
-.library__intro > div > p:last-child {
- max-width: 62ch;
- margin: 0;
- color: var(--text-muted);
- font-size: var(--text-base);
- line-height: var(--leading-normal);
-}
-
-/* One plain-English reassurance, not a strip of developer trivia. */
-.library__footer {
- max-width: 70ch;
- margin-top: var(--space-8);
- padding-top: var(--space-4);
- border-top: 1px solid var(--line);
- color: var(--text-muted);
- font-size: var(--text-xs);
- line-height: var(--leading-normal);
+ /* Bottom padding clears the fixed settings launcher. */
+ padding: var(--space-7) 0 var(--space-9);
}
/* --- Prompt composer ------------------------------------------------------- */
@@ -100,21 +70,13 @@
}
.composer-heading h2 {
- margin: var(--space-3) 0 var(--space-2);
+ margin: var(--space-3) 0 var(--space-5);
font-size: var(--text-xl);
font-weight: var(--weight-semibold);
line-height: var(--leading-tight);
letter-spacing: var(--tracking-tight);
}
-.composer-heading p {
- max-width: 68ch;
- margin: 0 0 var(--space-5);
- color: var(--text-muted);
- font-size: var(--text-base);
- line-height: var(--leading-normal);
-}
-
.composer {
position: relative;
border: 1px solid rgba(114, 139, 218, 0.27);
@@ -374,26 +336,11 @@
text-align: center;
}
-.composer__hint {
- margin-left: auto;
- display: inline-flex;
- align-items: center;
- gap: var(--space-1);
- color: var(--text-muted);
- font-size: var(--text-xs);
-}
-
-.composer__hint kbd {
- padding: var(--space-1) var(--space-2);
- border: 1px solid var(--line);
- border-radius: var(--radius-xs);
- color: var(--text-secondary);
- font: var(--weight-medium) var(--text-2xs) / 1 var(--font-mono);
-}
-
-/* Inherits the app's hero CTA from controls.css; only the fit is local. */
+/* Inherits the app's hero CTA from controls.css; only the fit is local. The
+ auto margin was the hint's job before the hint moved onto this button. */
.composer__submit {
flex: 0 0 auto;
+ margin-left: auto;
font-size: var(--text-base);
}
@@ -890,10 +837,6 @@
/* --- Responsive ------------------------------------------------------------ */
@media (max-width: 900px) {
- .library {
- grid-column: 2;
- }
-
.library__content {
width: calc(100% - var(--space-6));
}
@@ -908,10 +851,6 @@
}
@media (max-width: 650px) {
- .library {
- grid-column: 1;
- }
-
.library__topbar {
padding: 0 var(--space-4);
}
@@ -920,14 +859,6 @@
padding-top: var(--space-6);
}
- .library__intro {
- align-items: flex-start;
- }
-
- .storage-pill {
- margin-top: var(--space-3);
- }
-
.project-grid {
grid-template-columns: 1fr;
}
@@ -956,10 +887,6 @@
padding: var(--space-3) var(--space-4);
}
- .composer__hint {
- display: none;
- }
-
.composer__submit {
flex: 1 1 auto;
}
diff --git a/src/styles/shell.css b/src/styles/shell.css
index 5584512..e75a003 100644
--- a/src/styles/shell.css
+++ b/src/styles/shell.css
@@ -1,172 +1,16 @@
/* ============================================================================
- shell.css — application frame: grid shell, sidebar, brand mark, placeholders.
+ shell.css — application frame: grid shell, brand mark, settings surface.
========================================================================== */
.app-shell {
display: grid;
- grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
+ grid-template-columns: minmax(0, 1fr);
min-height: 100vh;
background:
radial-gradient(circle at 72% -20%, rgba(49, 76, 153, 0.11), transparent 37%),
var(--bg);
}
-/* --- Sidebar --------------------------------------------------------------- */
-
-.sidebar {
- position: fixed;
- z-index: 20;
- inset: 0 auto 0 0;
- width: var(--sidebar-width);
- padding: var(--space-5) var(--space-4) var(--space-4);
- display: flex;
- flex-direction: column;
- border-right: 1px solid var(--line);
- background: rgba(9, 11, 16, 0.96);
-}
-
-.sidebar__nav {
- margin-top: var(--space-6);
-}
-
-.sidebar__label {
- padding: 0 var(--space-3);
- margin: 0 0 var(--space-3);
- color: var(--text-faint);
- font-size: var(--text-xs);
- font-weight: var(--weight-bold);
- line-height: var(--leading-snug);
- letter-spacing: var(--tracking-label);
- text-transform: uppercase;
-}
-
-.nav-item,
-.utility-button {
- width: 100%;
- border: 0;
- background: transparent;
- display: flex;
- align-items: center;
- text-align: left;
- color: var(--text-muted);
-}
-
-.nav-item {
- position: relative;
- height: var(--control-lg);
- border-radius: var(--radius-md);
- gap: var(--space-3);
- padding: 0 var(--space-3);
- margin-bottom: var(--space-1);
- font-size: var(--text-base);
- font-weight: var(--weight-semibold);
- line-height: var(--leading-snug);
- transition: 0.18s ease;
-}
-
-.nav-item:hover {
- color: var(--text-secondary);
- background: rgba(255, 255, 255, 0.035);
-}
-
-.nav-item--active {
- color: var(--text-primary);
- background: linear-gradient(
- 90deg,
- rgba(60, 105, 239, 0.19),
- rgba(60, 105, 239, 0.075)
- );
- box-shadow: inset 2px 0 var(--accent-bright);
-}
-
-.nav-item__badge {
- margin-left: auto;
- color: var(--accent-bright);
- font: var(--weight-semibold) var(--text-2xs) / 1 var(--font-mono);
- border: 1px solid rgba(85, 124, 245, 0.3);
- background: rgba(50, 87, 199, 0.13);
- padding: var(--space-1) var(--space-2);
- border-radius: var(--radius-xs);
-}
-
-.sidebar__status {
- margin: auto var(--space-1) var(--space-5);
- padding: var(--space-3);
- border: 1px solid var(--line);
- border-radius: var(--radius-lg);
- display: flex;
- gap: var(--space-3);
- align-items: center;
- background: linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent);
-}
-
-.sidebar__status-icon {
- width: var(--control-md);
- height: var(--control-md);
- flex: 0 0 auto;
- display: grid;
- place-items: center;
- border-radius: var(--radius-md);
- color: var(--accent-bright);
- background: rgba(58, 99, 224, 0.13);
-}
-
-.sidebar__status strong,
-.sidebar__status span {
- display: block;
-}
-
-.sidebar__status strong {
- font-size: var(--text-base);
- font-weight: var(--weight-semibold);
- line-height: var(--leading-snug);
- color: var(--text-primary);
-}
-
-.sidebar__status span {
- margin-top: var(--space-1);
- font-size: var(--text-sm);
- line-height: var(--leading-snug);
- color: var(--text-muted);
-}
-
-.sidebar__bottom {
- border-top: 1px solid var(--line);
- padding-top: var(--space-3);
-}
-
-.utility-button {
- min-height: var(--control-md);
- gap: var(--space-3);
- padding: var(--space-2) var(--space-3);
- font-size: var(--text-base);
- font-weight: var(--weight-medium);
- line-height: var(--leading-snug);
- border-radius: var(--radius-sm);
-}
-
-.utility-button:hover:not(:disabled) {
- color: var(--text-secondary);
- background: rgba(255, 255, 255, 0.03);
-}
-
-/* Not built yet — greyed out and labelled rather than pretending to work. */
-.utility-button:disabled {
- color: var(--text-faint);
- background: transparent;
-}
-
-.utility-button__soon {
- margin-left: auto;
- padding: var(--space-1) var(--space-2);
- border: 1px solid var(--line);
- border-radius: var(--radius-xs);
- color: var(--text-faint);
- font: var(--weight-medium) var(--text-2xs) / 1 var(--font-mono);
- letter-spacing: var(--tracking-label);
- text-transform: uppercase;
-}
-
/* --- Brand ----------------------------------------------------------------- */
.brand {
@@ -196,10 +40,14 @@
/* --- Logo mark (decorative artwork — proportions preserved) ----------------- */
/* No plate behind the mark: it sits directly on whatever surface hosts it —
- the sidebar and the composer, both near-black. The wordmark therefore takes
- the app's own text colour rather than the ink-on-white it used to need. */
+ the topbar and the composer, both near-black. The wordmark therefore takes
+ the app's own text colour rather than the ink-on-white it used to need.
+
+ Every horizontal size here is intrinsic. The ticket used to be a fixed 51px
+ while "PolS" only measures ~36px, so the mark carried ~15px of dead blue
+ between the S and the wordmark; the box around it was fixed too, adding more
+ dead space on the right. Both now size to the artwork. */
.pol-logo {
- width: 114px;
height: 29px;
flex: 0 0 auto;
display: inline-flex;
@@ -214,9 +62,9 @@
.pol-logo__ticket {
position: relative;
z-index: 1;
- width: 51px;
height: 21px;
- flex: 0 0 51px;
+ flex: 0 0 auto;
+ padding-right: var(--space-1);
display: flex;
align-items: center;
border-radius: 4px 1px 1px 4px;
@@ -229,10 +77,10 @@
content: "";
position: absolute;
z-index: -1;
- width: 15px;
- height: 15px;
- right: -7px;
- top: 3px;
+ width: 13px;
+ height: 13px;
+ right: -6px;
+ top: 4px;
border-radius: 2px;
background: linear-gradient(135deg, #075be3, #153bc5);
transform: rotate(45deg);
@@ -271,6 +119,7 @@
position: relative;
z-index: 2;
margin-left: var(--space-2);
+ padding-left: 1px;
color: var(--text-primary);
font-size: var(--text-md);
font-weight: var(--weight-bold);
@@ -280,189 +129,285 @@
/* Compact mark: the ticket only. Scaled so the wordmark clears the 12px floor. */
.pol-logo--compact {
- width: 51px;
height: 29px;
padding: 4px 5px;
}
-.pol-logo--compact .pol-logo__ticket {
- width: 40px;
- flex-basis: 40px;
-}
-
.pol-logo--compact .pol-logo__pols {
font-size: var(--text-2xs);
letter-spacing: -1.1px;
}
-/* --- Placeholder views ----------------------------------------------------- */
+/* --- Settings launcher ------------------------------------------------------
+ Fixed bottom-left in every view, project editor included: the engine paths
+ behind it are what makes generation work at all, and finding out they are
+ wrong happens inside a project. It sits above the agent dock, which is why
+ the dock reserves room for it (see .agent-dock-wrap in workspace.css). */
-.placeholder-view {
- grid-column: 2;
- min-height: 100vh;
- padding: var(--space-7);
- background: radial-gradient(
- circle at 50% 30%,
- rgba(51, 82, 177, 0.12),
- transparent 35%
- );
+.settings-launcher {
+ position: fixed;
+ z-index: 40;
+ left: var(--space-4);
+ bottom: var(--space-4);
+ min-height: var(--control-sm);
+ display: inline-flex;
+ align-items: center;
+ gap: var(--space-2);
+ padding: 0 var(--space-3);
+ border: 1px solid var(--line-strong);
+ border-radius: var(--radius-pill);
+ color: var(--text-muted);
+ background: rgba(13, 16, 22, 0.92);
+ backdrop-filter: blur(12px);
+ font-size: var(--text-sm);
+ font-weight: var(--weight-semibold);
+ line-height: var(--leading-snug);
+ box-shadow: var(--shadow-sm);
+ transition: 0.16s ease;
}
-.placeholder-view__card {
- width: min(620px, 100%);
- margin: clamp(var(--space-7), 9vh, var(--space-9)) auto 0;
- text-align: center;
+.settings-launcher:hover {
+ color: var(--text-primary);
+ border-color: rgba(107, 141, 255, 0.4);
+ background: rgba(20, 26, 40, 0.96);
}
-.placeholder-view__card > span {
- width: var(--space-9);
- height: var(--space-9);
- margin: 0 auto var(--space-5);
- display: grid;
- place-items: center;
- color: var(--accent-bright);
- border: 1px solid rgba(91, 126, 231, 0.27);
+/* --- Settings ---------------------------------------------------------------
+ An overlay rather than a route: opening it from inside a project must not
+ unmount the editor and throw away unsaved edits. */
+
+.settings-overlay {
+ position: fixed;
+ z-index: 60;
+ inset: 0;
+ overflow-y: auto;
+ padding: var(--space-7) var(--space-5);
+ background: rgba(4, 6, 10, 0.72);
+ backdrop-filter: blur(10px);
+}
+
+.settings-view {
+ width: min(880px, 100%);
+ margin: 0 auto;
+ padding: var(--space-6);
+ border: 1px solid var(--line-strong);
border-radius: var(--radius-xl);
- background: rgba(44, 76, 177, 0.13);
+ background: var(--panel);
+ box-shadow: var(--shadow);
}
-.placeholder-view__card h1 {
+.settings-view__head {
+ display: flex;
+ align-items: flex-start;
+ justify-content: space-between;
+ gap: var(--space-4);
+}
+
+.settings-view__head h1 {
+ margin: var(--space-2) 0 0;
font-size: var(--text-2xl);
font-weight: var(--weight-semibold);
+ line-height: var(--leading-tight);
letter-spacing: var(--tracking-hero);
- margin: var(--space-2) 0 var(--space-3);
}
-.placeholder-view__card > p:not(.eyebrow) {
- color: var(--text-secondary);
+.settings-view__lead {
+ max-width: 70ch;
+ margin: var(--space-4) 0 var(--space-5);
+ color: var(--text-muted);
font-size: var(--text-base);
- line-height: var(--leading-relaxed);
- margin: 0 auto var(--space-5);
- max-width: 480px;
-}
-
-/* The route is project-scoped: spell out how to actually get there. */
-.placeholder-view__steps {
- max-width: 480px;
- margin: 0 auto var(--space-5);
- padding: var(--space-4) var(--space-5);
- list-style: none;
- counter-reset: placeholder-step;
- text-align: left;
+ line-height: var(--leading-normal);
+}
+
+.settings-status {
+ padding: var(--space-4);
border: 1px solid var(--line);
border-radius: var(--radius-lg);
background: rgba(255, 255, 255, 0.02);
}
-.placeholder-view__steps li {
- display: grid;
- grid-template-columns: var(--space-5) minmax(0, 1fr);
- align-items: start;
- gap: var(--space-1) var(--space-3);
- counter-increment: placeholder-step;
+.settings-status span {
+ display: flex;
+ align-items: center;
+ gap: var(--space-2);
+ color: var(--text-primary);
+ font-size: var(--text-base);
+ font-weight: var(--weight-semibold);
+ line-height: var(--leading-snug);
}
-.placeholder-view__steps li + li {
- margin-top: var(--space-4);
- padding-top: var(--space-4);
+.settings-status i {
+ width: 9px;
+ height: 9px;
+ flex: 0 0 auto;
+ border-radius: 50%;
+ background: var(--text-faint);
+}
+
+.settings-status p {
+ margin: var(--space-2) 0 0;
+ color: var(--text-muted);
+ font-size: var(--text-sm);
+ line-height: var(--leading-normal);
+}
+
+.settings-status--ready {
+ border-color: rgba(110, 207, 149, 0.3);
+ background: rgba(110, 207, 149, 0.07);
+}
+
+.settings-status--ready i {
+ background: var(--success);
+}
+
+.settings-status--modelsMissing i,
+.settings-status--incompatible i {
+ background: var(--warning);
+}
+
+.settings-status--runtimeMissing i {
+ background: var(--danger);
+}
+
+.settings-section {
+ margin-top: var(--space-6);
+}
+
+.settings-section h2 {
+ margin: 0 0 var(--space-4);
+ font-size: var(--text-md);
+ font-weight: var(--weight-semibold);
+ line-height: var(--leading-snug);
+ letter-spacing: var(--tracking-tight);
+}
+
+.settings-path {
+ padding: var(--space-4) 0;
border-top: 1px solid var(--line);
}
-.placeholder-view__steps li::before {
- content: counter(placeholder-step);
- grid-row: 1 / span 2;
- width: var(--space-5);
- height: var(--space-5);
- display: grid;
- place-items: center;
- border-radius: 50%;
- color: var(--accent-bright);
- background: var(--accent-soft);
- font: var(--weight-bold) var(--text-2xs) / 1 var(--font-mono);
+.settings-path label {
+ display: block;
+ cursor: pointer;
}
-.placeholder-view__steps b {
+.settings-path label b {
+ display: flex;
+ align-items: center;
+ gap: var(--space-2);
color: var(--text-primary);
font-size: var(--text-base);
font-weight: var(--weight-semibold);
line-height: var(--leading-snug);
}
-.placeholder-view__steps span {
+/* "Optional" is a qualifier on the label, not a status — keep it quiet. */
+.settings-path label b em {
+ padding: var(--space-1) var(--space-2);
+ border: 1px solid var(--line);
+ border-radius: var(--radius-xs);
+ color: var(--text-faint);
+ font: var(--weight-medium) var(--text-2xs) / 1 var(--font-mono);
+ letter-spacing: var(--tracking-label);
+ font-style: normal;
+ text-transform: uppercase;
+}
+
+.settings-path label small {
+ display: block;
+ margin-top: var(--space-1);
color: var(--text-muted);
- font-size: var(--text-base);
+ font-size: var(--text-sm);
line-height: var(--leading-normal);
}
-/* --- Responsive ------------------------------------------------------------ */
+.settings-path__row {
+ margin-top: var(--space-3);
+ display: flex;
+ gap: var(--space-2);
+}
-@media (max-width: 900px) {
- .app-shell {
- grid-template-columns: 88px minmax(0, 1fr);
- }
+.settings-path__row input {
+ flex: 1 1 auto;
+ min-width: 0;
+ height: var(--field-height);
+ padding: 0 var(--space-3);
+ border: 1px solid var(--line-strong);
+ border-radius: var(--radius-sm);
+ color: var(--text-primary);
+ background: rgba(7, 9, 14, 0.72);
+ font: var(--weight-regular) var(--text-sm) / 1 var(--font-mono);
+}
- .sidebar {
- width: 88px;
- padding-inline: var(--space-2);
- }
+.settings-path__row .secondary-button {
+ flex: 0 0 auto;
+}
- .brand {
- padding: 0;
- justify-content: center;
- }
+.settings-path__state {
+ margin-top: var(--space-2);
+ display: inline-flex;
+ align-items: center;
+ gap: var(--space-1);
+ color: var(--text-faint);
+ font-size: var(--text-xs);
+ line-height: var(--leading-snug);
+}
- /* Swap to the ticket-only mark instead of clipping the wordmark. */
- .brand .pol-logo {
- width: 51px;
- }
+.settings-path--found .settings-path__state {
+ color: var(--success);
+}
- .brand .pol-logo__ticket {
- width: 40px;
- flex-basis: 40px;
- }
+.settings-path--missing .settings-path__state {
+ color: var(--danger);
+}
- .brand .pol-logo__pols {
- font-size: var(--text-2xs);
- letter-spacing: -1.1px;
- }
+.settings-path--missing .settings-path__row input {
+ border-color: rgba(236, 125, 134, 0.45);
+}
- .brand .pol-logo__tudio {
- display: none;
- }
+.settings-view__foot {
+ margin-top: var(--space-6);
+ padding-top: var(--space-4);
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: var(--space-4);
+ border-top: 1px solid var(--line);
+}
- .brand__edition,
- .sidebar__label,
- .nav-item span:not(.nav-item__badge),
- .sidebar__status,
- .sidebar__bottom {
- display: none;
+.settings-view__foot span {
+ color: var(--text-faint);
+ font-size: var(--text-xs);
+ line-height: var(--leading-snug);
+}
+
+/* --- Responsive ------------------------------------------------------------ */
+
+@media (max-width: 650px) {
+ .settings-overlay {
+ padding: var(--space-4) var(--space-3);
}
- .nav-item {
- justify-content: center;
- padding: 0;
+ .settings-view {
+ padding: var(--space-5) var(--space-4);
}
- .nav-item__badge {
- position: absolute;
- top: var(--space-1);
- right: var(--space-1);
- margin: 0;
- padding: 1px var(--space-1);
+ .settings-path__row {
+ flex-direction: column;
}
-}
-@media (max-width: 650px) {
- .app-shell {
- display: block;
+ .settings-view__foot {
+ flex-direction: column;
+ align-items: flex-start;
}
- .sidebar {
+ /* The launcher shares the bottom edge with the agent dock on small windows,
+ so it drops to the mark alone rather than stacking on top of it. */
+ .settings-launcher span {
display: none;
}
- .placeholder-view {
- grid-column: 1;
- padding: var(--space-5);
+ .settings-launcher {
+ padding: 0 var(--space-2);
}
}
diff --git a/src/styles/timeline.css b/src/styles/timeline.css
index 3caf62c..901bcd0 100644
--- a/src/styles/timeline.css
+++ b/src/styles/timeline.css
@@ -483,19 +483,6 @@
font: var(--weight-medium) var(--text-xs) / 1 var(--font-mono);
}
-/* Sits under the transport rather than inside it, so the 1fr/auto/1fr row keeps
- its layout. The transport's title tooltips do fire on their disabled buttons
- in Chromium, but only for a mouse — this is the explanation everyone else
- gets. */
-.transport-note {
- margin: 0;
- padding: 0 var(--space-4) var(--space-3);
- color: var(--text-muted);
- font-size: var(--text-xs);
- line-height: var(--leading-snug);
- background: var(--panel);
-}
-
/* --- Clip inspector -------------------------------------------------------- */
.inspector-summary {
diff --git a/src/styles/tokens.css b/src/styles/tokens.css
index 968dea1..9345e17 100644
--- a/src/styles/tokens.css
+++ b/src/styles/tokens.css
@@ -83,7 +83,6 @@
--field-height: 40px; /* text inputs, selects */
/* --- Layout ------------------------------------------------------------- */
- --sidebar-width: 252px;
--topbar-height: 72px;
--content-max: 1180px;
diff --git a/src/styles/workspace.css b/src/styles/workspace.css
index e140a85..3008393 100644
--- a/src/styles/workspace.css
+++ b/src/styles/workspace.css
@@ -15,16 +15,21 @@
overflow: hidden;
display: grid;
grid-template-columns: minmax(0, 1fr);
- grid-template-rows: var(--topbar-height) 56px minmax(0, 1fr) 80px;
+ grid-template-rows: var(--topbar-height) minmax(0, 1fr) 80px;
color: var(--text-secondary);
background: #080a0e;
}
/* --- Topbar ---------------------------------------------------------------- */
+/* Three columns, not a flex row: the tabs are centred on the WINDOW rather
+ than on whatever space the project name and the actions happen to leave, so
+ they do not drift sideways as the name gets longer. The outer two columns
+ are equal and elastic; the name inside the left one truncates. */
.project-topbar {
min-width: 0;
- display: flex;
+ display: grid;
+ grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
align-items: center;
gap: var(--space-3);
padding: 0 var(--space-4);
@@ -32,8 +37,14 @@
background: var(--panel);
}
-/* The title is the only elastic column in the topbar: it gives its width up
- first so the save state and the actions never have to squash. */
+.project-topbar__lead {
+ min-width: 0;
+ display: flex;
+ align-items: center;
+ gap: var(--space-3);
+}
+
+/* The title gives its width up first so the tabs and the actions never squash. */
.project-title {
flex: 0 1 320px;
min-width: 0;
@@ -65,48 +76,6 @@
line-height: var(--leading-snug);
}
-/* Save feedback is the one piece of state the user needs at a glance. */
-.save-state {
- flex: 0 0 auto;
- margin: 0;
- min-height: var(--control-sm);
- display: inline-flex;
- align-items: center;
- gap: var(--space-2);
- padding: 0 var(--space-3);
- border: 1px solid var(--line);
- border-radius: var(--radius-pill);
- font-size: var(--text-sm);
- font-weight: var(--weight-semibold);
- line-height: var(--leading-snug);
- white-space: nowrap;
-}
-
-.save-state i {
- width: 8px;
- height: 8px;
- flex: 0 0 auto;
- border-radius: 50%;
-}
-
-.save-state--saved {
- color: var(--text-secondary);
-}
-
-.save-state--saved i {
- background: var(--success);
-}
-
-.save-state--dirty {
- color: var(--warning);
- border-color: rgba(227, 168, 98, 0.35);
- background: rgba(227, 168, 98, 0.08);
-}
-
-.save-state--dirty i {
- background: var(--warning);
-}
-
/* Never let the action buttons shrink — a squashed Save is worse than a
shortened project name. `margin-left: auto` still eats any spare width. */
.project-topbar__actions {
@@ -137,48 +106,37 @@
text-transform: uppercase;
}
-/* --- View navigation ------------------------------------------------------- */
+/* --- View navigation --------------------------------------------------------
+ The tabs used to own a 56px band under the topbar, alongside a read-out of
+ the project's aspect ratio, resolution and frame rate. Both are gone: the
+ tabs are a segmented control in the middle column of the topbar, and the
+ format numbers live in the project's settings and on the program monitor. */
.project-nav {
+ justify-self: center;
min-width: 0;
display: flex;
- align-items: center;
- padding: 0 var(--space-5) 0 var(--space-8);
- border-bottom: 1px solid #262934;
- background: #0b0e13;
-}
-
-/* Safety net: if the three tabs ever out-measure the row they scroll inside it
- rather than widening the shell. The scrollbar is suppressed because the row
- is only 56px tall — at every supported width the tabs simply fit. */
-.project-nav > div {
- min-width: 0;
- height: 100%;
- display: flex;
gap: var(--space-1);
- overflow-x: auto;
- overflow-y: hidden;
- scrollbar-width: none;
-}
-
-.project-nav > div::-webkit-scrollbar {
- display: none;
+ padding: var(--space-1);
+ border: 1px solid var(--line);
+ border-radius: var(--radius-lg);
+ background: rgba(255, 255, 255, 0.025);
}
.project-nav button {
position: relative;
- height: 100%;
- min-height: var(--control-lg);
- min-width: 136px;
+ min-height: var(--control-sm);
+ min-width: 128px;
padding: 0 var(--space-4);
display: flex;
align-items: center;
justify-content: center;
gap: var(--space-2);
border: 0;
+ border-radius: var(--radius-md);
color: var(--text-muted);
background: transparent;
- font-size: var(--text-base);
+ font-size: var(--text-sm);
font-weight: var(--weight-semibold);
line-height: var(--leading-snug);
white-space: nowrap;
@@ -191,25 +149,16 @@
.project-nav button:hover {
color: var(--text-secondary);
- background: rgba(255, 255, 255, 0.03);
+ background: rgba(255, 255, 255, 0.04);
}
.project-nav button.active {
color: var(--text-primary);
- background: rgba(60, 105, 239, 0.09);
-}
-
-.project-nav button.active::after {
- content: "";
- position: absolute;
- height: 3px;
- /* Sits at bottom 0, not -1px, so the tab strip's scroll container cannot
- clip it. */
- inset: auto var(--space-3) 0;
- border-radius: 3px 3px 0 0;
- background: var(--accent-bright);
+ background: rgba(60, 105, 239, 0.22);
+ box-shadow: inset 0 0 0 1px rgba(107, 141, 255, 0.28);
}
+/* Running-generation count. */
.project-nav button span {
flex: 0 0 auto;
min-width: 22px;
@@ -221,21 +170,6 @@
font: var(--weight-medium) var(--text-2xs) / 1.4 var(--font-mono);
}
-/* Reference info, not a control: it truncates before the tabs give ground, and
- disappears entirely on the narrowest windows. The full value stays in the
- title attribute and in project settings. */
-.project-nav__meta {
- flex: 0 1 auto;
- min-width: 0;
- margin-left: auto;
- padding-left: var(--space-4);
- color: var(--text-muted);
- font: var(--weight-medium) var(--text-xs) / var(--leading-snug) var(--font-mono);
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
/* --- Content region -------------------------------------------------------- */
/* The chrome (topbar, nav, agent dock) stays put while the active view scrolls.
@@ -262,9 +196,13 @@
box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.2);
}
+/* The settings launcher is fixed over the bottom-left corner, which is this
+ row. The dock stays CENTRED and gives up width instead of shifting right —
+ an off-centre dock reads as a layout bug, a narrower one does not. 256px is
+ twice the launcher's widest measure, so the reserve is symmetric. */
.agent-dock-wrap {
position: relative;
- width: min(880px, calc(100% - var(--space-7)));
+ width: min(880px, calc(100% - 256px));
}
.agent-dock {
@@ -326,17 +264,6 @@
white-space: nowrap;
}
-.agent-dock__hint {
- flex: 0 0 auto;
- display: flex;
- align-items: center;
- gap: var(--space-1);
- color: var(--text-faint);
- font-size: var(--text-xs);
- line-height: var(--leading-snug);
- white-space: nowrap;
-}
-
/* Says what is wrong and what the user can do, instead of a silent dead input. */
.agent-dock__blocked {
flex: 0 0 auto;
@@ -513,9 +440,9 @@
/* The window minimum is 900px (tauri.conf.json), so the chrome has to reach
900px with nothing clipped and nothing scrolling sideways. Each step spends
- the width it frees on the elements that carry the least information:
- the project name column shortens first, then the row padding and the
- keyboard hint, and only at the very bottom does the format read-out go. */
+ the width it frees on the elements that carry the least information: the
+ project name column shortens first, then the row padding, and only at the
+ very bottom do the tabs tighten. */
@media (max-width: 1180px) {
.project-topbar {
@@ -526,12 +453,8 @@
max-width: 240px;
}
- .project-nav {
- padding-left: var(--space-5);
- }
-
.project-nav button {
- min-width: 120px;
+ min-width: 116px;
padding: 0 var(--space-3);
}
@@ -549,30 +472,18 @@
max-width: 176px;
}
- .project-nav {
- padding-inline: var(--space-3);
- }
-
.project-nav button {
- min-width: 104px;
- }
-
- .project-nav__meta {
- padding-left: var(--space-3);
+ min-width: 96px;
}
.project-agent-row {
padding-inline: var(--space-3);
}
- /* The dock stops being a centred 880px island and just uses the row. */
+ /* The dock stops being an 880px island and takes what the row has left
+ after the settings launcher's reserve. */
.agent-dock-wrap {
- width: 100%;
- }
-
- /* Enter still sends — the hint is the reminder, not the mechanism. */
- .agent-dock__hint {
- display: none;
+ width: calc(100% - 256px);
}
.agent-dock__blocked {
@@ -585,15 +496,13 @@
max-width: 160px;
}
+ /* Tabs shed their labels before they shed their reachability: the icon and
+ the aria-current state carry the view at this width. */
.project-nav button {
- min-width: 0;
+ min-width: var(--control-sm);
+ padding: 0 var(--space-3);
}
- /* Aspect ratio, resolution and frame rate stay one click away in project
- settings; the tabs are navigation and outrank them. */
- .project-nav__meta {
- display: none;
- }
.agent-dock__identity b {
display: none;