Skip to content

Commit bc695e4

Browse files
author
jonathan sprauel
committed
hiding chat when no sandbox
1 parent 67543d2 commit bc695e4

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

index.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,14 @@ <h3 class="text-lg font-semibold mb-4 text-red-600">
404404
renderHistoryList(convs);
405405
if (convs.length > 0) {
406406
await loadSandbox(convs[0].id);
407+
} else {
408+
// No sandboxes available, hide input bar
409+
currentConvId = null;
410+
currentConvMessages = [];
411+
document.getElementById('timelineContainer').innerHTML = '';
412+
document.getElementById('chatContainer').innerHTML = '';
413+
document.getElementById('currentConvTitle').textContent = '';
414+
updateInputBarVisibility();
407415
}
408416
// Correction : vérification de l'existence du bouton +
409417
const addBtn = document.getElementById('addSandboxBtn');
@@ -529,6 +537,7 @@ <h3 class="text-lg font-semibold mb-4 text-red-600">
529537
document.getElementById('timelineContainer').innerHTML = '';
530538
document.getElementById('chatContainer').innerHTML = '';
531539
document.getElementById('currentConvTitle').textContent = '';
540+
updateInputBarVisibility();
532541
}
533542
}
534543
};
@@ -548,6 +557,7 @@ <h3 class="text-lg font-semibold mb-4 text-red-600">
548557
document.getElementById('timelineContainer').innerHTML = '';
549558
document.getElementById('chatContainer').innerHTML = '';
550559
document.getElementById('currentConvTitle').textContent = '';
560+
updateInputBarVisibility();
551561
}
552562
}
553563
};
@@ -710,6 +720,9 @@ <h3 class="text-lg font-semibold mb-4 text-red-600">
710720
// Met à jour toujours les deux vues pour éviter les problèmes de synchronisation
711721
renderTimeline();
712722
renderChatView();
723+
724+
// Show the input bar when a sandbox is loaded
725+
updateInputBarVisibility();
713726
}
714727

715728
function updateLastAssistantMessage(text, isComplete = false) {
@@ -761,6 +774,15 @@ <h3 class="text-lg font-semibold mb-4 text-red-600">
761774
}
762775
}
763776

777+
function updateInputBarVisibility() {
778+
const inputBar = document.getElementById('floatingInputBar');
779+
if (currentConvId) {
780+
inputBar.style.display = 'flex';
781+
} else {
782+
inputBar.style.display = 'none';
783+
}
784+
}
785+
764786
function updateCurrentView() {
765787
// Met à jour toujours les deux vues pour éviter les problèmes de synchronisation
766788
renderTimeline();

0 commit comments

Comments
 (0)