detached 9634a01

refactor(ui): trim browser window setup

commit
9634a01bde3e011ad3c861fd2ced373f881d5a69
author
brice · · 2026-06-23 15:52 UTC
committer
brice · · 2026-06-23 20:01 UTC
parent
3ada45b
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
1 file · +25 -21
M internal/ui/app.go +25 -21
@@ -511,6 +511,31 @@ func (a *App) createBrowserWindow(ctx context.Context, initialURL string) (*brow
511511 }
512512 mainWindow.Window().ConnectCloseRequest(&closeRequestCb)
513513
514+ a.initBrowserWindowOverlays(mainWindow, browserWindow, runtimeCfg)
515+ a.wireBrowserWindowPermissionIndicator(browserWindow)
516+ if a.kbDispatcher != nil {
517+ a.initBrowserWindowInput(ctx, browserWindow)
518+ }
519+ if a.tabCoord != nil {
520+ a.wireBrowserWindowTabBar(ctx, browserWindow)
521+ }
522+ browserWindow.initChrome(ctx, a)
523+
524+ // Apply GTK CSS styling from theme manager.
525+ if a.deps == nil || a.deps.Theme == nil {
526+ return browserWindow, nil
527+ }
528+ if display := mainWindow.Window().GetDisplay(); display != nil {
529+ a.deps.Theme.ApplyToDisplay(ctx, display)
530+ }
531+ log.Debug().
532+ Str("window_id", browserWindow.id).
533+ Str("url_host", logging.SafeURLHost(initialURL)).
534+ Msg("ui: create browser window completed")
535+ return browserWindow, nil
536+}
537+
538+func (a *App) initBrowserWindowOverlays(mainWindow *window.MainWindow, browserWindow *browserWindow, runtimeCfg port.RuntimeUIConfig) {
514539 // Create permission popup and dialog presenter
515540 if a.deps != nil && a.deps.PermissionUC != nil {
516541 uiScale := runtimeCfg.DefaultUIScale
@@ -535,27 +560,6 @@ func (a *App) createBrowserWindow(ctx context.Context, initialURL string) (*brow
535560 }
536561 browserWindow.webrtcIndicator = indicator
537562 }
538- a.wireBrowserWindowPermissionIndicator(browserWindow)
539- if a.kbDispatcher != nil {
540- a.initBrowserWindowInput(ctx, browserWindow)
541- }
542- if a.tabCoord != nil {
543- a.wireBrowserWindowTabBar(ctx, browserWindow)
544- }
545- browserWindow.initChrome(ctx, a)
546-
547- // Apply GTK CSS styling from theme manager.
548- if a.deps == nil || a.deps.Theme == nil {
549- return browserWindow, nil
550- }
551- if display := mainWindow.Window().GetDisplay(); display != nil {
552- a.deps.Theme.ApplyToDisplay(ctx, display)
553- }
554- log.Debug().
555- Str("window_id", browserWindow.id).
556- Str("url_host", logging.SafeURLHost(initialURL)).
557- Msg("ui: create browser window completed")
558- return browserWindow, nil
559563 }
560564
561565 func (a *App) ensureWindowForTabMap() {
@@ -511,6 +511,31 @@ func (a *App) createBrowserWindow(ctx context.Context, initialURL string) (*brow
511 }511 }
512 mainWindow.Window().ConnectCloseRequest(&closeRequestCb)512 mainWindow.Window().ConnectCloseRequest(&closeRequestCb)
513 513
514+ a.initBrowserWindowOverlays(mainWindow, browserWindow, runtimeCfg)
515+ a.wireBrowserWindowPermissionIndicator(browserWindow)
516+ if a.kbDispatcher != nil {
517+ a.initBrowserWindowInput(ctx, browserWindow)
518+ }
519+ if a.tabCoord != nil {
520+ a.wireBrowserWindowTabBar(ctx, browserWindow)
521+ }
522+ browserWindow.initChrome(ctx, a)
523+
524+ // Apply GTK CSS styling from theme manager.
525+ if a.deps == nil || a.deps.Theme == nil {
526+ return browserWindow, nil
527+ }
528+ if display := mainWindow.Window().GetDisplay(); display != nil {
529+ a.deps.Theme.ApplyToDisplay(ctx, display)
530+ }
531+ log.Debug().
532+ Str("window_id", browserWindow.id).
533+ Str("url_host", logging.SafeURLHost(initialURL)).
534+ Msg("ui: create browser window completed")
535+ return browserWindow, nil
536+}
537+
538+func (a *App) initBrowserWindowOverlays(mainWindow *window.MainWindow, browserWindow *browserWindow, runtimeCfg port.RuntimeUIConfig) {
514 // Create permission popup and dialog presenter539 // Create permission popup and dialog presenter
515 if a.deps != nil && a.deps.PermissionUC != nil {540 if a.deps != nil && a.deps.PermissionUC != nil {
516 uiScale := runtimeCfg.DefaultUIScale541 uiScale := runtimeCfg.DefaultUIScale
@@ -535,27 +560,6 @@ func (a *App) createBrowserWindow(ctx context.Context, initialURL string) (*brow
535 }560 }
536 browserWindow.webrtcIndicator = indicator561 browserWindow.webrtcIndicator = indicator
537 }562 }
538- a.wireBrowserWindowPermissionIndicator(browserWindow)
539- if a.kbDispatcher != nil {
540- a.initBrowserWindowInput(ctx, browserWindow)
541- }
542- if a.tabCoord != nil {
543- a.wireBrowserWindowTabBar(ctx, browserWindow)
544- }
545- browserWindow.initChrome(ctx, a)
546-
547- // Apply GTK CSS styling from theme manager.
548- if a.deps == nil || a.deps.Theme == nil {
549- return browserWindow, nil
550- }
551- if display := mainWindow.Window().GetDisplay(); display != nil {
552- a.deps.Theme.ApplyToDisplay(ctx, display)
553- }
554- log.Debug().
555- Str("window_id", browserWindow.id).
556- Str("url_host", logging.SafeURLHost(initialURL)).
557- Msg("ui: create browser window completed")
558- return browserWindow, nil
559 }563 }
560 564
561 func (a *App) ensureWindowForTabMap() {565 func (a *App) ensureWindowForTabMap() {

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