From de3e878ad12bbd3e609bd5b7d741fc792c72f255 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 16 Mar 2026 03:51:43 +0200 Subject: Decompose App God struct into embedded section structs Replace 60+ flat fields in App with 4 embedded section structs: CoreConfig, ProviderConfig, PromptConfig, FeatureConfig. Go field promotion preserves all existing field access patterns. Updated flattenAppConfig to recurse into embedded structs for runtimeconfig. Co-Authored-By: Claude Opus 4.6 --- internal/slashcommands/syncer_test.go | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'internal/slashcommands') diff --git a/internal/slashcommands/syncer_test.go b/internal/slashcommands/syncer_test.go index 7ae13dd..01c6d28 100644 --- a/internal/slashcommands/syncer_test.go +++ b/internal/slashcommands/syncer_test.go @@ -13,7 +13,7 @@ import ( func TestNewSyncer_Disabled(t *testing.T) { cfg := appconfig.App{ - MCPSlashCommandSync: false, + FeatureConfig: appconfig.FeatureConfig{MCPSlashCommandSync: false}, } syncer, err := NewSyncer(cfg) @@ -28,8 +28,10 @@ func TestNewSyncer_Disabled(t *testing.T) { func TestNewSyncer_NoDirectory(t *testing.T) { cfg := appconfig.App{ - MCPSlashCommandSync: true, - MCPSlashCommandDir: "", + FeatureConfig: appconfig.FeatureConfig{ + MCPSlashCommandSync: true, + MCPSlashCommandDir: "", + }, } _, err := NewSyncer(cfg) @@ -43,8 +45,10 @@ func TestNewSyncer_CreatesDirectory(t *testing.T) { testDir := filepath.Join(tmpDir, "test-commands") cfg := appconfig.App{ - MCPSlashCommandSync: true, - MCPSlashCommandDir: testDir, + FeatureConfig: appconfig.FeatureConfig{ + MCPSlashCommandSync: true, + MCPSlashCommandDir: testDir, + }, } syncer, err := NewSyncer(cfg) @@ -71,8 +75,10 @@ func TestNewSyncer_ExpandsHomeDirectory(t *testing.T) { defer os.Setenv("HOME", home) cfg := appconfig.App{ - MCPSlashCommandSync: true, - MCPSlashCommandDir: "~/test-commands", + FeatureConfig: appconfig.FeatureConfig{ + MCPSlashCommandSync: true, + MCPSlashCommandDir: "~/test-commands", + }, } syncer, err := NewSyncer(cfg) -- cgit v1.2.3