@@ -260,6 +260,24 @@ function switchBlockByBlockNum(index: number) {
260260 } , 10 ) ;
261261}
262262
263+ function cycleBlockFocus ( delta : 1 | - 1 ) {
264+ const layoutModel = getLayoutModelForStaticTab ( ) ;
265+ if ( ! layoutModel ) {
266+ return ;
267+ }
268+ const leafOrder = globalStore . get ( layoutModel . leafOrder ) ;
269+ if ( leafOrder . length === 0 ) {
270+ return ;
271+ }
272+ const focusedNodeId = layoutModel . focusedNodeId ;
273+ const curIdx = leafOrder . findIndex ( ( e ) => e . nodeid === focusedNodeId ) ;
274+ const nextIdx = ( curIdx + delta + leafOrder . length ) % leafOrder . length ;
275+ layoutModel . focusNode ( leafOrder [ nextIdx ] . nodeid ) ;
276+ setTimeout ( ( ) => {
277+ globalRefocus ( ) ;
278+ } , 10 ) ;
279+ }
280+
263281function switchBlockInDirection ( direction : NavigateDirection ) {
264282 const layoutModel = getLayoutModelForStaticTab ( ) ;
265283 const focusType = FocusManager . getInstance ( ) . getFocusType ( ) ;
@@ -591,15 +609,15 @@ const defaultActions: ActionDef[] = [
591609 } ,
592610 } ,
593611 {
594- id : "block:splitRight " ,
612+ id : "block:splitright " ,
595613 defaultKeys : [ "Cmd:d" ] ,
596614 handler : ( ) => {
597615 handleSplitHorizontal ( "after" ) ;
598616 return true ;
599617 } ,
600618 } ,
601619 {
602- id : "block:splitDown " ,
620+ id : "block:splitdown " ,
603621 defaultKeys : [ "Shift:Cmd:d" ] ,
604622 handler : ( ) => {
605623 handleSplitVertical ( "after" ) ;
@@ -651,27 +669,43 @@ const defaultActions: ActionDef[] = [
651669 } ,
652670 } ,
653671 {
654- id : "block:navUp " ,
672+ id : "block:navup " ,
655673 defaultKeys : [ "Ctrl:Shift:ArrowUp" , "Ctrl:Shift:k" ] ,
656674 handler : makeBlockNavHandler ( NavigateDirection . Up ) ,
657675 } ,
658676 {
659- id : "block:navDown " ,
677+ id : "block:navdown " ,
660678 defaultKeys : [ "Ctrl:Shift:ArrowDown" , "Ctrl:Shift:j" ] ,
661679 handler : makeBlockNavHandler ( NavigateDirection . Down ) ,
662680 } ,
663681 {
664- id : "block:navLeft " ,
682+ id : "block:navleft " ,
665683 defaultKeys : [ "Ctrl:Shift:ArrowLeft" , "Ctrl:Shift:h" ] ,
666684 handler : makeBlockNavHandler ( NavigateDirection . Left ) ,
667685 } ,
668686 {
669- id : "block:navRight " ,
687+ id : "block:navright " ,
670688 defaultKeys : [ "Ctrl:Shift:ArrowRight" , "Ctrl:Shift:l" ] ,
671689 handler : makeBlockNavHandler ( NavigateDirection . Right ) ,
672690 } ,
673691 {
674- id : "block:replaceWithLauncher" ,
692+ id : "block:focusnext" ,
693+ defaultKeys : [ "Ctrl:Shift:]" ] ,
694+ handler : ( ) => {
695+ cycleBlockFocus ( 1 ) ;
696+ return true ;
697+ } ,
698+ } ,
699+ {
700+ id : "block:focusprev" ,
701+ defaultKeys : [ "Ctrl:Shift:[" ] ,
702+ handler : ( ) => {
703+ cycleBlockFocus ( - 1 ) ;
704+ return true ;
705+ } ,
706+ } ,
707+ {
708+ id : "block:replacewithlauncher" ,
675709 defaultKeys : [ "Ctrl:Shift:x" ] ,
676710 handler : ( ) => {
677711 const blockId = getFocusedBlockId ( ) ;
@@ -691,7 +725,7 @@ const defaultActions: ActionDef[] = [
691725 } ,
692726 } ,
693727 {
694- id : "app:openConnection " ,
728+ id : "app:openconnection " ,
695729 defaultKeys : [ "Cmd:g" ] ,
696730 handler : ( ) => {
697731 const bcm = getBlockComponentModel ( getFocusedBlockInStaticTab ( ) ) ;
@@ -704,7 +738,7 @@ const defaultActions: ActionDef[] = [
704738 } ,
705739 } ,
706740 {
707- id : "term:toggleMultiInput " ,
741+ id : "term:togglemultiinput " ,
708742 defaultKeys : [ "Ctrl:Shift:i" ] ,
709743 handler : ( ) => {
710744 const tabModel = getActiveTabModel ( ) ;
@@ -740,7 +774,7 @@ const defaultActions: ActionDef[] = [
740774 } ,
741775 } ,
742776 {
743- id : "app:toggleAIPanel " ,
777+ id : "app:toggleaipanel " ,
744778 defaultKeys : [ "Cmd:Shift:a" ] ,
745779 handler : ( ) => {
746780 const currentVisible = WorkspaceLayoutModel . getInstance ( ) . getAIPanelVisible ( ) ;
@@ -749,7 +783,7 @@ const defaultActions: ActionDef[] = [
749783 } ,
750784 } ,
751785 {
752- id : "app:toggleWidgetsSidebar " ,
786+ id : "app:togglewidgetssidebar " ,
753787 defaultKeys : [ "Cmd:b" ] ,
754788 handler : ( ) => {
755789 const current = WorkspaceLayoutModel . getInstance ( ) . getWidgetsSidebarVisible ( ) ;
@@ -762,15 +796,15 @@ const defaultActions: ActionDef[] = [
762796 const idx = i + 1 ;
763797 return [
764798 {
765- id : `tab:switchTo ${ idx } ` ,
799+ id : `tab:switchto ${ idx } ` ,
766800 defaultKeys : [ `Cmd:${ idx } ` ] ,
767801 handler : ( ) => {
768802 switchTabAbs ( idx ) ;
769803 return true ;
770804 } ,
771805 } as ActionDef ,
772806 {
773- id : `block:switchTo ${ idx } ` ,
807+ id : `block:switchto ${ idx } ` ,
774808 defaultKeys : [ `Ctrl:Shift:c{Digit${ idx } }` , `Ctrl:Shift:c{Numpad${ idx } }` ] ,
775809 handler : ( ) => {
776810 switchBlockByBlockNum ( idx ) ;
@@ -781,7 +815,7 @@ const defaultActions: ActionDef[] = [
781815 } ) . flat ( ) ,
782816 // AI focus (block 0) — platform-dependent keys
783817 {
784- id : "block:switchToAI " ,
818+ id : "block:switchtoai " ,
785819 defaultKeys : isWindows ( )
786820 ? [ "Alt:c{Digit0}" , "Alt:c{Numpad0}" ]
787821 : [ "Ctrl:Shift:c{Digit0}" , "Ctrl:Shift:c{Numpad0}" ] ,
@@ -792,43 +826,43 @@ const defaultActions: ActionDef[] = [
792826 } ,
793827 // Chord initiator for block splitting
794828 {
795- id : "block:splitChord " ,
829+ id : "block:splitchord " ,
796830 defaultKeys : [ "Ctrl:Shift:s" ] ,
797831 handler : ( ) => true ,
798832 } ,
799833] ;
800834
801835const defaultChordActions : ChordActionDef [ ] = [
802836 {
803- id : "block:splitChordUp " ,
804- parentId : "block:splitChord " ,
837+ id : "block:splitchordup " ,
838+ parentId : "block:splitchord " ,
805839 defaultKey : "ArrowUp" ,
806840 handler : ( ) => {
807841 handleSplitVertical ( "before" ) ;
808842 return true ;
809843 } ,
810844 } ,
811845 {
812- id : "block:splitChordDown " ,
813- parentId : "block:splitChord " ,
846+ id : "block:splitchorddown " ,
847+ parentId : "block:splitchord " ,
814848 defaultKey : "ArrowDown" ,
815849 handler : ( ) => {
816850 handleSplitVertical ( "after" ) ;
817851 return true ;
818852 } ,
819853 } ,
820854 {
821- id : "block:splitChordLeft " ,
822- parentId : "block:splitChord " ,
855+ id : "block:splitchordleft " ,
856+ parentId : "block:splitchord " ,
823857 defaultKey : "ArrowLeft" ,
824858 handler : ( ) => {
825859 handleSplitHorizontal ( "before" ) ;
826860 return true ;
827861 } ,
828862 } ,
829863 {
830- id : "block:splitChordRight " ,
831- parentId : "block:splitChord " ,
864+ id : "block:splitchordright " ,
865+ parentId : "block:splitchord " ,
832866 defaultKey : "ArrowRight" ,
833867 handler : ( ) => {
834868 handleSplitHorizontal ( "after" ) ;
@@ -852,11 +886,11 @@ function buildKeyMaps(userOverrides: KeybindingEntry[]): void {
852886 }
853887
854888 // 2. Build chord bindings from defaults
855- const chordInitiatorAction = defaultActions . find ( ( a ) => a . id === "block:splitChord " ) ;
889+ const chordInitiatorAction = defaultActions . find ( ( a ) => a . id === "block:splitchord " ) ;
856890 if ( chordInitiatorAction ) {
857891 const subKeys : KeyMapEntry [ ] = [ ] ;
858892 for ( const chordDef of defaultChordActions ) {
859- if ( chordDef . parentId === "block:splitChord " ) {
893+ if ( chordDef . parentId === "block:splitchord " ) {
860894 actionHandlers . set ( chordDef . id , chordDef . handler ) ;
861895 subKeys . push ( { key : chordDef . defaultKey , handler : chordDef . handler } ) ;
862896 }
0 commit comments