empty commit

This commit is contained in:
Jack Amadeo
2026-04-06 20:22:03 -04:00
parent 25ad6db3f0
commit a6780ca5d1
4 changed files with 31 additions and 3 deletions
@@ -9,10 +9,18 @@ const i18n = defineMessages({
id: 'resetProviderSection.resetButton',
defaultMessage: 'Reset Provider and Model',
},
resetButtonDistro: {
id: 'resetProviderSection.resetButtonDistro',
defaultMessage: 'Reset to {distroName} Defaults',
},
resetDescription: {
id: 'resetProviderSection.resetDescription',
defaultMessage: "This will clear your selected model and provider settings. If no defaults are available, you'll be taken to the welcome screen to set them up again.",
},
resetDescriptionDistro: {
id: 'resetProviderSection.resetDescriptionDistro',
defaultMessage: 'This will reset your model and provider settings to the {distroName} defaults.',
},
});
interface ResetProviderSectionProps {
@@ -23,6 +31,10 @@ export default function ResetProviderSection(_props: ResetProviderSectionProps)
const intl = useIntl();
const { remove } = useConfig();
const distroName = window.appConfig.get('DISTRO_NAME') as string | null;
const hasDistroDefaults =
distroName && window.appConfig.get('GOOSE_DEFAULT_PROVIDER');
const handleResetProvider = async () => {
try {
await remove('GOOSE_PROVIDER', false);
@@ -42,10 +54,14 @@ export default function ResetProviderSection(_props: ResetProviderSectionProps)
className="flex items-center justify-center gap-2"
>
<RefreshCw className="h-4 w-4" />
{intl.formatMessage(i18n.resetButton)}
{hasDistroDefaults
? intl.formatMessage(i18n.resetButtonDistro, { distroName })
: intl.formatMessage(i18n.resetButton)}
</Button>
<p className="text-xs text-text-secondary mt-2">
{intl.formatMessage(i18n.resetDescription)}
{hasDistroDefaults
? intl.formatMessage(i18n.resetDescriptionDistro, { distroName })
: intl.formatMessage(i18n.resetDescription)}
</p>
</div>
);
+5
View File
@@ -2,6 +2,7 @@ import * as fs from 'fs';
import * as path from 'path';
interface DistroConfig {
name?: string;
env?: Record<string, string>;
features?: Record<string, unknown>;
}
@@ -48,6 +49,10 @@ export function getDistroFeature<T>(key: string, defaultValue: T): T {
return defaultValue;
}
export function getDistroName(): string | null {
return distroConfig.name || null;
}
export function getDistroDir(): string | null {
return distroDir;
}
+6
View File
@@ -3251,9 +3251,15 @@
"resetProviderSection.resetButton": {
"defaultMessage": "Reset Provider and Model"
},
"resetProviderSection.resetButtonDistro": {
"defaultMessage": "Reset to {distroName} Defaults"
},
"resetProviderSection.resetDescription": {
"defaultMessage": "This will clear your selected model and provider settings. If no defaults are available, you'll be taken to the welcome screen to set them up again."
},
"resetProviderSection.resetDescriptionDistro": {
"defaultMessage": "This will reset your model and provider settings to the {distroName} defaults."
},
"responseStyle.conciseDescription": {
"defaultMessage": "Tool calls are by default closed and only show the tool used"
},
+2 -1
View File
@@ -46,7 +46,7 @@ import {
setupAutoUpdater,
updateTrayMenu,
} from './utils/autoUpdater';
import { getDistroFeature, getDistroFilePath, getDistroDir } from './distro';
import { getDistroFeature, getDistroFilePath, getDistroDir, getDistroName } from './distro';
const UPDATES_ENABLED = getDistroFeature('updatesEnabled', true);
import './utils/recipeHash';
@@ -551,6 +551,7 @@ let appConfig = {
'dictationAllowedProviders',
null
),
DISTRO_NAME: getDistroName(),
};
const windowMap = new Map<number, BrowserWindow>();