detached bcab118

refactor(coordinator): decouple popup_types.go and oauth.go from webkit

Replace *webkit.WebView with port.WebView and webkit.LoadEvent with
port.LoadEvent in popup_types.go, oauth.go, and oauth_test.go.
commit
bcab118e10ddda39e9d455ebff7834d1460c9a64
author
brice · · 2026-03-15 16:43 UTC
parent
f36a1c5
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
3 files · +10 -11
M internal/ui/coordinator/oauth.go +5 -5
@@ -3,7 +3,7 @@ package coordinator
33 import (
44 "strings"
55
6- "github.com/bnema/dumber/internal/infrastructure/webkit"
6+ "github.com/bnema/dumber/internal/application/port"
77 )
88
99 // oauthFlowPatterns are URL patterns that indicate an OAuth flow is in progress.
@@ -177,16 +177,16 @@ func composeOnURIChanged(existing, next func(string)) func(string) {
177177 }
178178
179179 func composeOnLoadChanged(
180- existing func(webkit.LoadEvent),
181- next func(webkit.LoadEvent),
182-) func(webkit.LoadEvent) {
180+ existing func(port.LoadEvent),
181+ next func(port.LoadEvent),
182+) func(port.LoadEvent) {
183183 if existing == nil {
184184 return next
185185 }
186186 if next == nil {
187187 return existing
188188 }
189- return func(event webkit.LoadEvent) {
189+ return func(event port.LoadEvent) {
190190 existing(event)
191191 next(event)
192192 }
@@ -3,7 +3,7 @@ package coordinator
3 import (3 import (
4 "strings"4 "strings"
5 5
6- "github.com/bnema/dumber/internal/infrastructure/webkit"6+ "github.com/bnema/dumber/internal/application/port"
7 )7 )
8 8
9 // oauthFlowPatterns are URL patterns that indicate an OAuth flow is in progress.9 // oauthFlowPatterns are URL patterns that indicate an OAuth flow is in progress.
@@ -177,16 +177,16 @@ func composeOnURIChanged(existing, next func(string)) func(string) {
177 }177 }
178 178
179 func composeOnLoadChanged(179 func composeOnLoadChanged(
180- existing func(webkit.LoadEvent),180+ existing func(port.LoadEvent),
181- next func(webkit.LoadEvent),181+ next func(port.LoadEvent),
182-) func(webkit.LoadEvent) {182+) func(port.LoadEvent) {
183 if existing == nil {183 if existing == nil {
184 return next184 return next
185 }185 }
186 if next == nil {186 if next == nil {
187 return existing187 return existing
188 }188 }
189- return func(event webkit.LoadEvent) {189+ return func(event port.LoadEvent) {
190 existing(event)190 existing(event)
191 next(event)191 next(event)
192 }192 }
M internal/ui/coordinator/oauth_test.go +3 -3
@@ -40,10 +40,10 @@ func TestComposeOnLoadChanged_Order(t *testing.T) {
4040 var calls []string
4141
4242 composed := composeOnLoadChanged(
43- func(_ webkit.LoadEvent) { calls = append(calls, "existing") },
44- func(_ webkit.LoadEvent) { calls = append(calls, "next") },
43+ func(_ port.LoadEvent) { calls = append(calls, "existing") },
44+ func(_ port.LoadEvent) { calls = append(calls, "next") },
4545 )
46- composed(webkit.LoadCommitted)
46+ composed(port.LoadCommitted)
4747
4848 assert.Equal(t, []string{"existing", "next"}, calls)
4949 }
@@ -40,10 +40,10 @@ func TestComposeOnLoadChanged_Order(t *testing.T) {
40 var calls []string40 var calls []string
41 41
42 composed := composeOnLoadChanged(42 composed := composeOnLoadChanged(
43- func(_ webkit.LoadEvent) { calls = append(calls, "existing") },43+ func(_ port.LoadEvent) { calls = append(calls, "existing") },
44- func(_ webkit.LoadEvent) { calls = append(calls, "next") },44+ func(_ port.LoadEvent) { calls = append(calls, "next") },
45 )45 )
46- composed(webkit.LoadCommitted)46+ composed(port.LoadCommitted)
47 47
48 assert.Equal(t, []string{"existing", "next"}, calls)48 assert.Equal(t, []string{"existing", "next"}, calls)
49 }49 }
M internal/ui/coordinator/popup_types.go +2 -3
@@ -6,7 +6,6 @@ import (
66 "github.com/bnema/dumber/internal/application/port"
77 "github.com/bnema/dumber/internal/domain/entity"
88 "github.com/bnema/dumber/internal/infrastructure/config"
9- "github.com/bnema/dumber/internal/infrastructure/webkit"
109 )
1110
1211 // PopupType indicates whether the popup was triggered by a link or JavaScript.
@@ -39,7 +38,7 @@ func (t PopupType) String() string {
3938 type PendingPopup struct {
4039 // WebView is the related WebView created in the "create" phase.
4140 // It shares cookies/session with the parent for OAuth support.
42- WebView *webkit.WebView
41+ WebView port.WebView
4342
4443 // ParentPaneID is the pane that spawned this popup.
4544 ParentPaneID entity.PaneID
@@ -85,7 +84,7 @@ type InsertPopupInput struct {
8584 PopupPane *entity.Pane
8685
8786 // WebView is the related WebView for the popup.
88- WebView *webkit.WebView
87+ WebView port.WebView
8988
9089 // Behavior determines how the popup is inserted (split/stacked/tabbed).
9190 Behavior config.PopupBehavior
@@ -6,7 +6,6 @@ import (
6 "github.com/bnema/dumber/internal/application/port"6 "github.com/bnema/dumber/internal/application/port"
7 "github.com/bnema/dumber/internal/domain/entity"7 "github.com/bnema/dumber/internal/domain/entity"
8 "github.com/bnema/dumber/internal/infrastructure/config"8 "github.com/bnema/dumber/internal/infrastructure/config"
9- "github.com/bnema/dumber/internal/infrastructure/webkit"
10 )9 )
11 10
12 // PopupType indicates whether the popup was triggered by a link or JavaScript.11 // PopupType indicates whether the popup was triggered by a link or JavaScript.
@@ -39,7 +38,7 @@ func (t PopupType) String() string {
39 type PendingPopup struct {38 type PendingPopup struct {
40 // WebView is the related WebView created in the "create" phase.39 // WebView is the related WebView created in the "create" phase.
41 // It shares cookies/session with the parent for OAuth support.40 // It shares cookies/session with the parent for OAuth support.
42- WebView *webkit.WebView41+ WebView port.WebView
43 42
44 // ParentPaneID is the pane that spawned this popup.43 // ParentPaneID is the pane that spawned this popup.
45 ParentPaneID entity.PaneID44 ParentPaneID entity.PaneID
@@ -85,7 +84,7 @@ type InsertPopupInput struct {
85 PopupPane *entity.Pane84 PopupPane *entity.Pane
86 85
87 // WebView is the related WebView for the popup.86 // WebView is the related WebView for the popup.
88- WebView *webkit.WebView87+ WebView port.WebView
89 88
90 // Behavior determines how the popup is inserted (split/stacked/tabbed).89 // Behavior determines how the popup is inserted (split/stacked/tabbed).
91 Behavior config.PopupBehavior90 Behavior config.PopupBehavior

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