detached b21627f

fix(omnibox): enable keyboard navigation in favorites view with empty input

Arrow keys and Enter key now work correctly in favorites view when input is empty.
Previously, these keys only worked with suggestions, not favorites.
commit
b21627f725caf45a8c688c40b27c0a8546455118
author
bnema · · 2025-11-16 18:39 UTC
committer
bnema · · 2025-11-16 19:18 UTC
parent
85bc96a
signature
unsigned
1 file · +11 -3
M gui/src/components/omnibox/OmniboxInput.svelte +11 -3
@@ -185,8 +185,10 @@
185185 // Handle Enter key based on mode
186186 function handleEnterKey(event: KeyboardEvent) {
187187 if (mode === 'omnibox') {
188- const selectedSuggestion = selectedIndex >= 0 ? suggestions[selectedIndex] : null;
189- const url = selectedSuggestion?.url || inputValue || '';
188+ // Get selected item from current view (history or favorites)
189+ const currentList = viewMode === 'history' ? suggestions : favorites;
190+ const selectedItem = selectedIndex >= 0 ? currentList[selectedIndex] : null;
191+ const url = selectedItem?.url || inputValue || '';
190192
191193 if (url) {
192194 omniboxBridge.navigate(url);
@@ -233,7 +235,13 @@
233235
234236 // Handle arrow key navigation
235237 function handleArrowKeys(key: string) {
236- const totalItems = mode === 'omnibox' ? suggestions.length : matches.length;
238+ let totalItems: number;
239+ if (mode === 'omnibox') {
240+ // Get count from current view (history or favorites)
241+ totalItems = viewMode === 'history' ? suggestions.length : favorites.length;
242+ } else {
243+ totalItems = matches.length;
244+ }
237245
238246 if (totalItems > 0) {
239247 if (key === 'ArrowDown') {
@@ -185,8 +185,10 @@
185 // Handle Enter key based on mode185 // Handle Enter key based on mode
186 function handleEnterKey(event: KeyboardEvent) {186 function handleEnterKey(event: KeyboardEvent) {
187 if (mode === 'omnibox') {187 if (mode === 'omnibox') {
188- const selectedSuggestion = selectedIndex >= 0 ? suggestions[selectedIndex] : null;188+ // Get selected item from current view (history or favorites)
189- const url = selectedSuggestion?.url || inputValue || '';189+ const currentList = viewMode === 'history' ? suggestions : favorites;
190+ const selectedItem = selectedIndex >= 0 ? currentList[selectedIndex] : null;
191+ const url = selectedItem?.url || inputValue || '';
190 192
191 if (url) {193 if (url) {
192 omniboxBridge.navigate(url);194 omniboxBridge.navigate(url);
@@ -233,7 +235,13 @@
233 235
234 // Handle arrow key navigation236 // Handle arrow key navigation
235 function handleArrowKeys(key: string) {237 function handleArrowKeys(key: string) {
236- const totalItems = mode === 'omnibox' ? suggestions.length : matches.length;238+ let totalItems: number;
239+ if (mode === 'omnibox') {
240+ // Get count from current view (history or favorites)
241+ totalItems = viewMode === 'history' ? suggestions.length : favorites.length;
242+ } else {
243+ totalItems = matches.length;
244+ }
237 245
238 if (totalItems > 0) {246 if (totalItems > 0) {
239 if (key === 'ArrowDown') {247 if (key === 'ArrowDown') {

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