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 Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
10 files · +42 -43
M internal/application/port/webview.go +2 -1
| @@ -7,6 +7,7 @@ import ( | |||
| 7 | 7 | "context" | |
| 8 | 8 | ||
| 9 | 9 | "github.com/bnema/dumber/internal/application/dto" | |
| 10 | + | "github.com/bnema/dumber/internal/domain/entity" | |
| 10 | 11 | ) | |
| 11 | 12 | ||
| 12 | 13 | // WebViewID uniquely identifies a WebView instance. | |
| @@ -139,7 +140,7 @@ type WebViewCallbacks struct { | |||
| 139 | 140 | OnAudioStateChanged func(playing bool) | |
| 140 | 141 | // OnTouchpadNavigationGesture is called while a two-finger touchpad history | |
| 141 | 142 | // navigation gesture is progressing or finishing. | |
| 142 | - | OnTouchpadNavigationGesture func(gesture dto.TouchpadNavigationGesture) | |
| 143 | + | OnTouchpadNavigationGesture func(gesture entity.TouchpadNavigationGesture) | |
| 143 | 144 | } | |
| 144 | 145 | ||
| 145 | 146 | // 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 history | 141 | // 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 | |
| 2 | 2 | ||
| 3 | 3 | // TouchpadNavigationAction indicates the direction of a touchpad navigation gesture. | |
| 4 | 4 | type TouchpadNavigationAction int | |
| @@ -1,4 +1,4 @@ | |||||
| 1 | - | package dto | 1 | + | 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 int | 4 | type TouchpadNavigationAction int | ||
M internal/infrastructure/cef/touchpad_navigation.go +18 -18
| @@ -3,7 +3,7 @@ package cef | |||
| 3 | 3 | import ( | |
| 4 | 4 | "math" | |
| 5 | 5 | ||
| 6 | - | "github.com/bnema/dumber/internal/application/dto" | |
| 6 | + | "github.com/bnema/dumber/internal/domain/entity" | |
| 7 | 7 | cef2gtk "github.com/bnema/purego-cef2gtk" | |
| 8 | 8 | "github.com/bnema/puregotk/v4/gdk" | |
| 9 | 9 | ) | |
| @@ -25,7 +25,7 @@ type touchpadNavigationRecognizer struct { | |||
| 25 | 25 | thresholdReached bool | |
| 26 | 26 | verticalCanceled bool | |
| 27 | 27 | indicatorShown bool | |
| 28 | - | lastIndicatorAction dto.TouchpadNavigationAction | |
| 28 | + | lastIndicatorAction entity.TouchpadNavigationAction | |
| 29 | 29 | } | |
| 30 | 30 | ||
| 31 | 31 | type touchpadNavigationInput struct { | |
| @@ -38,7 +38,7 @@ type touchpadNavigationInput struct { | |||
| 38 | 38 | ||
| 39 | 39 | type touchpadNavigationResult struct { | |
| 40 | 40 | HasIndicator bool | |
| 41 | - | Indicator dto.TouchpadNavigationGesture | |
| 41 | + | Indicator entity.TouchpadNavigationGesture | |
| 42 | 42 | HasAction bool | |
| 43 | 43 | Action cef2gtk.NavigationSwipeAction | |
| 44 | 44 | } | |
| @@ -103,7 +103,7 @@ func (r *touchpadNavigationRecognizer) handleUpdate(input touchpadNavigationInpu | |||
| 103 | 103 | r.lastIndicatorAction = action | |
| 104 | 104 | return touchpadNavigationResult{ | |
| 105 | 105 | HasIndicator: true, | |
| 106 | - | Indicator: dto.TouchpadNavigationGesture{ | |
| 106 | + | Indicator: entity.TouchpadNavigationGesture{ | |
| 107 | 107 | Action: action, | |
| 108 | 108 | Progress: progress, | |
| 109 | 109 | ThresholdReached: r.thresholdReached, | |
| @@ -138,7 +138,7 @@ func (r *touchpadNavigationRecognizer) finishIndicator(input touchpadNavigationI | |||
| 138 | 138 | threshold := normalizedTouchpadNavigationMinDelta(input.Config.TouchpadNavigationMinDelta) | |
| 139 | 139 | return touchpadNavigationResult{ | |
| 140 | 140 | HasIndicator: true, | |
| 141 | - | Indicator: dto.TouchpadNavigationGesture{ | |
| 141 | + | Indicator: entity.TouchpadNavigationGesture{ | |
| 142 | 142 | Action: action, | |
| 143 | 143 | Progress: clampFloat(math.Abs(r.cumulativeDX)/threshold, 0, 1), | |
| 144 | 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 | 151 | return r.resolvedDirection(input) | |
| 152 | 152 | } | |
| 153 | 153 | ||
| 154 | 154 | func (r *touchpadNavigationRecognizer) cancelAsTooVertical() touchpadNavigationResult { | |
| 155 | - | var action dto.TouchpadNavigationAction | |
| 155 | + | var action entity.TouchpadNavigationAction | |
| 156 | 156 | hasAction := r.indicatorShown | |
| 157 | 157 | if hasAction { | |
| 158 | 158 | action = r.lastIndicatorAction | |
| @@ -164,7 +164,7 @@ func (r *touchpadNavigationRecognizer) cancelAsTooVertical() touchpadNavigationR | |||
| 164 | 164 | } | |
| 165 | 165 | return touchpadNavigationResult{ | |
| 166 | 166 | HasIndicator: true, | |
| 167 | - | Indicator: dto.TouchpadNavigationGesture{ | |
| 167 | + | Indicator: entity.TouchpadNavigationGesture{ | |
| 168 | 168 | Action: action, | |
| 169 | 169 | Active: false, | |
| 170 | 170 | }, | |
| @@ -176,20 +176,20 @@ func (r *touchpadNavigationRecognizer) navigationAction(input touchpadNavigation | |||
| 176 | 176 | if !ok { | |
| 177 | 177 | return cef2gtk.NavigationSwipeBack, false | |
| 178 | 178 | } | |
| 179 | - | if action == dto.TouchpadNavigationForward { | |
| 179 | + | if action == entity.TouchpadNavigationForward { | |
| 180 | 180 | return cef2gtk.NavigationSwipeForward, true | |
| 181 | 181 | } | |
| 182 | 182 | return cef2gtk.NavigationSwipeBack, true | |
| 183 | 183 | } | |
| 184 | 184 | ||
| 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 | |
| 188 | 188 | } | |
| 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 | |
| 191 | 191 | } | |
| 192 | - | return dto.TouchpadNavigationBack, false | |
| 192 | + | return entity.TouchpadNavigationBack, false | |
| 193 | 193 | } | |
| 194 | 194 | ||
| 195 | 195 | func (r *touchpadNavigationRecognizer) setGestureStart(input touchpadNavigationInput) { | |
| @@ -198,12 +198,12 @@ func (r *touchpadNavigationRecognizer) setGestureStart(input touchpadNavigationI | |||
| 198 | 198 | 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 | 202 | if r.gestureViewWidth <= 0 { | |
| 203 | 203 | return false | |
| 204 | 204 | } | |
| 205 | 205 | edgeDistance := math.Min(r.gestureViewWidth*touchpadNavigationEdgeFraction, touchpadNavigationMaxEdgeDistance) | |
| 206 | - | if action == dto.TouchpadNavigationForward { | |
| 206 | + | if action == entity.TouchpadNavigationForward { | |
| 207 | 207 | return r.gestureStartX >= r.gestureViewWidth-edgeDistance | |
| 208 | 208 | } | |
| 209 | 209 | return r.gestureStartX <= edgeDistance | |
| @@ -223,7 +223,7 @@ func (r *touchpadNavigationRecognizer) reset() { | |||
| 223 | 223 | r.thresholdReached = false | |
| 224 | 224 | r.verticalCanceled = false | |
| 225 | 225 | r.indicatorShown = false | |
| 226 | - | r.lastIndicatorAction = dto.TouchpadNavigationBack | |
| 226 | + | r.lastIndicatorAction = entity.TouchpadNavigationBack | |
| 227 | 227 | } | |
| 228 | 228 | ||
| 229 | 229 | 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 bool | 25 | thresholdReached bool | ||
| 26 | verticalCanceled bool | 26 | verticalCanceled bool | ||
| 27 | indicatorShown bool | 27 | indicatorShown bool | ||
| 28 | - | lastIndicatorAction dto.TouchpadNavigationAction | 28 | + | 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 bool | 40 | HasIndicator bool | ||
| 41 | - | Indicator dto.TouchpadNavigationGesture | 41 | + | Indicator entity.TouchpadNavigationGesture |
| 42 | HasAction bool | 42 | HasAction bool | ||
| 43 | Action cef2gtk.NavigationSwipeAction | 43 | Action cef2gtk.NavigationSwipeAction | ||
| 44 | } | 44 | } | ||
| @@ -103,7 +103,7 @@ func (r *touchpadNavigationRecognizer) handleUpdate(input touchpadNavigationInpu | |||||
| 103 | r.lastIndicatorAction = action | 103 | 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.TouchpadNavigationAction | 155 | + | var action entity.TouchpadNavigationAction |
| 156 | hasAction := r.indicatorShown | 156 | hasAction := r.indicatorShown | ||
| 157 | if hasAction { | 157 | if hasAction { | ||
| 158 | action = r.lastIndicatorAction | 158 | 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, false | 177 | return cef2gtk.NavigationSwipeBack, false | ||
| 178 | } | 178 | } | ||
| 179 | - | if action == dto.TouchpadNavigationForward { | 179 | + | if action == entity.TouchpadNavigationForward { |
| 180 | return cef2gtk.NavigationSwipeForward, true | 180 | return cef2gtk.NavigationSwipeForward, true | ||
| 181 | } | 181 | } | ||
| 182 | return cef2gtk.NavigationSwipeBack, true | 182 | 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, true | 187 | + | 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, true | 190 | + | return entity.TouchpadNavigationForward, true |
| 191 | } | 191 | } | ||
| 192 | - | return dto.TouchpadNavigationBack, false | 192 | + | 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 = true | 198 | 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 false | 203 | 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-edgeDistance | 207 | return r.gestureStartX >= r.gestureViewWidth-edgeDistance | ||
| 208 | } | 208 | } | ||
| 209 | return r.gestureStartX <= edgeDistance | 209 | return r.gestureStartX <= edgeDistance | ||
| @@ -223,7 +223,7 @@ func (r *touchpadNavigationRecognizer) reset() { | |||||
| 223 | r.thresholdReached = false | 223 | r.thresholdReached = false | ||
| 224 | r.verticalCanceled = false | 224 | r.verticalCanceled = false | ||
| 225 | r.indicatorShown = false | 225 | r.indicatorShown = false | ||
| 226 | - | r.lastIndicatorAction = dto.TouchpadNavigationBack | 226 | + | 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 | |||
| 3 | 3 | import ( | |
| 4 | 4 | "testing" | |
| 5 | 5 | ||
| 6 | - | "github.com/bnema/dumber/internal/application/dto" | |
| 6 | + | "github.com/bnema/dumber/internal/domain/entity" | |
| 7 | 7 | cef2gtk "github.com/bnema/purego-cef2gtk" | |
| 8 | 8 | "github.com/bnema/puregotk/v4/gdk" | |
| 9 | 9 | "github.com/stretchr/testify/require" | |
| @@ -43,7 +43,7 @@ func TestTouchpadNavigationRecognizer_ReportsProgressAndNavigatesOnReleaseAfterT | |||
| 43 | 43 | CanGoForward: true, | |
| 44 | 44 | }) | |
| 45 | 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 | 47 | require.True(t, progress.Indicator.Active) | |
| 48 | 48 | require.InDelta(t, 0.6, progress.Indicator.Progress, 0.001) | |
| 49 | 49 | require.False(t, progress.Indicator.ThresholdReached) | |
| @@ -56,7 +56,7 @@ func TestTouchpadNavigationRecognizer_ReportsProgressAndNavigatesOnReleaseAfterT | |||
| 56 | 56 | CanGoForward: true, | |
| 57 | 57 | }) | |
| 58 | 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 | 60 | require.True(t, armed.Indicator.Active) | |
| 61 | 61 | require.InDelta(t, 1.0, armed.Indicator.Progress, 0.001) | |
| 62 | 62 | require.True(t, armed.Indicator.ThresholdReached) | |
| @@ -99,7 +99,7 @@ func TestTouchpadNavigationRecognizer_ReportsForwardProgressAndNavigatesOnReleas | |||
| 99 | 99 | CanGoForward: true, | |
| 100 | 100 | }) | |
| 101 | 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 | 103 | require.True(t, armed.Indicator.Active) | |
| 104 | 104 | require.InDelta(t, 1.0, armed.Indicator.Progress, 0.001) | |
| 105 | 105 | require.True(t, armed.Indicator.ThresholdReached) | |
| @@ -466,7 +466,7 @@ func TestTouchpadNavigationRecognizer_ResetsBetweenConsecutiveGestures(t *testin | |||
| 466 | 466 | CanGoForward: true, | |
| 467 | 467 | }) | |
| 468 | 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 | 470 | secondEnd := recognizer.Handle(touchpadNavigationInput{ | |
| 471 | 471 | Event: touchpadNavigationScrollEventAt(cef2gtk.ScrollPhaseEnd, 976, 0, 0), | |
| 472 | 472 | 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 ( | |||
| 20 | 20 | ||
| 21 | 21 | "github.com/bnema/dumber/internal/application/dto" | |
| 22 | 22 | "github.com/bnema/dumber/internal/application/port" | |
| 23 | + | "github.com/bnema/dumber/internal/domain/entity" | |
| 23 | 24 | "github.com/bnema/dumber/internal/logging" | |
| 24 | 25 | "github.com/bnema/dumber/internal/shared/syncdispatch" | |
| 25 | 26 | ) | |
| @@ -1545,7 +1546,7 @@ func (wv *WebView) touchpadNavigationViewWidth() float64 { | |||
| 1545 | 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 | 1550 | if wv == nil { | |
| 1550 | 1551 | return | |
| 1551 | 1552 | } | |
| @@ -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 | return | 1551 | return | ||
| 1551 | } | 1552 | } | ||
M internal/infrastructure/cef/webview_input_test.go +2 -2
| @@ -4,8 +4,8 @@ import ( | |||
| 4 | 4 | "context" | |
| 5 | 5 | "testing" | |
| 6 | 6 | ||
| 7 | - | "github.com/bnema/dumber/internal/application/dto" | |
| 8 | 7 | "github.com/bnema/dumber/internal/application/port" | |
| 8 | + | "github.com/bnema/dumber/internal/domain/entity" | |
| 9 | 9 | cefmocks "github.com/bnema/purego-cef/cef/mocks" | |
| 10 | 10 | "github.com/bnema/purego-cef2gtk" | |
| 11 | 11 | "github.com/bnema/puregotk/v4/gdk" | |
| @@ -92,7 +92,7 @@ func TestWebViewHandleScrollInput_EmitsFinalGestureBeforeNavigation(t *testing.T | |||
| 92 | 92 | canGoBack: true, | |
| 93 | 93 | browser: browser, | |
| 94 | 94 | callbacks: &port.WebViewCallbacks{ | |
| 95 | - | OnTouchpadNavigationGesture: func(gesture dto.TouchpadNavigationGesture) { | |
| 95 | + | OnTouchpadNavigationGesture: func(gesture entity.TouchpadNavigationGesture) { | |
| 96 | 96 | if !gesture.Active && gesture.ThresholdReached { | |
| 97 | 97 | events = append(events, "indicator-finished") | |
| 98 | 98 | } | |
| @@ -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 ( | |||
| 13 | 13 | "time" | |
| 14 | 14 | "unsafe" | |
| 15 | 15 | ||
| 16 | - | "github.com/bnema/dumber/internal/application/dto" | |
| 17 | 16 | "github.com/bnema/dumber/internal/application/port" | |
| 18 | 17 | "github.com/bnema/dumber/internal/application/usecase" | |
| 19 | 18 | "github.com/bnema/dumber/internal/domain/entity" | |
| @@ -594,7 +593,7 @@ func (a *App) browserWindowForAnyPane(paneID entity.PaneID) *browserWindow { | |||
| 594 | 593 | 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 | 597 | if a == nil { | |
| 599 | 598 | return | |
| 600 | 599 | } | |
| @@ -3195,7 +3194,7 @@ func (a *App) initContentCoordinator( | |||
| 3195 | 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 | 3198 | a.handleTouchpadNavigationGesture(paneID, gesture) | |
| 3200 | 3199 | }) | |
| 3201 | 3200 | ||
| @@ -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 nil | 593 | 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 | return | 598 | 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 @@ | |||
| 1 | 1 | package component | |
| 2 | 2 | ||
| 3 | 3 | import ( | |
| 4 | - | "github.com/bnema/dumber/internal/application/dto" | |
| 4 | + | "github.com/bnema/dumber/internal/domain/entity" | |
| 5 | 5 | "github.com/bnema/puregotk/v4/glib" | |
| 6 | 6 | "github.com/bnema/puregotk/v4/gtk" | |
| 7 | 7 | ) | |
| @@ -114,7 +114,7 @@ func (i *TouchpadNavigationIndicator) Widget() *gtk.Widget { | |||
| 114 | 114 | 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 | 118 | if i == nil || i.container == nil || i.icon == nil || i.label == nil || i.bar == nil { | |
| 119 | 119 | return | |
| 120 | 120 | } | |
| @@ -123,7 +123,7 @@ func (i *TouchpadNavigationIndicator) ShowGesture(gesture dto.TouchpadNavigation | |||
| 123 | 123 | i.container.RemoveCssClass("hiding") | |
| 124 | 124 | i.container.RemoveCssClass("back") | |
| 125 | 125 | i.container.RemoveCssClass("forward") | |
| 126 | - | if gesture.Action == dto.TouchpadNavigationForward { | |
| 126 | + | if gesture.Action == entity.TouchpadNavigationForward { | |
| 127 | 127 | i.container.AddCssClass("forward") | |
| 128 | 128 | i.container.SetHalign(gtk.AlignEndValue) | |
| 129 | 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 { | |
| 210 | - | if gesture.Action == dto.TouchpadNavigationForward { | |
| 209 | + | func touchpadNavigationIndicatorIcon(gesture entity.TouchpadNavigationGesture) string { | |
| 210 | + | if gesture.Action == entity.TouchpadNavigationForward { | |
| 211 | 211 | return "→" | |
| 212 | 212 | } | |
| 213 | 213 | return "←" | |
| 214 | 214 | } | |
| 215 | 215 | ||
| 216 | - | func touchpadNavigationIndicatorLabel(gesture dto.TouchpadNavigationGesture) string { | |
| 216 | + | func touchpadNavigationIndicatorLabel(gesture entity.TouchpadNavigationGesture) string { | |
| 217 | 217 | suffix := "Back" | |
| 218 | - | if gesture.Action == dto.TouchpadNavigationForward { | |
| 218 | + | if gesture.Action == entity.TouchpadNavigationForward { | |
| 219 | 219 | suffix = "Forward" | |
| 220 | 220 | } | |
| 221 | 221 | if gesture.ThresholdReached { | |
| @@ -1,7 +1,7 @@ | |||||
| 1 | package component | 1 | 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.Widget | 114 | 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 | return | 119 | 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 ( | |||
| 5 | 5 | "net/url" | |
| 6 | 6 | "strings" | |
| 7 | 7 | ||
| 8 | - | "github.com/bnema/dumber/internal/application/dto" | |
| 9 | 8 | "github.com/bnema/dumber/internal/application/port" | |
| 10 | 9 | "github.com/bnema/dumber/internal/application/usecase" | |
| 11 | 10 | "github.com/bnema/dumber/internal/domain/entity" | |
| @@ -88,7 +87,7 @@ func (c *Coordinator) setupWebViewCallbacks(ctx context.Context, paneID entity.P | |||
| 88 | 87 | OnLinkHover: func(uri string) { | |
| 89 | 88 | c.onLinkHover(paneID, uri) | |
| 90 | 89 | }, | |
| 91 | - | OnTouchpadNavigationGesture: func(gesture dto.TouchpadNavigationGesture) { | |
| 90 | + | OnTouchpadNavigationGesture: func(gesture entity.TouchpadNavigationGesture) { | |
| 92 | 91 | if c.onTouchpadNavigationGesture != nil { | |
| 93 | 92 | c.onTouchpadNavigationGesture(paneID, gesture) | |
| 94 | 93 | } | |
| @@ -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 ( | |||
| 4 | 4 | "context" | |
| 5 | 5 | "sync" | |
| 6 | 6 | ||
| 7 | - | "github.com/bnema/dumber/internal/application/dto" | |
| 8 | 7 | "github.com/bnema/dumber/internal/application/port" | |
| 9 | 8 | "github.com/bnema/dumber/internal/application/usecase" | |
| 10 | 9 | "github.com/bnema/dumber/internal/domain/entity" | |
| @@ -66,7 +65,7 @@ type Coordinator struct { | |||
| 66 | 65 | onActiveNavigationCommitted func(paneID entity.PaneID, uri string) | |
| 67 | 66 | ||
| 68 | 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 | 70 | // Callback when the WebView becomes visible (first real commit) | |
| 72 | 71 | onWebViewShown func(paneID entity.PaneID) | |
| @@ -198,7 +197,7 @@ func (c *Coordinator) SetOnPaneURIUpdated(fn func(paneID entity.PaneID, url stri | |||
| 198 | 197 | ||
| 199 | 198 | // SetOnTouchpadNavigationGesture sets the callback for CEF two-finger history | |
| 200 | 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 | 201 | c.onTouchpadNavigationGesture = fn | |
| 203 | 202 | } | |
| 204 | 203 | ||
| @@ -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 history | 198 | // 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 = fn | 201 | c.onTouchpadNavigationGesture = fn | ||
| 203 | } | 202 | } | ||
| 204 | 203 | ||||