Commit Graph

1302 Commits

Author SHA1 Message Date
agoudbg
6b56108ec4 fix: exclude divider height from title bar overlay (#2054) 2026-08-05 00:28:53 +08:00
agoudbg
e9ef676d60 fix: switch style in usage card (#2053) 2026-08-05 00:28:30 +08:00
Memory
5046daaa6d fix: only allow disabling tray icon with floating window 2026-08-01 11:35:26 +08:00
MOMO0302-02
badebd10a4 test: make dirs.test.ts pass on Windows (#2044)
dirs.test.ts asserts on values produced by `path.join`, but compares
them against hardcoded POSIX literals such as
'/tmp/app-data/mihomo-party-dev'. On Windows `path.join` returns
'\tmp\app-data\mihomo-party-dev', so two of the three cases fail on a
clean checkout:

  × isolates an unpackaged local development app
  × keeps portable userData precedence over local development isolation

The fs mock had the same problem: it detected the portable marker with
`value.endsWith('/PORTABLE')`, which never matches the backslash path
that `path.join` produces on Windows.

dirs.ts itself is correct; only the test encodes a platform assumption.
Build the expected values with `path.join` and match the portable
marker with `path.basename`, so the suite is platform-agnostic.

Full suite now passes on Windows 11: 20 files, 176 tests.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-01 02:06:13 +08:00
MOMO0302-02
0f3d338e3a fix: updater HTTP handling, macOS pkg install path and proxy port (#2042)
* fix: treat HTTP errors as failures in the updater and fix the pkg install path

1. tryDownload returned the first response it got. chromeRequest only
   rejects on transport errors, so an HTTP 404/502 from a mirror was
   returned as success and the remaining mirrors were never tried.
   checkUpdate then ran `parse()` over an HTML error page; the result has
   no `version`, so compareVersions calls `.replace` on undefined and
   throws a TypeError instead of reporting that the check failed. Check
   the status code and throw so the fallback loop keeps going.

2. downloadAndInstallUpdate only cleared updateInstallPromise when
   installUpdate rejected. The macOS .pkg branch catches an osascript
   failure and falls back to `shell.openPath`, which resolves normally
   and leaves the app running. From then on updateInstallPromise held a
   settled promise, so every later attempt returned it immediately and
   the update button did nothing. Clear it in `finally`.

3. The pkg command escaped spaces with `.replace(' ', '\\\\ ')`. A string
   pattern replaces only the first occurrence, and the macOS data
   directory ("~/Library/Application Support/...") contains more than
   one space, so the installer command was still split. Quote the path
   once and escape it for the AppleScript string literal, and invoke
   osascript through execFile so the outer command is not shell-parsed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix: validate latest.yml and skip the proxy when the mixed port is off

- checkUpdate parsed latest.yml and used the result without checking it.
  A proxy error page can still parse as YAML (`404: Not Found` is a valid
  mapping), so `latest.version` was undefined and compareVersions threw a
  TypeError on `a.replace` instead of reporting a failed check.

- Both the update check and the download built the proxy from the mixed
  port through a destructuring default, which only covers undefined.
  Turning the port off stores 0, so every request went to 127.0.0.1:0 and
  failed. Go direct when no port is enabled.

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-01 02:05:58 +08:00
MOMO0302-02
5523129529 fix: restore the real tray icon when the traffic display is turned off (#2039)
Turning the traffic display off sent trayIconUpdate with enabled=false,
but the handler ignores that flag and always applies the supplied data
URL, so the tray kept showing the renderer-composed image until the app
was restarted. Ask the main process to redraw from its own resources
afterwards.

Refs #1080

This covers the "does not recover" half of the report. The colours being
wrong while the traffic display is on has the same root cause as #1143 -
the handler calls setTemplateImage(true) unconditionally, so macOS renders
alpha only - and needs a change in tray.ts.
2026-08-01 02:05:37 +08:00
MOMO0302-02
be1761ea15 fix: notify the renderer after a scheduled subscription update (#2034)
The scheduled updater calls addProfileItem, which never sends
profileConfigUpdated. The subscription list revalidates on that event, so
the "updated N minutes ago" line and the traffic figures stayed stale
until the window regained focus - which reads exactly like the interval
not working. The plugin update path already notifies; only the remote one
did not.

Refs #1570

This addresses the stale UI half of the report. A scheduled update of the
profile that is currently active still writes the new YAML without
reloading it into the running core, because changeCurrentProfile returns
early when the id is unchanged; that part is left for a separate change.
2026-08-01 02:05:15 +08:00
MOMO0302-02
841c3cfe22 fix: harden traffic stream parsing and sysproxy status lookup (#2022)
Two independent robustness defects in mihomoApi.

1. In mihomoTraffic(), `JSON.parse(data)` sat outside the try block,
   unlike the memory, logs and connections streams where it is inside.
   The handler was also `async`, so a non-JSON frame from the core threw
   inside a promise with no rejection handler, producing an
   unhandledRejection instead of being ignored like the other three
   streams. Move the parse inside the try and drop the unnecessary
   `async`.

2. SysProxyStatus() read `appConfig.sysProxy.enable` with no optional
   chaining, while the neighbouring TunStatus() already guards with
   `config?.tun?.enable`. If the app config is missing or truncated,
   sysProxy is undefined and the property access throws. That rejection
   propagates through getTrayIconStatus(), so the tray icon stops
   reflecting the real state. Guard it the same way TunStatus does.

Closes #1286

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-01 02:04:53 +08:00
zjdndjf
4c168ffa96 fix: validate system proxy bypass formats 2026-08-01 01:29:40 +08:00
Memory
ac7bf09612 fix: validate TUN MTU range 2026-07-28 09:52:04 +08:00
luantu
f9356aa657 feat(traffic): 为详情表格和子行展开添加 loading 动画 2026-07-27 09:56:20 +08:00
zjdndjf
beb54159bf fix: recover core before config push
Closes #2011
2026-07-27 09:44:09 +08:00
Wenjie Fu
0dd6481712 fix: restore macOS connection app icons 2026-07-25 19:11:40 +08:00
Tongyuxiu Zhou
e019290493 feat: redesign airport plugin UI & support per-plugin proxy settings (#2007)
* feat: redesign and streamline the airport plugin interface

* feat: support per-plugin proxy settings
2026-07-23 02:18:21 +08:00
zjdndjf
223b7f46de fix: restore proxy group expansion state
close #2009
2026-07-23 00:49:11 +08:00
zjdndjf
a84c18a7c3 feat: add silent app updates 2026-07-22 03:17:42 +08:00
Memory
6ae19f4ca1 feat: add QR code support for subscriptions and proxy providers 2026-07-20 21:54:14 +08:00
zjdndjf
ac9158bb67 Merge pull request #1991 from Naerelyth/fix/lightweight-mode-process-kill
fix: prevent killing unintended processes due to PID reuse in lightweight mode
2026-07-19 06:10:44 +08:00
moon
196fdcbf86 fix: prevent killing unintended processes due to PID reuse in lightweight mode 2026-07-19 06:10:12 +08:00
zjdndjf
84b19e3304 Merge pull request #1992 from Naerelyth/fix-linux-orphan-mihomo
fix: resolve orphaned mihomo core process on session logout
2026-07-19 05:58:27 +08:00
zjdndjf
c2b8e09343 feat: add clean uninstall option
Closes #2000
2026-07-19 05:50:15 +08:00
ezequielnick
b06667c6d7 fix: improve plugin vault keychain handling 2026-07-17 03:23:00 +08:00
Memory
a6d7116b37 feat: bundle MRS rules for mihomo work directories 2026-07-15 23:26:29 +08:00
Memory
873b3e9c6a feat: redesign narrow sidebar controls 2026-07-15 23:20:35 +08:00
ezequielnick
f84348e5b1 fix: harden shutdown and core recovery 2026-07-15 12:15:39 +08:00
ezequielnick
24e7e9b689 perf: streamline app startup and shutdown 2026-07-15 10:53:57 +08:00
zjdndjf
f0a47acd57 chore: preserve configured runtime log level 2026-07-14 06:28:22 +08:00
zjdndjf
1f85bbef8e feat: protect critical data writes 2026-07-14 06:19:31 +08:00
moon
698eb4d90c fix: resolve orphaned mihomo core process on session logout 2026-07-13 21:03:27 +08:00
moon
7597918aba fix: prevent killing unintended processes due to PID reuse in lightweight mode 2026-07-13 20:48:35 +08:00
zjdndjf
6d26c69511 fix: avoid overlapping traffic usage queries 2026-07-11 03:37:43 +08:00
zjdndjf
a26b724a3d fix: preserve log history and throttle rendering 2026-07-11 03:02:02 +08:00
GOUKI9999
d098e3d8b1 fix: 修复 IPC 监听器泄漏,改用精确 removeListener 替代 removeAllListeners (#1980)
- network-topology.tsx: removeAllListeners('mihomoConnections') 会误删
  connections 页和 traffic-logger 的监听器,改为精确 removeListener
- mihomo-core-card.tsx: 同样误用 removeAllListeners('mihomoMemory'),
  且监听器为内联匿名箭头无法精确移除,提取为具名函数 onMemory
- logs.tsx: 模块顶层注册的 mihomoLogs 监听器永不卸载,移入组件
  useEffect 并在 cleanup 中 removeListener

这三个问题都会导致渲染进程在长时间运行后内存缓慢增长。
2026-07-11 02:53:46 +08:00
Memory
0f32c1b373 refactor: update controller panel style and interactions 2026-07-10 20:21:20 +08:00
ezequielnick
304085f225 docs: document CPX distribution options 2026-07-10 11:01:46 +08:00
ezequielnick
726d12c74c feat: associate CPX plugin files 2026-07-10 10:55:57 +08:00
ezequielnick
00b8b569c1 feat: add CPX plugin deep links 2026-07-10 10:55:26 +08:00
Memory
becad752f6 feat: add pacman package support for linux 2026-07-07 21:29:01 +08:00
zjdndjf
1caff4cabd update changelog v2.0.0 2026-07-06 15:06:32 +08:00
ezequielnick
53eb7e5c31 chore: bump version 2026-07-06 02:18:11 +08:00
ezequielnick
abb2f32051 docs: clarify deprecated v1 provider integration design 2026-07-05 03:13:52 +08:00
ezequielnick
545c82f3d2 fix: validate TUN exclude CIDR without blocking other TUN settings 2026-07-05 02:24:32 +08:00
zjdndjf
489c23a9c7 fix: avoid quoted Windows post-up hook path 2026-07-05 02:12:06 +08:00
zjdndjf
a7c8e7b1fd feat: support post-up core startup detection
Co-authored-by: xishang0128 <xishang02@gmail.com>
2026-07-05 01:58:51 +08:00
zjdndjf
461c4cd0e2 fix: sync gist after runtime config hot reload
Closes #1969
2026-07-05 01:40:23 +08:00
ezequielnick
38d51e0a38 feat: plugin file drag & drop 2026-07-05 00:43:25 +08:00
ezequielnick
368b232d6d fix: persist window size only on close/quit, not on every resize 2026-07-04 09:34:47 +08:00
zjdndjf
7ea11bb645 fix: support provider proxies after mihomo api change 2026-07-02 22:04:20 +08:00
ezequielnick
4d11d2b00d fix: persist window size on Wayland without breaking DPI growth fix 2026-07-02 04:12:33 +08:00
ezequielnick
8ae73da199 perf: batch proxy group delay-test writes to prevent UI freeze on large subscriptions
fix: cap connections icon/appName caches to prevent unbounded growth
2026-07-01 14:21:02 +08:00