Browse Source

fix: use correct initialCapabilityFilter prop on ModelSearchDialog

The capabilities prop doesn't exist on ModelSearchDialogProps. Use the
correct initialCapabilityFilter="image" prop instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
handoff-20260429-1057
shrimbly 4 months ago
parent
commit
b1b54ae8bc
  1. 4
      src/app/globals.css
  2. 4
      src/components/GroupsOverlay.tsx
  3. 5
      src/components/WorkflowCanvas.tsx
  4. 43
      src/components/nodes/BaseNode.tsx
  5. 2
      src/components/nodes/GenerateImageNode.tsx
  6. 2
      src/store/workflowStore.ts

4
src/app/globals.css

@ -55,6 +55,10 @@ body {
transition: opacity 250ms ease-in-out;
}
.react-flow__node:not(.switch-dimmed) {
transition: opacity 250ms ease-in-out;
}
/* Base handle styles */
.react-flow__handle {
width: 14px;

4
src/components/GroupsOverlay.tsx

@ -1,7 +1,7 @@
"use client";
import { useCallback, useState, useRef, useEffect } from "react";
import { useStore, ViewportPortal } from "@xyflow/react";
import { useViewport, ViewportPortal } from "@xyflow/react";
import { useWorkflowStore, GROUP_COLORS } from "@/store/workflowStore";
import { GroupColor } from "@/types";
@ -492,7 +492,7 @@ export function GroupBackgroundsPortal() {
// Renders group controls (headers, resize handles) using ViewportPortal above nodes
export function GroupControlsOverlay() {
const { groups } = useWorkflowStore();
const zoom = useStore((s) => s.transform[2]);
const { zoom } = useViewport();
const groupIds = Object.keys(groups);

5
src/components/WorkflowCanvas.tsx

@ -331,11 +331,6 @@ export function WorkflowCanvas() {
// Apply dimming className to nodes downstream of disabled Switch outputs
const allNodes = useMemo(() => {
// Fast path: no dimming active and no stale dimmed classes to clean up
if (dimmedNodeIds.size === 0 && !nodes.some((n) => n.className?.includes("switch-dimmed"))) {
return nodes;
}
return nodes.map((node) => {
// Never dim Switch or ConditionalSwitch nodes themselves
if (node.type === "switch" || node.type === "conditionalSwitch") return node;

43
src/components/nodes/BaseNode.tsx

@ -100,36 +100,27 @@ export function BaseNode({
const panelEl = settingsPanelRef.current;
if (!panelEl) return;
let rafId: number | null = null;
const observer = new ResizeObserver((entries) => {
if (rafId !== null) cancelAnimationFrame(rafId);
rafId = requestAnimationFrame(() => {
rafId = null;
for (const entry of entries) {
const newPanelHeight = entry.contentRect.height;
if (newPanelHeight === 0) continue;
const delta = newPanelHeight - trackedSettingsHeightRef.current;
if (Math.abs(delta) < 2) continue; // Ignore sub-pixel changes
trackedSettingsHeightRef.current = newPanelHeight;
setNodes((nodes) =>
nodes.map((node) => {
if (node.id !== id) return node;
const currentHeight = getNodeDimension(node, "height");
const newHeight = Math.max(minHeight, currentHeight + delta);
return applyNodeDimensions(node, getNodeDimension(node, "width"), newHeight);
})
);
}
});
for (const entry of entries) {
const newPanelHeight = entry.contentRect.height;
if (newPanelHeight === 0) continue;
const delta = newPanelHeight - trackedSettingsHeightRef.current;
if (Math.abs(delta) < 2) continue; // Ignore sub-pixel changes
trackedSettingsHeightRef.current = newPanelHeight;
setNodes((nodes) =>
nodes.map((node) => {
if (node.id !== id) return node;
const currentHeight = getNodeDimension(node, "height");
const newHeight = Math.max(minHeight, currentHeight + delta);
return applyNodeDimensions(node, getNodeDimension(node, "width"), newHeight);
})
);
}
});
observer.observe(panelEl);
return () => {
if (rafId !== null) cancelAnimationFrame(rafId);
observer.disconnect();
};
return () => observer.disconnect();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [settingsExpanded, settingsPanel]);

2
src/components/nodes/GenerateImageNode.tsx

@ -825,7 +825,7 @@ export function GenerateImageNode({ id, data, selected }: NodeProps<NanoBananaNo
isOpen={isBrowseDialogOpen}
onClose={() => setIsBrowseDialogOpen(false)}
onModelSelected={handleBrowseModelSelect}
capabilities={IMAGE_CAPABILITIES}
initialCapabilityFilter="image"
/>
)}
</>

2
src/store/workflowStore.ts

@ -526,7 +526,7 @@ const workflowStoreImpl: StateCreator<WorkflowStore> = (set, get) => ({
},
setHoveredNodeId: (id: string | null) => {
if (get().hoveredNodeId !== id) set({ hoveredNodeId: id });
set({ hoveredNodeId: id });
},
addNode: (type: NodeType, position: XYPosition, initialData?: Partial<WorkflowNodeData>) => {

Loading…
Cancel
Save