detached 66e5fc8

omnibox: apply same fade+blur logic when navigating suggestion results (arrow/hover); always restore on input typing/focus

commit
66e5fc88dc5d1de3b081afb61e05f490faf47d62
author
bamen · · 2025-09-09 19:44 UTC
committer
bamen · · 2025-09-09 19:22 UTC
parent
32dec1e
signature
unsigned
1 file · +7 -4
M pkg/webkit/ucm_js_cgo.go +7 -4
@@ -139,13 +139,16 @@ func getOmniboxScript() string {
139139 if (H.selectedIndex<0) H.selectedIndex = n-1; if (H.selectedIndex>=n) H.selectedIndex = 0;
140140 H.paintList();
141141 H.scrollListToSelection();
142- if (H.mode==='find') { H.revealSelection(); H.setFaded(true); }
142+ // Fade overlay while navigating results; also reveal active match in find mode
143+ H.setFaded(true);
144+ if (H.mode==='find') { H.revealSelection(); }
143145 }
144146 } else {
145- if (H.mode==='find') H.setFaded(false);
147+ // Any other key input should restore full opacity while editing
148+ H.setFaded(false);
146149 }
147150 });
148- input.addEventListener('input', ()=> { H.onInput(); if (H.mode==='find') H.setFaded(false); });
151+ input.addEventListener('input', ()=> { H.onInput(); H.setFaded(false); });
149152 input.addEventListener('mousedown', ()=> H.setFaded(false));
150153 input.addEventListener('click', ()=> H.setFaded(false));
151154 H.el = root; H.input = input; H.list = list; H.selectedIndex = -1; H.paintList();
@@ -184,7 +187,7 @@ func getOmniboxScript() string {
184187 const pathEl = document.createElement('span'); pathEl.textContent = path || '/'; pathEl.style.cssText = 'color:#9ad;';
185188 text.appendChild(domainEl); text.appendChild(sep); text.appendChild(pathEl);
186189 item.appendChild(icon); item.appendChild(text);
187- item.addEventListener('mouseenter', ()=>{ H.selectedIndex = i; H.paintList(); H.scrollListToSelection(); });
190+ item.addEventListener('mouseenter', ()=>{ H.selectedIndex = i; H.paintList(); H.scrollListToSelection(); H.setFaded(true); });
188191 item.addEventListener('click',()=>{ H.post({type:'navigate', url:s.url}); H.toggle(false); });
189192 list.appendChild(item);
190193 });
@@ -139,13 +139,16 @@ func getOmniboxScript() string {
139 if (H.selectedIndex<0) H.selectedIndex = n-1; if (H.selectedIndex>=n) H.selectedIndex = 0;139 if (H.selectedIndex<0) H.selectedIndex = n-1; if (H.selectedIndex>=n) H.selectedIndex = 0;
140 H.paintList();140 H.paintList();
141 H.scrollListToSelection();141 H.scrollListToSelection();
142- if (H.mode==='find') { H.revealSelection(); H.setFaded(true); }142+ // Fade overlay while navigating results; also reveal active match in find mode
143+ H.setFaded(true);
144+ if (H.mode==='find') { H.revealSelection(); }
143 }145 }
144 } else {146 } else {
145- if (H.mode==='find') H.setFaded(false);147+ // Any other key input should restore full opacity while editing
148+ H.setFaded(false);
146 }149 }
147 });150 });
148- input.addEventListener('input', ()=> { H.onInput(); if (H.mode==='find') H.setFaded(false); });151+ input.addEventListener('input', ()=> { H.onInput(); H.setFaded(false); });
149 input.addEventListener('mousedown', ()=> H.setFaded(false));152 input.addEventListener('mousedown', ()=> H.setFaded(false));
150 input.addEventListener('click', ()=> H.setFaded(false));153 input.addEventListener('click', ()=> H.setFaded(false));
151 H.el = root; H.input = input; H.list = list; H.selectedIndex = -1; H.paintList();154 H.el = root; H.input = input; H.list = list; H.selectedIndex = -1; H.paintList();
@@ -184,7 +187,7 @@ func getOmniboxScript() string {
184 const pathEl = document.createElement('span'); pathEl.textContent = path || '/'; pathEl.style.cssText = 'color:#9ad;';187 const pathEl = document.createElement('span'); pathEl.textContent = path || '/'; pathEl.style.cssText = 'color:#9ad;';
185 text.appendChild(domainEl); text.appendChild(sep); text.appendChild(pathEl);188 text.appendChild(domainEl); text.appendChild(sep); text.appendChild(pathEl);
186 item.appendChild(icon); item.appendChild(text);189 item.appendChild(icon); item.appendChild(text);
187- item.addEventListener('mouseenter', ()=>{ H.selectedIndex = i; H.paintList(); H.scrollListToSelection(); });190+ item.addEventListener('mouseenter', ()=>{ H.selectedIndex = i; H.paintList(); H.scrollListToSelection(); H.setFaded(true); });
188 item.addEventListener('click',()=>{ H.post({type:'navigate', url:s.url}); H.toggle(false); });191 item.addEventListener('click',()=>{ H.post({type:'navigate', url:s.url}); H.toggle(false); });
189 list.appendChild(item);192 list.appendChild(item);
190 });193 });

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