From 4a314177c71094684634f2f347222c7be6a4f440 Mon Sep 17 00:00:00 2001 From: Egor Date: Mon, 6 Oct 2025 19:23:02 -0700 Subject: [PATCH] remove the ability to launch configs from the tray as it's too hard to get right for very little use --- package.json | 12 +- src/components/screens/Launch/index.tsx | 11 -- src/main/modules/tray.ts | 21 +-- src/preload/index.ts | 7 - src/types/electron.d.ts | 1 - yarn.lock | 172 ++++++++++++------------ 6 files changed, 96 insertions(+), 128 deletions(-) diff --git a/package.json b/package.json index dccfd61..370ca32 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "gerbil", "productName": "Gerbil", - "version": "1.6.7", + "version": "1.6.8", "description": "Run Large Language Models locally", "main": "out/main/index.js", "homepage": "./", @@ -39,11 +39,11 @@ "license": "AGPL-3.0-or-later", "devDependencies": { "@eslint/js": "^9.37.0", - "@types/node": "^24.6.2", - "@types/react": "^19.2.0", + "@types/node": "^24.7.0", + "@types/react": "^19.2.1", "@types/react-dom": "^19.2.0", - "@typescript-eslint/eslint-plugin": "^8.45.0", - "@typescript-eslint/parser": "^8.45.0", + "@typescript-eslint/eslint-plugin": "^8.46.0", + "@typescript-eslint/parser": "^8.46.0", "@vitejs/plugin-react": "^5.0.4", "cross-env": "^10.1.0", "electron": "^38.2.1", @@ -74,7 +74,7 @@ "@uiw/react-codemirror": "^4.25.2", "electron-updater": "^6.6.2", "execa": "^9.6.0", - "lucide-react": "^0.544.0", + "lucide-react": "^0.545.0", "react": "^19.2.0", "react-dom": "^19.2.0", "react-error-boundary": "^6.0.0", diff --git a/src/components/screens/Launch/index.tsx b/src/components/screens/Launch/index.tsx index 7d4a042..207a803 100644 --- a/src/components/screens/Launch/index.tsx +++ b/src/components/screens/Launch/index.tsx @@ -329,17 +329,6 @@ export const LaunchScreen = ({ onLaunch }: LaunchScreenProps) => { moeexperts, ]); - useEffect(() => { - const cleanup = window.electronAPI.app.onTrayLaunch(() => { - if (!model && !sdmodel) return; - if (isLaunching) return; - - handleLaunchClick(); - }); - - return cleanup; - }, [model, sdmodel, isLaunching, handleLaunchClick]); - return ( diff --git a/src/main/modules/tray.ts b/src/main/modules/tray.ts index d00e7c1..73c2586 100644 --- a/src/main/modules/tray.ts +++ b/src/main/modules/tray.ts @@ -9,10 +9,10 @@ import { join } from 'path'; import { platform, resourcesPath } from 'process'; import { getEnableSystemTray } from './config'; import { getMainWindow } from './window'; -import { stripFileExtension } from '@/utils/format'; import type { CpuMetrics, MemoryMetrics, GpuMetrics } from './monitoring'; import type { Screen } from '@/types'; import { PRODUCT_NAME } from '@/constants'; +import { stripFileExtension } from '@/utils/format'; let tray: Tray | null = null; let currentMetrics: { @@ -148,27 +148,14 @@ function buildContextMenu() { menuTemplate.push({ type: 'separator' }); - if (appState.currentScreen === 'launch' && !appState.isLaunched) { - const configDisplayName = appState.currentConfig - ? stripFileExtension(appState.currentConfig) - : null; - menuTemplate.push({ - label: configDisplayName - ? `Launch: ${configDisplayName}` - : 'Launch with Current Config', - enabled: !!appState.currentConfig, - click: () => { - const mainWindow = getMainWindow(); - mainWindow.webContents.send('tray:launch'); - }, - }); - } else if (appState.isLaunched && appState.currentScreen === 'interface') { + if (appState.isLaunched && appState.currentScreen === 'interface') { if (appState.currentModel) { menuTemplate.push({ - label: `Running: ${appState.currentModel}`, + label: `Running: ${stripFileExtension(appState.currentConfig || '')}`, enabled: false, }); } + menuTemplate.push({ label: 'Eject Model', click: () => { diff --git a/src/preload/index.ts b/src/preload/index.ts index bd8773e..4fcde90 100644 --- a/src/preload/index.ts +++ b/src/preload/index.ts @@ -106,13 +106,6 @@ const appAPI: AppAPI = { setEnableSystemTray: (enabled) => ipcRenderer.invoke('app:setEnableSystemTray', enabled), updateTrayState: (state) => ipcRenderer.invoke('app:updateTrayState', state), - onTrayLaunch: (callback) => { - const handler = () => callback(); - ipcRenderer.on('tray:launch', handler); - return () => { - ipcRenderer.removeListener('tray:launch', handler); - }; - }, onTrayEject: (callback) => { const handler = () => callback(); ipcRenderer.on('tray:eject', handler); diff --git a/src/types/electron.d.ts b/src/types/electron.d.ts index b3cefe8..ede55f1 100644 --- a/src/types/electron.d.ts +++ b/src/types/electron.d.ts @@ -183,7 +183,6 @@ export interface AppAPI { config?: string | null; monitoringEnabled?: boolean; }) => Promise; - onTrayLaunch: (callback: () => void) => () => void; onTrayEject: (callback: () => void) => () => void; openExternal: (url: string) => Promise; openPerformanceManager: () => Promise<{ diff --git a/yarn.lock b/yarn.lock index 5ce6d26..02dc110 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1431,12 +1431,12 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:*, @types/node@npm:^24.6.2": - version: 24.6.2 - resolution: "@types/node@npm:24.6.2" +"@types/node@npm:*, @types/node@npm:^24.7.0": + version: 24.7.0 + resolution: "@types/node@npm:24.7.0" dependencies: - undici-types: "npm:~7.13.0" - checksum: 10c0/d029757711be85ec468686f66cd8eca78f5996d7e2b1a5b818436e0299b19925b0fb4f7509a6b62750abdc72d66f5750ce22fb8b55559baca86df89a9c44722e + undici-types: "npm:~7.14.0" + checksum: 10c0/f036c78062cb3a0d5c6586bf2dac347ed3f4af121cef4ab92c85c44e32be1c50aab5ba96955842b7f8165f0e0f1c8066d1813ae259372df6c0fa9fadb1116a3e languageName: node linkType: hard @@ -1468,12 +1468,12 @@ __metadata: languageName: node linkType: hard -"@types/react@npm:^19.2.0": - version: 19.2.0 - resolution: "@types/react@npm:19.2.0" +"@types/react@npm:^19.2.1": + version: 19.2.1 + resolution: "@types/react@npm:19.2.1" dependencies: csstype: "npm:^3.0.2" - checksum: 10c0/a280e146df2abd3b06eaa2f5332dade9f7ebe916334a40699ee11139c5f22aeb49b5b78b6de8c55b53ef2fa94285e1bc2feaf4fbce6fe259a7de92dc1bf67b17 + checksum: 10c0/c44881c275da91156ce02986ab1f59c9724db256f4850d3937c9acea561a6ab1fe1028f7a1fc4da3a2c1bcb00de29e238922e8c6d42a727ef2e6e0cd40b3db9f languageName: node linkType: hard @@ -1509,106 +1509,106 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:^8.45.0": - version: 8.45.0 - resolution: "@typescript-eslint/eslint-plugin@npm:8.45.0" +"@typescript-eslint/eslint-plugin@npm:^8.46.0": + version: 8.46.0 + resolution: "@typescript-eslint/eslint-plugin@npm:8.46.0" dependencies: "@eslint-community/regexpp": "npm:^4.10.0" - "@typescript-eslint/scope-manager": "npm:8.45.0" - "@typescript-eslint/type-utils": "npm:8.45.0" - "@typescript-eslint/utils": "npm:8.45.0" - "@typescript-eslint/visitor-keys": "npm:8.45.0" + "@typescript-eslint/scope-manager": "npm:8.46.0" + "@typescript-eslint/type-utils": "npm:8.46.0" + "@typescript-eslint/utils": "npm:8.46.0" + "@typescript-eslint/visitor-keys": "npm:8.46.0" graphemer: "npm:^1.4.0" ignore: "npm:^7.0.0" natural-compare: "npm:^1.4.0" ts-api-utils: "npm:^2.1.0" peerDependencies: - "@typescript-eslint/parser": ^8.45.0 + "@typescript-eslint/parser": ^8.46.0 eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <6.0.0" - checksum: 10c0/0c60a0e5d07fa8618348db38b5a81e66143d528e1b3cdb5678bbc6c60590cd559b27c98c36f5663230fc4cf6920dff2cd604de30b58df26a37fcfcc5dc1dbd45 + checksum: 10c0/9de2b2127b977b0d73733042602a744e5b69bfe906c6dac424123ff9726816dcc4bb3d4ba470bc1fc5c741421f53274a3a896c09fbb50e298352d4a72011b2c2 languageName: node linkType: hard -"@typescript-eslint/parser@npm:^8.45.0": - version: 8.45.0 - resolution: "@typescript-eslint/parser@npm:8.45.0" +"@typescript-eslint/parser@npm:^8.46.0": + version: 8.46.0 + resolution: "@typescript-eslint/parser@npm:8.46.0" dependencies: - "@typescript-eslint/scope-manager": "npm:8.45.0" - "@typescript-eslint/types": "npm:8.45.0" - "@typescript-eslint/typescript-estree": "npm:8.45.0" - "@typescript-eslint/visitor-keys": "npm:8.45.0" + "@typescript-eslint/scope-manager": "npm:8.46.0" + "@typescript-eslint/types": "npm:8.46.0" + "@typescript-eslint/typescript-estree": "npm:8.46.0" + "@typescript-eslint/visitor-keys": "npm:8.46.0" debug: "npm:^4.3.4" peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <6.0.0" - checksum: 10c0/8b419bcf795b112a39fcac05dcf147835059345b6399035ffa3f76a9d8e320f3fac79cae2fe4320dcda83fa059b017ca7626a7b4e3da08a614415c8867d169b8 + checksum: 10c0/2e8c75b72c7cf170aca554014dbe30e85478d96799a2eb782c4fb61423c0c9e4416e98d6e7903601b1738ea1d0936417dbf61ac0293a0500f56e0eaeefbb2ecd languageName: node linkType: hard -"@typescript-eslint/project-service@npm:8.45.0": - version: 8.45.0 - resolution: "@typescript-eslint/project-service@npm:8.45.0" +"@typescript-eslint/project-service@npm:8.46.0": + version: 8.46.0 + resolution: "@typescript-eslint/project-service@npm:8.46.0" dependencies: - "@typescript-eslint/tsconfig-utils": "npm:^8.45.0" - "@typescript-eslint/types": "npm:^8.45.0" + "@typescript-eslint/tsconfig-utils": "npm:^8.46.0" + "@typescript-eslint/types": "npm:^8.46.0" debug: "npm:^4.3.4" peerDependencies: typescript: ">=4.8.4 <6.0.0" - checksum: 10c0/98af065a1a3ed9d3d1eb265e09d3e9c2ae676d500a8c1d764f5609fe2c1b86749516b709804eb814fae688be7809d11748b9ae691d43c28da51dac390ca81fa9 + checksum: 10c0/c3164c795570edfa141917f3099724eca70383b016be1b08f656a491b459d68cf8e2547ac416d75048d3511ca5feaea0586aabad339e3dfe2ae6fddb650d7bc8 languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:8.45.0": - version: 8.45.0 - resolution: "@typescript-eslint/scope-manager@npm:8.45.0" +"@typescript-eslint/scope-manager@npm:8.46.0": + version: 8.46.0 + resolution: "@typescript-eslint/scope-manager@npm:8.46.0" dependencies: - "@typescript-eslint/types": "npm:8.45.0" - "@typescript-eslint/visitor-keys": "npm:8.45.0" - checksum: 10c0/54cd36206f6b4fc8e1e48576ed01e0d6ab20c2a9c4c7d90d5cc3a2d317dd8a13abe148ffecf471b16f1224aba5749e0905472745626bef9ae5bed771776f4abe + "@typescript-eslint/types": "npm:8.46.0" + "@typescript-eslint/visitor-keys": "npm:8.46.0" + checksum: 10c0/9c242d1edd51247559f99dd8986bdb571db0a2a583a2d02ee8f5f346d265e956f413b442c27e1b02d55ce3944609f6593050ec657be672d9b24b7ed0a359a6ad languageName: node linkType: hard -"@typescript-eslint/tsconfig-utils@npm:8.45.0, @typescript-eslint/tsconfig-utils@npm:^8.45.0": - version: 8.45.0 - resolution: "@typescript-eslint/tsconfig-utils@npm:8.45.0" +"@typescript-eslint/tsconfig-utils@npm:8.46.0, @typescript-eslint/tsconfig-utils@npm:^8.46.0": + version: 8.46.0 + resolution: "@typescript-eslint/tsconfig-utils@npm:8.46.0" peerDependencies: typescript: ">=4.8.4 <6.0.0" - checksum: 10c0/227a9b7a5baaf35466fd369992cb933192515df1156ddf22f438deb344c2523695208e1036f5590b20603f31724de75a47fe0ee84e2fd4c8e9f3606f23f68112 + checksum: 10c0/306b27c741709f2435dd1c7eabdf552775dff1b3ced01d791c5b9755394ceb3f37c9bcceec92adb6fe60c622523f9d47d9b0d9e515071f47d50527705a4706f7 languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:8.45.0": - version: 8.45.0 - resolution: "@typescript-eslint/type-utils@npm:8.45.0" +"@typescript-eslint/type-utils@npm:8.46.0": + version: 8.46.0 + resolution: "@typescript-eslint/type-utils@npm:8.46.0" dependencies: - "@typescript-eslint/types": "npm:8.45.0" - "@typescript-eslint/typescript-estree": "npm:8.45.0" - "@typescript-eslint/utils": "npm:8.45.0" + "@typescript-eslint/types": "npm:8.46.0" + "@typescript-eslint/typescript-estree": "npm:8.46.0" + "@typescript-eslint/utils": "npm:8.46.0" debug: "npm:^4.3.4" ts-api-utils: "npm:^2.1.0" peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <6.0.0" - checksum: 10c0/ce0f4c209c2418ebeb65e7de053499fb68bf6000bdd71068594fdb8c8ac3dbbd62935a3cea233989491f7da3ef5db87e7efd2910133c6abf6d0cbf57248f6442 + checksum: 10c0/a0fa4617a998094bc217be1989b76a3e45c058117cda027a723ff6f98f15e5237abfa123284afbdea7f320b4da65e1053ed47c8a211dd012591908a9daa46f02 languageName: node linkType: hard -"@typescript-eslint/types@npm:8.45.0, @typescript-eslint/types@npm:^8.45.0": - version: 8.45.0 - resolution: "@typescript-eslint/types@npm:8.45.0" - checksum: 10c0/0213a0573c671d13bc91961a2b2e814ec7f6381ff093bce6704017bd96b2fc7fee25906c815cedb32a0601cf5071ca6c7c5f940d087c3b0d3dd7d4bc03478278 +"@typescript-eslint/types@npm:8.46.0, @typescript-eslint/types@npm:^8.46.0": + version: 8.46.0 + resolution: "@typescript-eslint/types@npm:8.46.0" + checksum: 10c0/2f986852139bcbe940b4aafe79bbd28dcca7176e95ba4e3880984ef58c81ad077ca9d9191aad56d2b1df6d16060f5744a96ab3118ddbc9766e5035ed470445c1 languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:8.45.0": - version: 8.45.0 - resolution: "@typescript-eslint/typescript-estree@npm:8.45.0" +"@typescript-eslint/typescript-estree@npm:8.46.0": + version: 8.46.0 + resolution: "@typescript-eslint/typescript-estree@npm:8.46.0" dependencies: - "@typescript-eslint/project-service": "npm:8.45.0" - "@typescript-eslint/tsconfig-utils": "npm:8.45.0" - "@typescript-eslint/types": "npm:8.45.0" - "@typescript-eslint/visitor-keys": "npm:8.45.0" + "@typescript-eslint/project-service": "npm:8.46.0" + "@typescript-eslint/tsconfig-utils": "npm:8.46.0" + "@typescript-eslint/types": "npm:8.46.0" + "@typescript-eslint/visitor-keys": "npm:8.46.0" debug: "npm:^4.3.4" fast-glob: "npm:^3.3.2" is-glob: "npm:^4.0.3" @@ -1617,32 +1617,32 @@ __metadata: ts-api-utils: "npm:^2.1.0" peerDependencies: typescript: ">=4.8.4 <6.0.0" - checksum: 10c0/8c2f44a00fe859a6cd4b50157c484c5b6a1c7af5d48e89ae79c5f4924947964962fc8f478ad4c2ade788907fceee9b72d4e376508ea79b51392f91082a37d239 + checksum: 10c0/39aed033dc23c3356e39891c9eba6dde0dc618406f0e13e9adc5967fb81790ec199b1d6eb1144e35ad13a0daaf72157f5f3fc7ac1b7c58d152ade68fe27ad221 languageName: node linkType: hard -"@typescript-eslint/utils@npm:8.45.0": - version: 8.45.0 - resolution: "@typescript-eslint/utils@npm:8.45.0" +"@typescript-eslint/utils@npm:8.46.0": + version: 8.46.0 + resolution: "@typescript-eslint/utils@npm:8.46.0" dependencies: "@eslint-community/eslint-utils": "npm:^4.7.0" - "@typescript-eslint/scope-manager": "npm:8.45.0" - "@typescript-eslint/types": "npm:8.45.0" - "@typescript-eslint/typescript-estree": "npm:8.45.0" + "@typescript-eslint/scope-manager": "npm:8.46.0" + "@typescript-eslint/types": "npm:8.46.0" + "@typescript-eslint/typescript-estree": "npm:8.46.0" peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <6.0.0" - checksum: 10c0/b3c83a23813b15e20e303d7153789508c01e06dec355b1a80547c59aa36998d498102f45fcd13f111031fac57270608abb04d20560248d4448fd00b1cf4dc4ab + checksum: 10c0/77cc7dff9132d9f02e8766d128edbeb7c2f2b56f9ebdac7308e75a04924e2369857da27b23f0054476c9640609a9707b8dd8ca8b1c59a067e45f65bf5ef4cc1b languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:8.45.0": - version: 8.45.0 - resolution: "@typescript-eslint/visitor-keys@npm:8.45.0" +"@typescript-eslint/visitor-keys@npm:8.46.0": + version: 8.46.0 + resolution: "@typescript-eslint/visitor-keys@npm:8.46.0" dependencies: - "@typescript-eslint/types": "npm:8.45.0" + "@typescript-eslint/types": "npm:8.46.0" eslint-visitor-keys: "npm:^4.2.1" - checksum: 10c0/119adcf50c902dad7f7757bcdd88fad0a23a171d309d9b7cefe78af12e451cf84c04ae611f4c31f7e23f16c2b47665ad92e6e5648fc77d542ef306f465bf1f29 + checksum: 10c0/473dd4861b81238c1df10008b3b6d4684b2fa5ec4f3a8eeb544ea1278a5e2119f839447d16653ea3070164d7e742e3516fe9b0faf16e12a457fa26d5e14a7498 languageName: node linkType: hard @@ -3861,12 +3861,12 @@ __metadata: "@fontsource/inter": "npm:^5.2.8" "@mantine/core": "npm:^8.3.3" "@mantine/hooks": "npm:^8.3.3" - "@types/node": "npm:^24.6.2" - "@types/react": "npm:^19.2.0" + "@types/node": "npm:^24.7.0" + "@types/react": "npm:^19.2.1" "@types/react-dom": "npm:^19.2.0" "@types/yauzl": "npm:^2.10.3" - "@typescript-eslint/eslint-plugin": "npm:^8.45.0" - "@typescript-eslint/parser": "npm:^8.45.0" + "@typescript-eslint/eslint-plugin": "npm:^8.46.0" + "@typescript-eslint/parser": "npm:^8.46.0" "@uiw/react-codemirror": "npm:^4.25.2" "@vitejs/plugin-react": "npm:^5.0.4" cross-env: "npm:^10.1.0" @@ -3884,7 +3884,7 @@ __metadata: execa: "npm:^9.6.0" globals: "npm:^16.4.0" jiti: "npm:^2.6.1" - lucide-react: "npm:^0.544.0" + lucide-react: "npm:^0.545.0" prettier: "npm:^3.6.2" react: "npm:^19.2.0" react-dom: "npm:^19.2.0" @@ -5010,12 +5010,12 @@ __metadata: languageName: node linkType: hard -"lucide-react@npm:^0.544.0": - version: 0.544.0 - resolution: "lucide-react@npm:0.544.0" +"lucide-react@npm:^0.545.0": + version: 0.545.0 + resolution: "lucide-react@npm:0.545.0" peerDependencies: react: ^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0 - checksum: 10c0/2503f8cf65e62915997073b6053423bf8091b9470cb397560b417ef2f1628ea162c49e821b787cf153afb86828482d941f051c3f2aa642a1fa58c3de227e0113 + checksum: 10c0/942622c8e5d113e6fc6f66407703dc06474cf1a36ee9998b9f562f2e64737ea098c0db5a4e5ba2a8eb14abecb9da05be4584e9400c4a192ba5b2781f21928c21 languageName: node linkType: hard @@ -7171,10 +7171,10 @@ __metadata: languageName: node linkType: hard -"undici-types@npm:~7.13.0": - version: 7.13.0 - resolution: "undici-types@npm:7.13.0" - checksum: 10c0/44bbb0935425291351bfd8039571f017295b5d6dc5727045d0a4fea8c6ffe73a6703b48ce010f9cb539b9041a75b463f8cfe1e7309cab7486452505fb0d66151 +"undici-types@npm:~7.14.0": + version: 7.14.0 + resolution: "undici-types@npm:7.14.0" + checksum: 10c0/e7f3214b45d788f03c51ceb33817be99c65dae203863aa9386b3ccc47201a245a7955fc721fb581da9c888b6ebad59fa3f53405214afec04c455a479908f0f14 languageName: node linkType: hard