@@ -936,6 +936,26 @@ export default function Layout(props: ParentProps) {
936936 navigateToSession ( session )
937937 }
938938
939+ function navigateProjectByOffset ( offset : number ) {
940+ const projects = layout . projects . list ( )
941+ if ( projects . length === 0 ) return
942+
943+ const current = currentProject ( ) ?. worktree
944+ const fallback = currentDir ( ) ? projectRoot ( currentDir ( ) ) : undefined
945+ const active = current ?? fallback
946+ const index = active ? projects . findIndex ( ( project ) => project . worktree === active ) : - 1
947+
948+ const target =
949+ index === - 1
950+ ? offset > 0
951+ ? projects [ 0 ]
952+ : projects [ projects . length - 1 ]
953+ : projects [ ( index + offset + projects . length ) % projects . length ]
954+ if ( ! target ) return
955+
956+ openProject ( target . worktree )
957+ }
958+
939959 function navigateSessionByUnseen ( offset : number ) {
940960 const sessions = currentSessions ( )
941961 if ( sessions . length === 0 ) return
@@ -1002,6 +1022,20 @@ export default function Layout(props: ParentProps) {
10021022 keybind : "mod+o" ,
10031023 onSelect : ( ) => chooseProject ( ) ,
10041024 } ,
1025+ {
1026+ id : "project.previous" ,
1027+ title : language . t ( "command.project.previous" ) ,
1028+ category : language . t ( "command.category.project" ) ,
1029+ keybind : "mod+alt+arrowup" ,
1030+ onSelect : ( ) => navigateProjectByOffset ( - 1 ) ,
1031+ } ,
1032+ {
1033+ id : "project.next" ,
1034+ title : language . t ( "command.project.next" ) ,
1035+ category : language . t ( "command.category.project" ) ,
1036+ keybind : "mod+alt+arrowdown" ,
1037+ onSelect : ( ) => navigateProjectByOffset ( 1 ) ,
1038+ } ,
10051039 {
10061040 id : "provider.connect" ,
10071041 title : language . t ( "command.provider.connect" ) ,
0 commit comments