This commit is contained in:
Timothy Jaeryang Baek
2026-04-21 15:52:33 +09:00
parent 6cc799b1bb
commit 0542df147a
+14 -2
View File
@@ -72,7 +72,10 @@
$: showControlsTab = $user?.role === 'admin' || ($user?.permissions?.chat?.controls ?? true);
$: showFilesTab =
!!$selectedTerminalId ||
($selectedTerminalId &&
(($terminalServers ?? []).some((t) => t.id && t.id === $selectedTerminalId) ||
$user?.role === 'admin' ||
($user?.permissions?.features?.direct_tool_servers ?? true))) ||
(codeInterpreterEnabled && $config?.code?.interpreter_engine !== 'jupyter');
$: showOverviewTab = hasMessages;
@@ -96,13 +99,22 @@
}
// Auto-open Files tab when a terminal is selected (suppress panel open when full-screen)
$: if ($selectedTerminalId) {
$: if ($selectedTerminalId && showFilesTab) {
activeTab = 'files';
if (largeScreen) {
showControls.set(true);
}
}
// Clear selected direct terminal if user lost permission
$: if (
$selectedTerminalId &&
!($terminalServers ?? []).some((t) => t.id && t.id === $selectedTerminalId) &&
!($user?.role === 'admin' || ($user?.permissions?.features?.direct_tool_servers ?? true))
) {
selectedTerminalId.set(null);
}
// Attach a terminal file to the chat input
const handleTerminalAttach = async (blob: Blob, name: string, contentType: string) => {
const tempItemId = uuidv4();