detached 15efbc7

refactor(engine): expand typed settings payload

commit
15efbc77c911a2bee009b30370e0649a434d506d
author
brice · · 2026-06-23 13:21 UTC
committer
brice · · 2026-06-23 20:01 UTC
parent
237f69b
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
2 files · +56 -7
M internal/application/port/engine.go +26 -7
@@ -142,22 +142,41 @@ type Engine interface {
142142 SetHandlerContext(ctx context.Context)
143143 }
144144
145+// EngineHardwareDecodingMode controls engine-facing video hardware acceleration.
146+type EngineHardwareDecodingMode string
147+
148+const (
149+ EngineHardwareDecodingAuto EngineHardwareDecodingMode = "auto"
150+ EngineHardwareDecodingForce EngineHardwareDecodingMode = "force"
151+ EngineHardwareDecodingDisable EngineHardwareDecodingMode = "disable"
152+)
153+
154+// EngineWebContentSettingsPayload is the engine-facing runtime view of web
155+// content settings that can be applied to newly-created or existing webviews.
156+type EngineWebContentSettingsPayload struct {
157+ SansFont string
158+ SerifFont string
159+ MonospaceFont string
160+ DefaultFontSize int
161+ EnableDevTools bool
162+ CaptureConsole bool
163+ DrawCompositingIndicators bool
164+ HardwareDecoding EngineHardwareDecodingMode
165+}
166+
145167 // EngineSettingsPayload is the engine-facing boundary view of runtime config.
146168 // Add fields here only when an engine needs to react to them at runtime.
147169 type EngineSettingsPayload struct {
148170 DefaultUIScale float64
171+ WebContent EngineWebContentSettingsPayload
149172 }
150173
151174 // EngineSettingsUpdate carries a runtime config change to the engine.
152-//
153-// Settings exposes the typed boundary payload that engine adapters should prefer.
154-// Raw remains for legacy adapters that still consume implementation-specific
155-// config until their settings managers are narrowed to boundary fields.
156175 type EngineSettingsUpdate struct {
157176 Settings EngineSettingsPayload
158- // Raw holds the implementation-specific config for legacy adapters.
159- // WebKit engine currently expects *infrastructure/config.Config.
160- Raw any //nolint:iface // intentional legacy bridge; prefer Settings for new code
177+ // Raw remains only until the UI runtime config provider migration removes
178+ // the last concrete-config caller. Adapter implementations must ignore it.
179+ Raw any //nolint:iface // temporary legacy bridge; removed in Phase 4
161180 }
162181
163182 // WebUIMessageHandler handles a decoded message payload from the JS bridge.
@@ -142,22 +142,41 @@ type Engine interface {
142 SetHandlerContext(ctx context.Context)142 SetHandlerContext(ctx context.Context)
143 }143 }
144 144
145+// EngineHardwareDecodingMode controls engine-facing video hardware acceleration.
146+type EngineHardwareDecodingMode string
147+
148+const (
149+ EngineHardwareDecodingAuto EngineHardwareDecodingMode = "auto"
150+ EngineHardwareDecodingForce EngineHardwareDecodingMode = "force"
151+ EngineHardwareDecodingDisable EngineHardwareDecodingMode = "disable"
152+)
153+
154+// EngineWebContentSettingsPayload is the engine-facing runtime view of web
155+// content settings that can be applied to newly-created or existing webviews.
156+type EngineWebContentSettingsPayload struct {
157+ SansFont string
158+ SerifFont string
159+ MonospaceFont string
160+ DefaultFontSize int
161+ EnableDevTools bool
162+ CaptureConsole bool
163+ DrawCompositingIndicators bool
164+ HardwareDecoding EngineHardwareDecodingMode
165+}
166+
145 // EngineSettingsPayload is the engine-facing boundary view of runtime config.167 // EngineSettingsPayload is the engine-facing boundary view of runtime config.
146 // Add fields here only when an engine needs to react to them at runtime.168 // Add fields here only when an engine needs to react to them at runtime.
147 type EngineSettingsPayload struct {169 type EngineSettingsPayload struct {
148 DefaultUIScale float64170 DefaultUIScale float64
171+ WebContent EngineWebContentSettingsPayload
149 }172 }
150 173
151 // EngineSettingsUpdate carries a runtime config change to the engine.174 // EngineSettingsUpdate carries a runtime config change to the engine.
152-//
153-// Settings exposes the typed boundary payload that engine adapters should prefer.
154-// Raw remains for legacy adapters that still consume implementation-specific
155-// config until their settings managers are narrowed to boundary fields.
156 type EngineSettingsUpdate struct {175 type EngineSettingsUpdate struct {
157 Settings EngineSettingsPayload176 Settings EngineSettingsPayload
158- // Raw holds the implementation-specific config for legacy adapters.177+ // Raw remains only until the UI runtime config provider migration removes
159- // WebKit engine currently expects *infrastructure/config.Config.178+ // the last concrete-config caller. Adapter implementations must ignore it.
160- Raw any //nolint:iface // intentional legacy bridge; prefer Settings for new code179+ Raw any //nolint:iface // temporary legacy bridge; removed in Phase 4
161 }180 }
162 181
163 // WebUIMessageHandler handles a decoded message payload from the JS bridge.182 // WebUIMessageHandler handles a decoded message payload from the JS bridge.
A internal/application/port/engine_settings_test.go +30 -0
@@ -0,0 +1,30 @@
1+package port
2+
3+import (
4+ "reflect"
5+ "testing"
6+)
7+
8+func TestEngineSettingsPayloadContainsRuntimeWebContentFields(t *testing.T) {
9+ payloadType := reflect.TypeOf(EngineSettingsPayload{})
10+ for _, field := range []string{"DefaultUIScale", "WebContent"} {
11+ if _, ok := payloadType.FieldByName(field); !ok {
12+ t.Fatalf("EngineSettingsPayload missing %s", field)
13+ }
14+ }
15+ webContentType := reflect.TypeOf(EngineWebContentSettingsPayload{})
16+ for _, field := range []string{
17+ "SansFont",
18+ "SerifFont",
19+ "MonospaceFont",
20+ "DefaultFontSize",
21+ "EnableDevTools",
22+ "CaptureConsole",
23+ "DrawCompositingIndicators",
24+ "HardwareDecoding",
25+ } {
26+ if _, ok := webContentType.FieldByName(field); !ok {
27+ t.Fatalf("EngineWebContentSettingsPayload missing %s", field)
28+ }
29+ }
30+}
@@ -0,0 +1,30 @@
1+package port
2+
3+import (
4+ "reflect"
5+ "testing"
6+)
7+
8+func TestEngineSettingsPayloadContainsRuntimeWebContentFields(t *testing.T) {
9+ payloadType := reflect.TypeOf(EngineSettingsPayload{})
10+ for _, field := range []string{"DefaultUIScale", "WebContent"} {
11+ if _, ok := payloadType.FieldByName(field); !ok {
12+ t.Fatalf("EngineSettingsPayload missing %s", field)
13+ }
14+ }
15+ webContentType := reflect.TypeOf(EngineWebContentSettingsPayload{})
16+ for _, field := range []string{
17+ "SansFont",
18+ "SerifFont",
19+ "MonospaceFont",
20+ "DefaultFontSize",
21+ "EnableDevTools",
22+ "CaptureConsole",
23+ "DrawCompositingIndicators",
24+ "HardwareDecoding",
25+ } {
26+ if _, ok := webContentType.FieldByName(field); !ok {
27+ t.Fatalf("EngineWebContentSettingsPayload missing %s", field)
28+ }
29+ }
30+}

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