From 3363382c1608df4ec580b441924ba32a7a506cdf Mon Sep 17 00:00:00 2001 From: Matt Wise Date: Wed, 8 Apr 2026 16:00:24 -0700 Subject: [PATCH] fix(ConfigUI): reload config editor when switching configurations ConfigEditorView loaded config data only in .onAppear, which doesn't re-fire when SwiftUI reuses the view for a different sidebar selection. This caused the first config's values to stick across all selections. Adding .id(manager.configPath) forces SwiftUI to recreate the editor when the selected config changes, triggering a fresh loadConfig(). Co-Authored-By: Claude Opus 4.6 (1M context) --- ConfigUI/Sources/ConfigurationsView.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ConfigUI/Sources/ConfigurationsView.swift b/ConfigUI/Sources/ConfigurationsView.swift index cbd0323..18c590b 100644 --- a/ConfigUI/Sources/ConfigurationsView.swift +++ b/ConfigUI/Sources/ConfigurationsView.swift @@ -296,9 +296,12 @@ struct ConfigDetailView: View { Divider() - // Tabbed config editor (includes logs as the last tab) + // Tabbed config editor (includes logs as the last tab). + // The .id() forces SwiftUI to recreate the editor when the + // selected config changes, ensuring loadConfig() fires fresh. ConfigEditorView(runner: manager) .environmentObject(instance.logStore) + .id(manager.configPath) } }