Skip to content

Commit 71cb1b2

Browse files
committed
fix: load button location, preparing label, debug logs/panels
1 parent 73ade15 commit 71cb1b2

File tree

2 files changed

+16
-34
lines changed

2 files changed

+16
-34
lines changed

frontend/components/ui-header/settings-bar.tsx

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export default function SettingsBar() {
4646
);
4747
const [sessions, setSessions] = useState<SessionSummary[]>([]);
4848
const [isFetchingSessions, setIsFetchingSessions] = useState(false);
49+
const [fetchingFor, setFetchingFor] = useState<'save' | 'load' | null>(null);
4950
const [isSaving, setIsSaving] = useState(false);
5051
const [isLoading, setIsLoading] = useState(false);
5152

@@ -153,6 +154,7 @@ export default function SettingsBar() {
153154
}
154155

155156
setIsFetchingSessions(true);
157+
setFetchingFor('save');
156158
try {
157159
const fetchedSessions = await getSessions();
158160
setSessions(fetchedSessions);
@@ -165,6 +167,7 @@ export default function SettingsBar() {
165167
});
166168
} finally {
167169
setIsFetchingSessions(false);
170+
setFetchingFor(null);
168171
}
169172
};
170173

@@ -174,6 +177,7 @@ export default function SettingsBar() {
174177
}
175178

176179
setIsFetchingSessions(true);
180+
setFetchingFor('load');
177181
try {
178182
const fetchedSessions = await getSessions();
179183
setSessions(fetchedSessions);
@@ -186,6 +190,7 @@ export default function SettingsBar() {
186190
});
187191
} finally {
188192
setIsFetchingSessions(false);
193+
setFetchingFor(null);
189194
}
190195
};
191196

@@ -296,25 +301,25 @@ export default function SettingsBar() {
296301
</Dialog>
297302
<Button
298303
variant="outline"
299-
onClick={handleLoadClick}
304+
onClick={handleSaveClick}
300305
disabled={isSaving || isLoading || isFetchingSessions}
301306
>
302-
{isLoading
303-
? 'Loading...'
304-
: isFetchingSessions && sessionModalMode === 'load'
307+
{isSaving
308+
? 'Saving...'
309+
: fetchingFor === 'save'
305310
? 'Preparing...'
306-
: 'Load'}
311+
: 'Save'}
307312
</Button>
308313
<Button
309314
variant="outline"
310-
onClick={handleSaveClick}
315+
onClick={handleLoadClick}
311316
disabled={isSaving || isLoading || isFetchingSessions}
312317
>
313-
{isSaving
314-
? 'Saving...'
315-
: isFetchingSessions && sessionModalMode === 'save'
318+
{isLoading
319+
? 'Loading...'
320+
: fetchingFor === 'load'
316321
? 'Preparing...'
317-
: 'Save'}
322+
: 'Load'}
318323
</Button>
319324
</div>
320325

frontend/components/ui-react-flow/react-flow-view.tsx

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ const ReactFlowInterface = () => {
184184
event.preventDefault();
185185

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

189188
if (!nodeType) {
190189
return;
@@ -202,16 +201,7 @@ const ReactFlowInterface = () => {
202201
data: { label: `${nodeType}` },
203202
};
204203

205-
console.log('🆕 Creating new node:', newNode);
206-
207-
setNodes((nds) => {
208-
const updatedNodes = [...nds, newNode];
209-
console.log(
210-
'📋 Updated nodes list:',
211-
updatedNodes.map((n) => ({ id: n.id, type: n.type }))
212-
);
213-
return updatedNodes;
214-
});
204+
setNodes((nds) => [...nds, newNode]);
215205
};
216206

217207
const isValidConnection = useCallback(
@@ -307,19 +297,6 @@ const ReactFlowInterface = () => {
307297
<Sidebar />
308298
</Panel>
309299

310-
{/* Debug Panel */}
311-
<Panel position="bottom-right">
312-
<div className="bg-white p-2 rounded border text-xs">
313-
<div>Nodes: {nodes.length}</div>
314-
<div>Edges: {edges.length}</div>
315-
<div className="mt-1 max-w-[260px]">
316-
{edges.map((e) => (
317-
<div key={e.id || `${e.source}-${e.target}`}>{`${e.source}${e.target}`}</div>
318-
))}
319-
</div>
320-
</div>
321-
</Panel>
322-
323300
<Background />
324301
</ReactFlow>
325302
</div>

0 commit comments

Comments
 (0)