detached 5af6b41

fix(cef): satisfy touchpad scroll lint

commit
5af6b41c7340d24cc93ef905e1a001bc1a91c585
author
brice · · 2026-06-17 21:27 UTC
parent
01d791b
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
3 files · +17 -13
M internal/infrastructure/config/schema_provider.go +7 -6
@@ -1056,12 +1056,13 @@ func (*SchemaProvider) getPerformanceKeys(defaults *Config) []entity.ConfigKeyIn
10561056 Section: SectionPerformance,
10571057 },
10581058 {
1059- Key: "engine.cef.input.touchpad_navigation_max_vertical_ratio",
1060- Type: "float64",
1061- Default: fmt.Sprintf("%.2f", defaults.Engine.CEF.Input.TouchpadNavigationMaxVerticalRatio),
1062- Description: "Maximum vertical-to-horizontal delta ratio allowed for CEF touchpad back/forward swipes; does not affect vertical scroll speed",
1063- Range: ">0",
1064- Section: SectionPerformance,
1059+ Key: "engine.cef.input.touchpad_navigation_max_vertical_ratio",
1060+ Type: "float64",
1061+ Default: fmt.Sprintf("%.2f", defaults.Engine.CEF.Input.TouchpadNavigationMaxVerticalRatio),
1062+ Description: "Maximum vertical-to-horizontal delta ratio allowed for CEF touchpad back/forward swipes; " +
1063+ "does not affect vertical scroll speed",
1064+ Range: ">0",
1065+ Section: SectionPerformance,
10651066 },
10661067 {
10671068 Key: "engine.webkit.skia_cpu_painting_threads",
@@ -1056,12 +1056,13 @@ func (*SchemaProvider) getPerformanceKeys(defaults *Config) []entity.ConfigKeyIn
1056 Section: SectionPerformance,1056 Section: SectionPerformance,
1057 },1057 },
1058 {1058 {
1059- Key: "engine.cef.input.touchpad_navigation_max_vertical_ratio",1059+ Key: "engine.cef.input.touchpad_navigation_max_vertical_ratio",
1060- Type: "float64",1060+ Type: "float64",
1061- Default: fmt.Sprintf("%.2f", defaults.Engine.CEF.Input.TouchpadNavigationMaxVerticalRatio),1061+ Default: fmt.Sprintf("%.2f", defaults.Engine.CEF.Input.TouchpadNavigationMaxVerticalRatio),
1062- Description: "Maximum vertical-to-horizontal delta ratio allowed for CEF touchpad back/forward swipes; does not affect vertical scroll speed",1062+ Description: "Maximum vertical-to-horizontal delta ratio allowed for CEF touchpad back/forward swipes; " +
1063- Range: ">0",1063+ "does not affect vertical scroll speed",
1064- Section: SectionPerformance,1064+ Range: ">0",
1065+ Section: SectionPerformance,
1065 },1066 },
1066 {1067 {
1067 Key: "engine.webkit.skia_cpu_painting_threads",1068 Key: "engine.webkit.skia_cpu_painting_threads",
M internal/infrastructure/config/transform_legacy.go +5 -2
@@ -72,7 +72,10 @@ func (*LegacyConfigTransformer) transformLegacyEngineConfig(rawConfig map[string
7272 migrateLegacyCEFInputScrollDefaults(cef)
7373 }
7474
75-const legacyCEFScrollTouchpadMultiplierDefault = 0.35
75+const (
76+ legacyCEFScrollTouchpadMultiplierDefault = 0.35
77+ configFloatTolerance = 0.000001
78+)
7679
7780 func migrateLegacyCEFInputScrollDefaults(cef map[string]any) {
7881 input, ok := cef["input"].(map[string]any)
@@ -114,7 +117,7 @@ func migratedCEFPreciseScrollMultiplier(value any) any {
114117 }
115118
116119 func sameConfigFloat(a, b float64) bool {
117- return math.Abs(a-b) <= 0.000001
120+ return math.Abs(a-b) <= configFloatTolerance
118121 }
119122
120123 func migrateLegacyCEFWindowlessFrameRateDefault(cef map[string]any, hasAdaptive, adaptiveEnabled bool) {
@@ -72,7 +72,10 @@ func (*LegacyConfigTransformer) transformLegacyEngineConfig(rawConfig map[string
72 migrateLegacyCEFInputScrollDefaults(cef)72 migrateLegacyCEFInputScrollDefaults(cef)
73 }73 }
74 74
75-const legacyCEFScrollTouchpadMultiplierDefault = 0.3575+const (
76+ legacyCEFScrollTouchpadMultiplierDefault = 0.35
77+ configFloatTolerance = 0.000001
78+)
76 79
77 func migrateLegacyCEFInputScrollDefaults(cef map[string]any) {80 func migrateLegacyCEFInputScrollDefaults(cef map[string]any) {
78 input, ok := cef["input"].(map[string]any)81 input, ok := cef["input"].(map[string]any)
@@ -114,7 +117,7 @@ func migratedCEFPreciseScrollMultiplier(value any) any {
114 }117 }
115 118
116 func sameConfigFloat(a, b float64) bool {119 func sameConfigFloat(a, b float64) bool {
117- return math.Abs(a-b) <= 0.000001120+ return math.Abs(a-b) <= configFloatTolerance
118 }121 }
119 122
120 func migrateLegacyCEFWindowlessFrameRateDefault(cef map[string]any, hasAdaptive, adaptiveEnabled bool) {123 func migrateLegacyCEFWindowlessFrameRateDefault(cef map[string]any, hasAdaptive, adaptiveEnabled bool) {
M internal/infrastructure/config/transform_legacy_test.go +5 -5
@@ -221,7 +221,7 @@ func TestTransformLegacyEngineConfig_UpgradesObsoletePreciseScrollDefault(t *tes
221221 transformer.TransformLegacyEngineConfig(rawConfig)
222222
223223 input := rawConfig["engine"].(map[string]any)["cef"].(map[string]any)["input"].(map[string]any)
224- assert.Equal(t, defaultCEFScrollPreciseMultiplier, input["scroll_precise_multiplier"])
224+ assert.InDelta(t, defaultCEFScrollPreciseMultiplier, input["scroll_precise_multiplier"], 0.001)
225225 }
226226
227227 func TestTransformLegacyEngineConfig_MigratesLegacyTouchpadScrollKey(t *testing.T) {
@@ -239,7 +239,7 @@ func TestTransformLegacyEngineConfig_MigratesLegacyTouchpadScrollKey(t *testing.
239239 transformer.TransformLegacyEngineConfig(rawConfig)
240240
241241 input := rawConfig["engine"].(map[string]any)["cef"].(map[string]any)["input"].(map[string]any)
242- assert.Equal(t, defaultCEFScrollPreciseMultiplier, input["scroll_precise_multiplier"])
242+ assert.InDelta(t, defaultCEFScrollPreciseMultiplier, input["scroll_precise_multiplier"], 0.001)
243243 assert.NotContains(t, input, "scroll_touchpad_multiplier")
244244 }
245245
@@ -258,7 +258,7 @@ func TestTransformLegacyEngineConfig_PreservesCustomPreciseScrollMultiplier(t *t
258258 transformer.TransformLegacyEngineConfig(rawConfig)
259259
260260 input := rawConfig["engine"].(map[string]any)["cef"].(map[string]any)["input"].(map[string]any)
261- assert.Equal(t, 4.0, input["scroll_precise_multiplier"])
261+ assert.InDelta(t, 4.0, input["scroll_precise_multiplier"], 0.001)
262262 }
263263
264264 func TestTransformLegacyEngineConfig_PreservesCustomLegacyTouchpadScrollMultiplier(t *testing.T) {
@@ -276,7 +276,7 @@ func TestTransformLegacyEngineConfig_PreservesCustomLegacyTouchpadScrollMultipli
276276 transformer.TransformLegacyEngineConfig(rawConfig)
277277
278278 input := rawConfig["engine"].(map[string]any)["cef"].(map[string]any)["input"].(map[string]any)
279- assert.Equal(t, 4.0, input["scroll_precise_multiplier"])
279+ assert.InDelta(t, 4.0, input["scroll_precise_multiplier"], 0.001)
280280 assert.NotContains(t, input, "scroll_touchpad_multiplier")
281281 }
282282
@@ -296,7 +296,7 @@ func TestTransformLegacyEngineConfig_PrefersCustomLegacyTouchpadOverGeneratedPre
296296 transformer.TransformLegacyEngineConfig(rawConfig)
297297
298298 input := rawConfig["engine"].(map[string]any)["cef"].(map[string]any)["input"].(map[string]any)
299- assert.Equal(t, 4.0, input["scroll_precise_multiplier"])
299+ assert.InDelta(t, 4.0, input["scroll_precise_multiplier"], 0.001)
300300 assert.NotContains(t, input, "scroll_touchpad_multiplier")
301301 }
302302
@@ -221,7 +221,7 @@ func TestTransformLegacyEngineConfig_UpgradesObsoletePreciseScrollDefault(t *tes
221 transformer.TransformLegacyEngineConfig(rawConfig)221 transformer.TransformLegacyEngineConfig(rawConfig)
222 222
223 input := rawConfig["engine"].(map[string]any)["cef"].(map[string]any)["input"].(map[string]any)223 input := rawConfig["engine"].(map[string]any)["cef"].(map[string]any)["input"].(map[string]any)
224- assert.Equal(t, defaultCEFScrollPreciseMultiplier, input["scroll_precise_multiplier"])224+ assert.InDelta(t, defaultCEFScrollPreciseMultiplier, input["scroll_precise_multiplier"], 0.001)
225 }225 }
226 226
227 func TestTransformLegacyEngineConfig_MigratesLegacyTouchpadScrollKey(t *testing.T) {227 func TestTransformLegacyEngineConfig_MigratesLegacyTouchpadScrollKey(t *testing.T) {
@@ -239,7 +239,7 @@ func TestTransformLegacyEngineConfig_MigratesLegacyTouchpadScrollKey(t *testing.
239 transformer.TransformLegacyEngineConfig(rawConfig)239 transformer.TransformLegacyEngineConfig(rawConfig)
240 240
241 input := rawConfig["engine"].(map[string]any)["cef"].(map[string]any)["input"].(map[string]any)241 input := rawConfig["engine"].(map[string]any)["cef"].(map[string]any)["input"].(map[string]any)
242- assert.Equal(t, defaultCEFScrollPreciseMultiplier, input["scroll_precise_multiplier"])242+ assert.InDelta(t, defaultCEFScrollPreciseMultiplier, input["scroll_precise_multiplier"], 0.001)
243 assert.NotContains(t, input, "scroll_touchpad_multiplier")243 assert.NotContains(t, input, "scroll_touchpad_multiplier")
244 }244 }
245 245
@@ -258,7 +258,7 @@ func TestTransformLegacyEngineConfig_PreservesCustomPreciseScrollMultiplier(t *t
258 transformer.TransformLegacyEngineConfig(rawConfig)258 transformer.TransformLegacyEngineConfig(rawConfig)
259 259
260 input := rawConfig["engine"].(map[string]any)["cef"].(map[string]any)["input"].(map[string]any)260 input := rawConfig["engine"].(map[string]any)["cef"].(map[string]any)["input"].(map[string]any)
261- assert.Equal(t, 4.0, input["scroll_precise_multiplier"])261+ assert.InDelta(t, 4.0, input["scroll_precise_multiplier"], 0.001)
262 }262 }
263 263
264 func TestTransformLegacyEngineConfig_PreservesCustomLegacyTouchpadScrollMultiplier(t *testing.T) {264 func TestTransformLegacyEngineConfig_PreservesCustomLegacyTouchpadScrollMultiplier(t *testing.T) {
@@ -276,7 +276,7 @@ func TestTransformLegacyEngineConfig_PreservesCustomLegacyTouchpadScrollMultipli
276 transformer.TransformLegacyEngineConfig(rawConfig)276 transformer.TransformLegacyEngineConfig(rawConfig)
277 277
278 input := rawConfig["engine"].(map[string]any)["cef"].(map[string]any)["input"].(map[string]any)278 input := rawConfig["engine"].(map[string]any)["cef"].(map[string]any)["input"].(map[string]any)
279- assert.Equal(t, 4.0, input["scroll_precise_multiplier"])279+ assert.InDelta(t, 4.0, input["scroll_precise_multiplier"], 0.001)
280 assert.NotContains(t, input, "scroll_touchpad_multiplier")280 assert.NotContains(t, input, "scroll_touchpad_multiplier")
281 }281 }
282 282
@@ -296,7 +296,7 @@ func TestTransformLegacyEngineConfig_PrefersCustomLegacyTouchpadOverGeneratedPre
296 transformer.TransformLegacyEngineConfig(rawConfig)296 transformer.TransformLegacyEngineConfig(rawConfig)
297 297
298 input := rawConfig["engine"].(map[string]any)["cef"].(map[string]any)["input"].(map[string]any)298 input := rawConfig["engine"].(map[string]any)["cef"].(map[string]any)["input"].(map[string]any)
299- assert.Equal(t, 4.0, input["scroll_precise_multiplier"])299+ assert.InDelta(t, 4.0, input["scroll_precise_multiplier"], 0.001)
300 assert.NotContains(t, input, "scroll_touchpad_multiplier")300 assert.NotContains(t, input, "scroll_touchpad_multiplier")
301 }301 }
302 302

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