detached 32dec1e

omnibox (Ctrl+L): redesign suggestion row to favicon + Domain | full path (single-line with gradient fade); remove 50/50 split; retain hover select and click navigate

commit
32dec1eaf8a61de0c26b9f8fc8f07ff6c4c47594
author
bamen · · 2025-09-09 20:31 UTC
committer
bamen · · 2025-09-09 19:26 UTC
parent
42da155
signature
unsigned
1 file · +19 -3
M pkg/webkit/ucm_js_cgo.go +19 -3
@@ -165,9 +165,25 @@ func getOmniboxScript() string {
165165 H.suggestions.forEach((s, i)=>{
166166 const item = document.createElement('div');
167167 item.style.cssText = 'padding:8px 10px;display:flex;gap:10px;align-items:center;cursor:pointer;border-bottom:1px solid #2a2a2a;'+(i===H.selectedIndex?'background:#0a0a0a;':'');
168- const url = document.createElement('div'); url.textContent = s.url || ''; url.style.cssText = 'flex:1;color:#9ad;word-break:break-all;';
169- const title = document.createElement('div'); title.textContent = s.title || ''; title.style.cssText = 'flex:1;color:#ccc;opacity:.9;';
170- item.appendChild(title); item.appendChild(url);
168+ // Favicon
169+ const icon = document.createElement('img');
170+ icon.src = s.favicon || '';
171+ icon.width = 18; icon.height = 18; icon.loading = 'lazy';
172+ icon.style.cssText = 'flex:0 0 18px;width:18px;height:18px;border-radius:4px;opacity:.95;';
173+ icon.onerror = ()=>{ icon.style.display='none'; };
174+ // Text line: Domain | full path (one line, fade at end)
175+ let domain = '', path = '';
176+ try { const u = new URL(s.url, window.location.href); domain = u.hostname; path = (u.pathname||'') + (u.search||'') + (u.hash||''); } catch(_) { domain = s.url || ''; }
177+ const text = document.createElement('div');
178+ text.style.cssText = 'flex:1;min-width:0;display:flex;gap:8px;align-items:center;white-space:nowrap;overflow:hidden;';
179+ // Apply gradient fade using mask for WebKit
180+ text.style.webkitMaskImage = 'linear-gradient(90deg, black 85%, transparent 100%)';
181+ text.style.maskImage = 'linear-gradient(90deg, black 85%, transparent 100%)';
182+ const domainEl = document.createElement('span'); domainEl.textContent = domain; domainEl.style.cssText = 'color:#e6e6e6;opacity:.95;';
183+ const sep = document.createElement('span'); sep.textContent = ' | '; sep.style.cssText = 'color:#777;';
184+ const pathEl = document.createElement('span'); pathEl.textContent = path || '/'; pathEl.style.cssText = 'color:#9ad;';
185+ text.appendChild(domainEl); text.appendChild(sep); text.appendChild(pathEl);
186+ item.appendChild(icon); item.appendChild(text);
171187 item.addEventListener('mouseenter', ()=>{ H.selectedIndex = i; H.paintList(); H.scrollListToSelection(); });
172188 item.addEventListener('click',()=>{ H.post({type:'navigate', url:s.url}); H.toggle(false); });
173189 list.appendChild(item);
@@ -165,9 +165,25 @@ func getOmniboxScript() string {
165 H.suggestions.forEach((s, i)=>{165 H.suggestions.forEach((s, i)=>{
166 const item = document.createElement('div');166 const item = document.createElement('div');
167 item.style.cssText = 'padding:8px 10px;display:flex;gap:10px;align-items:center;cursor:pointer;border-bottom:1px solid #2a2a2a;'+(i===H.selectedIndex?'background:#0a0a0a;':'');167 item.style.cssText = 'padding:8px 10px;display:flex;gap:10px;align-items:center;cursor:pointer;border-bottom:1px solid #2a2a2a;'+(i===H.selectedIndex?'background:#0a0a0a;':'');
168- const url = document.createElement('div'); url.textContent = s.url || ''; url.style.cssText = 'flex:1;color:#9ad;word-break:break-all;';168+ // Favicon
169- const title = document.createElement('div'); title.textContent = s.title || ''; title.style.cssText = 'flex:1;color:#ccc;opacity:.9;';169+ const icon = document.createElement('img');
170- item.appendChild(title); item.appendChild(url);170+ icon.src = s.favicon || '';
171+ icon.width = 18; icon.height = 18; icon.loading = 'lazy';
172+ icon.style.cssText = 'flex:0 0 18px;width:18px;height:18px;border-radius:4px;opacity:.95;';
173+ icon.onerror = ()=>{ icon.style.display='none'; };
174+ // Text line: Domain | full path (one line, fade at end)
175+ let domain = '', path = '';
176+ try { const u = new URL(s.url, window.location.href); domain = u.hostname; path = (u.pathname||'') + (u.search||'') + (u.hash||''); } catch(_) { domain = s.url || ''; }
177+ const text = document.createElement('div');
178+ text.style.cssText = 'flex:1;min-width:0;display:flex;gap:8px;align-items:center;white-space:nowrap;overflow:hidden;';
179+ // Apply gradient fade using mask for WebKit
180+ text.style.webkitMaskImage = 'linear-gradient(90deg, black 85%, transparent 100%)';
181+ text.style.maskImage = 'linear-gradient(90deg, black 85%, transparent 100%)';
182+ const domainEl = document.createElement('span'); domainEl.textContent = domain; domainEl.style.cssText = 'color:#e6e6e6;opacity:.95;';
183+ const sep = document.createElement('span'); sep.textContent = ' | '; sep.style.cssText = 'color:#777;';
184+ const pathEl = document.createElement('span'); pathEl.textContent = path || '/'; pathEl.style.cssText = 'color:#9ad;';
185+ text.appendChild(domainEl); text.appendChild(sep); text.appendChild(pathEl);
186+ item.appendChild(icon); item.appendChild(text);
171 item.addEventListener('mouseenter', ()=>{ H.selectedIndex = i; H.paintList(); H.scrollListToSelection(); });187 item.addEventListener('mouseenter', ()=>{ H.selectedIndex = i; H.paintList(); H.scrollListToSelection(); });
172 item.addEventListener('click',()=>{ H.post({type:'navigate', url:s.url}); H.toggle(false); });188 item.addEventListener('click',()=>{ H.post({type:'navigate', url:s.url}); H.toggle(false); });
173 list.appendChild(item);189 list.appendChild(item);

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