detached 103eec0

refactor: remove action functions from shortcut definitions

commit
103eec06f7d4fee2085e34148fb412478239d41c
author
bamen · · 2025-09-26 04:08 UTC
parent
def2355
signature
unsigned
1 file · +18 -37
M gui/src/pages/Homepage.svelte +18 -37
@@ -16,7 +16,6 @@
1616 interface Shortcut {
1717 key: string;
1818 description: string;
19- action: () => void;
2019 }
2120
2221 interface HistoryStats {
@@ -95,95 +94,77 @@
9594 // Browser shortcuts
9695 {
9796 key: 'Ctrl+L',
98- description: 'Focus address bar',
99- action: () => console.log('Ctrl+L triggered')
97+ description: 'Focus address bar'
10098 },
10199 {
102100 key: 'Ctrl+F',
103- description: 'Find in page',
104- action: () => console.log('Ctrl+F triggered')
101+ description: 'Find in page'
105102 },
106103 {
107104 key: 'Ctrl+Shift+C',
108- description: 'Copy URL',
109- action: () => console.log('Ctrl+Shift+C triggered')
105+ description: 'Copy URL'
110106 },
111107 {
112108 key: 'Ctrl+R / F5',
113- description: 'Reload page',
114- action: () => window.location.reload()
109+ description: 'Reload page'
115110 },
116111 {
117112 key: 'Ctrl+Shift+R',
118- description: 'Hard reload',
119- action: () => console.log('Ctrl+Shift+R triggered')
113+ description: 'Hard reload'
120114 },
121115 {
122116 key: 'F12',
123- description: 'DevTools',
124- action: () => console.log('F12 triggered')
117+ description: 'DevTools'
125118 },
126119 {
127120 key: 'Ctrl+← / Ctrl+→',
128- description: 'Navigate back/forward',
129- action: () => console.log('Ctrl+Arrow triggered')
121+ description: 'Navigate back/forward'
130122 },
131123 {
132124 key: 'Ctrl+0',
133- description: 'Reset zoom',
134- action: () => console.log('Ctrl+0 triggered')
125+ description: 'Reset zoom'
135126 },
136127 {
137128 key: 'Ctrl++ / Ctrl+-',
138- description: 'Zoom in/out',
139- action: () => console.log('Ctrl+Zoom triggered')
129+ description: 'Zoom in/out'
140130 },
141131 // Workspace pane mode
142132 {
143133 key: 'Ctrl+P',
144- description: 'Enter pane mode',
145- action: () => console.log('Ctrl+P triggered')
134+ description: 'Enter pane mode'
146135 },
147136 {
148137 key: '→ / R (pane mode)',
149- description: 'Split pane right',
150- action: () => console.log('Split right triggered')
138+ description: 'Split pane right'
151139 },
152140 {
153141 key: '← / L (pane mode)',
154- description: 'Split pane left',
155- action: () => console.log('Split left triggered')
142+ description: 'Split pane left'
156143 },
157144 {
158145 key: '↑ / U (pane mode)',
159- description: 'Split pane up',
160- action: () => console.log('Split up triggered')
146+ description: 'Split pane up'
161147 },
162148 {
163149 key: '↓ / D (pane mode)',
164- description: 'Split pane down',
165- action: () => console.log('Split down triggered')
150+ description: 'Split pane down'
166151 },
167152 {
168153 key: 'X (pane mode)',
169- description: 'Close current pane',
170- action: () => console.log('Close pane triggered')
154+ description: 'Close current pane'
171155 },
172156 {
173157 key: 'Enter (pane mode)',
174- description: 'Confirm action',
175- action: () => console.log('Confirm triggered')
158+ description: 'Confirm action'
176159 },
177160 {
178161 key: 'Escape (pane mode)',
179- description: 'Exit pane mode',
180- action: () => console.log('Exit pane mode triggered')
162+ description: 'Exit pane mode'
181163 },
182164 // Workspace navigation
183165 {
184166 key: 'Alt+Arrow Keys',
185- description: 'Navigate between panes',
186- action: () => console.log('Navigate panes triggered')
167+ description: 'Navigate between panes'
187168 }
188169 ];
189170 shortcutsLoading = false;
@@ -16,7 +16,6 @@
16 interface Shortcut {16 interface Shortcut {
17 key: string;17 key: string;
18 description: string;18 description: string;
19- action: () => void;
20 }19 }
21 20
22 interface HistoryStats {21 interface HistoryStats {
@@ -95,95 +94,77 @@
95 // Browser shortcuts94 // Browser shortcuts
96 {95 {
97 key: 'Ctrl+L',96 key: 'Ctrl+L',
98- description: 'Focus address bar',97+ description: 'Focus address bar'
99- action: () => console.log('Ctrl+L triggered')
100 },98 },
101 {99 {
102 key: 'Ctrl+F',100 key: 'Ctrl+F',
103- description: 'Find in page',101+ description: 'Find in page'
104- action: () => console.log('Ctrl+F triggered')
105 },102 },
106 {103 {
107 key: 'Ctrl+Shift+C',104 key: 'Ctrl+Shift+C',
108- description: 'Copy URL',105+ description: 'Copy URL'
109- action: () => console.log('Ctrl+Shift+C triggered')
110 },106 },
111 {107 {
112 key: 'Ctrl+R / F5',108 key: 'Ctrl+R / F5',
113- description: 'Reload page',109+ description: 'Reload page'
114- action: () => window.location.reload()
115 },110 },
116 {111 {
117 key: 'Ctrl+Shift+R',112 key: 'Ctrl+Shift+R',
118- description: 'Hard reload',113+ description: 'Hard reload'
119- action: () => console.log('Ctrl+Shift+R triggered')
120 },114 },
121 {115 {
122 key: 'F12',116 key: 'F12',
123- description: 'DevTools',117+ description: 'DevTools'
124- action: () => console.log('F12 triggered')
125 },118 },
126 {119 {
127 key: 'Ctrl+← / Ctrl+→',120 key: 'Ctrl+← / Ctrl+→',
128- description: 'Navigate back/forward',121+ description: 'Navigate back/forward'
129- action: () => console.log('Ctrl+Arrow triggered')
130 },122 },
131 {123 {
132 key: 'Ctrl+0',124 key: 'Ctrl+0',
133- description: 'Reset zoom',125+ description: 'Reset zoom'
134- action: () => console.log('Ctrl+0 triggered')
135 },126 },
136 {127 {
137 key: 'Ctrl++ / Ctrl+-',128 key: 'Ctrl++ / Ctrl+-',
138- description: 'Zoom in/out',129+ description: 'Zoom in/out'
139- action: () => console.log('Ctrl+Zoom triggered')
140 },130 },
141 // Workspace pane mode131 // Workspace pane mode
142 {132 {
143 key: 'Ctrl+P',133 key: 'Ctrl+P',
144- description: 'Enter pane mode',134+ description: 'Enter pane mode'
145- action: () => console.log('Ctrl+P triggered')
146 },135 },
147 {136 {
148 key: '→ / R (pane mode)',137 key: '→ / R (pane mode)',
149- description: 'Split pane right',138+ description: 'Split pane right'
150- action: () => console.log('Split right triggered')
151 },139 },
152 {140 {
153 key: '← / L (pane mode)',141 key: '← / L (pane mode)',
154- description: 'Split pane left',142+ description: 'Split pane left'
155- action: () => console.log('Split left triggered')
156 },143 },
157 {144 {
158 key: '↑ / U (pane mode)',145 key: '↑ / U (pane mode)',
159- description: 'Split pane up',146+ description: 'Split pane up'
160- action: () => console.log('Split up triggered')
161 },147 },
162 {148 {
163 key: '↓ / D (pane mode)',149 key: '↓ / D (pane mode)',
164- description: 'Split pane down',150+ description: 'Split pane down'
165- action: () => console.log('Split down triggered')
166 },151 },
167 {152 {
168 key: 'X (pane mode)',153 key: 'X (pane mode)',
169- description: 'Close current pane',154+ description: 'Close current pane'
170- action: () => console.log('Close pane triggered')
171 },155 },
172 {156 {
173 key: 'Enter (pane mode)',157 key: 'Enter (pane mode)',
174- description: 'Confirm action',158+ description: 'Confirm action'
175- action: () => console.log('Confirm triggered')
176 },159 },
177 {160 {
178 key: 'Escape (pane mode)',161 key: 'Escape (pane mode)',
179- description: 'Exit pane mode',162+ description: 'Exit pane mode'
180- action: () => console.log('Exit pane mode triggered')
181 },163 },
182 // Workspace navigation164 // Workspace navigation
183 {165 {
184 key: 'Alt+Arrow Keys',166 key: 'Alt+Arrow Keys',
185- description: 'Navigate between panes',167+ description: 'Navigate between panes'
186- action: () => console.log('Navigate panes triggered')
187 }168 }
188 ];169 ];
189 shortcutsLoading = false;170 shortcutsLoading = false;

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