AI media harness for planning, generating, and editing locally
TypeScript
Open related items from the work queue
Bittiff15870eb045
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.mdindex 391edbd..7d344fe 100644--- a/RELEASE_NOTES.md+++ b/RELEASE_NOTES.md@@ -32,6 +32,7 @@ This alpha update adds LAN generation workers, Linux support, expanded color gra## Fixes and improvements+- Click a work queue job to open its image, scene, reference, generator download or export. Navigation works across projects and preserves unsaved project edits.- Updated the bundled SlopFab runtime to API 1.18 for refmod export and support for version-5 refmod bundles.- LAN workers select weight downloads using their own GPU type and VRAM, even when a different variant is already downloaded on the client.- Continue preserves the full joined video and audio from Slopfab. Adjacent source and continuation scenes use that shared decode in preview and export, preserving context across the cut. Regenerate older Continue scenes to apply the fix.diff --git a/src/App.tsx b/src/App.tsxindex 93d7fbf..f7eacce 100644--- a/src/App.tsx+++ b/src/App.tsx@@ -1,5 +1,5 @@import { WorkQueue, isWorkActive, projectQueueKey } from "./lib/workQueue";-import { WorkQueuePanel } from "./components/WorkQueuePanel";+import { WorkQueuePanel, type WorkQueueTarget } from "./components/WorkQueuePanel";import { ReferenceIconGenerationDialog } from "./components/ReferenceIconGenerationDialog";import { CudaSetupDialog } from "./components/CudaSetupDialog";import { ReleaseNotesDialog } from "./components/ReleaseNotesDialog";@@ -11,9 +11,9 @@ import { Add16, FolderOpen16, FolderOpen48, GridView16, GridView16Filled, ListViimport { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore, type KeyboardEvent, type RefObject } from "react";import { DeleteProjectDialog, canConfirmNatively, confirmProjectDeletionNatively } from "./components/DeleteProjectDialog";import { ProjectCard } from "./components/ProjectCard";-import { ProjectWorkspace, type ProjectView } from "./components/ProjectWorkspace";+import { ProjectWorkspace, type ProjectView, type WorkspaceNavigation } from "./components/ProjectWorkspace";import { PromptComposer } from "./components/PromptComposer";-import { SettingsView } from "./components/SettingsView";+import { SettingsView, type SettingsNavigation } from "./components/SettingsView";import { TitleBar } from "./components/TitleBar";import { UpdateInfoBar, UpdatePanel, updateNeedsAttention } from "./components/UpdatePanel";import { CommandBar, CommandBarButton, EmptyState, InfoBadge, InfoBar, TextField } from "./components/ui";@@ -62,6 +62,8 @@ function App() {useEffect(() => startWorkerDiscovery(), []);const [activeProject, setActiveProject] = useState<ProjectRecord | null>(null);const [activeProjectInitialView, setActiveProjectInitialView] = useState<ProjectView>("timeline");+ const [workspaceNavigation, setWorkspaceNavigation] = useState<WorkspaceNavigation>();+ const [settingsNavigation, setSettingsNavigation] = useState<SettingsNavigation>();const [loading, setLoading] = useState(true);const [busy, setBusy] = useState(false);const [query, setQuery] = useState("");@@ -115,6 +117,7 @@ function App() {const queueButton = useRef<HTMLButtonElement>(null);const settingsQueueButton = useRef<HTMLButtonElement>(null);const openSettings = (tab: "engine" | "updates" = "engine") => {+ setSettingsNavigation(undefined);setWorkQueueOpen(false);setSettingsInitialTab(tab);setSettingsOpen(true);@@ -204,12 +207,37 @@ function App() {const showLibraryHeading = projects.length > 0;const openProject = (project: ProjectRecord, view: ProjectView = project.config.generationType === "image" ? "editor" : "timeline") => {+ setWorkspaceNavigation(undefined);setWorkQueueOpen(false);setSelectedKey(projectQueueKey(project));setActiveProjectInitialView(view);setActiveProject(project);};+ const navigateFromQueue = (target: WorkQueueTarget) => {+ if (target.kind === "download") {+ openSettings();+ setSettingsNavigation({ templateId: target.download.templateId, loraId: target.download.loraId });+ return;+ }+ const record = target.kind === "work" ? workQueue.projectRecord(target.item.projectKey)+ : [activeProject, ...projects].find((record) => record?.folderPath === target.folderPath);+ if (!record) return;+ let navigation: WorkspaceNavigation = { view: "export" };+ if (target.kind === "work") {+ const item = target.item;+ if (item.kind === "image") {+ const imageId = [item.imageDraftId, item.id, item.imageAssetId].find((id) => record.config.assets.some((asset) => asset.kind === "image" && asset.id === id));+ navigation = { view: "editor", imageId: imageId ?? undefined };+ } else if (item.kind === "refmod" || item.kind === "reference-icons") {+ navigation = { view: "references", referenceId: item.sceneId };+ } else navigation = { view: "generator", sceneId: item.sceneId };+ }+ if (settingsOpen) { setSettingsOpen(false); setSettingsRevision((value) => value + 1); }+ openProject(record, navigation.view);+ setWorkspaceNavigation(navigation);+ };+const openFromFolder = async () => {setBusy(true);setError(null);@@ -306,7 +334,7 @@ function App() {useShortcut("Ctrl+F", () => { searchInput.current?.focus(); searchInput.current?.select(); }, { enabled: inLibrary, allowInInput: true });useShortcut("Alt+ArrowLeft", closeSettings, { enabled: settingsOpen });- const queueFlyout = <WorkQueuePanel queue={workQueue} items={workItems} open={workQueueOpen} anchor={settingsOpen ? settingsQueueButton : queueButton} onClose={() => setWorkQueueOpen(false)} />;+ const queueFlyout = <WorkQueuePanel queue={workQueue} items={workItems} open={workQueueOpen} anchor={settingsOpen ? settingsQueueButton : queueButton} onClose={() => setWorkQueueOpen(false)} onNavigate={navigateFromQueue} />;const releaseNotesDialog = releaseNotesOpen ? <ReleaseNotesDialog onClose={() => setReleaseNotesOpen(false)} /> : null;const cudaNotice = cudaDownload && !releaseNotesOpen && !settingsOpen && !workQueueOpen && !projectToDelete && !newProjectOpen? <CudaSetupDialog download={cudaDownload} onContinue={() => setCudaNoticeDismissed(true)} /> : null;@@ -334,7 +362,7 @@ function App() {its unsaved edits, the agent its draft, and the library its search. */const settingsPage = settingsOpen ? (<div className="app-screen">- <SettingsView onClose={closeSettings} updates={updatePanel} initialTab={settingsInitialTab} titleBarActions={queueTrigger(settingsQueueButton)} />+ <SettingsView onClose={closeSettings} updates={updatePanel} initialTab={settingsInitialTab} navigation={settingsNavigation} titleBarActions={queueTrigger(settingsQueueButton)} /></div>) : null;@@ -345,6 +373,8 @@ function App() {key={projectQueueKey(activeProject)}project={activeProject}initialView={activeProjectInitialView}+ navigation={workspaceNavigation}+ onNavigated={() => setWorkspaceNavigation(undefined)}runtime={runtime}workQueue={workQueue}active={!settingsOpen}diff --git a/src/WorkQueue.integration.test.tsx b/src/WorkQueue.integration.test.tsxindex ca6c15f..8de418c 100644--- a/src/WorkQueue.integration.test.tsx+++ b/src/WorkQueue.integration.test.tsx@@ -2,6 +2,7 @@import "@testing-library/jest-dom/vitest";import { act, cleanup, fireEvent, render, screen, waitFor, within } from "@testing-library/react";import { listen } from "@tauri-apps/api/event";+import { invoke } from "@tauri-apps/api/core";import { afterEach, beforeEach, expect, it, vi } from "vitest";import App from "./App";import { markReleaseNotesSeen } from "./lib/releaseNotes";@@ -12,9 +13,14 @@ import { enqueueSlopfabGeneration, type SlopfabStatus } from "./lib/runtime";import { loadReferenceIconAutomation } from "./lib/referenceIconSettings";import { reportGenerationJobs } from "./lib/nativeShell";import { getExportJob, resetExportJobForTests, setExportJobForTests } from "./lib/exportJob";+import { EMPTY_ENGINE_SETTINGS, minimaxOriginalTemplate, saveGeneratorTemplateSettings } from "./lib/settings";+import { getWeightDownloadState } from "./lib/weightDownloads";+import { createImageScene } from "./lib/imageScene";+import { saveLoras } from "./lib/loras";vi.mock("@tauri-apps/api/core", () => ({ invoke: vi.fn(async () => undefined) }));vi.mock("@tauri-apps/api/event", () => ({ listen: vi.fn() }));+vi.mock("./lib/weightDownloads", async (original) => ({ ...await original<typeof import("./lib/weightDownloads")>(), getWeightDownloadState: vi.fn(() => null), subscribeWeightDownloads: () => () => undefined }));vi.mock("./lib/nativeShell", async (original) => ({ ...await original<typeof import("./lib/nativeShell")>(), reportGenerationJobs: vi.fn(async () => undefined) }));vi.mock("./lib/generatedVideo", () => ({ saveGeneratedScene: vi.fn(), releaseRendered: vi.fn(async () => true) }));vi.mock("./lib/timelineThumbnails", async (original) => ({ ...await original<typeof import("./lib/timelineThumbnails")>(), purgeTimelineThumbnails: vi.fn(async () => undefined) }));@@ -28,6 +34,8 @@ vi.mock("./lib/runtime", async (original) => ({const handlers = new Map<string, (event: { payload: unknown }) => void>();beforeEach(() => {vi.clearAllMocks(); localStorage.clear(); handlers.clear();+ vi.mocked(getWeightDownloadState).mockReturnValue(null);+ vi.mocked(invoke).mockImplementation(async () => undefined);markReleaseNotesSeen();vi.spyOn(HTMLMediaElement.prototype, "load").mockImplementation(() => undefined);vi.mocked(listen).mockImplementation((async (name: string, handler: (event: { payload: unknown }) => void) => { handlers.set(name, handler); return () => handlers.delete(name); }) as unknown as typeof listen);@@ -83,6 +91,8 @@ it("keeps the application queue alive while switching projects and saves resultsfireEvent.click(screen.getByRole("button", { name: "Back to project library" }));expect(screen.queryByRole("dialog")).toBeNull();fireEvent.doubleClick(screen.getByRole("option", { name: "Second project" }));+ fireEvent.click(screen.getByRole("tab", { name: "Video" }));+ fireEvent.change(screen.getByRole("textbox", { name: "Rename First scene" }), { target: { value: "Unsaved second scene" } });// The title-bar button counts what is running or waiting.expect(screen.getByRole("button", { name: "Work queue" })).toHaveTextContent("2");fireEvent.click(screen.getByRole("button", { name: "Work queue" }));@@ -99,10 +109,92 @@ it("keeps the application queue alive while switching projects and saves resultsexpect(saveGeneratedScene).toHaveBeenCalledWith(expect.objectContaining({ jobId: workId, folderPath: first.folderPath }));expect(vi.mocked(reportGenerationJobs).mock.calls.some(([jobs]) => jobs.some((job) => job.running && job.title.includes("First project")))).toBe(true);expect(enqueueSlopfabGeneration).toHaveBeenCalledTimes(1);+ fireEvent.click(screen.getByRole("button", { name: "Settings" }));+ fireEvent.click(screen.getByRole("button", { name: "Work queue" }));+ fireEvent.click(screen.getByRole("button", { name: "Open First scene in First project" }));+ expect(screen.queryByRole("dialog", { name: "Work queue" })).toBeNull();+ expect(screen.queryByRole("main", { name: "Settings" })).toBeNull();+ expect(document.querySelector(".project-title")?.textContent).toBe("First project");+ expect(screen.getByRole("region", { name: "First scene" })).toHaveTextContent(/finished/i);+ expect(screen.getByRole("complementary", { name: "Scene: First scene" })).toBeInTheDocument();+ fireEvent.click(screen.getByRole("button", { name: "Work queue" }));+ fireEvent.click(screen.getByRole("button", { name: "Open Upcoming scene in First project" }));+ expect(screen.getByRole("complementary", { name: "Scene: Upcoming scene" })).toBeInTheDocument();fireEvent.click(screen.getByRole("button", { name: "Back to project library" }));- fireEvent.doubleClick(screen.getByRole("option", { name: "First project" }));+ fireEvent.doubleClick(screen.getByRole("option", { name: "Second project" }));fireEvent.click(screen.getByRole("tab", { name: "Video" }));- expect(screen.getByRole("region", { name: "First scene" })).toHaveTextContent(/finished/i);+ expect(screen.getByRole("textbox", { name: "Rename Unsaved second scene" })).toHaveValue("Unsaved second scene");+ expect(screen.getByRole("button", { name: "Save" })).toBeEnabled();+});++it("opens a download's generator from the queue even while another Settings tab is open", async () => {+ const template = minimaxOriginalTemplate();+ vi.mocked(getWeightDownloadState).mockReturnValue({ templateId: template.id, active: true, field: "transformer", downloaded: 5, total: 10, files: 4, completed: 0, error: null });+ vi.mocked(listRecentProjects).mockResolvedValue({ projects: [], unreadable: [] });+ render(<App />);+ await screen.findByRole("heading", { name: "No projects yet" });+ fireEvent.click(screen.getByRole("button", { name: "Settings" }));+ fireEvent.click(screen.getByRole("button", { name: "Appearance" }));+ fireEvent.click(screen.getByRole("button", { name: "Work queue" }));+ fireEvent.click(screen.getByRole("button", { name: `Open ${template.name} download` }));+ expect(screen.getByRole("textbox", { name: "Generator name" })).toHaveValue(template.name);+ expect(screen.queryByRole("dialog", { name: "Work queue" })).toBeNull();+});++it("opens a pending image and its completed result without restarting generation", async () => {+ saveGeneratorTemplateSettings({ defaultTemplateId: "test", templates: [{ id: "test", name: "Test", modelType: "minimax-h3", defaultSteps: 20, attention: "sage2", paths: { ...EMPTY_ENGINE_SETTINGS, transformer: "C:/h3.safetensors" } }] });+ const config = createProjectConfig({ name: "Pictures", generationType: "image", prompt: "A forest", aspectRatio: "1:1", resolution: "416p", targetDurationSeconds: 15 });+ config.imageScene = { ...createImageScene("A forest"), outputAssetId: "source" };+ config.assets = [{ id: "source", kind: "image", name: "Original", relativePath: "media/source.jpg", mimeType: "image/jpeg", createdAt: config.createdAt }];+ vi.mocked(listRecentProjects).mockResolvedValue({ projects: [{ folderPath: "C:/Pictures", config }], unreadable: [] });+ vi.mocked(invoke).mockImplementation(async (command) => command === "save_generated_image" ? { relativePath: "media/result.jpg", width: 416, height: 416 } : undefined);+ render(<App />);+ fireEvent.doubleClick(await screen.findByRole("option", { name: "Pictures" }));+ fireEvent.click(screen.getByRole("button", { name: "Generate" }));+ await waitFor(() => expect(enqueueSlopfabGeneration).toHaveBeenCalledTimes(1));+ const workId = vi.mocked(enqueueSlopfabGeneration).mock.calls[0][0].jobId;+ fireEvent.click(screen.getByRole("tab", { name: "Video" }));+ fireEvent.click(screen.getByRole("button", { name: "Work queue" }));+ fireEvent.click(screen.getByRole("button", { name: "Open Image · Pictures in Pictures" }));+ expect(screen.getByRole("button", { name: "View Original" })).toHaveAttribute("aria-pressed", "true");+ fireEvent.click(screen.getByRole("tab", { name: "Video" }));+ await act(async () => { handlers.get("slopfab-job")?.({ payload: { jobId: workId, state: "framesReady", detail: "Ready" } }); });+ await waitFor(() => expect(saveProject).toHaveBeenCalledWith(expect.objectContaining({ config: expect.objectContaining({ assets: expect.arrayContaining([expect.objectContaining({ id: workId })]) }) })));+ fireEvent.click(screen.getByRole("button", { name: "Work queue" }));+ fireEvent.click(screen.getByRole("button", { name: "Open Image · Pictures in Pictures" }));+ expect(document.querySelector(`[data-image-asset="${workId}"]`)).toHaveAttribute("aria-pressed", "true");+ expect(screen.getByRole("button", { name: "Back to all images" })).toBeInTheDocument();+ expect(enqueueSlopfabGeneration).toHaveBeenCalledTimes(1);+});++it("opens the matching LoRA for a standalone download", async () => {+ saveLoras([{ id: "adapter", name: "My adapter", path: "", url: "https://example.com/adapter.safetensors" }]);+ vi.mocked(getWeightDownloadState).mockReturnValue({ templateId: "", loraId: "adapter", name: "My adapter", active: true, field: null, downloaded: 5, total: 10, files: 1, completed: 0, error: null });+ vi.mocked(listRecentProjects).mockResolvedValue({ projects: [], unreadable: [] });+ render(<App />);+ await screen.findByRole("heading", { name: "No projects yet" });+ fireEvent.click(screen.getByRole("button", { name: "Work queue" }));+ fireEvent.click(screen.getByRole("button", { name: "Open My adapter download" }));+ expect(screen.getByRole("dialog", { name: "Edit LoRA" })).toBeInTheDocument();+ expect(screen.getByRole("textbox", { name: "LoRA name" })).toHaveValue("My adapter");+});++it("opens a running export's project and export tab from the library", async () => {+ const config = createProjectConfig({ name: "Exported film", prompt: "A forest", aspectRatio: "16:9", resolution: "416p", targetDurationSeconds: 15 });+ vi.mocked(listRecentProjects).mockResolvedValue({ projects: [{ folderPath: "C:/Exported film", config }], unreadable: [] });+ setExportJobForTests({ folderPath: "C:/Exported film", projectName: config.name, progress: { phase: "rendering", framesDone: 1, frameCount: 10, detail: "Rendering" } });+ render(<App />);+ await screen.findByRole("option", { name: "Exported film" });+ fireEvent.click(screen.getByRole("button", { name: "Work queue" }));+ fireEvent.click(screen.getByRole("button", { name: "Open Export Exported film" }));+ expect(screen.getByRole("tab", { name: "Export" })).toHaveAttribute("aria-selected", "true");+ expect(document.querySelector(".project-title")?.textContent).toBe("Exported film");+ expect(getExportJob().progress).not.toBeNull();+ fireEvent.click(within(screen.getByRole("tablist", { name: "Export type" })).getByRole("tab", { name: "Image" }));+ fireEvent.click(screen.getByRole("button", { name: "Work queue" }));+ fireEvent.click(screen.getByRole("button", { name: "Open Export Exported film" }));+ expect(screen.getByRole("tab", { name: "Export" })).toHaveAttribute("aria-selected", "true");+ expect(within(screen.getByRole("tablist", { name: "Export type" })).getByRole("tab", { name: "Video" })).toHaveAttribute("aria-selected", "true");});it("opens an empty queue from the library and closes it with Escape", async () => {diff --git a/src/components/ProjectWorkspace.tsx b/src/components/ProjectWorkspace.tsxindex 98808cb..edaa21d 100644--- a/src/components/ProjectWorkspace.tsx+++ b/src/components/ProjectWorkspace.tsx@@ -24,6 +24,7 @@ import { outputDimensions, videoDurationMs } from "../lib/export";* a project "on the agent" still means something: the pane opens with it. */export type ProjectView = "timeline" | "generator" | "references" | "agent" | "export" | "editor";type ShownView = Exclude<ProjectView, "agent">;+export interface WorkspaceNavigation { view: ShownView; sceneId?: string; imageId?: string; referenceId?: string }/** The scene badge includes native generation and the final encoding step. */export const isGenerationOngoing = (job: GenerationJob) =>@@ -104,9 +105,11 @@ function useWindowWidth(): number {through session.edit() and are undo steps; background work (generationresults, icons, measurements) is not (see projectSession.ts). Text fieldskeep their own native undo — the shortcuts do not fire in them. */-export function ProjectWorkspace({ project, initialView, runtime = null, onBack, onSave, workQueue, onGeneratorRuntimeChange, titleBarActions, active = true }: {+export function ProjectWorkspace({ project, initialView, runtime = null, onBack, onSave, workQueue, onGeneratorRuntimeChange, titleBarActions, active = true, navigation, onNavigated }: {project: ProjectRecord;initialView?: ProjectView;+ navigation?: WorkspaceNavigation;+ onNavigated?: () => void;/** What is installed on this computer, probed once at startup by App. Null* while that probe is still in flight — not "nothing is installed". */runtime?: RuntimeStatus | null;@@ -155,6 +158,17 @@ export function ProjectWorkspace({ project, initialView, runtime = null, onBack,const [editingProject, setEditingProject] = useState(false);const [savingProjectSettings, setSavingProjectSettings] = useState(false);const [selectedGenerationJobId, setSelectedGenerationJobId] = useState<string | undefined>(project.config.generationJobs[0]?.id);+ const [imageNavigation, setImageNavigation] = useState<{ id: string }>();+ const [referenceNavigation, setReferenceNavigation] = useState<{ id: string }>();+ useEffect(() => {+ if (!navigation) return;+ setView(navigation.view);+ if (navigation.view === "export") setMediaMode("video");+ if (navigation.sceneId) setSelectedGenerationJobId(navigation.sceneId);+ if (navigation.imageId) setImageNavigation({ id: navigation.imageId });+ if (navigation.referenceId) setReferenceNavigation({ id: navigation.referenceId });+ onNavigated?.();+ }, [navigation]);const knownSceneIds = useRef(new Set(project.config.generationJobs.map((job) => job.id)));const projectItems = items.filter((item) => item.projectKey === projectQueueKey(project));const generationCompletionTimes = Object.fromEntries(projectItems.filter((item) => item.completionAt !== null).map((item) => [item.sceneId, item.completionAt as number]));@@ -287,10 +301,10 @@ export function ProjectWorkspace({ project, initialView, runtime = null, onBack,<ProjectStatusSlot.Provider value={statusSlot}><div className={`project-body${agentOpen ? " project-body--agent" : ""}`} style={agentPane.style}><div id={`${panelId}-view`} role="tabpanel" aria-label={VIEW_LABELS[view]} className={`project-content project-content--${view}`}>- {view === "editor" && <ImageEditor config={config} folderPath={project.folderPath} onChange={changeConfig} onGenerate={(template) => queue.enqueueImage(session, template)} onGenerateCharacterSheet={(template, sourceId, options) => queue.enqueueCharacterSheet(session, template, sourceId, options)} onGenerateExtend={(template, sourceId, options) => queue.enqueueExtendImage(session, template, sourceId, options)} onCancel={(id) => queue.cancel(id)} workItems={projectItems.filter((item) => item.kind === "image")} onOpenGenerator={(jobId) => { setSelectedGenerationJobId(jobId); setView("generator"); }} onOpenReferences={() => setView("references")} />}+ {view === "editor" && <ImageEditor openImage={imageNavigation} onImageOpened={() => setImageNavigation(undefined)} config={config} folderPath={project.folderPath} onChange={changeConfig} onGenerate={(template) => queue.enqueueImage(session, template)} onGenerateCharacterSheet={(template, sourceId, options) => queue.enqueueCharacterSheet(session, template, sourceId, options)} onGenerateExtend={(template, sourceId, options) => queue.enqueueExtendImage(session, template, sourceId, options)} onCancel={(id) => queue.cancel(id)} workItems={projectItems.filter((item) => item.kind === "image")} onOpenGenerator={(jobId) => { setSelectedGenerationJobId(jobId); setView("generator"); }} onOpenReferences={() => setView("references")} />}{view === "timeline" && <TimelineView config={config} openSceneId={selectedGenerationJobId} folderPath={project.folderPath} generationCompletionTimes={generationCompletionTimes} onChange={changeConfig} onMeasured={recordMeasurement} onOpenGenerator={(jobId) => { setSelectedGenerationJobId(jobId); setView("generator"); }} />}{view === "generator" && <GeneratorView onGenerate={(submissions) => queue.enqueue(session, submissions)} onCancelGeneration={(ids) => queue.cancelScenes(session, ids)} cancellingJobIds={cancellingJobIds} config={config} folderPath={project.folderPath} generationCompletionTimes={generationCompletionTimes} runtime={runtime?.slopfab ?? null} onRuntimeChange={onGeneratorRuntimeChange} onChange={changeConfig} selectedJobId={selectedGenerationJobId} onSelectedJobChange={setSelectedGenerationJobId} onOpenTimeline={() => setView("timeline")} />}- {view === "references" && <ReferencesView config={config} folderPath={project.folderPath} onChange={changeConfig} onRegenerateIcon={(id) => queue.regenerateReferenceIcon(session, id)} onExportRefmod={(id, outputPath) => queue.exportReferenceRefmod(session, id, outputPath)} onGenerateBuiltinIcons={() => queue.generateBuiltinReferenceIcons(session)} onRegenerateBuiltinIcon={(id) => queue.regenerateBuiltinReferenceIcon(session, id)} pendingBuiltinIconIds={queue.pendingBuiltinIconIds()} pendingIconIds={new Set(config.references.filter((reference) => queue.isReferenceIconPending(session, reference.id)).map((reference) => reference.id))} onOpenGenerator={(jobId) => { setSelectedGenerationJobId(jobId); setView("generator"); }} />}+ {view === "references" && <ReferencesView openReference={referenceNavigation} onReferenceOpened={() => setReferenceNavigation(undefined)} config={config} folderPath={project.folderPath} onChange={changeConfig} onRegenerateIcon={(id) => queue.regenerateReferenceIcon(session, id)} onExportRefmod={(id, outputPath) => queue.exportReferenceRefmod(session, id, outputPath)} onGenerateBuiltinIcons={() => queue.generateBuiltinReferenceIcons(session)} onRegenerateBuiltinIcon={(id) => queue.regenerateBuiltinReferenceIcon(session, id)} pendingBuiltinIconIds={queue.pendingBuiltinIconIds()} pendingIconIds={new Set(config.references.filter((reference) => queue.isReferenceIconPending(session, reference.id)).map((reference) => reference.id))} onOpenGenerator={(jobId) => { setSelectedGenerationJobId(jobId); setView("generator"); }} />}{view === "export" && <div className="project-export"><SelectorBar aria-label="Export type" className="project-export__types" value={mediaMode} onChange={setMediaMode} items={[{ value: "video", label: "Video" }, { value: "image", label: "Image" }]} />{mediaMode === "image"diff --git a/src/components/SettingsView.tsx b/src/components/SettingsView.tsxindex 886528d..99f2dca 100644--- a/src/components/SettingsView.tsx+++ b/src/components/SettingsView.tsx@@ -14,7 +14,7 @@ import { WeightSourcesEditor } from "./WeightSourcesEditor";import { LoraEditor, LoraLibrary, TemplateLorasEditor } from "./LoraSettings";import { OpenableCard } from "./OpenableCard";import { TitleBar } from "./TitleBar";-import { downloadableTemplateLoras } from "../lib/loras";+import { downloadableTemplateLoras, loadLoras } from "../lib/loras";import { retryWeightDownload } from "../lib/weightDownloads";import { cancelWeightDownload, downloadTemplateWeights, getWeightDownloadState, refreshDownloadedWeights, removeTemplateWeights, subscribeWeightDownloads, updateWeightPath, weightDownloadProgress, type DownloadState } from "../lib/weightDownloads";import { chooseEnginePath, getAgentModels, getEngineStatus, type ModelStatus, type SlopfabStatus } from "../lib/runtime";@@ -275,10 +275,13 @@ const engineSeverity = (status: SlopfabStatus | null, desktop: boolean): InfoBara 280px navigation pane with Back at its top, and a content column thatreads like Windows Settings — a 28px title (a breadcrumb on sub-pages) overgroups of one-setting-per-row cards. */-export function SettingsView({ onClose, updates, initialTab = "engine", titleBarActions }: {+export interface SettingsNavigation { templateId: string; loraId?: string }++export function SettingsView({ onClose, updates, initialTab = "engine", titleBarActions, navigation }: {onClose: () => void; updates?: ReactNode; initialTab?: TabId;/** App-wide title-bar buttons (the work queue), after Settings' own. */titleBarActions?: ReactNode;+ navigation?: SettingsNavigation;}) {/* The engine first: this screen exists because those paths have to be setbefore anything can be rendered. */@@ -295,6 +298,12 @@ export function SettingsView({ onClose, updates, initialTab = "engine", titleBarconst downloadPercent = downloadState ? weightDownloadProgress(downloadState) : 0;const [editingTemplateId, setEditingTemplateId] = useState<string | null>(null);const [editingLoraId, setEditingLoraId] = useState<string | null>(null);+ useEffect(() => {+ if (!navigation) return;+ setTab("engine");+ setEditingTemplateId(loadGeneratorTemplateSettings().templates.some((template) => template.id === navigation.templateId) ? navigation.templateId : null);+ setEditingLoraId(navigation.loraId && loadLoras().some((lora) => lora.id === navigation.loraId) ? navigation.loraId : null);+ }, [navigation]);const [showAdvancedOptions, setShowAdvancedOptions] = useState(false);const [editingPath, setEditingPath] = useState<EnginePathId | null>(null);const [pathMenu, setPathMenu] = useState<{ field: EnginePathField; anchor: HTMLElement } | null>(null);diff --git a/src/components/WorkQueuePanel.tsx b/src/components/WorkQueuePanel.tsxindex 86bd5fc..5561c8b 100644--- a/src/components/WorkQueuePanel.tsx+++ b/src/components/WorkQueuePanel.tsx@@ -4,7 +4,7 @@ import { GENERATION_FRAME_RATE } from "../lib/project";import { isWorkActive, type WorkItem, type WorkQueue } from "../lib/workQueue";import { loadGeneratorTemplateSettings } from "../lib/settings";import { cancelExportJob, exportFraction, useExportJob } from "../lib/exportJob";-import { cancelWeightDownload, retryWeightDownload, getWeightDownloadState, subscribeWeightDownloads, weightDownloadProgress } from "../lib/weightDownloads";+import { cancelWeightDownload, retryWeightDownload, getWeightDownloadState, subscribeWeightDownloads, weightDownloadProgress, type DownloadState } from "../lib/weightDownloads";import { Flyout, ProgressBar, ProgressRing } from "./ui";/* The work queue, as a flyout hanging from its title-bar button: no scrim, no@@ -24,7 +24,11 @@ function StateGlyph({ item }: { item: WorkItem }) {return <ProgressRing size={16} />;}-export function WorkQueuePanel({ queue, items, open = true, anchor = null, onClose }: {+export type WorkQueueTarget = { kind: "work"; item: WorkItem }+ | { kind: "download"; download: DownloadState }+ | { kind: "export"; folderPath: string };++export function WorkQueuePanel({ queue, items, open = true, anchor = null, onClose, onNavigate }: {queue: WorkQueue;items: readonly WorkItem[];/** Default true, so it can be rendered conditionally. */@@ -32,6 +36,7 @@ export function WorkQueuePanel({ queue, items, open = true, anchor = null, onClo/** The title-bar button it hangs from. */anchor?: RefObject<HTMLElement | null> | null;onClose: () => void;+ onNavigate?: (target: WorkQueueTarget) => void;}) {// Downloads are observed here, never enqueued in the GPU generation scheduler.const download = useSyncExternalStore(subscribeWeightDownloads, getWeightDownloadState);@@ -46,10 +51,12 @@ export function WorkQueuePanel({ queue, items, open = true, anchor = null, onCloconst current = items.filter((item) => isWorkActive(item) && item.status !== "queued");const upcoming = items.filter((item) => item.status === "queued").sort((a, b) => Number(a.kind === "reference-icons") - Number(b.kind === "reference-icons"));const finished = items.filter((item) => !isWorkActive(item)).slice().reverse();+ const openTarget = (target: WorkQueueTarget) => { onClose(); onNavigate?.(target); };const row = (item: WorkItem) => {const running = isWorkActive(item) && item.status !== "queued";- return <li className="work-queue__row" key={item.id}>+ return <li className={`work-queue__row${onNavigate ? " work-queue__row--navigable" : ""}`} key={item.id}>+ {onNavigate && <button type="button" className="work-queue__open" aria-label={`Open ${item.title} in ${item.projectName}`} data-tooltip={`${item.title} — ${settingsLine(item)}`} onClick={() => openTarget({ kind: "work", item })} />}<span className={`work-queue__state work-queue__state--${item.status}`} aria-hidden="true"><StateGlyph item={item} /></span><div className="work-queue__text"><span className="work-queue__title" data-tooltip={`${item.title} — ${settingsLine(item)}`}>{item.title}</span>@@ -73,7 +80,8 @@ export function WorkQueuePanel({ queue, items, open = true, anchor = null, onClo<div className="work-queue__list">{items.length === 0 && !download && !exporting && <div className="work-queue__empty"><WorkQueue32 aria-hidden="true" /><strong>No work yet</strong><span>Generated scenes and images show up here.</span></div>}{current.length > 0 && <section aria-label="In progress"><ul>{current.map(row)}</ul></section>}- {exporting && <section aria-label="Export"><ul><li className="work-queue__row">+ {exporting && <section aria-label="Export"><ul><li className={`work-queue__row${onNavigate && exportJob.folderPath ? " work-queue__row--navigable" : ""}`}>+ {onNavigate && exportJob.folderPath && <button type="button" className="work-queue__open" aria-label={`Open ${exportTitle}`} onClick={() => openTarget({ kind: "export", folderPath: exportJob.folderPath! })} />}<span className="work-queue__state work-queue__state--preparing" aria-hidden="true"><Film16 /></span><div className="work-queue__text"><span className="work-queue__title" data-tooltip={exportJob.destination ?? undefined}>{exportTitle}</span>@@ -82,7 +90,8 @@ export function WorkQueuePanel({ queue, items, open = true, anchor = null, onClo</div><button type="button" className="icon-button work-queue__cancel" aria-label={`Cancel ${exportTitle}`} data-tooltip="Cancel" disabled={exportJob.cancelling} onClick={cancelExportJob}><Dismiss16 /></button></li></ul></section>}- {download && <section aria-label="Weight downloads"><ul><li className="work-queue__row">+ {download && <section aria-label="Weight downloads"><ul><li className={`work-queue__row${onNavigate ? " work-queue__row--navigable" : ""}`}>+ {onNavigate && <button type="button" className="work-queue__open" aria-label={`Open ${downloadName} download`} onClick={() => openTarget({ kind: "download", download })} />}<span className={`work-queue__state work-queue__state--${download.active ? "preparing" : download.error ? "failed" : "completed"}`} aria-hidden="true">{download.active ? <Download16 /> : download.error ? <Warning16 /> : <Check16 />}</span>diff --git a/src/components/workspace/ImageBar.tsx b/src/components/workspace/ImageBar.tsxindex 016aac5..15c21dc 100644--- a/src/components/workspace/ImageBar.tsx+++ b/src/components/workspace/ImageBar.tsx@@ -44,6 +44,10 @@ export const ImageBar = forwardRef<HTMLDivElement | null, {if (element && shown.length > previousCount.current) element.scrollLeft = element.scrollWidth;previousCount.current = shown.length;}, [shown.length]);+ useLayoutEffect(() => {+ const selected = [...(bar.current?.querySelectorAll<HTMLElement>("[data-image-asset]") ?? [])].find((element) => element.dataset.imageAsset === pressed);+ selected?.scrollIntoView?.({ block: "nearest", inline: "nearest" });+ }, [pressed, inFamily]);useEffect(() => {const element = bar.current;if (!element) return;diff --git a/src/components/workspace/ImageEditor.tsx b/src/components/workspace/ImageEditor.tsxindex 5922124..d30c3c7 100644--- a/src/components/workspace/ImageEditor.tsx+++ b/src/components/workspace/ImageEditor.tsx@@ -44,13 +44,15 @@ function UsedImageSeed({ id, seed, onError }: { id: string; seed: number | undef</PropRow>;}-export function ImageEditor({ config, folderPath, onChange: changeConfig, onGenerate, onGenerateCharacterSheet, onGenerateExtend, onCancel, onOpenGenerator, onOpenReferences, workItems = [] }: {+export function ImageEditor({ config, folderPath, onChange: changeConfig, onGenerate, onGenerateCharacterSheet, onGenerateExtend, onCancel, onOpenGenerator, onOpenReferences, workItems = [], openImage, onImageOpened }: {config: ProjectConfig; folderPath: string; onChange: (update: ConfigUpdate) => void;onGenerate: (template: GeneratorTemplate) => void; onCancel: (id: string) => Promise<void>; workItems?: readonly WorkItem[];onGenerateCharacterSheet?: (template: GeneratorTemplate, sourceId: string, options: CharacterSheetOptions) => void;onGenerateExtend?: (template: GeneratorTemplate, sourceId: string, options: ExtendOptions) => void;onOpenGenerator?: (jobId: string) => void;onOpenReferences?: () => void;+ openImage?: { id: string };+ onImageOpened?: () => void;}) {const scene = useMemo(() => config.imageScene ?? createImageScene(config.brief.prompt), [config.imageScene, config.brief.prompt]);const root = scene.nodes.find((node) => node.kind === "root")!;@@ -218,6 +220,15 @@ export function ImageEditor({ config, folderPath, onChange: changeConfig, onGeneresetImageEditing(id);attempt(() => onChange((current) => restoreGeneratedImage(current, id)));};+ useEffect(() => {+ if (!openImage) return;+ if (config.assets.some((asset) => asset.kind === "image" && asset.id === openImage.id)) {+ if (scene.outputAssetId !== openImage.id) selectImage(openImage.id);+ setTemplateSourceId(null); setExtendSourceId(null);+ setView({ zoom: 1, x: 0, y: 0 });+ }+ onImageOpened?.();+ }, [openImage]);const measureImportedImage = (id: string, size: { width: number; height: number }) => attempt(() => {onChange((current) => {const asset = current.assets.find((item) => item.id === id);diff --git a/src/components/workspace/ReferencesView.tsx b/src/components/workspace/ReferencesView.tsxindex ef10c54..a4ea369 100644--- a/src/components/workspace/ReferencesView.tsx+++ b/src/components/workspace/ReferencesView.tsx@@ -73,7 +73,7 @@ const readView = (): LibraryView => {try { return localStorage.getItem(VIEW_KEY) === "details" ? "details" : "icons"; } catch { return "icons"; }};-export function ReferencesView({ config, folderPath, onChange, onRegenerateIcon, onExportRefmod, onGenerateBuiltinIcons, onRegenerateBuiltinIcon, pendingBuiltinIconIds = new Set<string>(), pendingIconIds = new Set<string>(), onOpenGenerator }: {+export function ReferencesView({ config, folderPath, onChange, onRegenerateIcon, onExportRefmod, onGenerateBuiltinIcons, onRegenerateBuiltinIcon, pendingBuiltinIconIds = new Set<string>(), pendingIconIds = new Set<string>(), onOpenGenerator, openReference, onReferenceOpened }: {config: ProjectConfig;folderPath: string;/** `key` groups rapid edits of one reference into one undo step. */@@ -86,6 +86,8 @@ export function ReferencesView({ config, folderPath, onChange, onRegenerateIcon,pendingBuiltinIconIds?: ReadonlySet<string>;pendingIconIds?: ReadonlySet<string>;onOpenGenerator?: (jobId: string) => void;+ openReference?: { id: string };+ onReferenceOpened?: () => void;}) {const [selectedId, setSelectedId] = useState<string | undefined>(config.references[0]?.id);/* Ctrl/Shift multi-select. `selectedId` stays the one reference the@@ -93,6 +95,13 @@ export function ReferencesView({ config, folderPath, onChange, onRegenerateIcon,Duplicate act on. A plain click makes them the same single reference again. */const [selectedIds, setSelectedIds] = useState<ReadonlySet<string>>(() => new Set(config.references[0] ? [config.references[0].id] : []));const anchorId = useRef<string | undefined>(selectedId);+ useEffect(() => {+ if (!openReference) return;+ if (config.references.some((reference) => reference.id === openReference.id)) {+ setSelectedId(openReference.id); setSelectedIds(new Set([openReference.id])); anchorId.current = openReference.id;+ }+ onReferenceOpened?.();+ }, [openReference]);const [imagePage, setImagePage] = useState(0);useEffect(() => setImagePage(0), [selectedId]);const configRef = useRef(config);diff --git a/src/lib/referenceIconWork.ts b/src/lib/referenceIconWork.tsindex 6036bd4..484fc8a 100644--- a/src/lib/referenceIconWork.ts+++ b/src/lib/referenceIconWork.ts@@ -8,7 +8,7 @@ import { cancelSlopfabGeneration, enqueueSlopfabGeneration, saveReferenceIcon }import { engineProviderSetting, generationStepsWithLoras } from "./settings";import { activeReferenceRefmods, referenceRefmodInputs } from "./project";import { loadReferenceIconAutomation, referenceIconGenerator, saveReferenceIconAutomation, subscribeReferenceIconAutomation } from "./referenceIconSettings";-import type { WorkItem } from "./workQueue";+import { projectQueueKey, type WorkItem } from "./workQueue";import { hasPresetIcon, REFERENCE_PRESETS, REFERENCE_TYPES, type ReferencePreset } from "./reference-presets";import { saveBuiltinIcon } from "./builtinReferenceIcons";@@ -214,8 +214,10 @@ export class ReferenceIconWork {const queued = this.hasQueued();const failed = tasks.filter((task) => task.status === "failed");const projects = new Set(tasks.map((task) => task.session));+ const target = this.active ?? tasks.find((task) => task.status === "queued") ?? tasks.at(-1);this.item = {...this.item,+ ...(target ? { projectKey: projectQueueKey(target.session.record), folderPath: target.session.record.folderPath, sceneId: target.referenceId } : {}),projectName: tasks.every((task) => task.preset) ? "Built-in references" : projects.size === 1 ? [...projects][0].getSnapshot().config.name : `${projects.size} projects`,status: this.active ? (this.active.status === "saving" ? "encoding" : "generating") : queued ? "queued" : failed.length ? "failed" : tasks.some((task) => task.status === "cancelled") ? "cancelled" : "completed",progress: tasks.length ? Math.min(1, (settled + (this.active ? this.progress : 0)) / tasks.length) : 1,diff --git a/src/lib/workQueue.ts b/src/lib/workQueue.tsindex dfc02a4..f20627a 100644--- a/src/lib/workQueue.ts+++ b/src/lib/workQueue.ts@@ -113,6 +113,10 @@ export class WorkQueue {constructor(private writer: ProjectWriter = saveProject) {}getSnapshot = () => this.items;+ projectRecord(key: string): ProjectRecord | undefined {+ const session = this.projects.get(key);+ return session ? { ...session.record, config: session.getSnapshot().config } : undefined;+ }updateBlockReason = (): string | null => {if (this.items.some(isWorkActive) || this.icons.confirmationCount() > 0) {return "Finish or cancel queued work before installing an update.";diff --git a/src/styles/work-queue.css b/src/styles/work-queue.cssindex feb9c69..40dd49b 100644--- a/src/styles/work-queue.css+++ b/src/styles/work-queue.css@@ -85,6 +85,7 @@}.work-queue__row {+ position: relative;display: flex;align-items: flex-start;gap: var(--space-3);@@ -92,6 +93,28 @@border-top: 1px solid var(--stroke-card);}+.work-queue__open {+ position: absolute;+ inset: 0;+ width: 100%;+ border: 0;+ border-radius: var(--radius-sm);+ background: transparent;+ cursor: pointer;+}++.work-queue__open:hover { background: var(--fill-subtle-hover); }+.work-queue__open:active { background: var(--fill-subtle-pressed); }+.work-queue__open:focus-visible { outline-offset: -2px; }++/* Let the row-wide navigation button receive clicks through its labels while+ keeping Cancel and Retry independent keyboard and pointer targets. */+.work-queue__row--navigable > :not(.work-queue__open) { pointer-events: none; }+.work-queue__row--navigable button:not(.work-queue__open) {+ position: relative;+ pointer-events: auto;+}+.work-queue__list section:first-child > ul > .work-queue__row:first-child {border-top-color: transparent;}