dsh-oc-desktop 0.3.4 → 0.3.6

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.
Binary file
package/assets/icon.ico CHANGED
Binary file
package/assets/tray.ico CHANGED
Binary file
package/assets/tray.png CHANGED
Binary file
package/launcher/main.js CHANGED
@@ -18,7 +18,10 @@ const { parseCurrentSession, SESSION_ID_RE } = require('./session-window');
18
18
  const PACKAGE_ROOT = path.join(__dirname, '..'); // plugins/dsh-desktop(包根,自带 assets)
19
19
 
20
20
  app.setName('dsh-desktop');
21
- // Windows 原生通知需要 AppUserModelID(与 electron-builder 的 appId 一致),否则打包后通知不显示
21
+ // Windows 原生通知需要 AppUserModelID
22
+ // 注意:设置后 Windows 会把任务栏按钮图标解析为 exe 图标而非窗口图标 —— 这没问题,
23
+ // 因为 electron.exe 图标已通过 scripts/set-exe-icon.ps1 注入为圆角白底黑鲸
24
+ // (任务栏 + 任务管理器进程图标同源)。若重装 electron(npm install)需重跑注入脚本。
22
25
  app.setAppUserModelId('dev.dsh.desktop');
23
26
 
24
27
  // ---------- 更新应用模式 ----------
@@ -341,6 +344,13 @@ function onHarnessExit(code, sig) {
341
344
  }
342
345
 
343
346
  // ---------- 窗口 ----------
347
+ // 窗口图标用多帧 icon.ico:Windows 按目标尺寸就近取帧(任务栏 32/48px 取对应帧),
348
+ // 圆角与黑鲸细节不被 512px 大图缩放磨掉;取不到则回退 512px icon-app.png,避免回落 Electron 默认图标。
349
+ function appIcon() {
350
+ let img = nativeImage.createFromPath(path.join(ASSETS, 'icon.ico'));
351
+ if (img.isEmpty()) img = nativeImage.createFromPath(path.join(ASSETS, 'icon-app.png'));
352
+ return img.isEmpty() ? undefined : img;
353
+ }
344
354
  function createMainWindow(url) {
345
355
  const state = loadJson(statePath, { width: 1280, height: 860 });
346
356
  const opts = {
@@ -351,7 +361,7 @@ function createMainWindow(url) {
351
361
  minHeight: 600,
352
362
  show: false,
353
363
  title: 'DeepSeek Harness',
354
- icon: nativeImage.createFromPath(path.join(ASSETS, 'icon-app.png')),
364
+ icon: appIcon(),
355
365
  backgroundColor: '#14161a',
356
366
  webPreferences: {
357
367
  contextIsolation: true,
@@ -435,7 +445,7 @@ function createSessionWindow(sessionId) {
435
445
  minHeight: 600,
436
446
  show: false,
437
447
  title: 'DeepSeek Harness',
438
- icon: nativeImage.createFromPath(path.join(ASSETS, 'icon-app.png')),
448
+ icon: appIcon(),
439
449
  backgroundColor: '#14161a',
440
450
  webPreferences: {
441
451
  contextIsolation: true,
@@ -558,7 +568,7 @@ function showError(msg) {
558
568
  if (splash && !splash.isDestroyed()) splash.close();
559
569
  mainWin = new BrowserWindow({
560
570
  width: 720, height: 420, show: false, title: 'DeepSeek Harness',
561
- icon: nativeImage.createFromPath(path.join(ASSETS, 'icon-app.png')), backgroundColor: '#101216',
571
+ icon: appIcon(), backgroundColor: '#101216',
562
572
  // 固定对话框(设计系统「窗口框架」):禁止缩放/最大化,保留拖拽
563
573
  resizable: false, maximizable: false, minimizable: false,
564
574
  // 必须带 preload:错误页的「重试」按钮依赖 window.dshNative.retryHarness()
@@ -583,10 +593,10 @@ function toggleWindow() {
583
593
  else { mainWin.show(); mainWin.focus(); }
584
594
  }
585
595
  function createTray() {
586
- // 托盘图标跟随系统主题(深色=白鲸,浅色=黑鲸),与窗口一致
596
+ // 托盘图标用专用 32px 白底圆角黑鲸(tray.png):托盘 16px 显示时不会被 512px 大图缩放磨糊
587
597
  try {
588
- let icon = nativeImage.createFromPath(path.join(ASSETS, 'icon-app.png'));
589
- if (icon.isEmpty()) icon = nativeImage.createFromPath(path.join(ASSETS, 'tray.png'));
598
+ let icon = nativeImage.createFromPath(path.join(ASSETS, 'tray.png'));
599
+ if (icon.isEmpty()) icon = nativeImage.createFromPath(path.join(ASSETS, 'icon-app.png'));
590
600
  if (icon.isEmpty()) icon = nativeImage.createEmpty();
591
601
  tray = new Tray(icon);
592
602
  tray.setToolTip('DeepSeek Harness');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-oc-desktop",
3
3
  "productName": "DeepSeek Harness Desktop",
4
- "version": "0.3.4",
4
+ "version": "0.3.6",
5
5
  "description": "DeepSeek Harness 桌面端插件(Electron 启动器):自绘标题栏/托盘/通知/快捷键/崩溃自愈",
6
6
  "main": "launcher/main.js",
7
7
  "bin": {