@@ -16,6 +16,7 @@ import { useLanguage } from "@/context/language"
1616import { useLayout } from "@/context/layout"
1717import { usePlatform } from "@/context/platform"
1818import { useServer } from "@/context/server"
19+ import { useSettings } from "@/context/settings"
1920import { useSync } from "@/context/sync"
2021import { useTerminal } from "@/context/terminal"
2122import { focusTerminalById } from "@/pages/session/helpers"
@@ -134,6 +135,7 @@ export function SessionHeader() {
134135 const server = useServer ( )
135136 const platform = usePlatform ( )
136137 const language = useLanguage ( )
138+ const settings = useSettings ( )
137139 const sync = useSync ( )
138140 const terminal = useTerminal ( )
139141 const { params, view } = useSessionLayout ( )
@@ -151,6 +153,9 @@ export function SessionHeader() {
151153 } )
152154 const hotkey = createMemo ( ( ) => command . keybind ( "file.open" ) )
153155 const os = createMemo ( ( ) => detectOS ( platform ) )
156+ const tree = createMemo ( ( ) => platform . platform !== "desktop" || settings . general . showFileTree ( ) )
157+ const term = createMemo ( ( ) => platform . platform !== "desktop" || settings . general . showTerminal ( ) )
158+ const status = createMemo ( ( ) => platform . platform !== "desktop" || settings . general . showStatus ( ) )
154159
155160 const [ exists , setExists ] = createStore < Partial < Record < OpenApp , boolean > > > ( {
156161 finder : true ,
@@ -415,24 +420,28 @@ export function SessionHeader() {
415420 </ div >
416421 </ Show >
417422 < div class = "flex items-center gap-1" >
418- < Tooltip placement = "bottom" value = { language . t ( "status.popover.trigger" ) } >
419- < StatusPopover />
420- </ Tooltip >
421- < TooltipKeybind
422- title = { language . t ( "command.terminal.toggle" ) }
423- keybind = { command . keybind ( "terminal.toggle" ) }
424- >
425- < Button
426- variant = "ghost"
427- class = "group/terminal-toggle titlebar-icon w-8 h-6 p-0 box-border shrink-0"
428- onClick = { toggleTerminal }
429- aria-label = { language . t ( "command.terminal.toggle" ) }
430- aria-expanded = { view ( ) . terminal . opened ( ) }
431- aria-controls = "terminal-panel"
423+ < Show when = { status ( ) } >
424+ < Tooltip placement = "bottom" value = { language . t ( "status.popover.trigger" ) } >
425+ < StatusPopover />
426+ </ Tooltip >
427+ </ Show >
428+ < Show when = { term ( ) } >
429+ < TooltipKeybind
430+ title = { language . t ( "command.terminal.toggle" ) }
431+ keybind = { command . keybind ( "terminal.toggle" ) }
432432 >
433- < Icon size = "small" name = { view ( ) . terminal . opened ( ) ? "terminal-active" : "terminal" } />
434- </ Button >
435- </ TooltipKeybind >
433+ < Button
434+ variant = "ghost"
435+ class = "group/terminal-toggle titlebar-icon w-8 h-6 p-0 box-border shrink-0"
436+ onClick = { toggleTerminal }
437+ aria-label = { language . t ( "command.terminal.toggle" ) }
438+ aria-expanded = { view ( ) . terminal . opened ( ) }
439+ aria-controls = "terminal-panel"
440+ >
441+ < Icon size = "small" name = { view ( ) . terminal . opened ( ) ? "terminal-active" : "terminal" } />
442+ </ Button >
443+ </ TooltipKeybind >
444+ </ Show >
436445
437446 < div class = "hidden md:flex items-center gap-1 shrink-0" >
438447 < TooltipKeybind
@@ -451,30 +460,32 @@ export function SessionHeader() {
451460 </ Button >
452461 </ TooltipKeybind >
453462
454- < TooltipKeybind
455- title = { language . t ( "command.fileTree.toggle" ) }
456- keybind = { command . keybind ( "fileTree.toggle" ) }
457- >
458- < Button
459- variant = "ghost"
460- class = "titlebar-icon w-8 h-6 p-0 box-border"
461- onClick = { ( ) => layout . fileTree . toggle ( ) }
462- aria-label = { language . t ( "command.fileTree.toggle" ) }
463- aria-expanded = { layout . fileTree . opened ( ) }
464- aria-controls = "file-tree-panel"
463+ < Show when = { tree ( ) } >
464+ < TooltipKeybind
465+ title = { language . t ( "command.fileTree.toggle" ) }
466+ keybind = { command . keybind ( "fileTree.toggle" ) }
465467 >
466- < div class = "relative flex items-center justify-center size-4" >
467- < Icon
468- size = "small"
469- name = { layout . fileTree . opened ( ) ? "file-tree-active" : "file-tree" }
470- classList = { {
471- "text-icon-strong" : layout . fileTree . opened ( ) ,
472- "text-icon-weak" : ! layout . fileTree . opened ( ) ,
473- } }
474- />
475- </ div >
476- </ Button >
477- </ TooltipKeybind >
468+ < Button
469+ variant = "ghost"
470+ class = "titlebar-icon w-8 h-6 p-0 box-border"
471+ onClick = { ( ) => layout . fileTree . toggle ( ) }
472+ aria-label = { language . t ( "command.fileTree.toggle" ) }
473+ aria-expanded = { layout . fileTree . opened ( ) }
474+ aria-controls = "file-tree-panel"
475+ >
476+ < div class = "relative flex items-center justify-center size-4" >
477+ < Icon
478+ size = "small"
479+ name = { layout . fileTree . opened ( ) ? "file-tree-active" : "file-tree" }
480+ classList = { {
481+ "text-icon-strong" : layout . fileTree . opened ( ) ,
482+ "text-icon-weak" : ! layout . fileTree . opened ( ) ,
483+ } }
484+ />
485+ </ div >
486+ </ Button >
487+ </ TooltipKeybind >
488+ </ Show >
478489 </ div >
479490 </ div >
480491 </ div >
0 commit comments