refactor(config): remove raw engine settings bridge
- commit
- ccbb8126c762556653d0a80b440c521e541c6336
- author
- brice · · 2026-06-23 15:36 UTC
- committer
- brice · · 2026-06-23 20:01 UTC
- parent
- 2064b93
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
3 files · +10 -6
M internal/application/port/engine.go +0 -3
| @@ -174,9 +174,6 @@ type EngineSettingsPayload struct { | |||
| 174 | 174 | // EngineSettingsUpdate carries a runtime config change to the engine. | |
| 175 | 175 | type EngineSettingsUpdate struct { | |
| 176 | 176 | Settings EngineSettingsPayload | |
| 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 | |
| 180 | 177 | } | |
| 181 | 178 | ||
| 182 | 179 | // WebUIMessageHandler handles a decoded message payload from the JS bridge. | |
| @@ -174,9 +174,6 @@ type EngineSettingsPayload struct { | |||||
| 174 | // EngineSettingsUpdate carries a runtime config change to the engine. | 174 | // EngineSettingsUpdate carries a runtime config change to the engine. | ||
| 175 | type EngineSettingsUpdate struct { | 175 | type EngineSettingsUpdate struct { | ||
| 176 | Settings EngineSettingsPayload | 176 | Settings EngineSettingsPayload | ||
| 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 | |||
| 180 | } | 177 | } | ||
| 181 | 178 | ||||
| 182 | // WebUIMessageHandler handles a decoded message payload from the JS bridge. | 179 | // WebUIMessageHandler handles a decoded message payload from the JS bridge. | ||
M internal/application/port/engine_settings_test.go +7 -0
| @@ -28,3 +28,10 @@ func TestEngineSettingsPayloadContainsRuntimeWebContentFields(t *testing.T) { | |||
| 28 | 28 | } | |
| 29 | 29 | } | |
| 30 | 30 | } | |
| 31 | + | ||
| 32 | + | func TestEngineSettingsUpdateHasNoRawBridge(t *testing.T) { | |
| 33 | + | updateType := reflect.TypeOf(EngineSettingsUpdate{}) | |
| 34 | + | if _, ok := updateType.FieldByName("Raw"); ok { | |
| 35 | + | t.Fatal("EngineSettingsUpdate must not expose Raw legacy bridge") | |
| 36 | + | } | |
| 37 | + | } | |
| @@ -28,3 +28,10 @@ func TestEngineSettingsPayloadContainsRuntimeWebContentFields(t *testing.T) { | |||||
| 28 | } | 28 | } | ||
| 29 | } | 29 | } | ||
| 30 | } | 30 | } | ||
| 31 | + | ||||
| 32 | + | func TestEngineSettingsUpdateHasNoRawBridge(t *testing.T) { | |||
| 33 | + | updateType := reflect.TypeOf(EngineSettingsUpdate{}) | |||
| 34 | + | if _, ok := updateType.FieldByName("Raw"); ok { | |||
| 35 | + | t.Fatal("EngineSettingsUpdate must not expose Raw legacy bridge") | |||
| 36 | + | } | |||
| 37 | + | } | |||
M internal/infrastructure/cef/engine_settings_test.go +3 -3
| @@ -21,10 +21,10 @@ func TestEngineUpdateSettingsUpdatesApplicationScaleFromBoundaryPayload(t *testi | |||
| 21 | 21 | } | |
| 22 | 22 | } | |
| 23 | 23 | ||
| 24 | - | func TestEngineUpdateSettingsIgnoresLegacyRawForApplicationScale(t *testing.T) { | |
| 25 | - | e := &Engine{applicationScale: 1} | |
| 24 | + | func TestEngineUpdateSettingsUsesZeroScaleWhenPayloadIsEmpty(t *testing.T) { | |
| 25 | + | e := &Engine{applicationScale: 1.25} | |
| 26 | 26 | ||
| 27 | - | if err := e.UpdateSettings(context.Background(), port.EngineSettingsUpdate{Raw: "wrong"}); err != nil { | |
| 27 | + | if err := e.UpdateSettings(context.Background(), port.EngineSettingsUpdate{}); err != nil { | |
| 28 | 28 | t.Fatalf("UpdateSettings returned error: %v", err) | |
| 29 | 29 | } | |
| 30 | 30 | if got := e.currentApplicationScale(); got != 1 { | |
| @@ -21,10 +21,10 @@ func TestEngineUpdateSettingsUpdatesApplicationScaleFromBoundaryPayload(t *testi | |||||
| 21 | } | 21 | } | ||
| 22 | } | 22 | } | ||
| 23 | 23 | ||||
| 24 | - | func TestEngineUpdateSettingsIgnoresLegacyRawForApplicationScale(t *testing.T) { | 24 | + | func TestEngineUpdateSettingsUsesZeroScaleWhenPayloadIsEmpty(t *testing.T) { |
| 25 | - | e := &Engine{applicationScale: 1} | 25 | + | e := &Engine{applicationScale: 1.25} |
| 26 | 26 | ||||
| 27 | - | if err := e.UpdateSettings(context.Background(), port.EngineSettingsUpdate{Raw: "wrong"}); err != nil { | 27 | + | if err := e.UpdateSettings(context.Background(), port.EngineSettingsUpdate{}); err != nil { |
| 28 | t.Fatalf("UpdateSettings returned error: %v", err) | 28 | t.Fatalf("UpdateSettings returned error: %v", err) | ||
| 29 | } | 29 | } | ||
| 30 | if got := e.currentApplicationScale(); got != 1 { | 30 | if got := e.currentApplicationScale(); got != 1 { | ||