AI media harness for planning, generating, and editing locally
TypeScript
Shorten Add reference label
Bittia96dc73fee97
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.mdindex b789a55..afca6af 100644--- a/RELEASE_NOTES.md+++ b/RELEASE_NOTES.md@@ -23,7 +23,7 @@ This alpha update adds DMAD LoRA support, resumable model downloads, and improve- Removed box coordinates and palettes from image prompts, and limited image controls to supported generator model types.- Improved image family deletion so removing a variant preserves its original. Selected image boxes can also be deleted from the canvas.- Long prompts scroll inside their fields. Smart chips align with surrounding text and no longer overlap on adjacent lines.-- Moved the Add a reference scrollbar clear of reference cards, and made the image bar scrollbar appear while scrolling.+- Moved the Add reference scrollbar clear of reference cards, and made the image bar scrollbar appear while scrolling.- Agent-generated shots use full language names, such as English.- Removed the opening-frame helper caption and made the release-note introduction render as normal text.- Updated the bundled SlopFab runtime to API 1.16 and adapted LoRA preparation to preserve companion-grid downloads for older adapters.diff --git a/docs/reference-icons.md b/docs/reference-icons.mdindex b7871fe..d909d23 100644--- a/docs/reference-icons.md+++ b/docs/reference-icons.md@@ -1,6 +1,6 @@# Built-in reference icons-Hover over a preset's icon area in **Add a reference** to reveal its generation+Hover over a preset's icon area in **Add reference** to reveal its generationbutton. It generates or regenerates only that preset and keeps the picker open.Hovering the button does not highlight or select the reference card.Built-in icon work follows category order: Character, Animal, Clothes,@@ -12,7 +12,7 @@ temporary file, then atomically replaces its destination. Interrupted temporaryfiles are ignored, and an existing icon stays available until its replacementis complete. Normal video generation still uses the quit confirmation.-Opening **Add a reference** for the first time offers to generate any missing+Opening **Add reference** for the first time offers to generate any missingbuilt-in icons. **Don't ask again** remembers either answer across app launches:Start enables generation of missing icons on later visits; Cancel disables it.Without that option, the question appears only once per app session.diff --git a/docs/video-references.md b/docs/video-references.mdindex fbae85f..e563319 100644--- a/docs/video-references.md+++ b/docs/video-references.md@@ -47,7 +47,7 @@ it does not resolve or validate the remaining conditioning/transformer failure.## Adding video references-In **References**, choose **Add a reference → Other → New** to create an+In **References**, choose **Add reference → Other → New** to create an**Uncategorized** reference, then choose **Add file** in its details. Videocan also be attached to an existing reference. The reference card shows thevideo's first source frame, including after reopening the project; replacingdiff --git a/src/components/ProjectWorkspace.test.ts b/src/components/ProjectWorkspace.test.tsindex 68263e4..a890713 100644--- a/src/components/ProjectWorkspace.test.ts+++ b/src/components/ProjectWorkspace.test.ts@@ -552,8 +552,8 @@ describe("project workspace timecode", () => {const onChange = vi.fn();await asDesktopApp([{ kind: "image", name: "IMG_4821", relativePath: "references/IMG_4821.jpg" }], async () => {const view = render(createElement(ReferencesView, { config, folderPath: "C:\\Ceramic Lamp", onChange }));- fireEvent.click(screen.getByRole("button", { name: /Add a reference/ }));- const dialog = screen.getByRole("dialog", { name: "Add a reference" });+ fireEvent.click(screen.getByRole("button", { name: /Add reference/ }));+ const dialog = screen.getByRole("dialog", { name: "Add reference" });fireEvent.click(within(dialog).getByRole("button", { name: "Product" }));fireEvent.click(within(dialog).getByRole("button", { name: "New" }));const withReference = onChange.mock.calls[0][0];@@ -604,7 +604,7 @@ describe("project workspace timecode", () => {const view = container.querySelector(".references-view")!;expect(Array.from(view.children).map((element) => element.className.split(" ")[0])).toEqual(["references-main", "ui-splitter", "reference-inspector"]);expect(container.querySelector(".references-heading__actions")).toBeNull();- expect(screen.getByRole("button", { name: /Add a reference/ })).not.toBeNull();+ expect(screen.getByRole("button", { name: /Add reference/ })).not.toBeNull();expect(container.querySelector(".reference-inspector__scroll")).not.toBeNull();expect(container.querySelector(".reference-layout")).toBeNull();expect(container.querySelector(".reference-library__toolbar")).toBeNull();diff --git a/src/components/ReferenceIconGenerationDialog.tsx b/src/components/ReferenceIconGenerationDialog.tsxindex 52a819f..c18bff5 100644--- a/src/components/ReferenceIconGenerationDialog.tsx+++ b/src/components/ReferenceIconGenerationDialog.tsx@@ -32,7 +32,7 @@ export function ReferenceIconGenerationDialog({ count, onAnswer, builtins = falschecked={remember}onChange={setRemember}label="Don't ask again"- description={builtins ? "Remember the answer when you open Add a reference." : "Start turns on automatic generation; Cancel turns it off."}+ description={builtins ? "Remember the answer when you open Add reference." : "Start turns on automatic generation; Cancel turns it off."}/></ContentDialog>);diff --git a/src/components/workspace/ReferencesView.builtins.test.tsx b/src/components/workspace/ReferencesView.builtins.test.tsxindex d465ccf..adae2d1 100644--- a/src/components/workspace/ReferencesView.builtins.test.tsx+++ b/src/components/workspace/ReferencesView.builtins.test.tsx@@ -28,14 +28,14 @@ it("generates a preset icon without selecting its card and supports regeneratingconst generate = vi.fn();const props = { config, folderPath: "C:/project", onChange, onRegenerateBuiltinIcon: generate };const view = render(<ReferencesView {...props} />);- fireEvent.click(screen.getByRole("button", { name: /^Add a reference/ }));+ fireEvent.click(screen.getByRole("button", { name: /^Add reference/ }));fireEvent.change(screen.getByRole("textbox", { name: "Search reference options" }), { target: { value: preset.name } });const button = screen.getByRole("button", { name: `Generate icon for ${preset.name}` });expect(button.parentElement?.querySelector(".reference-preset-select")?.contains(button)).toBe(false);fireEvent.click(button);expect(generate).toHaveBeenCalledWith(preset.id);expect(onChange).not.toHaveBeenCalled();- expect(screen.getByRole("dialog", { name: "Add a reference" })).toBeInTheDocument();+ expect(screen.getByRole("dialog", { name: "Add reference" })).toBeInTheDocument();view.rerender(<ReferencesView {...props} pendingBuiltinIconIds={new Set([preset.id])} />);expect(button).toBeDisabled();try {@@ -50,7 +50,7 @@ it("generates a preset icon without selecting its card and supports regeneratingit("asks on the first Add reference visit, explains video priority, and remembers Start", async () => {const view = open();expect(screen.queryByRole("dialog", { name: /reference icons/ })).toBeNull();- fireEvent.click(screen.getByRole("button", { name: /^Add a reference/ }));+ fireEvent.click(screen.getByRole("button", { name: /^Add reference/ }));const prompt = await screen.findByRole("dialog", { name: "Generate built-in reference icons?" });expect(prompt).toHaveTextContent("take a long time");expect(prompt).toHaveTextContent("pauses for video generation");@@ -58,17 +58,17 @@ it("asks on the first Add reference visit, explains video priority, and rememberfireEvent.click(screen.getByRole("checkbox", { name: /Don't ask again/ }));fireEvent.click(screen.getByRole("button", { name: "Start generation" }));expect(view.generate).toHaveBeenCalledOnce();- expect(screen.getByRole("dialog", { name: "Add a reference" })).toBeInTheDocument();+ expect(screen.getByRole("dialog", { name: "Add reference" })).toBeInTheDocument();view.unmount(); sessionStorage.clear();open(view.generate);- fireEvent.click(screen.getByRole("button", { name: /^Add a reference/ }));+ fireEvent.click(screen.getByRole("button", { name: /^Add reference/ }));await waitFor(() => expect(view.generate).toHaveBeenCalledTimes(2));expect(screen.queryByRole("dialog", { name: /reference icons/ })).toBeNull();});it("remembers Cancel across sessions without starting generation", async () => {const view = open();- fireEvent.click(screen.getByRole("button", { name: /^Add a reference/ }));+ fireEvent.click(screen.getByRole("button", { name: /^Add reference/ }));await screen.findByRole("dialog");fireEvent.click(screen.getByRole("checkbox", { name: /Don't ask again/ }));fireEvent.click(screen.getByRole("button", { name: "Cancel" }));@@ -79,11 +79,11 @@ it("remembers Cancel across sessions without starting generation", async () => {it("does not ask again on another visit in the same session when Cancel is not remembered", async () => {open();- fireEvent.click(screen.getByRole("button", { name: /^Add a reference/ }));+ fireEvent.click(screen.getByRole("button", { name: /^Add reference/ }));await screen.findByRole("dialog");fireEvent.click(screen.getByRole("button", { name: "Cancel" }));- fireEvent.click(within(screen.getByRole("dialog", { name: "Add a reference" })).getByRole("button", { name: "Cancel" }));- fireEvent.click(screen.getByRole("button", { name: /^Add a reference/ }));+ fireEvent.click(within(screen.getByRole("dialog", { name: "Add reference" })).getByRole("button", { name: "Cancel" }));+ fireEvent.click(screen.getByRole("button", { name: /^Add reference/ }));await waitFor(() => expect(invoke).toHaveBeenCalledWith("list_builtin_reference_icons"));expect(screen.queryByRole("dialog", { name: /reference icons/ })).toBeNull();expect(localStorage.getItem("slopus.builtin-reference-icons.v1")).toBeNull();diff --git a/src/components/workspace/ReferencesView.test.tsx b/src/components/workspace/ReferencesView.test.tsxindex 586633e..9b02a3d 100644--- a/src/components/workspace/ReferencesView.test.tsx+++ b/src/components/workspace/ReferencesView.test.tsx@@ -178,8 +178,8 @@ describe("Reference type presets", () => {it("adds an animal preset from its searchable subcategory", () => {const state = setup();- fireEvent.click(screen.getByRole("button", { name: /Add a reference/ }));- const dialog = screen.getByRole("dialog", { name: "Add a reference" });+ fireEvent.click(screen.getByRole("button", { name: /Add reference/ }));+ const dialog = screen.getByRole("dialog", { name: "Add reference" });fireEvent.click(within(dialog).getByRole("button", { name: "Animal" }));fireEvent.click(within(dialog).getByRole("tab", { name: "Pets" }));fireEvent.change(within(dialog).getByRole("textbox", { name: "Search reference options" }), { target: { value: "retriever" } });@@ -199,8 +199,8 @@ describe("Reference type presets", () => {["Style", "style", "Cinematic"],])("creates and saves an editable %s with its subcategory", (label, category, subcategory) => {const state = setup();- fireEvent.click(screen.getByRole("button", { name: /Add a reference/ }));- const dialog = screen.getByRole("dialog", { name: "Add a reference" });+ fireEvent.click(screen.getByRole("button", { name: /Add reference/ }));+ const dialog = screen.getByRole("dialog", { name: "Add reference" });fireEvent.click(within(dialog).getByRole("button", { name: label }));fireEvent.click(within(dialog).getByRole("tab", { name: subcategory }));fireEvent.click(within(dialog).getByRole("button", { name: "New" }));@@ -242,9 +242,9 @@ describe("Reference type presets", () => {const state = setup();expect(screen.queryByRole("button", { name: "New definition" })).not.toBeInTheDocument();expect(screen.queryByRole("button", { name: "Add image" })).not.toBeInTheDocument();- fireEvent.click(screen.getByRole("button", { name: /Add a reference/ }));+ fireEvent.click(screen.getByRole("button", { name: /Add reference/ }));- const dialog = screen.getByRole("dialog", { name: "Add a reference" });+ const dialog = screen.getByRole("dialog", { name: "Add reference" });expect(dialog).toBeInTheDocument();expect(state.latest().references).toHaveLength(1);expect(within(dialog).queryByRole("button", { name: "Text" })).not.toBeInTheDocument();@@ -265,8 +265,8 @@ describe("Reference type presets", () => {it("chooses one prepared character from the scalable popup", () => {const state = setup();- fireEvent.click(screen.getByRole("button", { name: /Add a reference/ }));- const dialog = screen.getByRole("dialog", { name: "Add a reference" });+ fireEvent.click(screen.getByRole("button", { name: /Add reference/ }));+ const dialog = screen.getByRole("dialog", { name: "Add reference" });fireEvent.click(within(dialog).getByRole("button", { name: "Character" }));const groups = within(dialog).getByRole("tablist", { name: "Character subcategories" });expect(within(groups).getByRole("tab", { name: "Film" })).toBeInTheDocument();@@ -288,8 +288,8 @@ describe("Reference type presets", () => {it("shows a bundled MiniMax icon for an illustrated character preset", () => {REFERENCE_PRESETS.find((preset) => preset.name === "Abby Sciuto")!.icon = "/test-preset.jpg";setup();- fireEvent.click(screen.getByRole("button", { name: /Add a reference/ }));- const dialog = screen.getByRole("dialog", { name: "Add a reference" });+ fireEvent.click(screen.getByRole("button", { name: /Add reference/ }));+ const dialog = screen.getByRole("dialog", { name: "Add reference" });fireEvent.click(within(dialog).getByRole("button", { name: "Character" }));fireEvent.change(within(dialog).getByRole("textbox", { name: "Search reference options" }), { target: { value: "Abby Sciuto" } });const preset = within(dialog).getByRole("button", { name: /Abby Sciuto/ });@@ -305,8 +305,8 @@ describe("Reference type presets", () => {it("searches location templates and allows editing their prompt directly", () => {const state = setup();- fireEvent.click(screen.getByRole("button", { name: /Add a reference/ }));- const dialog = screen.getByRole("dialog", { name: "Add a reference" });+ fireEvent.click(screen.getByRole("button", { name: /Add reference/ }));+ const dialog = screen.getByRole("dialog", { name: "Add reference" });fireEvent.click(within(dialog).getByRole("button", { name: "Location" }));const groups = within(dialog).getByRole("tablist", { name: "Location subcategories" });fireEvent.click(within(groups).getByRole("tab", { name: "Sci-fi" }));@@ -335,8 +335,8 @@ describe("Reference type presets", () => {it("adds clothes and restores, updates, and clears their color and fabric settings", () => {const state = setup();- fireEvent.click(screen.getByRole("button", { name: /Add a reference/ }));- const picker = screen.getByRole("dialog", { name: "Add a reference" });+ fireEvent.click(screen.getByRole("button", { name: /Add reference/ }));+ const picker = screen.getByRole("dialog", { name: "Add reference" });fireEvent.click(within(picker).getByRole("button", { name: "Clothes" }));fireEvent.click(within(picker).getByRole("tab", { name: "Tops" }));fireEvent.click(within(picker).getByRole("button", { name: /T-shirt/ }));@@ -364,8 +364,8 @@ describe("Reference type presets", () => {it("finds wearable accessories by subcategory and search", () => {const state = setup();- fireEvent.click(screen.getByRole("button", { name: /Add a reference/ }));- const picker = screen.getByRole("dialog", { name: "Add a reference" });+ fireEvent.click(screen.getByRole("button", { name: /Add reference/ }));+ const picker = screen.getByRole("dialog", { name: "Add reference" });fireEvent.click(within(picker).getByRole("button", { name: "Accessories" }));fireEvent.click(within(picker).getByRole("tab", { name: "Eyewear" }));fireEvent.change(within(picker).getByRole("textbox", { name: "Search reference options" }), { target: { value: "aviator" } });@@ -376,8 +376,8 @@ describe("Reference type presets", () => {it("creates locations directly and restores, updates, and clears their saved settings in the inspector", () => {const state = setup();- fireEvent.click(screen.getByRole("button", { name: /Add a reference/ }));- const dialog = screen.getByRole("dialog", { name: "Add a reference" });+ fireEvent.click(screen.getByRole("button", { name: /Add reference/ }));+ const dialog = screen.getByRole("dialog", { name: "Add reference" });fireEvent.click(within(dialog).getByRole("button", { name: "Location" }));expect(within(dialog).queryByText("Time of day")).not.toBeInTheDocument();expect(within(dialog).queryByText("Weather")).not.toBeInTheDocument();@@ -400,15 +400,15 @@ describe("Reference type presets", () => {description: "Coastal village, at night, in winter.",content: "Coastal village, at night, in winter.",});- fireEvent.click(screen.getByRole("button", { name: /Add a reference/ }));- const picker = screen.getByRole("dialog", { name: "Add a reference" });+ fireEvent.click(screen.getByRole("button", { name: /Add reference/ }));+ const picker = screen.getByRole("dialog", { name: "Add reference" });fireEvent.click(within(picker).getByRole("button", { name: "Location" }));fireEvent.change(within(picker).getByRole("textbox", { name: "Search reference options" }), { target: { value: "lunar" } });fireEvent.click(within(picker).getByRole("button", { name: /Lunar base/ }));expect(restored.latest().references[0].description).toBe("Lunar base.");expect(restored.latest().references[1].description).toBe("Coastal village, at night, in winter.");- fireEvent.click(screen.getByRole("button", { name: /Add a reference/ }));- const newPicker = screen.getByRole("dialog", { name: "Add a reference" });+ fireEvent.click(screen.getByRole("button", { name: /Add reference/ }));+ const newPicker = screen.getByRole("dialog", { name: "Add reference" });fireEvent.click(within(newPicker).getByRole("button", { name: "Location" }));fireEvent.click(within(newPicker).getByRole("button", { name: /Coastal village/ }));expect(restored.latest().references[0].description).toBe("Coastal village.");@@ -423,8 +423,8 @@ describe("Reference type presets", () => {]);const state = setup();- fireEvent.click(screen.getByRole("button", { name: /Add a reference/ }));- const dialog = screen.getByRole("dialog", { name: "Add a reference" });+ fireEvent.click(screen.getByRole("button", { name: /Add reference/ }));+ const dialog = screen.getByRole("dialog", { name: "Add reference" });fireEvent.click(within(dialog).getByRole("button", { name: "Product" }));fireEvent.click(within(dialog).getByRole("button", { name: "New" }));fireEvent.click(screen.getByRole("button", { name: "Add file" }));diff --git a/src/components/workspace/ReferencesView.tsx b/src/components/workspace/ReferencesView.tsxindex 35990c5..a293b62 100644--- a/src/components/workspace/ReferencesView.tsx+++ b/src/components/workspace/ReferencesView.tsx@@ -452,7 +452,7 @@ export function ReferencesView({ config, folderPath, onChange, onRegenerateIcon,<CommandBarButton icon={view === "details" ? <ListView16Filled /> : <ListView16 />} label="Details" pressed={view === "details"} onClick={() => chooseView("details")} /></>}>- <CommandBarButton icon={<Add16 />} label="Add a reference" tooltip="Add reference" showLabel onClick={openNewReference} />+ <CommandBarButton icon={<Add16 />} label="Add reference" tooltip="Add reference" showLabel onClick={openNewReference} /><CommandBarSeparator /><CommandBarButton icon={<ImageAdd16 />} label="Add file" showLabel disabled={!selected || importingFiles || hasRefmods || selection.length > 1} onClick={() => void addFiles()} /><CommandBarButton icon={<Delete16 />} label="Delete" shortcut="Delete" disabled={!selection.length} onClick={() => remove()} />@@ -707,7 +707,7 @@ export function ReferencesView({ config, folderPath, onChange, onRegenerateIcon,}}} />}{presetDialog && builtinConfirmationCount === 0 && <ContentDialog- title="Add a reference"+ title="Add reference"className="reference-preset-dialog"width={920}primaryText="New"diff --git a/src/components/workspace/ReferencesView.video.test.tsx b/src/components/workspace/ReferencesView.video.test.tsxindex 6c23830..df7eff2 100644--- a/src/components/workspace/ReferencesView.video.test.tsx+++ b/src/components/workspace/ReferencesView.video.test.tsx@@ -126,8 +126,8 @@ it("imports a video, edits its saved trim and soundtrack, then removes its attac}render(<Harness />);expect(screen.queryByRole("button", { name: "Import video" })).not.toBeInTheDocument();- fireEvent.click(screen.getByRole("button", { name: /Add a reference/ }));- const picker = screen.getByRole("dialog", { name: "Add a reference" });+ fireEvent.click(screen.getByRole("button", { name: /Add reference/ }));+ const picker = screen.getByRole("dialog", { name: "Add reference" });fireEvent.click(within(picker).getByRole("button", { name: "Other" }));expect(within(picker).queryByRole("textbox")).not.toBeInTheDocument();expect(within(picker).queryByRole("group")).not.toBeInTheDocument();