@lobehub/chat 1.85.9 → 1.85.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.85.10](https://github.com/lobehub/lobe-chat/compare/v1.85.9...v1.85.10)
6
+
7
+ <sup>Released on **2025-05-14**</sup>
8
+
9
+ #### 💄 Styles
10
+
11
+ - **misc**: Update electron style on windows.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Styles
19
+
20
+ - **misc**: Update electron style on windows, closes [#7839](https://github.com/lobehub/lobe-chat/issues/7839) ([474de56](https://github.com/lobehub/lobe-chat/commit/474de56))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
5
30
  ### [Version 1.85.9](https://github.com/lobehub/lobe-chat/compare/v1.85.8...v1.85.9)
6
31
 
7
32
  <sup>Released on **2025-05-14**</sup>
package/README.md CHANGED
@@ -333,7 +333,7 @@ In addition, these plugins are not limited to news aggregation, but can also ext
333
333
  | [Bing_websearch](https://lobechat.com/discover/plugin/Bingsearch-identifier)<br/><sup>By **FineHow** on **2024-12-22**</sup> | Search for information from the internet base BingApi<br/>`bingsearch` |
334
334
  | [Google CSE](https://lobechat.com/discover/plugin/google-cse)<br/><sup>By **vsnthdev** on **2024-12-02**</sup> | Searches Google through their official CSE API.<br/>`web` `search` |
335
335
 
336
- > 📊 Total plugins: [<kbd>**44**</kbd>](https://lobechat.com/discover/plugins)
336
+ > 📊 Total plugins: [<kbd>**43**</kbd>](https://lobechat.com/discover/plugins)
337
337
 
338
338
  <!-- PLUGIN LIST -->
339
339
 
package/README.zh-CN.md CHANGED
@@ -326,7 +326,7 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
326
326
  | [必应网页搜索](https://lobechat.com/discover/plugin/Bingsearch-identifier)<br/><sup>By **FineHow** on **2024-12-22**</sup> | 通过 BingApi 搜索互联网上的信息<br/>`bingsearch` |
327
327
  | [谷歌自定义搜索引擎](https://lobechat.com/discover/plugin/google-cse)<br/><sup>By **vsnthdev** on **2024-12-02**</sup> | 通过他们的官方自定义搜索引擎 API 搜索谷歌。<br/>`网络` `搜索` |
328
328
 
329
- > 📊 Total plugins: [<kbd>**44**</kbd>](https://lobechat.com/discover/plugins)
329
+ > 📊 Total plugins: [<kbd>**43**</kbd>](https://lobechat.com/discover/plugins)
330
330
 
331
331
  <!-- PLUGIN LIST -->
332
332
 
@@ -79,9 +79,12 @@ const config = {
79
79
  allowToChangeInstallationDirectory: true,
80
80
  artifactName: '${productName}-${version}-setup.${ext}',
81
81
  createDesktopShortcut: 'always',
82
+ installerHeader: './build/nsis-header.bmp',
83
+ installerSidebar: './build/nsis-sidebar.bmp',
82
84
  oneClick: false,
83
85
  shortcutName: '${productName}',
84
86
  uninstallDisplayName: '${productName}',
87
+ uninstallerSidebar: './build/nsis-sidebar.bmp',
85
88
  },
86
89
  publish: [
87
90
  {
@@ -41,6 +41,7 @@ export class App {
41
41
  updaterManager: UpdaterManager;
42
42
  shortcutManager: ShortcutManager;
43
43
  trayManager: TrayManager;
44
+ chromeFlags: string[] = ['OverlayScrollbar', 'FluentOverlayScrollbar', 'FluentScrollbar'];
44
45
 
45
46
  /**
46
47
  * whether app is in quiting
@@ -185,6 +186,8 @@ export class App {
185
186
  }
186
187
  });
187
188
 
189
+ app.commandLine.appendSwitch('enable-features', this.chromeFlags.join(','));
190
+
188
191
  logger.debug('Waiting for app to be ready');
189
192
  await app.whenReady();
190
193
  logger.debug('Application ready');
@@ -1,5 +1,6 @@
1
1
  import { MainBroadcastEventKey, MainBroadcastParams } from '@lobechat/electron-client-ipc';
2
- import { BrowserWindow, BrowserWindowConstructorOptions, ipcMain } from 'electron';
2
+ import { BrowserWindow, BrowserWindowConstructorOptions, ipcMain, nativeTheme } from 'electron';
3
+ import os from 'node:os';
3
4
  import { join } from 'node:path';
4
5
 
5
6
  import { createLogger } from '@/utils/logger';
@@ -188,17 +189,32 @@ export default class Browser {
188
189
  `[${this.identifier}] Saved window state (only size used): ${JSON.stringify(savedState)}`,
189
190
  );
190
191
 
192
+ const { isWindows11, isWindows } = this.getWindowsVersion();
193
+ const isDarkMode = nativeTheme.shouldUseDarkColors;
194
+
191
195
  const browserWindow = new BrowserWindow({
192
196
  ...res,
193
- height: savedState?.height || height,
197
+ ...(isWindows
198
+ ? {
199
+ titleBarStyle: 'hidden',
200
+ }
201
+ : {}),
202
+ ...(isWindows11
203
+ ? {
204
+ backgroundMaterial: isDarkMode ? 'mica' : 'acrylic',
205
+ vibrancy: 'under-window',
206
+ visualEffectState: 'active',
207
+ }
208
+ : {}),
209
+ autoHideMenuBar: true,
210
+ backgroundColor: '#00000000',
211
+ frame: false,
194
212
 
213
+ height: savedState?.height || height,
195
214
  // Always create hidden first
196
215
  show: false,
197
-
198
216
  title,
199
217
 
200
- transparent: true,
201
-
202
218
  webPreferences: {
203
219
  // Context isolation environment
204
220
  // https://www.electronjs.org/docs/tutorial/context-isolation
@@ -211,17 +227,13 @@ export default class Browser {
211
227
  this._browserWindow = browserWindow;
212
228
  logger.debug(`[${this.identifier}] BrowserWindow instance created.`);
213
229
 
230
+ if (isWindows11) this.applyVisualEffects();
231
+
214
232
  logger.debug(`[${this.identifier}] Setting up nextInterceptor.`);
215
233
  this.stopInterceptHandler = this.app.nextInterceptor({
216
234
  session: browserWindow.webContents.session,
217
235
  });
218
236
 
219
- // Windows 11 can use this new API
220
- if (process.platform === 'win32' && browserWindow.setBackgroundMaterial) {
221
- logger.debug(`[${this.identifier}] Setting window background material for Windows 11`);
222
- browserWindow.setBackgroundMaterial('acrylic');
223
- }
224
-
225
237
  logger.debug(`[${this.identifier}] Initiating placeholder and URL loading sequence.`);
226
238
  this.loadPlaceholder().then(() => {
227
239
  this.loadUrl(path).catch((e) => {
@@ -334,6 +346,16 @@ export default class Browser {
334
346
  this._browserWindow.webContents.send(channel, data);
335
347
  };
336
348
 
349
+ applyVisualEffects() {
350
+ // Windows 11 can use this new API
351
+ if (this._browserWindow) {
352
+ logger.debug(`[${this.identifier}] Setting window background material for Windows 11`);
353
+ const isDarkMode = nativeTheme.shouldUseDarkColors;
354
+ this._browserWindow?.setBackgroundMaterial(isDarkMode ? 'mica' : 'acrylic');
355
+ this._browserWindow?.setVibrancy('under-window');
356
+ }
357
+ }
358
+
337
359
  toggleVisible() {
338
360
  logger.debug(`Toggling visibility for window: ${this.identifier}`);
339
361
  if (this._browserWindow.isVisible() && this._browserWindow.isFocused()) {
@@ -343,4 +365,36 @@ export default class Browser {
343
365
  this._browserWindow.focus();
344
366
  }
345
367
  }
368
+
369
+ getWindowsVersion() {
370
+ if (process.platform !== 'win32') {
371
+ return {
372
+ isWindows: false,
373
+ isWindows10: false,
374
+ isWindows11: false,
375
+ version: null,
376
+ };
377
+ }
378
+
379
+ // 获取操作系统版本(如 "10.0.22621")
380
+ const release = os.release();
381
+ const parts = release.split('.');
382
+
383
+ // 主版本和次版本
384
+ const majorVersion = parseInt(parts[0], 10);
385
+ const minorVersion = parseInt(parts[1], 10);
386
+
387
+ // 构建号是第三部分
388
+ const buildNumber = parseInt(parts[2], 10);
389
+
390
+ // Windows 11 的构建号从 22000 开始
391
+ const isWindows11 = majorVersion === 10 && minorVersion === 0 && buildNumber >= 22_000;
392
+
393
+ return {
394
+ buildNumber,
395
+ isWindows: true,
396
+ isWindows11,
397
+ version: release,
398
+ };
399
+ }
346
400
  }
package/changelog/v1.json CHANGED
@@ -1,4 +1,13 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "improvements": [
5
+ "Update electron style on windows."
6
+ ]
7
+ },
8
+ "date": "2025-05-14",
9
+ "version": "1.85.10"
10
+ },
2
11
  {
3
12
  "children": {
4
13
  "fixes": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.85.9",
3
+ "version": "1.85.10",
4
4
  "description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",
@@ -1,4 +1,3 @@
1
- import { Icon } from '@lobehub/ui';
2
1
  import { createStyles } from 'antd-style';
3
2
  import { Minus, Square, XIcon } from 'lucide-react';
4
3
 
@@ -12,7 +11,7 @@ const useStyles = createStyles(({ css, cx, token }) => {
12
11
  align-items: center;
13
12
  justify-content: center;
14
13
 
15
- width: 40px;
14
+ width: ${TITLE_BAR_HEIGHT * 1.2}px;
16
15
  min-height: ${TITLE_BAR_HEIGHT}px;
17
16
 
18
17
  color: ${token.colorTextSecondary};
@@ -22,10 +21,12 @@ const useStyles = createStyles(({ css, cx, token }) => {
22
21
  -webkit-app-region: no-drag;
23
22
 
24
23
  &:hover {
24
+ color: ${token.colorText};
25
25
  background: ${token.colorFillTertiary};
26
26
  }
27
27
 
28
28
  &:active {
29
+ color: ${token.colorText};
29
30
  background: ${token.colorFillSecondary};
30
31
  }
31
32
  `;
@@ -33,6 +34,8 @@ const useStyles = createStyles(({ css, cx, token }) => {
33
34
  close: cx(
34
35
  icon,
35
36
  css`
37
+ padding-inline-end: 2px;
38
+
36
39
  &:hover {
37
40
  color: ${token.colorTextLightSolid};
38
41
 
@@ -58,6 +61,7 @@ const useStyles = createStyles(({ css, cx, token }) => {
58
61
 
59
62
  const WinControl = () => {
60
63
  const { styles } = useStyles();
64
+
61
65
  return (
62
66
  <div className={styles.container}>
63
67
  <div
@@ -66,7 +70,7 @@ const WinControl = () => {
66
70
  electronSystemService.minimizeWindow();
67
71
  }}
68
72
  >
69
- <Icon icon={Minus} style={{ fontSize: 18 }} />
73
+ <Minus absoluteStrokeWidth size={14} strokeWidth={1.2} />
70
74
  </div>
71
75
  <div
72
76
  className={styles.icon}
@@ -74,7 +78,7 @@ const WinControl = () => {
74
78
  electronSystemService.maximizeWindow();
75
79
  }}
76
80
  >
77
- <Icon icon={Square} />
81
+ <Square absoluteStrokeWidth size={10} strokeWidth={1.2} />
78
82
  </div>
79
83
  <div
80
84
  className={styles.close}
@@ -82,7 +86,7 @@ const WinControl = () => {
82
86
  electronSystemService.closeWindow();
83
87
  }}
84
88
  >
85
- <Icon icon={XIcon} style={{ fontSize: 18 }} />
89
+ <XIcon absoluteStrokeWidth size={14} strokeWidth={1.2} />
86
90
  </div>
87
91
  </div>
88
92
  );
@@ -1 +1 @@
1
- export const TITLE_BAR_HEIGHT = 36;
1
+ export const TITLE_BAR_HEIGHT = 30;