From b047b5db4c55ab001a005d72b8e6f58956826d1e Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Wed, 19 Aug 2026 20:47:34 -0700 Subject: [PATCH] fix(desktop): settings pages state loudly when they edit a non-default profile's config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After any Bot Mode chat the active gateway profile is the bot's, so the settings scope silently followed it — edits landed in profiles//config.yaml with only a faint chip tint as the tell (#89190/#89162/#89597 report class, live-repro'd: Max Agent Steps written to scout's config). The applies-to note now renders for ANY non-default target, override or not, accented; default-profile editing stays quiet. --- .../src/app/settings/profile-scope.test.tsx | 41 +++++++++++++++++++ .../src/app/settings/profile-scope.tsx | 17 +++++++- 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/apps/desktop/src/app/settings/profile-scope.test.tsx b/apps/desktop/src/app/settings/profile-scope.test.tsx index 664cdc260c..612711380a 100644 --- a/apps/desktop/src/app/settings/profile-scope.test.tsx +++ b/apps/desktop/src/app/settings/profile-scope.test.tsx @@ -65,4 +65,45 @@ describe('SettingsProfileScope', () => { fireEvent.click(screen.getByRole('button', { name: 'default' })) expect($settingsScopeOverride.get()).toBeNull() }) + + // #89190/#89162 class: after opening a Bot Mode chat, the ACTIVE profile is + // the bot's — so with no override the settings pages silently edit the bot's + // config. The target must be stated (accented) whenever it isn't the default + // profile, override or not. + it('states the edit target when the active profile is a non-default bot (no override)', () => { + $activeGatewayProfile.set('scout') + $profiles.set([profile('default', true), profile('scout')]) + + const { container } = render() + + expect($settingsScopeOverride.get()).toBeNull() + expect(container.textContent).toContain('scout') + // The note paragraph is present and accented (font-medium marks the loud variant). + const note = container.querySelector('p') + expect(note).toBeTruthy() + expect(note?.className).toContain('font-medium') + }) + + it('shows no note when following the active DEFAULT profile', () => { + $activeGatewayProfile.set('default') + $profiles.set([profile('default', true), profile('coder')]) + + const { container } = render() + + expect(container.querySelector('p')).toBeNull() + }) + + it('keeps the quiet note style for an explicit override onto the default profile', () => { + $activeGatewayProfile.set('scout') + $profiles.set([profile('default', true), profile('scout')]) + + render() + + fireEvent.click(screen.getByRole('button', { name: 'default' })) + expect($settingsScopeOverride.get()).toBe('default') + + const note = document.querySelector('p') + expect(note).toBeTruthy() + expect(note?.className).not.toContain('font-medium') + }) }) diff --git a/apps/desktop/src/app/settings/profile-scope.tsx b/apps/desktop/src/app/settings/profile-scope.tsx index a256096e22..451d3943eb 100644 --- a/apps/desktop/src/app/settings/profile-scope.tsx +++ b/apps/desktop/src/app/settings/profile-scope.tsx @@ -51,6 +51,8 @@ export function SettingsProfileScope({ className }: { className?: string }) { } const selected = normalizeProfileKey(override ?? active) + const defaultProfile = profiles.find(profile => profile.is_default) + const editingNonDefault = defaultProfile ? selected !== normalizeProfileKey(defaultProfile.name) : false return (
@@ -67,8 +69,19 @@ export function SettingsProfileScope({ className }: { className?: string }) { /> ))}
- {override !== null ? ( -

+ {/* The scope follows the app's ACTIVE profile when no override is set — + which, after opening any Bot Mode chat, is the BOT's profile. Users + reasonably assume Settings edit their main config, so an edit landing + in profiles//config.yaml with only a faint chip tint as the tell + is a silent misdirect (the #89190/#89162 report class). Always state + the target when it isn't the default profile, and make it loud. */} + {override !== null || editingNonDefault ? ( +

{scope.editsProfile(selected)}

) : null}