@@ -13,6 +13,7 @@ import { useLayout, usePanelResize } from '@/context/layout-context'
1313import { useAppMode } from '@/context/app-mode-context'
1414import { WorkspaceSidebar } from '@/components/workspace-sidebar'
1515import { FloatingPanel } from '@/components/floating-panel'
16+ import { EditorTabs } from '@/components/editor-tabs'
1617import { isTauri } from '@/lib/tauri'
1718import {
1819 fetchFileContentsByName as fetchFileContents ,
@@ -149,6 +150,8 @@ export default function EditorLayout() {
149150 )
150151 const showMobileBottomTabs = isMobile && ! modeSpec . terminalCenter && keyboardOffset === 0
151152 const showMobileSidebarButton = isMobile && mode !== 'tui' && ! usePrismShell
153+ const showWorkflowEditorTabs =
154+ ! isMobile && ! modeSpec . terminalCenter && activeView === 'workshop' && files . length > 0
152155 const mobileTerminalOffset = showMobileBottomTabs
153156 ? 'calc(env(safe-area-inset-bottom) + 5.75rem)'
154157 : 'calc(env(safe-area-inset-bottom) + 0.5rem)'
@@ -345,16 +348,23 @@ export default function EditorLayout() {
345348 const { path, sha, content : providedContent } = detail ?? { }
346349 if ( ! path ) return
347350
351+ const revealEditorFromChat = ( ) => {
352+ if ( activeView === 'chat' ) {
353+ layout . show ( 'chat' )
354+ }
355+ setView ( 'editor' )
356+ }
357+
348358 const existing = files . find ( ( f ) => f . path === path )
349359 if ( existing ) {
350360 setActiveFile ( path )
351- setView ( 'editor' )
361+ revealEditorFromChat ( )
352362 return
353363 }
354364
355365 if ( providedContent != null ) {
356366 openFile ( path , providedContent , sha ?? '' )
357- setView ( 'editor' )
367+ revealEditorFromChat ( )
358368 return
359369 }
360370
@@ -372,7 +382,7 @@ export default function EditorLayout() {
372382 const content = await localReadFile ( path )
373383 openFile ( path , content , '' )
374384 }
375- setView ( 'editor' )
385+ revealEditorFromChat ( )
376386 } catch ( err ) {
377387 console . error ( 'Failed to read local file:' , path , err )
378388 }
@@ -389,13 +399,24 @@ export default function EditorLayout() {
389399 } else {
390400 openFile ( path , result . content , result . sha ?? sha ?? '' )
391401 }
392- setView ( 'editor' )
402+ revealEditorFromChat ( )
393403 } catch ( err ) {
394404 console . error ( 'Failed to open file:' , path , err )
395405 }
396406 }
397407 } )
398- } , [ repo , files , openFile , setActiveFile , setView , localMode , localReadFile , localReadFileBase64 ] )
408+ } , [
409+ repo ,
410+ files ,
411+ openFile ,
412+ setActiveFile ,
413+ setView ,
414+ activeView ,
415+ layout ,
416+ localMode ,
417+ localReadFile ,
418+ localReadFileBase64 ,
419+ ] )
399420
400421 // ─── Commit handler ────────────────────────────────────
401422 useEffect ( ( ) => {
@@ -680,6 +701,8 @@ export default function EditorLayout() {
680701 </ div >
681702 ) }
682703
704+ { showWorkflowEditorTabs && < EditorTabs onTabSelect = { ( ) => setView ( 'editor' ) } /> }
705+
683706 { /* Mode transition wrapper */ }
684707 < AnimatePresence mode = "wait" initial = { false } >
685708 < motion . div
0 commit comments