diff --git a/package.json b/package.json index 1d30319..d9bf6bc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "gerbil", "productName": "Gerbil", - "version": "1.5.2", + "version": "1.5.3", "description": "Run Large Language Models locally", "main": "out/main/index.js", "homepage": "./", @@ -15,7 +15,7 @@ "build": "electron-vite build", "package": "electron-vite build && electron-builder --publish=never", "analyze": "cross-env ANALYZE=true electron-vite build && yarn dlx open-cli dist/stats.html", - "format": "prettier --write . --ignore-path .gitignore", + "format": "prettier --write . --ignore-path .gitignore | grep -v '(unchanged)' || true", "lint": "eslint .", "lint:fix": "eslint . --fix", "compile": "tsc --noEmit", @@ -68,8 +68,8 @@ "@codemirror/theme-one-dark": "^6.1.3", "@codemirror/view": "^6.38.3", "@fontsource/inter": "^5.2.8", - "@mantine/core": "^8.3.1", - "@mantine/hooks": "^8.3.1", + "@mantine/core": "8.3.1", + "@mantine/hooks": "8.3.1", "@types/yauzl": "^2.10.3", "@uiw/react-codemirror": "^4.25.2", "electron-updater": "6.6.2", diff --git a/src/components/App/TitleBar.tsx b/src/components/App/TitleBar.tsx index 29beb91..008f4dc 100644 --- a/src/components/App/TitleBar.tsx +++ b/src/components/App/TitleBar.tsx @@ -3,7 +3,6 @@ import { ActionIcon, Box, Image, - Select, AppShell, Tooltip, } from '@mantine/core'; @@ -18,6 +17,7 @@ import { UpdateButton } from '@/components/App/UpdateButton'; import icon from '/icon.png'; import { PRODUCT_NAME, TITLEBAR_HEIGHT } from '@/constants'; import type { InterfaceTab, Screen, SelectOption } from '@/types'; +import { Select } from '@/components/Select'; interface TitleBarProps { currentScreen: Screen; @@ -135,9 +135,7 @@ export const TitleBar = ({ onDropdownClose={() => setIsSelectOpen(false)} data={interfaceOptions} renderOption={renderOption} - allowDeselect={false} variant="unstyled" - size="sm" style={{ textAlign: 'center', minWidth: '7.5rem' }} styles={{ input: { diff --git a/src/components/App/UpdateAvailableModal.tsx b/src/components/App/UpdateAvailableModal.tsx index e734a0e..76d4643 100644 --- a/src/components/App/UpdateAvailableModal.tsx +++ b/src/components/App/UpdateAvailableModal.tsx @@ -91,9 +91,9 @@ export const UpdateAvailableModal = ({ - {currentVersion && ( + {availableUpdate?.name && ( - Binary Type: {pretifyBinName(currentVersion.filename)} + Binary Type: {pretifyBinName(availableUpdate?.name)} )} diff --git a/src/components/App/index.tsx b/src/components/App/index.tsx index ec6d643..5643d58 100644 --- a/src/components/App/index.tsx +++ b/src/components/App/index.tsx @@ -90,10 +90,13 @@ export const App = () => { }; const handleBinaryUpdate = async (download: DownloadItem) => { + const currentVersion = await window.electronAPI.kobold.getCurrentVersion(); + await handleDownload({ item: download, isUpdate: true, wasCurrentBinary: true, + oldVersionPath: currentVersion?.path, }); closeModal(); diff --git a/src/components/Select.tsx b/src/components/Select.tsx new file mode 100644 index 0000000..04d6b10 --- /dev/null +++ b/src/components/Select.tsx @@ -0,0 +1,16 @@ +import { Select as MantineSelect } from '@mantine/core'; +import type { SelectProps } from '@mantine/core'; + +export const Select = ({ + allowDeselect = false, + clearable = false, + size = 'sm', + ...props +}: SelectProps) => ( + +); diff --git a/src/components/SelectWithTooltip.tsx b/src/components/SelectWithTooltip.tsx index c782f99..70cc41e 100644 --- a/src/components/SelectWithTooltip.tsx +++ b/src/components/SelectWithTooltip.tsx @@ -1,8 +1,8 @@ import type { CSSProperties } from 'react'; -import { Select } from '@mantine/core'; import type { ComboboxItem } from '@mantine/core'; import { LabelWithTooltip } from '@/components/LabelWithTooltip'; import type { SelectOption } from '@/types'; +import { Select } from '@/components/Select'; interface SelectWithTooltipProps { label: string; @@ -36,7 +36,6 @@ export const SelectWithTooltip = ({ data={data} disabled={disabled} clearable={clearable} - allowDeselect={false} /> ); diff --git a/src/components/screens/Launch/ConfigFileManager.tsx b/src/components/screens/Launch/ConfigFileManager.tsx index 008d936..1213578 100644 --- a/src/components/screens/Launch/ConfigFileManager.tsx +++ b/src/components/screens/Launch/ConfigFileManager.tsx @@ -1,9 +1,10 @@ -import { Stack, Text, Group, Button, Select, Tooltip } from '@mantine/core'; +import { Stack, Text, Group, Button, Tooltip } from '@mantine/core'; import { useState, useCallback } from 'react'; import { Save, File, Plus, Check, Trash2 } from 'lucide-react'; import type { ConfigFile } from '@/types'; import { CreateConfigModal } from './CreateConfigModal'; import { DeleteConfigModal } from './DeleteConfigModal'; +import { Select } from '@/components/Select'; interface ConfigFileManagerProps { configFiles: ConfigFile[]; @@ -108,8 +109,6 @@ export const ConfigFileManager = ({ data={selectData} leftSection={} searchable - clearable={false} - allowDeselect={false} />