File tree Expand file tree Collapse file tree 4 files changed +13
-4
lines changed
Expand file tree Collapse file tree 4 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 682682 opacity : 0.85 ;
683683}
684684
685+ .toggle-switch : focus-visible {
686+ border-radius : 4px ;
687+ }
688+
685689.toggle-switch .toggle-label {
686690 font-size : 11px ;
687691 font-weight : 500 ;
Original file line number Diff line number Diff line change @@ -733,14 +733,18 @@ function toggleAllBytecode() {
733733 }
734734}
735735
736- // Keyboard shortcut: 'b' toggles all bytecode panels
736+ // Keyboard shortcut: 'b' toggles all bytecode panels, Enter/Space activates toggle switches
737737document . addEventListener ( 'keydown' , function ( e ) {
738738 if ( e . target . tagName === 'INPUT' || e . target . tagName === 'TEXTAREA' ) {
739739 return ;
740740 }
741741 if ( e . key === 'b' && ! e . ctrlKey && ! e . altKey && ! e . metaKey ) {
742742 toggleAllBytecode ( ) ;
743743 }
744+ if ( ( e . key === 'Enter' || e . key === ' ' ) && e . target . classList . contains ( 'toggle-switch' ) ) {
745+ e . preventDefault ( ) ;
746+ e . target . click ( ) ;
747+ }
744748} ) ;
745749
746750// Handle hash changes
Original file line number Diff line number Diff line change 7070 </ div >
7171 < div class ="legend-separator " aria-hidden ="true "> </ div >
7272 < div class ="legend-controls ">
73- < div class ="toggle-switch " id ="toggle-color-mode " title ="Toggle between self time and total time coloring ">
73+ < div class ="toggle-switch " id ="toggle-color-mode " title ="Toggle between self time and total time coloring " tabindex =" 0 " >
7474 < span class ="toggle-label active " data-text ="Self Time "> Self Time</ span >
7575 < div class ="toggle-track "> </ div >
7676 < span class ="toggle-label " data-text ="Total Time "> Total Time</ span >
7777 </ div >
78- < div class ="toggle-switch " id ="toggle-cold " title ="Toggle visibility of lines with zero samples ">
78+ < div class ="toggle-switch " id ="toggle-cold " title ="Toggle visibility of lines with zero samples " tabindex =" 0 " >
7979 < span class ="toggle-label active " data-text ="Show All "> Show All</ span >
8080 < div class ="toggle-track "> </ div >
8181 < span class ="toggle-label " data-text ="Hot Only "> Hot Only</ span >
8282 </ div >
83- < div class ="toggle-switch " id ="toggle-spec-view " title ="Color lines by specialization level (requires bytecode data) ">
83+ < div class ="toggle-switch " id ="toggle-spec-view " title ="Color lines by specialization level (requires bytecode data) " tabindex =" 0 " >
8484 < span class ="toggle-label active " data-text ="Heat "> Heat</ span >
8585 < div class ="toggle-track "> </ div >
8686 < span class ="toggle-label " data-text ="Specialization "> Specialization</ span >
Original file line number Diff line number Diff line change @@ -387,6 +387,7 @@ body {
387387button : focus-visible ,
388388select : focus-visible ,
389389input : focus-visible ,
390+ .toggle-switch : focus-visible ,
390391a .toolbar-btn : focus-visible {
391392 outline : 2px solid var (--python-gold );
392393 outline-offset : 2px ;
You can’t perform that action at this time.
0 commit comments