detached 37da1ff

feat(ux): auto-open omnibox on new blank panes

Implements automatic omnibox opening when a new pane is created with
about:blank, providing immediate search/navigation access.

Changes:
- Remove dead JavaScript injection code from clonePaneState that tried
  to open omnibox via URI changed handler (timing issues)
- Add simple client-side detection in Omnibox.svelte onMount that
  checks for about:blank and auto-opens omnibox
- KISS approach: UI component knows its own state and acts accordingly

The new implementation is more reliable and eliminates timing issues
with WebKit event handlers and JS injection.
commit
37da1ff43be1adf5a42571b9c6254eb19a7864e2
author
bamen · · 2025-10-06 16:03 UTC
committer
bamen · · 2025-10-06 16:25 UTC
parent
bc5cb18
signature
unsigned
3 files · +9 -16
M CHANGELOG.md +1 -0
@@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.
55 ## [Unreleased]
66
77 ### Added
8+- **Auto-open omnibox on blank panes**: Omnibox automatically opens when a new pane is created with about:blank, providing immediate search/navigation access
89 - **Configurable default zoom**: Added `default_zoom` config (defaults to 1.2/120%). Per-domain zoom still overrides this
910 - **Pin/favorite sites**: Pin websites from history or quick access to prioritize them in "Jump back in" section. Uses localStorage persistence with star icons for pin/unpin actions
1011 - **Zellij-style stacked panes**: Added Ctrl+P → 's' to stack panes instead of splitting, with Alt+Up/Down navigation between stacked panes. Features collapsed page title bars showing for inactive panes and full WebView interaction for the active pane. Includes GTK4 CSS styling for proper visual feedback
@@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.
5 ## [Unreleased]5 ## [Unreleased]
6 6
7 ### Added7 ### Added
8+- **Auto-open omnibox on blank panes**: Omnibox automatically opens when a new pane is created with about:blank, providing immediate search/navigation access
8 - **Configurable default zoom**: Added `default_zoom` config (defaults to 1.2/120%). Per-domain zoom still overrides this9 - **Configurable default zoom**: Added `default_zoom` config (defaults to 1.2/120%). Per-domain zoom still overrides this
9 - **Pin/favorite sites**: Pin websites from history or quick access to prioritize them in "Jump back in" section. Uses localStorage persistence with star icons for pin/unpin actions10 - **Pin/favorite sites**: Pin websites from history or quick access to prioritize them in "Jump back in" section. Uses localStorage persistence with star icons for pin/unpin actions
10 - **Zellij-style stacked panes**: Added Ctrl+P → 's' to stack panes instead of splitting, with Alt+Up/Down navigation between stacked panes. Features collapsed page title bars showing for inactive panes and full WebView interaction for the active pane. Includes GTK4 CSS styling for proper visual feedback11 - **Zellij-style stacked panes**: Added Ctrl+P → 's' to stack panes instead of splitting, with Alt+Up/Down navigation between stacked panes. Features collapsed page title bars showing for inactive panes and full WebView interaction for the active pane. Includes GTK4 CSS styling for proper visual feedback
M gui/src/components/omnibox/Omnibox.svelte +7 -1
@@ -329,7 +329,7 @@
329329 };
330330
331331 console.log('✅ Omnibox API exposed:', Object.keys(window.__dumber_omnibox));
332-
332+
333333 // Check for pending suggestions that arrived before API was ready
334334 if ((window as any).__dumber_omnibox_pending_suggestions) {
335335 console.log('🔄 [OMNIBOX] Processing pending suggestions');
@@ -337,6 +337,12 @@
337337 omniboxBridge.setSuggestions(pending);
338338 delete (window as any).__dumber_omnibox_pending_suggestions;
339339 }
340+
341+ // Auto-open omnibox on about:blank pages
342+ if (window.location.href === 'about:blank') {
343+ console.log('🚀 Auto-opening omnibox for about:blank');
344+ omniboxStore.open('omnibox');
345+ }
340346 } catch (error) {
341347 console.error('❌ Failed to set up omnibox global API:', error);
342348 }
@@ -329,7 +329,7 @@
329 };329 };
330 330
331 console.log('✅ Omnibox API exposed:', Object.keys(window.__dumber_omnibox));331 console.log('✅ Omnibox API exposed:', Object.keys(window.__dumber_omnibox));
332- 332+
333 // Check for pending suggestions that arrived before API was ready333 // Check for pending suggestions that arrived before API was ready
334 if ((window as any).__dumber_omnibox_pending_suggestions) {334 if ((window as any).__dumber_omnibox_pending_suggestions) {
335 console.log('🔄 [OMNIBOX] Processing pending suggestions');335 console.log('🔄 [OMNIBOX] Processing pending suggestions');
@@ -337,6 +337,12 @@
337 omniboxBridge.setSuggestions(pending);337 omniboxBridge.setSuggestions(pending);
338 delete (window as any).__dumber_omnibox_pending_suggestions;338 delete (window as any).__dumber_omnibox_pending_suggestions;
339 }339 }
340+
341+ // Auto-open omnibox on about:blank pages
342+ if (window.location.href === 'about:blank') {
343+ console.log('🚀 Auto-opening omnibox for about:blank');
344+ omniboxStore.open('omnibox');
345+ }
340 } catch (error) {346 } catch (error) {
341 console.error('❌ Failed to set up omnibox global API:', error);347 console.error('❌ Failed to set up omnibox global API:', error);
342 }348 }
M internal/app/browser/workspace_pane_ops.go +1 -15
@@ -124,21 +124,7 @@ func (wm *WorkspaceManager) clonePaneState(_ *paneNode, target *paneNode) {
124124 log.Printf("[workspace] failed to prepare blank pane: %v", err)
125125 }
126126
127- // Wait for about:blank to load before opening omnibox
128- target.pane.webView.RegisterURIChangedHandler(func(uri string) {
129- if uri == blankURL {
130- // Defer omnibox opening to allow page to fully initialize
131- wm.scheduleIdleGuarded(func() bool {
132- if target == nil || target.pane == nil || target.pane.webView == nil {
133- return false
134- }
135- if injErr := target.pane.webView.InjectScript("window.__dumber_omnibox?.open('omnibox');"); injErr != nil {
136- log.Printf("[workspace] failed to open omnibox: %v", injErr)
137- }
138- return false // Remove idle callback
139- }, target)
140- }
141- })
127+ // Omnibox will auto-open on about:blank via client-side detection
142128 }
143129
144130 // safelyDetachControllersBeforeReparent removes GTK controllers that GTK will auto-clean up during reparenting.
@@ -124,21 +124,7 @@ func (wm *WorkspaceManager) clonePaneState(_ *paneNode, target *paneNode) {
124 log.Printf("[workspace] failed to prepare blank pane: %v", err)124 log.Printf("[workspace] failed to prepare blank pane: %v", err)
125 }125 }
126 126
127- // Wait for about:blank to load before opening omnibox127+ // Omnibox will auto-open on about:blank via client-side detection
128- target.pane.webView.RegisterURIChangedHandler(func(uri string) {
129- if uri == blankURL {
130- // Defer omnibox opening to allow page to fully initialize
131- wm.scheduleIdleGuarded(func() bool {
132- if target == nil || target.pane == nil || target.pane.webView == nil {
133- return false
134- }
135- if injErr := target.pane.webView.InjectScript("window.__dumber_omnibox?.open('omnibox');"); injErr != nil {
136- log.Printf("[workspace] failed to open omnibox: %v", injErr)
137- }
138- return false // Remove idle callback
139- }, target)
140- }
141- })
142 }128 }
143 129
144 // safelyDetachControllersBeforeReparent removes GTK controllers that GTK will auto-clean up during reparenting.130 // safelyDetachControllersBeforeReparent removes GTK controllers that GTK will auto-clean up during reparenting.

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