@@ -114,7 +114,7 @@ import { WorkspacePageContainer } from "../components/WorkspacePageContainer";
114114import { WorkspacePageHeader } from "../components/WorkspacePageHeader" ;
115115import { isCommandPaletteOpen } from "../commandPaletteBus" ;
116116import { isElectron } from "../env" ;
117- import { resolveShortcutCommand } from "../keybindings" ;
117+ import { resolveShortcutCommand , shortcutLabelForCommand } from "../keybindings" ;
118118import { isTerminalFocused } from "../lib/terminalFocus" ;
119119import { PanelLayoutControls } from "../components/chat/PanelLayoutControls" ;
120120import { Button } from "../components/ui/button" ;
@@ -1577,7 +1577,7 @@ function PullRequestsRouteView() {
15771577 terminalShortcutLabel = { null }
15781578 rightPanelAvailable = { rightPanelAvailable }
15791579 rightPanelOpen = { rightPanelState . isOpen }
1580- rightPanelShortcutLabel = { null }
1580+ rightPanelShortcutLabel = { shortcutLabelForCommand ( keybindings , "rightPanel.toggle" ) }
15811581 rightPanelUnavailableLabel = "Select a pull request first"
15821582 liveAgentCount = { 0 }
15831583 onToggleTerminal = { ( ) => undefined }
@@ -1914,13 +1914,20 @@ function PullRequestsRouteView() {
19141914 event . stopPropagation ( ) ;
19151915 if ( ! event . repeat ) closeSurface ( activePullRequestSurface ) ;
19161916 } ) ;
1917+ const toggleRightPanelFromShortcut = useEffectEvent ( ( event : KeyboardEvent ) => {
1918+ if ( ! rightPanelAvailable ) return ;
1919+ event . preventDefault ( ) ;
1920+ event . stopPropagation ( ) ;
1921+ toggleRightPanel ( ) ;
1922+ } ) ;
19171923 useEffect ( ( ) => {
19181924 const onKeyDown = ( event : KeyboardEvent ) => {
19191925 if ( event . defaultPrevented || isCommandPaletteOpen ( ) ) return ;
19201926 const command = resolveShortcutCommand ( event , keybindings , {
19211927 context : { terminalFocus : isTerminalFocused ( ) } ,
19221928 } ) ;
19231929 if ( command === "rightPanel.close" ) closeActiveSurfaceFromShortcut ( event ) ;
1930+ if ( command === "rightPanel.toggle" ) toggleRightPanelFromShortcut ( event ) ;
19241931 if ( command === "thread.copyReference" ) copyPullRequestFromShortcut ( event ) ;
19251932 } ;
19261933 window . addEventListener ( "keydown" , onKeyDown ) ;
0 commit comments