@@ -13,6 +13,27 @@ import RequirementsNotice from "./components/RequirementsNotice";
1313import { useToast } from "./hooks/use-toast" ;
1414import { useGithubAuth } from "./hooks/useGithubAuth" ;
1515import emdashLogo from "../assets/images/emdash/emdash_logo.svg" ;
16+ import Titlebar from "./components/titlebar/Titlebar" ;
17+ import { SidebarProvider , useSidebar } from "./components/ui/sidebar" ;
18+
19+ const SidebarHotkeys : React . FC = ( ) => {
20+ const { toggle } = useSidebar ( ) ;
21+
22+ useEffect ( ( ) => {
23+ if ( typeof window === "undefined" ) return undefined ;
24+ const handler = ( event : KeyboardEvent ) => {
25+ if ( ( event . metaKey || event . ctrlKey ) && event . key . toLowerCase ( ) === "b" ) {
26+ event . preventDefault ( ) ;
27+ toggle ( ) ;
28+ }
29+ } ;
30+
31+ window . addEventListener ( "keydown" , handler ) ;
32+ return ( ) => window . removeEventListener ( "keydown" , handler ) ;
33+ } , [ toggle ] ) ;
34+
35+ return null ;
36+ } ;
1637
1738interface Project {
1839 id : string ;
@@ -458,23 +479,9 @@ const App: React.FC = () => {
458479 } ) ;
459480 } ;
460481
461- return (
462- < div className = "h-screen flex bg-background text-foreground" >
463- < LeftSidebar
464- projects = { projects }
465- selectedProject = { selectedProject }
466- onSelectProject = { handleSelectProject }
467- onGoHome = { handleGoHome }
468- onSelectWorkspace = { handleSelectWorkspace }
469- activeWorkspace = { activeWorkspace || undefined }
470- onReorderProjects = { handleReorderProjects }
471- onReorderProjectsFull = { handleReorderProjectsFull }
472- githubInstalled = { ghInstalled }
473- githubAuthenticated = { isAuthenticated }
474- githubUser = { user }
475- />
476-
477- { showHomeView ? (
482+ const renderMainContent = ( ) => {
483+ if ( showHomeView ) {
484+ return (
478485 < div className = "flex-1 bg-background text-foreground overflow-y-auto" >
479486 < div className = "container mx-auto px-4 py-8 flex flex-col justify-center min-h-screen" >
480487 < div className = "text-center mb-12" >
@@ -526,7 +533,11 @@ const App: React.FC = () => {
526533 { null }
527534 </ div >
528535 </ div >
529- ) : selectedProject ? (
536+ ) ;
537+ }
538+
539+ if ( selectedProject ) {
540+ return (
530541 < div className = "flex-1 flex bg-background text-foreground overflow-hidden" >
531542 < div className = "flex-1 min-h-0 overflow-hidden flex flex-col" >
532543 { activeWorkspace ? (
@@ -548,7 +559,7 @@ const App: React.FC = () => {
548559 </ div >
549560
550561 { activeWorkspace && (
551- < div className = "w-80 border-l border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900 flex flex-col h-screen max-h-screen " >
562+ < div className = "w-80 border-l border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900 flex flex-col h-full max-h-full " >
552563 < FileChangesPanel
553564 workspaceId = { activeWorkspace . path }
554565 className = "flex-1 min-h-0"
@@ -560,44 +571,71 @@ const App: React.FC = () => {
560571 </ div >
561572 ) }
562573 </ div >
563- ) : (
564- < div className = "flex-1 bg-background text-foreground overflow-y-auto" >
565- < div className = "container mx-auto px-4 py-8 flex flex-col justify-center min-h-screen" >
566- < div className = "text-center mb-12" >
567- < div className = "flex items-center justify-center mb-4" >
568- < img
569- src = { emdashLogo }
570- alt = "emdash"
571- className = "h-16"
572- />
573- </ div >
574- < p className = "text-sm sm:text-base text-gray-700 text-muted-foreground mb-6" >
575- Run multiple Coding Agents in parallel
576- </ p >
577- < RequirementsNotice
578- showGithubRequirement = { showGithubRequirement }
579- needsGhInstall = { needsGhInstall }
580- needsGhAuth = { needsGhAuth }
581- showAgentRequirement = { showAgentRequirement }
582- />
583- </ div >
574+ ) ;
575+ }
584576
585- < div className = "flex flex-col sm:flex-row gap-4 justify-center mb-8" >
586- < Button
587- onClick = { handleOpenProject }
588- size = "lg"
589- className = "min-w-[200px] bg-black text-white hover:bg-gray-800 hover:text-white border-black"
590- >
591- < FolderOpen className = "mr-2 h-5 w-5" />
592- Open Project
593- </ Button >
577+ return (
578+ < div className = "flex-1 bg-background text-foreground overflow-y-auto" >
579+ < div className = "container mx-auto px-4 py-8 flex flex-col justify-center min-h-screen" >
580+ < div className = "text-center mb-12" >
581+ < div className = "flex items-center justify-center mb-4" >
582+ < img
583+ src = { emdashLogo }
584+ alt = "emdash"
585+ className = "h-16"
586+ />
594587 </ div >
588+ < p className = "text-sm sm:text-base text-gray-700 text-muted-foreground mb-6" >
589+ Run multiple Coding Agents in parallel
590+ </ p >
591+ < RequirementsNotice
592+ showGithubRequirement = { showGithubRequirement }
593+ needsGhInstall = { needsGhInstall }
594+ needsGhAuth = { needsGhAuth }
595+ showAgentRequirement = { showAgentRequirement }
596+ />
597+ </ div >
595598
596- { null }
599+ < div className = "flex flex-col sm:flex-row gap-4 justify-center mb-8" >
600+ < Button
601+ onClick = { handleOpenProject }
602+ size = "lg"
603+ className = "min-w-[200px] bg-black text-white hover:bg-gray-800 hover:text-white border-black"
604+ >
605+ < FolderOpen className = "mr-2 h-5 w-5" />
606+ Open Project
607+ </ Button >
597608 </ div >
609+
610+ { null }
598611 </ div >
599- ) }
612+ </ div >
613+ ) ;
614+ } ;
600615
616+ return (
617+ < SidebarProvider >
618+ < SidebarHotkeys />
619+ < Titlebar />
620+ < div className = "mt-9 flex h-[calc(100vh-36px)] w-full bg-background text-foreground overflow-hidden" >
621+ < LeftSidebar
622+ projects = { projects }
623+ selectedProject = { selectedProject }
624+ onSelectProject = { handleSelectProject }
625+ onGoHome = { handleGoHome }
626+ onSelectWorkspace = { handleSelectWorkspace }
627+ activeWorkspace = { activeWorkspace || undefined }
628+ onReorderProjects = { handleReorderProjects }
629+ onReorderProjectsFull = { handleReorderProjectsFull }
630+ githubInstalled = { ghInstalled }
631+ githubAuthenticated = { isAuthenticated }
632+ githubUser = { user }
633+ />
634+
635+ < div className = "flex-1 overflow-hidden flex flex-col" >
636+ { renderMainContent ( ) }
637+ </ div >
638+ </ div >
601639 < WorkspaceModal
602640 isOpen = { showWorkspaceModal }
603641 onClose = { ( ) => setShowWorkspaceModal ( false ) }
@@ -607,7 +645,7 @@ const App: React.FC = () => {
607645 existingNames = { ( selectedProject ?. workspaces || [ ] ) . map ( ( w ) => w . name ) }
608646 />
609647 < Toaster />
610- </ div >
648+ </ SidebarProvider >
611649 ) ;
612650} ;
613651
0 commit comments