Skip to content

Commit 8501188

Browse files
mzhaomclaude
andcommitted
Fix Show() to correctly distinguish nil vs empty enabled providers
The Show() method was using len(enabledProviders) == 0 to check for the "all enabled" case, but this matches both nil and empty slices. According to the Settings design: - nil means "all enabled" (default/unset) - empty slice means "all disabled" Changed to enabledProviders == nil to correctly distinguish these cases. This prevents the dialog from re-enabling all providers when the user has explicitly disabled everything. Fixes the last remaining issue identified in PR review. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 5b1bc52 commit 8501188

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bramble/app/reposettingsdialog.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ func (d *RepoSettingsDialog) Show(repoName string, cfg RepoSettings, currentThem
108108
// unchecked and untoggable in the UI.
109109
d.providerStatuses = providerStatuses
110110
d.enabledProviders = make(map[string]bool, len(agent.AllProviders))
111-
if len(enabledProviders) == 0 {
112-
// nil/empty = all installed providers enabled
111+
if enabledProviders == nil {
112+
// nil = all installed providers enabled (default/unset)
113113
for _, s := range providerStatuses {
114114
if s.Installed {
115115
d.enabledProviders[s.Provider] = true

0 commit comments

Comments
 (0)