@@ -31,8 +31,8 @@ import {
3131
3232type SelectionAction =
3333 | { _tag : "Move" ; offset : - 1 | 1 }
34- | { _tag : "NextSection" }
3534 | { _tag : "PreviousSection" }
35+ | { _tag : "NextSection" }
3636 | { _tag : "TogglePreview" }
3737 | { _tag : "OpenFullscreenPreview" } ;
3838
@@ -71,18 +71,18 @@ const selectionBindings: Array<ShortcutBinding<SelectionAction>> = [
7171 keys : [ "ArrowDown" , "j" ] ,
7272 action : { _tag : "Move" , offset : 1 } ,
7373 } ,
74- {
75- id : "next-section" ,
76- description : "Next section" ,
77- keys : [ "J" ] ,
78- action : { _tag : "NextSection" } ,
79- } ,
8074 {
8175 id : "previous-section" ,
8276 description : "Previous section" ,
83- keys : [ "K " ] ,
77+ keys : [ "Shift+ArrowUp" , "Shift+k "] ,
8478 action : { _tag : "PreviousSection" } ,
8579 } ,
80+ {
81+ id : "next-section" ,
82+ description : "Next section" ,
83+ keys : [ "Shift+ArrowDown" , "Shift+j" ] ,
84+ action : { _tag : "NextSection" } ,
85+ } ,
8686 togglePreviewBinding ,
8787 openFullscreenPreviewBinding ,
8888] ;
@@ -193,17 +193,12 @@ export const handleCommitEditingMessageKeyDown = ({
193193 const action = getAction ( commitEditingMessageBindings , event ) ;
194194 if ( ! action ) return ;
195195
196+ event . preventDefault ( ) ;
197+
196198 Match . value ( action ) . pipe (
197199 Match . tagsExhaustive ( {
198- Save : ( ) => {
199- if ( event . shiftKey ) return ;
200- event . preventDefault ( ) ;
201- onSave ( ) ;
202- } ,
203- Cancel : ( ) => {
204- event . preventDefault ( ) ;
205- onCancel ( ) ;
206- } ,
200+ Save : onSave ,
201+ Cancel : onCancel ,
207202 } ) ,
208203 ) ;
209204} ;
@@ -464,17 +459,17 @@ export const useWorkspaceShortcuts = ({
464459
465460 const move = ( offset : - 1 | 1 , selection : Item ) =>
466461 select ( getAdjacentItem ( navigationModel , selection , offset ) ) ;
467- const nextSection = ( selection : Item ) =>
468- select ( getAdjacentSection ( navigationModel , selection , 1 ) ) ;
469462 const previousSection = ( selection : Item ) =>
470463 select ( getParentSection ( selection ) ?? getAdjacentSection ( navigationModel , selection , - 1 ) ) ;
464+ const nextSection = ( selection : Item ) =>
465+ select ( getAdjacentSection ( navigationModel , selection , 1 ) ) ;
471466
472467 const handleSelectionAction = ( action : SelectionAction , selection : Item ) =>
473468 Match . value ( action ) . pipe (
474469 Match . tagsExhaustive ( {
475470 Move : ( { offset } ) => move ( offset , selection ) ,
476- NextSection : ( ) => nextSection ( selection ) ,
477471 PreviousSection : ( ) => previousSection ( selection ) ,
472+ NextSection : ( ) => nextSection ( selection ) ,
478473 TogglePreview : ( ) => setShowPreviewPanel ( ( visible ) => ! visible ) ,
479474 OpenFullscreenPreview : ( ) => setShowFullscreenPreview ( true ) ,
480475 } ) ,
@@ -546,7 +541,6 @@ export const useWorkspaceShortcuts = ({
546541
547542 const handleKeyDown = useEffectEvent ( ( event : KeyboardEvent ) => {
548543 if ( event . defaultPrevented ) return ;
549- if ( event . metaKey || event . ctrlKey || event . altKey ) return ;
550544 if ( isTypingTarget ( event . target ) ) return ;
551545 if ( isWithinBaseUiInert ( event . target ) ) return ;
552546
0 commit comments