cicy-desktop 2.1.74 → 2.1.75

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cicy-desktop",
3
- "version": "2.1.74",
3
+ "version": "2.1.75",
4
4
  "description": "CiCy - AI-powered operating system browser",
5
5
  "main": "src/main.js",
6
6
  "bin": {
@@ -133,11 +133,11 @@
133
133
  },
134
134
  "//optionalDependencies": "Runtime Bundle v1 (主人指令): platform binaries delivered by `npm i -g cicy-desktop` itself — npm installs only the current-platform subpackage (os/cpu pinned in each), so first start seeds the runtime store with ZERO network, ZERO npx. Windows packages are named *-windows-* (npm spam filter 403s new names containing win32). cicy-msys2 added once published.",
135
135
  "optionalDependencies": {
136
- "cicy-code-darwin-x64": "2.2.5",
137
- "cicy-code-darwin-arm64": "2.2.5",
138
- "cicy-code-linux-x64": "2.2.5",
139
- "cicy-code-linux-arm64": "2.2.5",
140
- "cicy-code-windows-x64": "2.2.5",
136
+ "cicy-code-darwin-x64": "2.2.6",
137
+ "cicy-code-darwin-arm64": "2.2.6",
138
+ "cicy-code-linux-x64": "2.2.6",
139
+ "cicy-code-linux-arm64": "2.2.6",
140
+ "cicy-code-windows-x64": "2.2.6",
141
141
  "cicy-mihomo-darwin-x64": "1.10.4",
142
142
  "cicy-mihomo-darwin-arm64": "1.10.4",
143
143
  "cicy-mihomo-linux-x64": "1.10.4",
@@ -32,6 +32,8 @@ async function openHomepage() {
32
32
  minWidth: 360,
33
33
  minHeight: 480,
34
34
  title: "CiCy Desktop",
35
+ icon: require("../utils/app-icon").appIconPath(), // npx/unpackaged → set the
36
+ // window+taskbar icon ourselves (no .exe to embed it on Windows).
35
37
  backgroundColor: "#0d1117",
36
38
  titleBarStyle: process.platform === "darwin" ? "hiddenInset" : "default",
37
39
  // Auto-hide the native menu bar on win/linux. The bar reappears when
package/src/main.js CHANGED
@@ -117,6 +117,14 @@ if (!__singleLock) {
117
117
  electronApp.exit(0);
118
118
  }
119
119
 
120
+ // Windows groups taskbar buttons + picks the taskbar icon by AppUserModelId.
121
+ // Unpackaged (npx / npm i -g) there's no installer to register one, so without
122
+ // this the taskbar shows the stock Electron icon even when each BrowserWindow
123
+ // sets its own. Must be set before any window is created. (No-op off Windows.)
124
+ if (process.platform === "win32") {
125
+ try { electronApp.setAppUserModelId("com.cicy.desktop"); } catch {}
126
+ }
127
+
120
128
  // Register cicy-desktop:// as the desktop's URL protocol. We MOVED off the bare
121
129
  // `cicy://` scheme because it collides: the CiCy mobile/Expo app (com.cicy-ai
122
130
  // .mobile) and a generic com.github.Electron both claim `cicy:`, so a browser
@@ -0,0 +1,22 @@
1
+ // Resolve the bundled app icon for BrowserWindow({ icon }).
2
+ //
3
+ // When cicy-desktop runs UNPACKAGED (npx / npm i -g — the mac/win/linux default,
4
+ // 主人令), there is no electron-builder .exe to embed the icon, so every window
5
+ // falls back to the stock Electron icon unless we point BrowserWindow at our own
6
+ // icon file explicitly. The icons ship in build/ (published — no files[]/​.npmignore
7
+ // excludes it). Windows wants a .ico; linux a .png; macOS takes the dock icon
8
+ // from elsewhere but a .png here is harmless.
9
+ const path = require("path");
10
+
11
+ const ROOT = path.join(__dirname, "..", ".."); // src/utils → package root
12
+ const ICON = {
13
+ win32: path.join(ROOT, "build", "icon.ico"),
14
+ linux: path.join(ROOT, "build", "icon.png"),
15
+ darwin: path.join(ROOT, "build", "icon.png"),
16
+ };
17
+
18
+ function appIconPath() {
19
+ return ICON[process.platform] || ICON.linux;
20
+ }
21
+
22
+ module.exports = { appIconPath };
@@ -284,6 +284,8 @@ function createWindow(options = {}, accountIdx = 0, forceNew = false) {
284
284
  height: winHeight,
285
285
  x: posX,
286
286
  y: posY,
287
+ icon: require("./app-icon").appIconPath(), // npx/unpackaged → set our own icon
288
+ // (Windows has no built .exe to embed it; default electron icon otherwise).
287
289
  // Native menu bar collapses by default on win/linux; press Alt to
288
290
  // peek. Same UX as the homepage window — keeps the chrome out of
289
291
  // the way for backend pages.
@@ -975,9 +975,17 @@ function LocalTeamCard({ team, onOpen, onRename, onRefresh }) {
975
975
  const v = JSON.parse(r.body)?.version || null;
976
976
  setLatest(v);
977
977
  if (manual && v) {
978
- const behind = team.version && cmpVer(v, team.version) > 0;
979
- if (!behind) {
980
- setUpToDateMsg(`${tr("sidecar.upToDate", "已是最新")} v${team.version || v}`);
978
+ if (!team.version) {
979
+ // Current version UNKNOWN (daemon stopped, or health returned no
980
+ // version). Do NOT claim "已是最新" and NEVER show the latest as if
981
+ // it were the current version (the old `team.version || v` bug made
982
+ // it say "已是最新 v<latest>" while the running daemon was older).
983
+ setUpToDateMsg(`${tr("sidecar.latestVersionIs", "最新版本")} v${v}·${tr("sidecar.startToCompare", "启动后对比当前版本")}`);
984
+ setTimeout(() => setUpToDateMsg(""), 3500);
985
+ } else if (cmpVer(v, team.version) > 0) {
986
+ // Behind — the 更新 badge/button drives the upgrade; no toast here.
987
+ } else {
988
+ setUpToDateMsg(`${tr("sidecar.upToDate", "已是最新")} v${team.version}`);
981
989
  setTimeout(() => setUpToDateMsg(""), 2500);
982
990
  }
983
991
  }