@@ -672,7 +672,12 @@ export class CommitsPanel extends LitElement {
672672 this . requestUpdate ( ) ; // Re-render to hide unassign drop zone
673673 }
674674
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 ;
676681 this . dispatchEvent (
677682 new CustomEvent ( 'commit-select' , {
678683 detail : { commitId : commitId , multiSelect : multiSelect } ,
@@ -681,7 +686,9 @@ export class CommitsPanel extends LitElement {
681686 ) ;
682687 }
683688
684- private dispatchUnassignedSelect ( section : string ) {
689+ private dispatchUnassignedSelect ( section : string , e ?: MouseEvent | KeyboardEvent ) {
690+ if ( e instanceof KeyboardEvent && e . key !== 'Enter' ) return ;
691+
685692 this . dispatchEvent (
686693 new CustomEvent ( 'unassigned-select' , {
687694 detail : { section : section } ,
@@ -787,7 +794,9 @@ export class CommitsPanel extends LitElement {
787794 ) ;
788795 }
789796
790- private handleCompositionSummaryClick ( ) {
797+ private handleCompositionSummaryClick ( e : MouseEvent | KeyboardEvent ) {
798+ if ( e instanceof KeyboardEvent && e . key !== 'Enter' ) return ;
799+
791800 // Dispatch event to show composition summary
792801 this . dispatchEvent (
793802 new CustomEvent ( 'select-composition-summary' , {
@@ -912,7 +921,9 @@ export class CommitsPanel extends LitElement {
912921 class ="composer-item is-uncommitted ${ this . selectedUnassignedSection === section . key
913922 ? ' is-selected'
914923 : '' } "
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 ) }
916927 >
917928 < div class ="composer-item__content ">
918929 < div class ="composer-item__header ">
@@ -960,7 +971,9 @@ export class CommitsPanel extends LitElement {
960971 < h3 class ="composition-summary__header "> Composition Summary</ h3 >
961972 < div
962973 class ="composer-item is-summary ${ this . compositionSummarySelected ? ' is-selected' : '' } "
974+ tabindex ="0 "
963975 @click =${ this . handleCompositionSummaryClick }
976+ @keydown =${ this . handleCompositionSummaryClick }
964977 >
965978 < div class ="composer-item__content ">
966979 < div class ="composer-item__header ">
@@ -1168,8 +1181,8 @@ export class CommitsPanel extends LitElement {
11681181 .multiSelected=${ this . selectedCommitIds . has ( commit . id ) }
11691182 .isPreviewMode=${ this . isPreviewMode }
11701183 ?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 ) }
11731186 > </ gl-commit-item >
11741187 ` ;
11751188 } ,
0 commit comments