detached 0b983cb

fix(cef): move touchpad gesture contract to domain

commit
0b983cba7da7fe0f9779c62e09280589af9aa006
author
brice · · 2026-06-18 11:56 UTC
committer
brice · · 2026-06-18 11:56 UTC
parent
aceb4c8
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
10 files · +42 -43
M internal/application/port/webview.go +2 -1
@@ -7,6 +7,7 @@ import (
77 "context"
88
99 "github.com/bnema/dumber/internal/application/dto"
10+ "github.com/bnema/dumber/internal/domain/entity"
1011 )
1112
1213 // WebViewID uniquely identifies a WebView instance.
@@ -139,7 +140,7 @@ type WebViewCallbacks struct {
139140 OnAudioStateChanged func(playing bool)
140141 // OnTouchpadNavigationGesture is called while a two-finger touchpad history
141142 // navigation gesture is progressing or finishing.
142- OnTouchpadNavigationGesture func(gesture dto.TouchpadNavigationGesture)
143+ OnTouchpadNavigationGesture func(gesture entity.TouchpadNavigationGesture)
143144 }
144145
145146 // FindOptions configures search behavior.
@@ -7,6 +7,7 @@ import (
7 "context"7 "context"
8 8
9 "github.com/bnema/dumber/internal/application/dto"9 "github.com/bnema/dumber/internal/application/dto"
10+ "github.com/bnema/dumber/internal/domain/entity"
10 )11 )
11 12
12 // WebViewID uniquely identifies a WebView instance.13 // WebViewID uniquely identifies a WebView instance.
@@ -139,7 +140,7 @@ type WebViewCallbacks struct {
139 OnAudioStateChanged func(playing bool)140 OnAudioStateChanged func(playing bool)
140 // OnTouchpadNavigationGesture is called while a two-finger touchpad history141 // OnTouchpadNavigationGesture is called while a two-finger touchpad history
141 // navigation gesture is progressing or finishing.142 // navigation gesture is progressing or finishing.
142- OnTouchpadNavigationGesture func(gesture dto.TouchpadNavigationGesture)143+ OnTouchpadNavigationGesture func(gesture entity.TouchpadNavigationGesture)
143 }144 }
144 145
145 // FindOptions configures search behavior.146 // FindOptions configures search behavior.
R internal/application/dto/touchpad_navigation.go → internal/domain/entity/touchpad_navigation.go +1 -1 renamed, 98% similar
@@ -1,4 +1,4 @@
1-package dto
1+package entity
22
33 // TouchpadNavigationAction indicates the direction of a touchpad navigation gesture.
44 type TouchpadNavigationAction int
@@ -1,4 +1,4 @@
1-package dto1+package entity
2 2
3 // TouchpadNavigationAction indicates the direction of a touchpad navigation gesture.3 // TouchpadNavigationAction indicates the direction of a touchpad navigation gesture.
4 type TouchpadNavigationAction int4 type TouchpadNavigationAction int
M internal/infrastructure/cef/touchpad_navigation.go +18 -18
@@ -3,7 +3,7 @@ package cef
33 import (
44 "math"
55
6- "github.com/bnema/dumber/internal/application/dto"
6+ "github.com/bnema/dumber/internal/domain/entity"
77 cef2gtk "github.com/bnema/purego-cef2gtk"
88 "github.com/bnema/puregotk/v4/gdk"
99 )
@@ -25,7 +25,7 @@ type touchpadNavigationRecognizer struct {
2525 thresholdReached bool
2626 verticalCanceled bool
2727 indicatorShown bool
28- lastIndicatorAction dto.TouchpadNavigationAction
28+ lastIndicatorAction entity.TouchpadNavigationAction
2929 }
3030
3131 type touchpadNavigationInput struct {
@@ -38,7 +38,7 @@ type touchpadNavigationInput struct {
3838
3939 type touchpadNavigationResult struct {
4040 HasIndicator bool
41- Indicator dto.TouchpadNavigationGesture
41+ Indicator entity.TouchpadNavigationGesture
4242 HasAction bool
4343 Action cef2gtk.NavigationSwipeAction
4444 }
@@ -103,7 +103,7 @@ func (r *touchpadNavigationRecognizer) handleUpdate(input touchpadNavigationInpu
103103 r.lastIndicatorAction = action
104104 return touchpadNavigationResult{
105105 HasIndicator: true,
106- Indicator: dto.TouchpadNavigationGesture{
106+ Indicator: entity.TouchpadNavigationGesture{
107107 Action: action,
108108 Progress: progress,
109109 ThresholdReached: r.thresholdReached,
@@ -138,7 +138,7 @@ func (r *touchpadNavigationRecognizer) finishIndicator(input touchpadNavigationI
138138 threshold := normalizedTouchpadNavigationMinDelta(input.Config.TouchpadNavigationMinDelta)
139139 return touchpadNavigationResult{
140140 HasIndicator: true,
141- Indicator: dto.TouchpadNavigationGesture{
141+ Indicator: entity.TouchpadNavigationGesture{
142142 Action: action,
143143 Progress: clampFloat(math.Abs(r.cumulativeDX)/threshold, 0, 1),
144144 ThresholdReached: triggered,
@@ -147,12 +147,12 @@ func (r *touchpadNavigationRecognizer) finishIndicator(input touchpadNavigationI
147147 }
148148 }
149149
150-func (r *touchpadNavigationRecognizer) indicatorAction(input touchpadNavigationInput) (dto.TouchpadNavigationAction, bool) {
150+func (r *touchpadNavigationRecognizer) indicatorAction(input touchpadNavigationInput) (entity.TouchpadNavigationAction, bool) {
151151 return r.resolvedDirection(input)
152152 }
153153
154154 func (r *touchpadNavigationRecognizer) cancelAsTooVertical() touchpadNavigationResult {
155- var action dto.TouchpadNavigationAction
155+ var action entity.TouchpadNavigationAction
156156 hasAction := r.indicatorShown
157157 if hasAction {
158158 action = r.lastIndicatorAction
@@ -164,7 +164,7 @@ func (r *touchpadNavigationRecognizer) cancelAsTooVertical() touchpadNavigationR
164164 }
165165 return touchpadNavigationResult{
166166 HasIndicator: true,
167- Indicator: dto.TouchpadNavigationGesture{
167+ Indicator: entity.TouchpadNavigationGesture{
168168 Action: action,
169169 Active: false,
170170 },
@@ -176,20 +176,20 @@ func (r *touchpadNavigationRecognizer) navigationAction(input touchpadNavigation
176176 if !ok {
177177 return cef2gtk.NavigationSwipeBack, false
178178 }
179- if action == dto.TouchpadNavigationForward {
179+ if action == entity.TouchpadNavigationForward {
180180 return cef2gtk.NavigationSwipeForward, true
181181 }
182182 return cef2gtk.NavigationSwipeBack, true
183183 }
184184
185-func (r *touchpadNavigationRecognizer) resolvedDirection(input touchpadNavigationInput) (dto.TouchpadNavigationAction, bool) {
186- if r.cumulativeDX > 0 && input.CanGoBack && r.startedAtNavigationEdge(dto.TouchpadNavigationBack) {
187- return dto.TouchpadNavigationBack, true
185+func (r *touchpadNavigationRecognizer) resolvedDirection(input touchpadNavigationInput) (entity.TouchpadNavigationAction, bool) {
186+ if r.cumulativeDX > 0 && input.CanGoBack && r.startedAtNavigationEdge(entity.TouchpadNavigationBack) {
187+ return entity.TouchpadNavigationBack, true
188188 }
189- if r.cumulativeDX < 0 && input.CanGoForward && r.startedAtNavigationEdge(dto.TouchpadNavigationForward) {
190- return dto.TouchpadNavigationForward, true
189+ if r.cumulativeDX < 0 && input.CanGoForward && r.startedAtNavigationEdge(entity.TouchpadNavigationForward) {
190+ return entity.TouchpadNavigationForward, true
191191 }
192- return dto.TouchpadNavigationBack, false
192+ return entity.TouchpadNavigationBack, false
193193 }
194194
195195 func (r *touchpadNavigationRecognizer) setGestureStart(input touchpadNavigationInput) {
@@ -198,12 +198,12 @@ func (r *touchpadNavigationRecognizer) setGestureStart(input touchpadNavigationI
198198 r.hasGestureStart = true
199199 }
200200
201-func (r *touchpadNavigationRecognizer) startedAtNavigationEdge(action dto.TouchpadNavigationAction) bool {
201+func (r *touchpadNavigationRecognizer) startedAtNavigationEdge(action entity.TouchpadNavigationAction) bool {
202202 if r.gestureViewWidth <= 0 {
203203 return false
204204 }
205205 edgeDistance := math.Min(r.gestureViewWidth*touchpadNavigationEdgeFraction, touchpadNavigationMaxEdgeDistance)
206- if action == dto.TouchpadNavigationForward {
206+ if action == entity.TouchpadNavigationForward {
207207 return r.gestureStartX >= r.gestureViewWidth-edgeDistance
208208 }
209209 return r.gestureStartX <= edgeDistance
@@ -223,7 +223,7 @@ func (r *touchpadNavigationRecognizer) reset() {
223223 r.thresholdReached = false
224224 r.verticalCanceled = false
225225 r.indicatorShown = false
226- r.lastIndicatorAction = dto.TouchpadNavigationBack
226+ r.lastIndicatorAction = entity.TouchpadNavigationBack
227227 }
228228
229229 func isTouchpadNavigationPreciseEvent(event cef2gtk.ScrollEvent) bool {
@@ -3,7 +3,7 @@ package cef
3 import (3 import (
4 "math"4 "math"
5 5
6- "github.com/bnema/dumber/internal/application/dto"6+ "github.com/bnema/dumber/internal/domain/entity"
7 cef2gtk "github.com/bnema/purego-cef2gtk"7 cef2gtk "github.com/bnema/purego-cef2gtk"
8 "github.com/bnema/puregotk/v4/gdk"8 "github.com/bnema/puregotk/v4/gdk"
9 )9 )
@@ -25,7 +25,7 @@ type touchpadNavigationRecognizer struct {
25 thresholdReached bool25 thresholdReached bool
26 verticalCanceled bool26 verticalCanceled bool
27 indicatorShown bool27 indicatorShown bool
28- lastIndicatorAction dto.TouchpadNavigationAction28+ lastIndicatorAction entity.TouchpadNavigationAction
29 }29 }
30 30
31 type touchpadNavigationInput struct {31 type touchpadNavigationInput struct {
@@ -38,7 +38,7 @@ type touchpadNavigationInput struct {
38 38
39 type touchpadNavigationResult struct {39 type touchpadNavigationResult struct {
40 HasIndicator bool40 HasIndicator bool
41- Indicator dto.TouchpadNavigationGesture41+ Indicator entity.TouchpadNavigationGesture
42 HasAction bool42 HasAction bool
43 Action cef2gtk.NavigationSwipeAction43 Action cef2gtk.NavigationSwipeAction
44 }44 }
@@ -103,7 +103,7 @@ func (r *touchpadNavigationRecognizer) handleUpdate(input touchpadNavigationInpu
103 r.lastIndicatorAction = action103 r.lastIndicatorAction = action
104 return touchpadNavigationResult{104 return touchpadNavigationResult{
105 HasIndicator: true,105 HasIndicator: true,
106- Indicator: dto.TouchpadNavigationGesture{106+ Indicator: entity.TouchpadNavigationGesture{
107 Action: action,107 Action: action,
108 Progress: progress,108 Progress: progress,
109 ThresholdReached: r.thresholdReached,109 ThresholdReached: r.thresholdReached,
@@ -138,7 +138,7 @@ func (r *touchpadNavigationRecognizer) finishIndicator(input touchpadNavigationI
138 threshold := normalizedTouchpadNavigationMinDelta(input.Config.TouchpadNavigationMinDelta)138 threshold := normalizedTouchpadNavigationMinDelta(input.Config.TouchpadNavigationMinDelta)
139 return touchpadNavigationResult{139 return touchpadNavigationResult{
140 HasIndicator: true,140 HasIndicator: true,
141- Indicator: dto.TouchpadNavigationGesture{141+ Indicator: entity.TouchpadNavigationGesture{
142 Action: action,142 Action: action,
143 Progress: clampFloat(math.Abs(r.cumulativeDX)/threshold, 0, 1),143 Progress: clampFloat(math.Abs(r.cumulativeDX)/threshold, 0, 1),
144 ThresholdReached: triggered,144 ThresholdReached: triggered,
@@ -147,12 +147,12 @@ func (r *touchpadNavigationRecognizer) finishIndicator(input touchpadNavigationI
147 }147 }
148 }148 }
149 149
150-func (r *touchpadNavigationRecognizer) indicatorAction(input touchpadNavigationInput) (dto.TouchpadNavigationAction, bool) {150+func (r *touchpadNavigationRecognizer) indicatorAction(input touchpadNavigationInput) (entity.TouchpadNavigationAction, bool) {
151 return r.resolvedDirection(input)151 return r.resolvedDirection(input)
152 }152 }
153 153
154 func (r *touchpadNavigationRecognizer) cancelAsTooVertical() touchpadNavigationResult {154 func (r *touchpadNavigationRecognizer) cancelAsTooVertical() touchpadNavigationResult {
155- var action dto.TouchpadNavigationAction155+ var action entity.TouchpadNavigationAction
156 hasAction := r.indicatorShown156 hasAction := r.indicatorShown
157 if hasAction {157 if hasAction {
158 action = r.lastIndicatorAction158 action = r.lastIndicatorAction
@@ -164,7 +164,7 @@ func (r *touchpadNavigationRecognizer) cancelAsTooVertical() touchpadNavigationR
164 }164 }
165 return touchpadNavigationResult{165 return touchpadNavigationResult{
166 HasIndicator: true,166 HasIndicator: true,
167- Indicator: dto.TouchpadNavigationGesture{167+ Indicator: entity.TouchpadNavigationGesture{
168 Action: action,168 Action: action,
169 Active: false,169 Active: false,
170 },170 },
@@ -176,20 +176,20 @@ func (r *touchpadNavigationRecognizer) navigationAction(input touchpadNavigation
176 if !ok {176 if !ok {
177 return cef2gtk.NavigationSwipeBack, false177 return cef2gtk.NavigationSwipeBack, false
178 }178 }
179- if action == dto.TouchpadNavigationForward {179+ if action == entity.TouchpadNavigationForward {
180 return cef2gtk.NavigationSwipeForward, true180 return cef2gtk.NavigationSwipeForward, true
181 }181 }
182 return cef2gtk.NavigationSwipeBack, true182 return cef2gtk.NavigationSwipeBack, true
183 }183 }
184 184
185-func (r *touchpadNavigationRecognizer) resolvedDirection(input touchpadNavigationInput) (dto.TouchpadNavigationAction, bool) {185+func (r *touchpadNavigationRecognizer) resolvedDirection(input touchpadNavigationInput) (entity.TouchpadNavigationAction, bool) {
186- if r.cumulativeDX > 0 && input.CanGoBack && r.startedAtNavigationEdge(dto.TouchpadNavigationBack) {186+ if r.cumulativeDX > 0 && input.CanGoBack && r.startedAtNavigationEdge(entity.TouchpadNavigationBack) {
187- return dto.TouchpadNavigationBack, true187+ return entity.TouchpadNavigationBack, true
188 }188 }
189- if r.cumulativeDX < 0 && input.CanGoForward && r.startedAtNavigationEdge(dto.TouchpadNavigationForward) {189+ if r.cumulativeDX < 0 && input.CanGoForward && r.startedAtNavigationEdge(entity.TouchpadNavigationForward) {
190- return dto.TouchpadNavigationForward, true190+ return entity.TouchpadNavigationForward, true
191 }191 }
192- return dto.TouchpadNavigationBack, false192+ return entity.TouchpadNavigationBack, false
193 }193 }
194 194
195 func (r *touchpadNavigationRecognizer) setGestureStart(input touchpadNavigationInput) {195 func (r *touchpadNavigationRecognizer) setGestureStart(input touchpadNavigationInput) {
@@ -198,12 +198,12 @@ func (r *touchpadNavigationRecognizer) setGestureStart(input touchpadNavigationI
198 r.hasGestureStart = true198 r.hasGestureStart = true
199 }199 }
200 200
201-func (r *touchpadNavigationRecognizer) startedAtNavigationEdge(action dto.TouchpadNavigationAction) bool {201+func (r *touchpadNavigationRecognizer) startedAtNavigationEdge(action entity.TouchpadNavigationAction) bool {
202 if r.gestureViewWidth <= 0 {202 if r.gestureViewWidth <= 0 {
203 return false203 return false
204 }204 }
205 edgeDistance := math.Min(r.gestureViewWidth*touchpadNavigationEdgeFraction, touchpadNavigationMaxEdgeDistance)205 edgeDistance := math.Min(r.gestureViewWidth*touchpadNavigationEdgeFraction, touchpadNavigationMaxEdgeDistance)
206- if action == dto.TouchpadNavigationForward {206+ if action == entity.TouchpadNavigationForward {
207 return r.gestureStartX >= r.gestureViewWidth-edgeDistance207 return r.gestureStartX >= r.gestureViewWidth-edgeDistance
208 }208 }
209 return r.gestureStartX <= edgeDistance209 return r.gestureStartX <= edgeDistance
@@ -223,7 +223,7 @@ func (r *touchpadNavigationRecognizer) reset() {
223 r.thresholdReached = false223 r.thresholdReached = false
224 r.verticalCanceled = false224 r.verticalCanceled = false
225 r.indicatorShown = false225 r.indicatorShown = false
226- r.lastIndicatorAction = dto.TouchpadNavigationBack226+ r.lastIndicatorAction = entity.TouchpadNavigationBack
227 }227 }
228 228
229 func isTouchpadNavigationPreciseEvent(event cef2gtk.ScrollEvent) bool {229 func isTouchpadNavigationPreciseEvent(event cef2gtk.ScrollEvent) bool {
M internal/infrastructure/cef/touchpad_navigation_test.go +5 -5
@@ -3,7 +3,7 @@ package cef
33 import (
44 "testing"
55
6- "github.com/bnema/dumber/internal/application/dto"
6+ "github.com/bnema/dumber/internal/domain/entity"
77 cef2gtk "github.com/bnema/purego-cef2gtk"
88 "github.com/bnema/puregotk/v4/gdk"
99 "github.com/stretchr/testify/require"
@@ -43,7 +43,7 @@ func TestTouchpadNavigationRecognizer_ReportsProgressAndNavigatesOnReleaseAfterT
4343 CanGoForward: true,
4444 })
4545 require.True(t, progress.HasIndicator)
46- require.Equal(t, dto.TouchpadNavigationBack, progress.Indicator.Action)
46+ require.Equal(t, entity.TouchpadNavigationBack, progress.Indicator.Action)
4747 require.True(t, progress.Indicator.Active)
4848 require.InDelta(t, 0.6, progress.Indicator.Progress, 0.001)
4949 require.False(t, progress.Indicator.ThresholdReached)
@@ -56,7 +56,7 @@ func TestTouchpadNavigationRecognizer_ReportsProgressAndNavigatesOnReleaseAfterT
5656 CanGoForward: true,
5757 })
5858 require.True(t, armed.HasIndicator)
59- require.Equal(t, dto.TouchpadNavigationBack, armed.Indicator.Action)
59+ require.Equal(t, entity.TouchpadNavigationBack, armed.Indicator.Action)
6060 require.True(t, armed.Indicator.Active)
6161 require.InDelta(t, 1.0, armed.Indicator.Progress, 0.001)
6262 require.True(t, armed.Indicator.ThresholdReached)
@@ -99,7 +99,7 @@ func TestTouchpadNavigationRecognizer_ReportsForwardProgressAndNavigatesOnReleas
9999 CanGoForward: true,
100100 })
101101 require.True(t, armed.HasIndicator)
102- require.Equal(t, dto.TouchpadNavigationForward, armed.Indicator.Action)
102+ require.Equal(t, entity.TouchpadNavigationForward, armed.Indicator.Action)
103103 require.True(t, armed.Indicator.Active)
104104 require.InDelta(t, 1.0, armed.Indicator.Progress, 0.001)
105105 require.True(t, armed.Indicator.ThresholdReached)
@@ -466,7 +466,7 @@ func TestTouchpadNavigationRecognizer_ResetsBetweenConsecutiveGestures(t *testin
466466 CanGoForward: true,
467467 })
468468 require.True(t, secondUpdate.HasIndicator)
469- require.Equal(t, dto.TouchpadNavigationForward, secondUpdate.Indicator.Action)
469+ require.Equal(t, entity.TouchpadNavigationForward, secondUpdate.Indicator.Action)
470470 secondEnd := recognizer.Handle(touchpadNavigationInput{
471471 Event: touchpadNavigationScrollEventAt(cef2gtk.ScrollPhaseEnd, 976, 0, 0),
472472 Config: cfg,
@@ -3,7 +3,7 @@ package cef
3 import (3 import (
4 "testing"4 "testing"
5 5
6- "github.com/bnema/dumber/internal/application/dto"6+ "github.com/bnema/dumber/internal/domain/entity"
7 cef2gtk "github.com/bnema/purego-cef2gtk"7 cef2gtk "github.com/bnema/purego-cef2gtk"
8 "github.com/bnema/puregotk/v4/gdk"8 "github.com/bnema/puregotk/v4/gdk"
9 "github.com/stretchr/testify/require"9 "github.com/stretchr/testify/require"
@@ -43,7 +43,7 @@ func TestTouchpadNavigationRecognizer_ReportsProgressAndNavigatesOnReleaseAfterT
43 CanGoForward: true,43 CanGoForward: true,
44 })44 })
45 require.True(t, progress.HasIndicator)45 require.True(t, progress.HasIndicator)
46- require.Equal(t, dto.TouchpadNavigationBack, progress.Indicator.Action)46+ require.Equal(t, entity.TouchpadNavigationBack, progress.Indicator.Action)
47 require.True(t, progress.Indicator.Active)47 require.True(t, progress.Indicator.Active)
48 require.InDelta(t, 0.6, progress.Indicator.Progress, 0.001)48 require.InDelta(t, 0.6, progress.Indicator.Progress, 0.001)
49 require.False(t, progress.Indicator.ThresholdReached)49 require.False(t, progress.Indicator.ThresholdReached)
@@ -56,7 +56,7 @@ func TestTouchpadNavigationRecognizer_ReportsProgressAndNavigatesOnReleaseAfterT
56 CanGoForward: true,56 CanGoForward: true,
57 })57 })
58 require.True(t, armed.HasIndicator)58 require.True(t, armed.HasIndicator)
59- require.Equal(t, dto.TouchpadNavigationBack, armed.Indicator.Action)59+ require.Equal(t, entity.TouchpadNavigationBack, armed.Indicator.Action)
60 require.True(t, armed.Indicator.Active)60 require.True(t, armed.Indicator.Active)
61 require.InDelta(t, 1.0, armed.Indicator.Progress, 0.001)61 require.InDelta(t, 1.0, armed.Indicator.Progress, 0.001)
62 require.True(t, armed.Indicator.ThresholdReached)62 require.True(t, armed.Indicator.ThresholdReached)
@@ -99,7 +99,7 @@ func TestTouchpadNavigationRecognizer_ReportsForwardProgressAndNavigatesOnReleas
99 CanGoForward: true,99 CanGoForward: true,
100 })100 })
101 require.True(t, armed.HasIndicator)101 require.True(t, armed.HasIndicator)
102- require.Equal(t, dto.TouchpadNavigationForward, armed.Indicator.Action)102+ require.Equal(t, entity.TouchpadNavigationForward, armed.Indicator.Action)
103 require.True(t, armed.Indicator.Active)103 require.True(t, armed.Indicator.Active)
104 require.InDelta(t, 1.0, armed.Indicator.Progress, 0.001)104 require.InDelta(t, 1.0, armed.Indicator.Progress, 0.001)
105 require.True(t, armed.Indicator.ThresholdReached)105 require.True(t, armed.Indicator.ThresholdReached)
@@ -466,7 +466,7 @@ func TestTouchpadNavigationRecognizer_ResetsBetweenConsecutiveGestures(t *testin
466 CanGoForward: true,466 CanGoForward: true,
467 })467 })
468 require.True(t, secondUpdate.HasIndicator)468 require.True(t, secondUpdate.HasIndicator)
469- require.Equal(t, dto.TouchpadNavigationForward, secondUpdate.Indicator.Action)469+ require.Equal(t, entity.TouchpadNavigationForward, secondUpdate.Indicator.Action)
470 secondEnd := recognizer.Handle(touchpadNavigationInput{470 secondEnd := recognizer.Handle(touchpadNavigationInput{
471 Event: touchpadNavigationScrollEventAt(cef2gtk.ScrollPhaseEnd, 976, 0, 0),471 Event: touchpadNavigationScrollEventAt(cef2gtk.ScrollPhaseEnd, 976, 0, 0),
472 Config: cfg,472 Config: cfg,
M internal/infrastructure/cef/webview.go +2 -1
@@ -20,6 +20,7 @@ import (
2020
2121 "github.com/bnema/dumber/internal/application/dto"
2222 "github.com/bnema/dumber/internal/application/port"
23+ "github.com/bnema/dumber/internal/domain/entity"
2324 "github.com/bnema/dumber/internal/logging"
2425 "github.com/bnema/dumber/internal/shared/syncdispatch"
2526 )
@@ -1545,7 +1546,7 @@ func (wv *WebView) touchpadNavigationViewWidth() float64 {
15451546 return float64(wv.nativeWidget.GetWidth())
15461547 }
15471548
1548-func (wv *WebView) emitTouchpadNavigationGesture(gesture dto.TouchpadNavigationGesture) {
1549+func (wv *WebView) emitTouchpadNavigationGesture(gesture entity.TouchpadNavigationGesture) {
15491550 if wv == nil {
15501551 return
15511552 }
@@ -20,6 +20,7 @@ import (
20 20
21 "github.com/bnema/dumber/internal/application/dto"21 "github.com/bnema/dumber/internal/application/dto"
22 "github.com/bnema/dumber/internal/application/port"22 "github.com/bnema/dumber/internal/application/port"
23+ "github.com/bnema/dumber/internal/domain/entity"
23 "github.com/bnema/dumber/internal/logging"24 "github.com/bnema/dumber/internal/logging"
24 "github.com/bnema/dumber/internal/shared/syncdispatch"25 "github.com/bnema/dumber/internal/shared/syncdispatch"
25 )26 )
@@ -1545,7 +1546,7 @@ func (wv *WebView) touchpadNavigationViewWidth() float64 {
1545 return float64(wv.nativeWidget.GetWidth())1546 return float64(wv.nativeWidget.GetWidth())
1546 }1547 }
1547 1548
1548-func (wv *WebView) emitTouchpadNavigationGesture(gesture dto.TouchpadNavigationGesture) {1549+func (wv *WebView) emitTouchpadNavigationGesture(gesture entity.TouchpadNavigationGesture) {
1549 if wv == nil {1550 if wv == nil {
1550 return1551 return
1551 }1552 }
M internal/infrastructure/cef/webview_input_test.go +2 -2
@@ -4,8 +4,8 @@ import (
44 "context"
55 "testing"
66
7- "github.com/bnema/dumber/internal/application/dto"
87 "github.com/bnema/dumber/internal/application/port"
8+ "github.com/bnema/dumber/internal/domain/entity"
99 cefmocks "github.com/bnema/purego-cef/cef/mocks"
1010 "github.com/bnema/purego-cef2gtk"
1111 "github.com/bnema/puregotk/v4/gdk"
@@ -92,7 +92,7 @@ func TestWebViewHandleScrollInput_EmitsFinalGestureBeforeNavigation(t *testing.T
9292 canGoBack: true,
9393 browser: browser,
9494 callbacks: &port.WebViewCallbacks{
95- OnTouchpadNavigationGesture: func(gesture dto.TouchpadNavigationGesture) {
95+ OnTouchpadNavigationGesture: func(gesture entity.TouchpadNavigationGesture) {
9696 if !gesture.Active && gesture.ThresholdReached {
9797 events = append(events, "indicator-finished")
9898 }
@@ -4,8 +4,8 @@ import (
4 "context"4 "context"
5 "testing"5 "testing"
6 6
7- "github.com/bnema/dumber/internal/application/dto"
8 "github.com/bnema/dumber/internal/application/port"7 "github.com/bnema/dumber/internal/application/port"
8+ "github.com/bnema/dumber/internal/domain/entity"
9 cefmocks "github.com/bnema/purego-cef/cef/mocks"9 cefmocks "github.com/bnema/purego-cef/cef/mocks"
10 "github.com/bnema/purego-cef2gtk"10 "github.com/bnema/purego-cef2gtk"
11 "github.com/bnema/puregotk/v4/gdk"11 "github.com/bnema/puregotk/v4/gdk"
@@ -92,7 +92,7 @@ func TestWebViewHandleScrollInput_EmitsFinalGestureBeforeNavigation(t *testing.T
92 canGoBack: true,92 canGoBack: true,
93 browser: browser,93 browser: browser,
94 callbacks: &port.WebViewCallbacks{94 callbacks: &port.WebViewCallbacks{
95- OnTouchpadNavigationGesture: func(gesture dto.TouchpadNavigationGesture) {95+ OnTouchpadNavigationGesture: func(gesture entity.TouchpadNavigationGesture) {
96 if !gesture.Active && gesture.ThresholdReached {96 if !gesture.Active && gesture.ThresholdReached {
97 events = append(events, "indicator-finished")97 events = append(events, "indicator-finished")
98 }98 }
M internal/ui/app.go +2 -3
@@ -13,7 +13,6 @@ import (
1313 "time"
1414 "unsafe"
1515
16- "github.com/bnema/dumber/internal/application/dto"
1716 "github.com/bnema/dumber/internal/application/port"
1817 "github.com/bnema/dumber/internal/application/usecase"
1918 "github.com/bnema/dumber/internal/domain/entity"
@@ -594,7 +593,7 @@ func (a *App) browserWindowForAnyPane(paneID entity.PaneID) *browserWindow {
594593 return nil
595594 }
596595
597-func (a *App) handleTouchpadNavigationGesture(paneID entity.PaneID, gesture dto.TouchpadNavigationGesture) {
596+func (a *App) handleTouchpadNavigationGesture(paneID entity.PaneID, gesture entity.TouchpadNavigationGesture) {
598597 if a == nil {
599598 return
600599 }
@@ -3195,7 +3194,7 @@ func (a *App) initContentCoordinator(
31953194 a.contentCoord.SetOnLaunchExternalURL(a.deps.LaunchExternalURL)
31963195 }
31973196
3198- a.contentCoord.SetOnTouchpadNavigationGesture(func(paneID entity.PaneID, gesture dto.TouchpadNavigationGesture) {
3197+ a.contentCoord.SetOnTouchpadNavigationGesture(func(paneID entity.PaneID, gesture entity.TouchpadNavigationGesture) {
31993198 a.handleTouchpadNavigationGesture(paneID, gesture)
32003199 })
32013200
@@ -13,7 +13,6 @@ import (
13 "time"13 "time"
14 "unsafe"14 "unsafe"
15 15
16- "github.com/bnema/dumber/internal/application/dto"
17 "github.com/bnema/dumber/internal/application/port"16 "github.com/bnema/dumber/internal/application/port"
18 "github.com/bnema/dumber/internal/application/usecase"17 "github.com/bnema/dumber/internal/application/usecase"
19 "github.com/bnema/dumber/internal/domain/entity"18 "github.com/bnema/dumber/internal/domain/entity"
@@ -594,7 +593,7 @@ func (a *App) browserWindowForAnyPane(paneID entity.PaneID) *browserWindow {
594 return nil593 return nil
595 }594 }
596 595
597-func (a *App) handleTouchpadNavigationGesture(paneID entity.PaneID, gesture dto.TouchpadNavigationGesture) {596+func (a *App) handleTouchpadNavigationGesture(paneID entity.PaneID, gesture entity.TouchpadNavigationGesture) {
598 if a == nil {597 if a == nil {
599 return598 return
600 }599 }
@@ -3195,7 +3194,7 @@ func (a *App) initContentCoordinator(
3195 a.contentCoord.SetOnLaunchExternalURL(a.deps.LaunchExternalURL)3194 a.contentCoord.SetOnLaunchExternalURL(a.deps.LaunchExternalURL)
3196 }3195 }
3197 3196
3198- a.contentCoord.SetOnTouchpadNavigationGesture(func(paneID entity.PaneID, gesture dto.TouchpadNavigationGesture) {3197+ a.contentCoord.SetOnTouchpadNavigationGesture(func(paneID entity.PaneID, gesture entity.TouchpadNavigationGesture) {
3199 a.handleTouchpadNavigationGesture(paneID, gesture)3198 a.handleTouchpadNavigationGesture(paneID, gesture)
3200 })3199 })
3201 3200
M internal/ui/component/touchpad_navigation_indicator.go +7 -7
@@ -1,7 +1,7 @@
11 package component
22
33 import (
4- "github.com/bnema/dumber/internal/application/dto"
4+ "github.com/bnema/dumber/internal/domain/entity"
55 "github.com/bnema/puregotk/v4/glib"
66 "github.com/bnema/puregotk/v4/gtk"
77 )
@@ -114,7 +114,7 @@ func (i *TouchpadNavigationIndicator) Widget() *gtk.Widget {
114114 return &i.container.Widget
115115 }
116116
117-func (i *TouchpadNavigationIndicator) ShowGesture(gesture dto.TouchpadNavigationGesture) {
117+func (i *TouchpadNavigationIndicator) ShowGesture(gesture entity.TouchpadNavigationGesture) {
118118 if i == nil || i.container == nil || i.icon == nil || i.label == nil || i.bar == nil {
119119 return
120120 }
@@ -123,7 +123,7 @@ func (i *TouchpadNavigationIndicator) ShowGesture(gesture dto.TouchpadNavigation
123123 i.container.RemoveCssClass("hiding")
124124 i.container.RemoveCssClass("back")
125125 i.container.RemoveCssClass("forward")
126- if gesture.Action == dto.TouchpadNavigationForward {
126+ if gesture.Action == entity.TouchpadNavigationForward {
127127 i.container.AddCssClass("forward")
128128 i.container.SetHalign(gtk.AlignEndValue)
129129 i.bar.SetInverted(true)
@@ -206,16 +206,16 @@ func (i *TouchpadNavigationIndicator) cancelHideTimer() {
206206 }
207207 }
208208
209-func touchpadNavigationIndicatorIcon(gesture dto.TouchpadNavigationGesture) string {
210- if gesture.Action == dto.TouchpadNavigationForward {
209+func touchpadNavigationIndicatorIcon(gesture entity.TouchpadNavigationGesture) string {
210+ if gesture.Action == entity.TouchpadNavigationForward {
211211 return "→"
212212 }
213213 return "←"
214214 }
215215
216-func touchpadNavigationIndicatorLabel(gesture dto.TouchpadNavigationGesture) string {
216+func touchpadNavigationIndicatorLabel(gesture entity.TouchpadNavigationGesture) string {
217217 suffix := "Back"
218- if gesture.Action == dto.TouchpadNavigationForward {
218+ if gesture.Action == entity.TouchpadNavigationForward {
219219 suffix = "Forward"
220220 }
221221 if gesture.ThresholdReached {
@@ -1,7 +1,7 @@
1 package component1 package component
2 2
3 import (3 import (
4- "github.com/bnema/dumber/internal/application/dto"4+ "github.com/bnema/dumber/internal/domain/entity"
5 "github.com/bnema/puregotk/v4/glib"5 "github.com/bnema/puregotk/v4/glib"
6 "github.com/bnema/puregotk/v4/gtk"6 "github.com/bnema/puregotk/v4/gtk"
7 )7 )
@@ -114,7 +114,7 @@ func (i *TouchpadNavigationIndicator) Widget() *gtk.Widget {
114 return &i.container.Widget114 return &i.container.Widget
115 }115 }
116 116
117-func (i *TouchpadNavigationIndicator) ShowGesture(gesture dto.TouchpadNavigationGesture) {117+func (i *TouchpadNavigationIndicator) ShowGesture(gesture entity.TouchpadNavigationGesture) {
118 if i == nil || i.container == nil || i.icon == nil || i.label == nil || i.bar == nil {118 if i == nil || i.container == nil || i.icon == nil || i.label == nil || i.bar == nil {
119 return119 return
120 }120 }
@@ -123,7 +123,7 @@ func (i *TouchpadNavigationIndicator) ShowGesture(gesture dto.TouchpadNavigation
123 i.container.RemoveCssClass("hiding")123 i.container.RemoveCssClass("hiding")
124 i.container.RemoveCssClass("back")124 i.container.RemoveCssClass("back")
125 i.container.RemoveCssClass("forward")125 i.container.RemoveCssClass("forward")
126- if gesture.Action == dto.TouchpadNavigationForward {126+ if gesture.Action == entity.TouchpadNavigationForward {
127 i.container.AddCssClass("forward")127 i.container.AddCssClass("forward")
128 i.container.SetHalign(gtk.AlignEndValue)128 i.container.SetHalign(gtk.AlignEndValue)
129 i.bar.SetInverted(true)129 i.bar.SetInverted(true)
@@ -206,16 +206,16 @@ func (i *TouchpadNavigationIndicator) cancelHideTimer() {
206 }206 }
207 }207 }
208 208
209-func touchpadNavigationIndicatorIcon(gesture dto.TouchpadNavigationGesture) string {209+func touchpadNavigationIndicatorIcon(gesture entity.TouchpadNavigationGesture) string {
210- if gesture.Action == dto.TouchpadNavigationForward {210+ if gesture.Action == entity.TouchpadNavigationForward {
211 return "→"211 return "→"
212 }212 }
213 return "←"213 return "←"
214 }214 }
215 215
216-func touchpadNavigationIndicatorLabel(gesture dto.TouchpadNavigationGesture) string {216+func touchpadNavigationIndicatorLabel(gesture entity.TouchpadNavigationGesture) string {
217 suffix := "Back"217 suffix := "Back"
218- if gesture.Action == dto.TouchpadNavigationForward {218+ if gesture.Action == entity.TouchpadNavigationForward {
219 suffix = "Forward"219 suffix = "Forward"
220 }220 }
221 if gesture.ThresholdReached {221 if gesture.ThresholdReached {
M internal/ui/coordinator/content/callbacks.go +1 -2
@@ -5,7 +5,6 @@ import (
55 "net/url"
66 "strings"
77
8- "github.com/bnema/dumber/internal/application/dto"
98 "github.com/bnema/dumber/internal/application/port"
109 "github.com/bnema/dumber/internal/application/usecase"
1110 "github.com/bnema/dumber/internal/domain/entity"
@@ -88,7 +87,7 @@ func (c *Coordinator) setupWebViewCallbacks(ctx context.Context, paneID entity.P
8887 OnLinkHover: func(uri string) {
8988 c.onLinkHover(paneID, uri)
9089 },
91- OnTouchpadNavigationGesture: func(gesture dto.TouchpadNavigationGesture) {
90+ OnTouchpadNavigationGesture: func(gesture entity.TouchpadNavigationGesture) {
9291 if c.onTouchpadNavigationGesture != nil {
9392 c.onTouchpadNavigationGesture(paneID, gesture)
9493 }
@@ -5,7 +5,6 @@ import (
5 "net/url"5 "net/url"
6 "strings"6 "strings"
7 7
8- "github.com/bnema/dumber/internal/application/dto"
9 "github.com/bnema/dumber/internal/application/port"8 "github.com/bnema/dumber/internal/application/port"
10 "github.com/bnema/dumber/internal/application/usecase"9 "github.com/bnema/dumber/internal/application/usecase"
11 "github.com/bnema/dumber/internal/domain/entity"10 "github.com/bnema/dumber/internal/domain/entity"
@@ -88,7 +87,7 @@ func (c *Coordinator) setupWebViewCallbacks(ctx context.Context, paneID entity.P
88 OnLinkHover: func(uri string) {87 OnLinkHover: func(uri string) {
89 c.onLinkHover(paneID, uri)88 c.onLinkHover(paneID, uri)
90 },89 },
91- OnTouchpadNavigationGesture: func(gesture dto.TouchpadNavigationGesture) {90+ OnTouchpadNavigationGesture: func(gesture entity.TouchpadNavigationGesture) {
92 if c.onTouchpadNavigationGesture != nil {91 if c.onTouchpadNavigationGesture != nil {
93 c.onTouchpadNavigationGesture(paneID, gesture)92 c.onTouchpadNavigationGesture(paneID, gesture)
94 }93 }
M internal/ui/coordinator/content/coordinator.go +2 -3
@@ -4,7 +4,6 @@ import (
44 "context"
55 "sync"
66
7- "github.com/bnema/dumber/internal/application/dto"
87 "github.com/bnema/dumber/internal/application/port"
98 "github.com/bnema/dumber/internal/application/usecase"
109 "github.com/bnema/dumber/internal/domain/entity"
@@ -66,7 +65,7 @@ type Coordinator struct {
6665 onActiveNavigationCommitted func(paneID entity.PaneID, uri string)
6766
6867 // Callback when a CEF touchpad history navigation gesture progresses.
69- onTouchpadNavigationGesture func(paneID entity.PaneID, gesture dto.TouchpadNavigationGesture)
68+ onTouchpadNavigationGesture func(paneID entity.PaneID, gesture entity.TouchpadNavigationGesture)
7069
7170 // Callback when the WebView becomes visible (first real commit)
7271 onWebViewShown func(paneID entity.PaneID)
@@ -198,7 +197,7 @@ func (c *Coordinator) SetOnPaneURIUpdated(fn func(paneID entity.PaneID, url stri
198197
199198 // SetOnTouchpadNavigationGesture sets the callback for CEF two-finger history
200199 // navigation gesture progress.
201-func (c *Coordinator) SetOnTouchpadNavigationGesture(fn func(paneID entity.PaneID, gesture dto.TouchpadNavigationGesture)) {
200+func (c *Coordinator) SetOnTouchpadNavigationGesture(fn func(paneID entity.PaneID, gesture entity.TouchpadNavigationGesture)) {
202201 c.onTouchpadNavigationGesture = fn
203202 }
204203
@@ -4,7 +4,6 @@ import (
4 "context"4 "context"
5 "sync"5 "sync"
6 6
7- "github.com/bnema/dumber/internal/application/dto"
8 "github.com/bnema/dumber/internal/application/port"7 "github.com/bnema/dumber/internal/application/port"
9 "github.com/bnema/dumber/internal/application/usecase"8 "github.com/bnema/dumber/internal/application/usecase"
10 "github.com/bnema/dumber/internal/domain/entity"9 "github.com/bnema/dumber/internal/domain/entity"
@@ -66,7 +65,7 @@ type Coordinator struct {
66 onActiveNavigationCommitted func(paneID entity.PaneID, uri string)65 onActiveNavigationCommitted func(paneID entity.PaneID, uri string)
67 66
68 // Callback when a CEF touchpad history navigation gesture progresses.67 // Callback when a CEF touchpad history navigation gesture progresses.
69- onTouchpadNavigationGesture func(paneID entity.PaneID, gesture dto.TouchpadNavigationGesture)68+ onTouchpadNavigationGesture func(paneID entity.PaneID, gesture entity.TouchpadNavigationGesture)
70 69
71 // Callback when the WebView becomes visible (first real commit)70 // Callback when the WebView becomes visible (first real commit)
72 onWebViewShown func(paneID entity.PaneID)71 onWebViewShown func(paneID entity.PaneID)
@@ -198,7 +197,7 @@ func (c *Coordinator) SetOnPaneURIUpdated(fn func(paneID entity.PaneID, url stri
198 197
199 // SetOnTouchpadNavigationGesture sets the callback for CEF two-finger history198 // SetOnTouchpadNavigationGesture sets the callback for CEF two-finger history
200 // navigation gesture progress.199 // navigation gesture progress.
201-func (c *Coordinator) SetOnTouchpadNavigationGesture(fn func(paneID entity.PaneID, gesture dto.TouchpadNavigationGesture)) {200+func (c *Coordinator) SetOnTouchpadNavigationGesture(fn func(paneID entity.PaneID, gesture entity.TouchpadNavigationGesture)) {
202 c.onTouchpadNavigationGesture = fn201 c.onTouchpadNavigationGesture = fn
203 }202 }
204 203

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