Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion electron-builder-win.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"arch": ["x64"]
}
],
"signAndEditExecutable": false,
"signAndEditExecutable": true,
"icon": "electron/assets/snap-mind-app-icon-Win.ico"
},
"portable": {
Expand Down
3 changes: 2 additions & 1 deletion electron/SettingsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class SettingsService {

const resolveByProviderAndModel = (providerId, modelId) => {
const provider = providers.find((p) => p.id === providerId);
if (!provider || !Array.isArray(provider.models)) return { provider: undefined, model: undefined };
if (!provider || !Array.isArray(provider.models))
return { provider: undefined, model: undefined };
const model = provider.models.find((m) => m.id === modelId);
if (!model) return { provider: undefined, model: undefined };
return { provider, model };
Expand Down
6 changes: 6 additions & 0 deletions electron/assets/mind-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added electron/assets/mind_tray_windows_white.ico
Binary file not shown.
Binary file modified electron/assets/snap-mind-app-icon-Win.ico
Binary file not shown.
22 changes: 19 additions & 3 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
Tray,
Menu,
nativeImage,
nativeTheme,
screen,
shell,
} from 'electron';
Expand Down Expand Up @@ -600,12 +601,27 @@ app.whenReady().then(() => {
tray = new Tray(trayIcon);
logService.info('Tray icon created (macOS template):', trayIconPath);
} else if (process.platform === 'win32') {
const trayIconPath = isDev()
? path.join(__dirname, '..', 'electron/assets/mind_tray_windows.ico')
: path.join(__dirname, 'electron/assets/mind_tray_windows.ico');
const getWindowsTrayIcon = () => {
const useWhiteIcon = nativeTheme.shouldUseDarkColors;
const iconName = useWhiteIcon ? 'mind_tray_windows_white.ico' : 'mind_tray_windows.ico';
return isDev()
? path.join(__dirname, '..', 'electron', 'assets', iconName)
: path.join(__dirname, 'electron', 'assets', iconName);
};

const trayIconPath = getWindowsTrayIcon();
trayIcon = nativeImage.createFromPath(trayIconPath);
tray = new Tray(trayIcon);
logService.info('Tray icon created (Windows):', trayIconPath);

// Update icon when theme changes
nativeTheme.on('updated', () => {
const newIconPath = getWindowsTrayIcon();
const newIcon = nativeImage.createFromPath(newIconPath);
tray.setImage(newIcon);
logService.info('Tray icon updated (Windows theme change):', newIconPath);
});

// Add double-click handler to open settings window
tray.on('double-click', () => {
const win = settingsWindow || createSettingsWindow();
Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/components/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
LuRotateCcw,
LuCloud,
} from 'react-icons/lu';
import { MdOutlineCleaningServices } from "react-icons/md";
import { MdOutlineCleaningServices } from 'react-icons/md';

import OpenAI from '@lobehub/icons-static-svg/icons/openai.svg?react';
import AzureAI from '@lobehub/icons-static-svg/icons/azureai.svg?react';
Expand Down
22 changes: 11 additions & 11 deletions src/components/ModelTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ function ModelTable({ providerConfig, onModelsChange, showSyncedButton = false }
} finally {
setDiscovering(false);
}
}
};

// Use HeroUI controlled pattern so clear button works reliably
const handleSearchValueChange = (value: string) => {
Expand Down Expand Up @@ -272,16 +272,16 @@ function ModelTable({ providerConfig, onModelsChange, showSyncedButton = false }
</Tooltip>
)}
<Tooltip content={t('settings.providers.cleanModels')} delay={500}>
<Button
isIconOnly
variant='ghost'
isLoading={discovering}
isDisabled={discovering}
onPress={handleCleanModels}
>
<Icon icon="cleaning-services" />
</Button>
</Tooltip>
<Button
isIconOnly
variant="ghost"
isLoading={discovering}
isDisabled={discovering}
onPress={handleCleanModels}
>
<Icon icon="cleaning-services" />
</Button>
</Tooltip>
</ButtonGroup>
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion src/services/AIService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ export class AIService {
}

if (!this.providerSetting || !this.modelSetting) {
throw new Error(`No provider/model found for default selection ${defaultProviderId}:${defaultModelId}`);
throw new Error(
`No provider/model found for default selection ${defaultProviderId}:${defaultModelId}`
);
}

this.activeProvider = ProviderFactory.createProvider(this.providerSetting);
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
},
"types": ["@testing-library/jest-dom"]
},
"include": ["src"],
"exclude": ["dist-electron"],
Expand Down
Loading