Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions frontend/components/ui-header/settings-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export default function SettingsBar() {
);
const [sessions, setSessions] = useState<SessionSummary[]>([]);
const [isFetchingSessions, setIsFetchingSessions] = useState(false);
const [fetchingFor, setFetchingFor] = useState<'save' | 'load' | null>(null);
const [isSaving, setIsSaving] = useState(false);
const [isLoading, setIsLoading] = useState(false);

Expand Down Expand Up @@ -183,6 +184,7 @@ export default function SettingsBar() {
}

setIsFetchingSessions(true);
setFetchingFor('save');
try {
const fetchedSessions = await getSessions();
setSessions(fetchedSessions);
Expand All @@ -195,6 +197,7 @@ export default function SettingsBar() {
});
} finally {
setIsFetchingSessions(false);
setFetchingFor(null);
}
};

Expand All @@ -204,6 +207,7 @@ export default function SettingsBar() {
}

setIsFetchingSessions(true);
setFetchingFor('load');
try {
const fetchedSessions = await getSessions();
setSessions(fetchedSessions);
Expand All @@ -216,6 +220,7 @@ export default function SettingsBar() {
});
} finally {
setIsFetchingSessions(false);
setFetchingFor(null);
}
};

Expand Down Expand Up @@ -326,25 +331,25 @@ export default function SettingsBar() {
</Dialog>
<Button
variant="outline"
onClick={handleLoadClick}
onClick={handleSaveClick}
disabled={isSaving || isLoading || isFetchingSessions}
>
{isLoading
? 'Loading...'
: isFetchingSessions && sessionModalMode === 'load'
{isSaving
? 'Saving...'
: fetchingFor === 'save'
? 'Preparing...'
: 'Load'}
: 'Save'}
</Button>
<Button
variant="outline"
onClick={handleSaveClick}
onClick={handleLoadClick}
disabled={isSaving || isLoading || isFetchingSessions}
>
{isSaving
? 'Saving...'
: isFetchingSessions && sessionModalMode === 'save'
{isLoading
? 'Loading...'
: fetchingFor === 'load'
? 'Preparing...'
: 'Save'}
: 'Load'}
</Button>
</div>

Expand Down
25 changes: 1 addition & 24 deletions frontend/components/ui-react-flow/react-flow-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ const ReactFlowInterface = () => {
event.preventDefault();

const nodeType = event.dataTransfer.getData('application/reactflow');
console.log('🎯 Dropped nodeType:', nodeType);

if (!nodeType) {
return;
Expand All @@ -202,16 +201,7 @@ const ReactFlowInterface = () => {
data: { label: `${nodeType}` },
};

console.log('🆕 Creating new node:', newNode);

setNodes((nds) => {
const updatedNodes = [...nds, newNode];
console.log(
'📋 Updated nodes list:',
updatedNodes.map((n) => ({ id: n.id, type: n.type }))
);
return updatedNodes;
});
setNodes((nds) => [...nds, newNode]);
};

const isValidConnection = useCallback(
Expand Down Expand Up @@ -307,19 +297,6 @@ const ReactFlowInterface = () => {
<Sidebar />
</Panel>

{/* Debug Panel */}
<Panel position="bottom-right">
<div className="bg-white p-2 rounded border text-xs">
<div>Nodes: {nodes.length}</div>
<div>Edges: {edges.length}</div>
<div className="mt-1 max-w-[260px]">
{edges.map((e) => (
<div key={e.id || `${e.source}-${e.target}`}>{`${e.source} → ${e.target}`}</div>
))}
</div>
</div>
</Panel>

<Background />
</ReactFlow>
</div>
Expand Down
Loading