Browse Source

feat: add Video Input to floating action bar and all nodes menu

Adds a top-level "Video" quick-access button to the floating action bar
and adds videoInput to the Input category in the All Nodes menu. Fixes
test selectors to disambiguate the new top-level Video button from the
Generate dropdown's Video option.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
handoff-20260429-1057
shrimbly 4 months ago
parent
commit
f9756dc5e9
  1. 2
      src/components/FloatingActionBar.tsx
  2. 10
      src/components/__tests__/FloatingActionBar.test.tsx

2
src/components/FloatingActionBar.tsx

@ -14,6 +14,7 @@ const ALL_NODES_CATEGORIES: { label: string; nodes: { type: NodeType; label: str
nodes: [
{ type: "imageInput", label: "Image Input" },
{ type: "audioInput", label: "Audio Input" },
{ type: "videoInput", label: "Video Input" },
{ type: "glbViewer", label: "3D Viewer" },
],
},
@ -416,6 +417,7 @@ export function FloatingActionBar() {
<div className="fixed bottom-5 left-1/2 -translate-x-1/2 z-50">
<div className="flex items-center gap-0.5 bg-neutral-800/95 rounded-lg shadow-lg border border-neutral-700/80 px-1.5 py-1">
<NodeButton type="imageInput" label="Image" />
<NodeButton type="videoInput" label="Video" />
<NodeButton type="prompt" label="Prompt" />
<GenerateComboButton />
<NodeButton type="output" label="Output" />

10
src/components/__tests__/FloatingActionBar.test.tsx

@ -284,7 +284,7 @@ describe("FloatingActionBar", () => {
// Dropdown menu items should appear
expect(screen.getByText("Image", { selector: "button.w-full" })).toBeInTheDocument();
expect(screen.getByText("Video")).toBeInTheDocument();
expect(screen.getByText("Video", { selector: "button.w-full" })).toBeInTheDocument();
expect(screen.getByText("Text (LLM)")).toBeInTheDocument();
});
@ -321,7 +321,7 @@ describe("FloatingActionBar", () => {
});
fireEvent.click(screen.getByText("Generate"));
fireEvent.click(screen.getByText("Video"));
fireEvent.click(screen.getByText("Video", { selector: "button.w-full" }));
expect(mockAddNode).toHaveBeenCalledWith("generateVideo", expect.any(Object));
});
@ -357,13 +357,13 @@ describe("FloatingActionBar", () => {
fireEvent.click(screen.getByText("Generate"));
// Verify dropdown is open
expect(screen.getByText("Video")).toBeInTheDocument();
expect(screen.getByText("Video", { selector: "button.w-full" })).toBeInTheDocument();
// Click an option
fireEvent.click(screen.getByText("Video"));
fireEvent.click(screen.getByText("Video", { selector: "button.w-full" }));
// Dropdown should close
expect(screen.queryByText("Video")).not.toBeInTheDocument();
expect(screen.queryByText("Video", { selector: "button.w-full" })).not.toBeInTheDocument();
});
});

Loading…
Cancel
Save