refactor(cli): fully remove React anti patterns, improve type safety and fix UX oversights in SettingsDialog.tsx (#18963)

Co-authored-by: Jacob Richman <jacob314@gmail.com>
This commit is contained in:
Pyush Sinha
2026-03-02 13:30:58 -08:00
committed by GitHub
parent 18d0375a7f
commit 8133d63ac6
14 changed files with 589 additions and 1390 deletions
@@ -11,7 +11,7 @@ import {
getScopeItems,
getScopeMessageForSetting,
} from './dialogScopeUtils.js';
import { settingExistsInScope } from './settingsUtils.js';
import { isInSettingsScope } from './settingsUtils.js';
vi.mock('../config/settings', () => ({
SettingScope: {
@@ -24,7 +24,7 @@ vi.mock('../config/settings', () => ({
}));
vi.mock('./settingsUtils', () => ({
settingExistsInScope: vi.fn(),
isInSettingsScope: vi.fn(),
}));
describe('dialogScopeUtils', () => {
@@ -53,7 +53,7 @@ describe('dialogScopeUtils', () => {
});
it('should return empty string if not modified in other scopes', () => {
vi.mocked(settingExistsInScope).mockReturnValue(false);
vi.mocked(isInSettingsScope).mockReturnValue(false);
const message = getScopeMessageForSetting(
'key',
SettingScope.User,
@@ -63,7 +63,7 @@ describe('dialogScopeUtils', () => {
});
it('should return message indicating modification in other scopes', () => {
vi.mocked(settingExistsInScope).mockReturnValue(true);
vi.mocked(isInSettingsScope).mockReturnValue(true);
const message = getScopeMessageForSetting(
'key',
@@ -88,7 +88,7 @@ describe('dialogScopeUtils', () => {
return { settings: {} };
});
vi.mocked(settingExistsInScope).mockImplementation(
vi.mocked(isInSettingsScope).mockImplementation(
(_key, settings: unknown) => {
if (settings === workspaceSettings) return true;
if (settings === systemSettings) return false;