@@ -672,7 +672,12 @@ export class CommitsPanel extends LitElement {
672
672
this . requestUpdate ( ) ; // Re-render to hide unassign drop zone
673
673
}
674
674
675
- private dispatchCommitSelect ( commitId : string , multiSelect : boolean = false ) {
675
+ private dispatchCommitSelect ( commitId : string , e ?: MouseEvent | KeyboardEvent ) {
676
+ if ( e instanceof KeyboardEvent && e . key !== 'Enter' ) {
677
+ return ;
678
+ }
679
+
680
+ const multiSelect = e ?. shiftKey ?? false ;
676
681
this . dispatchEvent (
677
682
new CustomEvent ( 'commit-select' , {
678
683
detail : { commitId : commitId , multiSelect : multiSelect } ,
@@ -681,7 +686,9 @@ export class CommitsPanel extends LitElement {
681
686
) ;
682
687
}
683
688
684
- private dispatchUnassignedSelect ( section : string ) {
689
+ private dispatchUnassignedSelect ( section : string , e ?: MouseEvent | KeyboardEvent ) {
690
+ if ( e instanceof KeyboardEvent && e . key !== 'Enter' ) return ;
691
+
685
692
this . dispatchEvent (
686
693
new CustomEvent ( 'unassigned-select' , {
687
694
detail : { section : section } ,
@@ -787,7 +794,9 @@ export class CommitsPanel extends LitElement {
787
794
) ;
788
795
}
789
796
790
- private handleCompositionSummaryClick ( ) {
797
+ private handleCompositionSummaryClick ( e : MouseEvent | KeyboardEvent ) {
798
+ if ( e instanceof KeyboardEvent && e . key !== 'Enter' ) return ;
799
+
791
800
// Dispatch event to show composition summary
792
801
this . dispatchEvent (
793
802
new CustomEvent ( 'select-composition-summary' , {
@@ -912,7 +921,9 @@ export class CommitsPanel extends LitElement {
912
921
class ="composer-item is-uncommitted ${ this . selectedUnassignedSection === section . key
913
922
? ' is-selected'
914
923
: '' } "
915
- @click =${ ( ) => this . dispatchUnassignedSelect ( section . key ) }
924
+ tabindex ="0 "
925
+ @click =${ ( e : MouseEvent ) => this . dispatchUnassignedSelect ( section . key , e ) }
926
+ @keydown =${ ( e : KeyboardEvent ) => this . dispatchUnassignedSelect ( section . key , e ) }
916
927
>
917
928
< div class ="composer-item__content ">
918
929
< div class ="composer-item__header ">
@@ -960,7 +971,9 @@ export class CommitsPanel extends LitElement {
960
971
< h3 class ="composition-summary__header "> Composition Summary</ h3 >
961
972
< div
962
973
class ="composer-item is-summary ${ this . compositionSummarySelected ? ' is-selected' : '' } "
974
+ tabindex ="0 "
963
975
@click =${ this . handleCompositionSummaryClick }
976
+ @keydown =${ this . handleCompositionSummaryClick }
964
977
>
965
978
< div class ="composer-item__content ">
966
979
< div class ="composer-item__header ">
@@ -1168,8 +1181,8 @@ export class CommitsPanel extends LitElement {
1168
1181
.multiSelected=${ this . selectedCommitIds . has ( commit . id ) }
1169
1182
.isPreviewMode=${ this . isPreviewMode }
1170
1183
?first=${ i === 0 }
1171
- @click=${ ( e : MouseEvent ) =>
1172
- this . dispatchCommitSelect ( commit . id , e . shiftKey ) }
1184
+ @click=${ ( e : MouseEvent ) => this . dispatchCommitSelect ( commit . id , e ) }
1185
+ @keydown= ${ ( e : KeyboardEvent ) => this . dispatchCommitSelect ( commit . id , e ) }
1173
1186
> </ gl-commit-item >
1174
1187
` ;
1175
1188
} ,
0 commit comments