From 373a10660bdd1faf27d22073380e5e897870ab12 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 2 Apr 2026 22:18:09 +0300 Subject: task zy: move GUI application launch out of Processor into cmd/main.go [SoC] Replace Processor.RunGUIMode() with a standalone runGUIMode() function in the composition root (cmd/main.go) that calls proc.GUIConfig() to get the GUI settings and then owns the gui.New()/Run() lifecycle. The processor package still imports gui for the gui.Config return type; complete removal of that import is deferred to task 000 (god-object decomposition) where the Processor itself will be split up. Co-Authored-By: Claude Sonnet 4.6 --- internal/processor/processor_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'internal/processor/processor_test.go') diff --git a/internal/processor/processor_test.go b/internal/processor/processor_test.go index db03266..cfa4545 100644 --- a/internal/processor/processor_test.go +++ b/internal/processor/processor_test.go @@ -274,7 +274,7 @@ func TestGUIConfigForRunModeUsesNanoBananaDefaultWhenImageAPIIsNotSpecified(t *t flags.ImageAPISpecified = false p := NewProcessor(flags) - guiConfig := p.guiConfigForRunMode() + guiConfig := p.GUIConfig() if guiConfig.ImageProvider != gui.DefaultConfig().ImageProvider { t.Fatalf("guiConfig.ImageProvider = %q, want GUI default %q", guiConfig.ImageProvider, gui.DefaultConfig().ImageProvider) } @@ -314,7 +314,7 @@ func TestGUIConfigForRunModeHonorsExplicitImageAPI(t *testing.T) { flags.ImageAPISpecified = true p := NewProcessor(flags) - guiConfig := p.guiConfigForRunMode() + guiConfig := p.GUIConfig() if guiConfig.ImageProvider != "openai" { t.Fatalf("guiConfig.ImageProvider = %q, want %q", guiConfig.ImageProvider, "openai") } @@ -348,7 +348,7 @@ func TestGUIConfigForRunModeHonorsExplicitNanoBananaModelFlags(t *testing.T) { flags.NanoBananaTextModelSpecified = true p := NewProcessor(flags) - guiConfig := p.guiConfigForRunMode() + guiConfig := p.GUIConfig() if guiConfig.NanoBananaModel != "flag-image-model" { t.Fatalf("guiConfig.NanoBananaModel = %q, want %q", guiConfig.NanoBananaModel, "flag-image-model") } @@ -1218,7 +1218,7 @@ func TestDownloadImagesWithTranslationUsesNanoBananaConfigAndSavesPrompt(t *test originalConstructor := newNanoBananaImageClient stubSearcher := &stubImageSearcher{} capturedConfig := new(image.NanoBananaConfig) - newNanoBananaImageClient = func(config *image.NanoBananaConfig) image.ImageSearcher { + newNanoBananaImageClient = func(config *image.NanoBananaConfig) image.ImageClient { *capturedConfig = *config return stubSearcher } @@ -1274,7 +1274,7 @@ func TestDownloadImagesWithTranslationPersistsPromptWhenDownloadFails(t *testing originalConstructor := newNanoBananaImageClient stubSearcher := &stubImageSearcher{downloadErr: errors.New("download failed")} - newNanoBananaImageClient = func(config *image.NanoBananaConfig) image.ImageSearcher { + newNanoBananaImageClient = func(config *image.NanoBananaConfig) image.ImageClient { return stubSearcher } t.Cleanup(func() { @@ -1323,7 +1323,7 @@ func TestDownloadImagesWithTranslationUsesConfiguredNanoBananaWhenImageAPINotSpe originalConstructor := newNanoBananaImageClient stubSearcher := &stubImageSearcher{} capturedConfig := new(image.NanoBananaConfig) - newNanoBananaImageClient = func(config *image.NanoBananaConfig) image.ImageSearcher { + newNanoBananaImageClient = func(config *image.NanoBananaConfig) image.ImageClient { *capturedConfig = *config return stubSearcher } @@ -1429,7 +1429,7 @@ func TestNewNanoBananaImageSearcherExplicitDefaultWinsOverConfig(t *testing.T) { originalConstructor := newNanoBananaImageClient capturedConfig := new(image.NanoBananaConfig) - newNanoBananaImageClient = func(config *image.NanoBananaConfig) image.ImageSearcher { + newNanoBananaImageClient = func(config *image.NanoBananaConfig) image.ImageClient { *capturedConfig = *config return &stubImageSearcher{} } -- cgit v1.2.3