diff --git a/src/ui/components/chrome/HelpDialog.tsx b/src/ui/components/chrome/HelpDialog.tsx index 51b63f39..1c222574 100644 --- a/src/ui/components/chrome/HelpDialog.tsx +++ b/src/ui/components/chrome/HelpDialog.tsx @@ -48,6 +48,7 @@ export function HelpDialog({ ["a", "toggle AI notes"], ["z", "toggle unchanged context"], ["l / w / m", "lines / wrap / metadata"], + ["e", "open file in $EDITOR"], ], }, { diff --git a/src/ui/components/ui-components.test.tsx b/src/ui/components/ui-components.test.tsx index 52f70191..297f2adc 100644 --- a/src/ui/components/ui-components.test.tsx +++ b/src/ui/components/ui-components.test.tsx @@ -2235,13 +2235,13 @@ describe("UI components", () => { const frame = await captureFrame( {}} />, 76, - 38, + 39, ); const expectedRows = [ @@ -2268,6 +2268,7 @@ describe("UI components", () => { "a toggle AI notes", "z toggle unchanged context", "l / w / m lines / wrap / metadata", + "e open file in $EDITOR", "Review", "/ focus file filter", "c create review note", diff --git a/src/ui/hooks/useAppKeyboardShortcuts.ts b/src/ui/hooks/useAppKeyboardShortcuts.ts index 85b1ca20..9154b130 100644 --- a/src/ui/hooks/useAppKeyboardShortcuts.ts +++ b/src/ui/hooks/useAppKeyboardShortcuts.ts @@ -108,6 +108,7 @@ export function useAppKeyboardShortcuts({ toggleGapForSelectedHunk, toggleHelp, toggleHunkHeaders, + triggerEditSelectedFile, toggleLineNumbers, toggleLineWrap, toggleSidebar, @@ -466,6 +467,11 @@ export function useAppKeyboardShortcuts({ return; } + if (key.name === "e" || key.sequence === "e") { + runAndCloseMenu(triggerEditSelectedFile); + return; + } + if (key.name === "[") { runAndCloseMenu(() => moveToHunk(-1)); return; diff --git a/src/ui/lib/appMenus.ts b/src/ui/lib/appMenus.ts index 4d5650ce..cf44d1d1 100644 --- a/src/ui/lib/appMenus.ts +++ b/src/ui/lib/appMenus.ts @@ -87,6 +87,7 @@ export function buildAppMenus({ { kind: "item", label: "Open file in editor", + hint: "e", action: triggerEditSelectedFile, }, ];