detached 0ff690b

feat(omnibox): add smart Escape key behavior

Implements intelligent Escape key handling in the omnibox:
- First Esc: Clear input text and keep omnibox open
- Second Esc (or first Esc with empty input): Close omnibox immediately
- In find mode: Also clears search highlights when clearing text

This provides a more intuitive workflow where users can quickly clear
their input without fully closing the omnibox.
commit
0ff690b193aac7c5df8bccd31da6b8d0e3898f05
author
bnema · · 2025-11-16 20:28 UTC
committer
bnema · · 2025-11-16 22:42 UTC
parent
b21627f
signature
unsigned
1 file · +13 -1
M gui/src/components/omnibox/OmniboxInput.svelte +13 -1
@@ -136,7 +136,19 @@
136136 case 'Escape':
137137 event.preventDefault();
138138 event.stopPropagation();
139- omniboxStore.close();
139+
140+ if (inputValue && inputValue.trim() !== '') {
141+ // Input has text - clear it but keep omnibox open
142+ omniboxStore.setInputValue('');
143+
144+ // In find mode, clear the search highlights
145+ if (mode === 'find') {
146+ findInPage('');
147+ }
148+ } else {
149+ // Input is empty - close omnibox immediately
150+ omniboxStore.close();
151+ }
140152 break;
141153
142154 case 'Enter':
@@ -136,7 +136,19 @@
136 case 'Escape':136 case 'Escape':
137 event.preventDefault();137 event.preventDefault();
138 event.stopPropagation();138 event.stopPropagation();
139- omniboxStore.close();139+
140+ if (inputValue && inputValue.trim() !== '') {
141+ // Input has text - clear it but keep omnibox open
142+ omniboxStore.setInputValue('');
143+
144+ // In find mode, clear the search highlights
145+ if (mode === 'find') {
146+ findInPage('');
147+ }
148+ } else {
149+ // Input is empty - close omnibox immediately
150+ omniboxStore.close();
151+ }
140 break;152 break;
141 153
142 case 'Enter':154 case 'Enter':

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