detached 74f641a

feat(keyboard): migrate all shortcuts from cmdorctrl to ctrl modifier

Removes support for cmd/cmdorctrl modifiers and standardizes on ctrl+ across all keyboard shortcuts. Existing configs with cmdorctrl still work via backward compatibility layer.
commit
74f641a0e398e4b0065c7f61f0c51f97b0d35626
author
bnema · · 2025-10-23 16:43 UTC
committer
bnema · · 2025-10-24 17:33 UTC
parent
fe885f2
signature
GPG Unverified2B82207D370127A0 The key is unknown
3 files · +10 -17
M gui/src/lib/keyboard/KeyboardService.ts +5 -10
@@ -343,13 +343,8 @@ export class KeyboardService {
343343 const parts: string[] = [];
344344
345345 // Add modifiers using MODIFIER_KEYS mapping
346- if (event.ctrlKey && event.metaKey) {
347- // Both ctrl and meta pressed - use cmdorctrl
348- parts.push("cmdorctrl");
349- } else if (event.ctrlKey) {
346+ if (event.ctrlKey) {
350347 parts.push("ctrl");
351- } else if (event.metaKey) {
352- parts.push("cmd");
353348 }
354349
355350 if (event.altKey) parts.push("alt");
@@ -407,20 +402,20 @@ export const keyboardService = new KeyboardService({
407402 globalShortcuts: [
408403 // Navigation shortcuts (migrated from controls module)
409404 {
410- key: "cmdorctrl+arrowleft",
405+ key: "ctrl+arrowleft",
411406 handler: () => {
412407 if (window.history.length > 1) {
413408 window.history.back();
414409 }
415410 },
416- description: "Navigate back (Ctrl/Cmd+Left Arrow)",
411+ description: "Navigate back (Ctrl+Left Arrow)",
417412 },
418413 {
419- key: "cmdorctrl+arrowright",
414+ key: "ctrl+arrowright",
420415 handler: () => {
421416 window.history.forward();
422417 },
423- description: "Navigate forward (Ctrl/Cmd+Right Arrow)",
418+ description: "Navigate forward (Ctrl+Right Arrow)",
424419 },
425420 // Note: Global UI shortcuts (Ctrl+L, Ctrl+F, Ctrl+Shift+C) are now handled
426421 // directly by the native Go shortcut handlers to ensure proper active pane detection.
@@ -343,13 +343,8 @@ export class KeyboardService {
343 const parts: string[] = [];343 const parts: string[] = [];
344 344
345 // Add modifiers using MODIFIER_KEYS mapping345 // Add modifiers using MODIFIER_KEYS mapping
346- if (event.ctrlKey && event.metaKey) {346+ if (event.ctrlKey) {
347- // Both ctrl and meta pressed - use cmdorctrl
348- parts.push("cmdorctrl");
349- } else if (event.ctrlKey) {
350 parts.push("ctrl");347 parts.push("ctrl");
351- } else if (event.metaKey) {
352- parts.push("cmd");
353 }348 }
354 349
355 if (event.altKey) parts.push("alt");350 if (event.altKey) parts.push("alt");
@@ -407,20 +402,20 @@ export const keyboardService = new KeyboardService({
407 globalShortcuts: [402 globalShortcuts: [
408 // Navigation shortcuts (migrated from controls module)403 // Navigation shortcuts (migrated from controls module)
409 {404 {
410- key: "cmdorctrl+arrowleft",405+ key: "ctrl+arrowleft",
411 handler: () => {406 handler: () => {
412 if (window.history.length > 1) {407 if (window.history.length > 1) {
413 window.history.back();408 window.history.back();
414 }409 }
415 },410 },
416- description: "Navigate back (Ctrl/Cmd+Left Arrow)",411+ description: "Navigate back (Ctrl+Left Arrow)",
417 },412 },
418 {413 {
419- key: "cmdorctrl+arrowright",414+ key: "ctrl+arrowright",
420 handler: () => {415 handler: () => {
421 window.history.forward();416 window.history.forward();
422 },417 },
423- description: "Navigate forward (Ctrl/Cmd+Right Arrow)",418+ description: "Navigate forward (Ctrl+Right Arrow)",
424 },419 },
425 // Note: Global UI shortcuts (Ctrl+L, Ctrl+F, Ctrl+Shift+C) are now handled420 // Note: Global UI shortcuts (Ctrl+L, Ctrl+F, Ctrl+Shift+C) are now handled
426 // directly by the native Go shortcut handlers to ensure proper active pane detection.421 // directly by the native Go shortcut handlers to ensure proper active pane detection.
M gui/src/lib/keyboard/types.ts +3 -5
@@ -6,7 +6,7 @@
66 */
77
88 export interface ShortcutConfig {
9- /** The keyboard shortcut key combination (e.g., 'cmdorctrl+l', 'escape', 'enter') */
9+ /** The keyboard shortcut key combination (e.g., 'ctrl+l', 'escape', 'enter') */
1010 key: string;
1111
1212 /** Function to execute when the shortcut is triggered */
@@ -78,8 +78,6 @@ export interface KeyboardEvent {
7878 */
7979 export const MODIFIER_KEYS = {
8080 ctrl: "ctrlKey",
81- cmd: "metaKey",
82- cmdorctrl: navigator.platform.includes("Mac") ? "metaKey" : "ctrlKey",
8381 alt: "altKey",
8482 shift: "shiftKey",
8583 } as const;
@@ -88,8 +86,8 @@ export const MODIFIER_KEYS = {
8886 * Common shortcut patterns used throughout the application
8987 */
9088 export const COMMON_SHORTCUTS = {
91- OMNIBOX_OPEN: "cmdorctrl+l",
92- FIND_OPEN: "cmdorctrl+f",
89+ OMNIBOX_OPEN: "ctrl+l",
90+ FIND_OPEN: "ctrl+f",
9391 ESCAPE: "escape",
9492 ENTER: "enter",
9593 ARROW_UP: "arrowup",
@@ -6,7 +6,7 @@
6 */6 */
7 7
8 export interface ShortcutConfig {8 export interface ShortcutConfig {
9- /** The keyboard shortcut key combination (e.g., 'cmdorctrl+l', 'escape', 'enter') */9+ /** The keyboard shortcut key combination (e.g., 'ctrl+l', 'escape', 'enter') */
10 key: string;10 key: string;
11 11
12 /** Function to execute when the shortcut is triggered */12 /** Function to execute when the shortcut is triggered */
@@ -78,8 +78,6 @@ export interface KeyboardEvent {
78 */78 */
79 export const MODIFIER_KEYS = {79 export const MODIFIER_KEYS = {
80 ctrl: "ctrlKey",80 ctrl: "ctrlKey",
81- cmd: "metaKey",
82- cmdorctrl: navigator.platform.includes("Mac") ? "metaKey" : "ctrlKey",
83 alt: "altKey",81 alt: "altKey",
84 shift: "shiftKey",82 shift: "shiftKey",
85 } as const;83 } as const;
@@ -88,8 +86,8 @@ export const MODIFIER_KEYS = {
88 * Common shortcut patterns used throughout the application86 * Common shortcut patterns used throughout the application
89 */87 */
90 export const COMMON_SHORTCUTS = {88 export const COMMON_SHORTCUTS = {
91- OMNIBOX_OPEN: "cmdorctrl+l",89+ OMNIBOX_OPEN: "ctrl+l",
92- FIND_OPEN: "cmdorctrl+f",90+ FIND_OPEN: "ctrl+f",
93 ESCAPE: "escape",91 ESCAPE: "escape",
94 ENTER: "enter",92 ENTER: "enter",
95 ARROW_UP: "arrowup",93 ARROW_UP: "arrowup",
M internal/app/browser/shortcuts.go +2 -2
@@ -67,7 +67,7 @@ func (s *ShortcutHandler) RegisterShortcuts() {
6767 // by WindowShortcutHandler at the window level to prevent duplicates
6868
6969 // Page refresh shortcuts
70- _ = s.webView.RegisterKeyboardShortcut("cmdorctrl+r", 0, func() {
70+ _ = s.webView.RegisterKeyboardShortcut("ctrl+r", 0, func() {
7171 if !s.isActivePane() {
7272 return
7373 }
@@ -75,7 +75,7 @@ func (s *ShortcutHandler) RegisterShortcuts() {
7575 _ = s.webView.Reload()
7676 })
7777
78- _ = s.webView.RegisterKeyboardShortcut("cmdorctrl+shift+r", 0, func() {
78+ _ = s.webView.RegisterKeyboardShortcut("ctrl+shift+r", 0, func() {
7979 if !s.isActivePane() {
8080 return
8181 }
@@ -67,7 +67,7 @@ func (s *ShortcutHandler) RegisterShortcuts() {
67 // by WindowShortcutHandler at the window level to prevent duplicates67 // by WindowShortcutHandler at the window level to prevent duplicates
68 68
69 // Page refresh shortcuts69 // Page refresh shortcuts
70- _ = s.webView.RegisterKeyboardShortcut("cmdorctrl+r", 0, func() {70+ _ = s.webView.RegisterKeyboardShortcut("ctrl+r", 0, func() {
71 if !s.isActivePane() {71 if !s.isActivePane() {
72 return72 return
73 }73 }
@@ -75,7 +75,7 @@ func (s *ShortcutHandler) RegisterShortcuts() {
75 _ = s.webView.Reload()75 _ = s.webView.Reload()
76 })76 })
77 77
78- _ = s.webView.RegisterKeyboardShortcut("cmdorctrl+shift+r", 0, func() {78+ _ = s.webView.RegisterKeyboardShortcut("ctrl+shift+r", 0, func() {
79 if !s.isActivePane() {79 if !s.isActivePane() {
80 return80 return
81 }81 }

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close