diff --git a/src-web/components/RecentRequestsDropdown.tsx b/src-web/components/RecentRequestsDropdown.tsx index a62fab40..97253cc2 100644 --- a/src-web/components/RecentRequestsDropdown.tsx +++ b/src-web/components/RecentRequestsDropdown.tsx @@ -31,7 +31,7 @@ export function RecentRequestsDropdown({ className }: Pick { if (e.metaKey) { e.preventDefault(); - dropdownRef.current?.toggle(0); + dropdownRef.current?.toggle(); } }); @@ -42,12 +42,12 @@ export function RecentRequestsDropdown({ className }: Pick { - if (!dropdownRef.current?.isOpen) dropdownRef.current?.open(1); + if (!dropdownRef.current?.isOpen) dropdownRef.current?.open(); dropdownRef.current?.next?.(); }); useHotKey('requestSwitcher.next', () => { - if (!dropdownRef.current?.isOpen) dropdownRef.current?.open(-1); + if (!dropdownRef.current?.isOpen) dropdownRef.current?.open(); dropdownRef.current?.prev?.(); }); diff --git a/src-web/components/ResponsePane.tsx b/src-web/components/ResponsePane.tsx index 69873e94..af434376 100644 --- a/src-web/components/ResponsePane.tsx +++ b/src-web/components/ResponsePane.tsx @@ -145,7 +145,7 @@ export const ResponsePane = memo(function ResponsePane({ style, className, activ {activeResponse?.error ? ( - + {activeResponse.error} ) : ( diff --git a/src-web/components/SidebarActions.tsx b/src-web/components/SidebarActions.tsx index 124642a7..c0e83312 100644 --- a/src-web/components/SidebarActions.tsx +++ b/src-web/components/SidebarActions.tsx @@ -32,11 +32,11 @@ export const SidebarActions = memo(function SidebarActions() { icon={hidden ? 'leftPanelHidden' : 'leftPanelVisible'} /> createHttpRequest.mutate({}), }, { diff --git a/src-web/hooks/useHotKey.ts b/src-web/hooks/useHotKey.ts index b38aa303..ce4ee25a 100644 --- a/src-web/hooks/useHotKey.ts +++ b/src-web/hooks/useHotKey.ts @@ -5,6 +5,7 @@ import { debounce } from '../lib/debounce'; import { useOsInfo } from './useOsInfo'; export type HotkeyAction = + | 'dropdown.close' | 'environmentEditor.toggle' | 'hotkeys.showHelp' | 'grpc_request.send' @@ -19,6 +20,7 @@ export type HotkeyAction = | 'urlBar.focus'; const hotkeys: Record = { + 'dropdown.close': ['Escape'], 'environmentEditor.toggle': ['CmdCtrl+Shift+e'], 'grpc_request.send': ['CmdCtrl+Enter', 'CmdCtrl+r'], 'hotkeys.showHelp': ['CmdCtrl+Shift+/'], @@ -34,6 +36,7 @@ const hotkeys: Record = { }; const hotkeyLabels: Record = { + 'dropdown.close': 'Close Dropdown', 'environmentEditor.toggle': 'Edit Environments', 'grpc_request.send': 'Send Message', 'hotkeys.showHelp': 'Show Keyboard Shortcuts', @@ -81,7 +84,7 @@ export function useAnyHotkey( useEffect(() => { // Sometimes the keyup event doesn't fire, so we clear the keys after a timeout - const clearCurrentKeys = debounce(() => currentKeys.current.clear(), 1000); + const clearCurrentKeys = debounce(() => currentKeys.current.clear(), 5000); const down = (e: KeyboardEvent) => { if (options.enable === false) {