1517 Commits

Author SHA1 Message Date
GrainFull
9e5da1a851
feat(tray): 恢复并重构托盘显示速率功能 (#6487)
* feat(tray): 恢复并重构托盘显示速率功能

* docs(changelog): add tray speed feature entry for v2.4.7

* refactor(tray): 将托盘速率显示限制为仅 macOS

* chore(style): 统一托盘速率设置相关代码风格

* refactor(tray): 统一 speed 任务调度并移除循环内配置轮询

* chore(tauri): enable createUpdaterArtifacts for updater support

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

* refactor(tray): refine macOS tray speed formatting and two-line alignment

* refactor(tray): move to utils

* refactor(tray): improve macOS speed display formatting, alignment, and structure

* chore: 降级 Node.js 版本至 21.7.1

* refactor(tray): 优化 macOS 托盘速率流与显示逻辑

* refactor(tray): 将速率任务重构为独立控制器并切换至 /traffic 流

* refactor(tray): 缩短速率宽度

* refactor(tray): 收敛测速流抽象并修正停止清理时序

* docs(changelog): 更新变更日志

* refactor(tray): simplify speed formatting logic and remove redundant functions

* refactor(tray): optimize speed display logic and reduce redundant attribute initialization

* refactor(tray): enhance traffic event parsing and improve stale event handling

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Tunglies <77394545+Tunglies@users.noreply.github.com>
2026-04-09 14:40:32 +00:00
Tunglies
f70da6b292
fix: call enhanceProfiles after drag-drop import to reload core config #6744 2026-04-07 22:02:46 +08:00
Tunglies
bff78d96b4
chore: migrate formatter from prettier to biome 2026-04-07 01:32:14 +08:00
Tunglies
3aa39bff94
refactor: fix startup init chain — resolve_done semantics, dedupe events, cleanup
Backend:
- Move resolve_done() from sync setup() to async task after futures::join!
  so Timer waits for actual init completion instead of firing immediately
- Replace std:🧵:sleep(50ms) with tokio::time::sleep in async context
- Remove duplicate refresh_tray_menu in tray_init (keep post-join call only)
- Delete dead code reset_resolve_done (process restarts, static is destroyed)
- Rename create_window(is_show) → create_window(should_create) for clarity

Frontend:
- Remove duplicate verge://refresh-clash-config listener from AppDataProvider
  (useLayoutEvents handles it via invalidateQueries — single consumer path)
- Stabilize useEffect deps with useRef for TQ refetch references
- Simplify AppDataProvider event listener setup (profile-changed + proxy only)
2026-04-06 12:20:16 +08:00
Tunglies
437fef1c30
fix: eliminate error flash on startup by distinguishing loading from error state
- Change TQ_MIHOMO retryDelay from fixed 2000ms to exponential backoff
  (200ms → 400ms → 800ms, cap 3s) so core-dependent queries retry faster
- Expose isCoreDataPending from AppDataProvider to distinguish between
  data still loading vs actual errors
- ClashModeCard: show placeholder instead of "communication error" while
  core data is pending
- CurrentProxyCard: show empty space instead of "no active node" while
  core data is pending
2026-04-06 02:14:33 +08:00
Tunglies
ec82b69786
refactor: eliminate startup flicker — defer window show until overlay renders
- Remove Rust-side `eval(INITIAL_LOADING_OVERLAY)` that prematurely
  dismissed the overlay before React/MUI theme was ready
- Defer `window.show()` from Rust `activate_window` to an inline
  `<script>` in index.html, executed after the themed overlay is in DOM
- Remove `useAppInitialization` hook (duplicate of `useLoadingOverlay`
  with no themeReady gate)
- Simplify overlay to pure theme-colored background — no spinner or
  loading text — so fast startup feels instant
- Simplify `hideInitialOverlay` API and reduce overlay fade to 0.2s
- Clean up unused CSS variables (spinner-track, spinner-top, etc.)
2026-04-06 01:53:40 +08:00
Tunglies
04ce3d1772
refactor: remove unused UI notification functions and streamline initialization logic 2026-04-06 01:14:42 +08:00
Tunglies
b8fbabae04
fix: frontend memory leaks — Monaco dispose, TQ cache eviction, useEffect cleanup
- Dispose Monaco editor instances on dialog close to prevent cycle leak
- Replace gcTime: Infinity with finite TTLs and evict orphaned subscription queryKeys
- Add missing useEffect cleanup for timers, move setTimeout out of useMemo
2026-04-05 23:10:45 +08:00
Tunglies
5da9f99698
fix: prevent TUN from being falsely disabled during startup
- Add 10s startup grace period before TUN auto-disable logic activates;
  service IPC may not be ready when the frontend first queries, causing
  a transient isServiceOk=false that incorrectly persists
- Replace placeholderData (which set isLoading=false with stale data)
  with a proper isStartingUp guard; query now polls every 2s during
  startup to catch service readiness quickly
- Add 'getSystemState' to refresh-verge-config invalidation keys to
  fix key mismatch that prevented event-driven refetches from working
2026-04-03 21:20:37 +08:00
Tunglies
d6d15652ca
refactor: migrate react-virtuoso to @tanstack/react-virtual 2026-04-03 17:13:13 +08:00
Tunglies
a73fafaf9f
refactor: migrate SWR to TanStack Query v5 (#6713)
Replace swr with @tanstack/react-query v5 across all hooks, providers,
and components. Introduce singleton QueryClient, WS subscription pattern
via useQuery+useEffect, and enforce component-layer cache access contract.
2026-04-03 08:15:51 +00:00
Tunglies
36624aff49
fix(logs): preserve log data and eliminate blank flash on page navigation
Preserve SWR cache in onConnected to avoid replacing accumulated logs
with kernel buffer on reconnect. Add KeepAlive for the logs page so
its DOM stays mounted across route changes, removing the visible blank
window when navigating back.
2026-04-03 13:13:57 +08:00
wonfen
51578c03b0
fix: URL test url 2026-04-03 12:13:04 +08:00
Tunglies
824bcc77eb
fix: throttle WebSocket subscriptions to prevent UI freeze on profile switch (#6683) (#6686)
Add leading-edge throttle to useMihomoWsSubscription, reduce SWR retry
aggressiveness, and increase WebSocket reconnect delay to prevent event
storms when switching profiles under poor network conditions.
2026-04-02 13:22:30 +00:00
Nemu-x
4e75c36097
feat: complete Russian localization (#6685) 2026-03-31 14:29:16 +00:00
Tunglies
9bcb79465c
fix: resolve frontend data race conditions in hooks
- use-system-state: convert module-level `disablingTunMode` to useRef
  to isolate state per hook instance, fix no-op clearTimeout, add
  proper effect cleanup
- use-profiles: convert forEach to for..of so selectNodeForGroup is
  properly awaited, remove fire-and-forget setTimeout around mutate
- use-clash: add useLockFn to patchInfo for concurrency safety
2026-03-31 20:26:34 +08:00
Tunglies
7a06a5a069
fix: remove dead localStorage writes and hardcoded key
- Remove unused `dns_settings_enabled` localStorage writes in
  setting-clash.tsx — state is sourced from verge config, these
  writes were never read anywhere.
- Replace hardcoded `'last_check_update'` localStorage read in
  system-info-card.tsx with exported `readLastCheckTime()` from
  the useUpdate hook, keeping the key in a single source of truth.
2026-03-29 02:06:08 +08:00
Tunglies
99bbd7ee5a
fix(home): unify last check update timestamp across settings and home page (#6605)
The settings page "Check for updates" did not update the homepage
"last check update time" because each page managed the timestamp
independently. Centralizes the timestamp in the useUpdate hook
via SWR + localStorage so both pages share a single data source.

Closes https://github.com/clash-verge-rev/clash-verge-rev/issues/6605#issuecomment-4147144987
2026-03-29 01:56:34 +08:00
Tunglies
c3aba3fc79
fix(profile): refresh profile data after timer auto-update completes
The profile-update-completed event handler was missing a mutate('getProfiles')
call, causing the "X time ago" display to show stale timestamps after
backend timer auto-updates.
2026-03-28 02:37:59 +08:00
Tunglies
ca8e350694
fix(proxy): resolve system proxy toggle stuck and state desync (#6614) (#6657)
* fix(proxy): resolve system proxy toggle stuck and state desync (#6614)

Backend: replace hand-rolled AtomicBool lock in update_sysproxy() with
tokio::sync::Mutex so concurrent calls wait instead of being silently
dropped, ensuring the latest config is always applied.

Move blocking OS calls (networksetup on macOS) to spawn_blocking so
they no longer stall the tokio worker thread pool.

Frontend: release SwitchRow pendingRef in .finally() so the UI always
re-syncs with the actual OS proxy state, and rollback checked on error.

Closes #6614

* fix(changelog): add note for macOS proxy toggle freeze issue
2026-03-27 15:40:03 +00:00
Tunglies
607ef5a8a9
fix(home): update last check timestamp on manual update check (#6605)
The onCheckUpdate handler never persisted the timestamp to localStorage
or dispatched it to component state, so clicking "Last Check Update"
would report the result but leave the displayed time stale.
2026-03-27 22:10:20 +08:00
Nemu-x
6ff1e527ee
fix(i18n): improve Russian frontend localization (#6640) 2026-03-26 21:21:13 +00:00
renovate[bot]
1f465e4742
chore(deps): update dependency typescript to v6 (#6607)
* chore(deps): update dependency typescript to v6

* chore: remove deprecated config

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Slinetrac <realakayuki@gmail.com>
2026-03-24 04:07:13 +00:00
wonfen
56141e6dfa
feat: use optimistic updates for system proxy toggle 2026-03-17 12:50:44 +08:00
wonfen
68ca01cfea
refactor: streamline proxy availability checks and remove redundant methods 2026-03-17 09:25:16 +08:00
wonfen
2043b24e4b
feat: use actual OS proxy status 2026-03-17 09:25:16 +08:00
wysha-object
4ceb7e6043
feat: Allow toggling pause of traffic stats animation on blur (#6463)
* feat: Allow toggling pause of traffic stats animation on blur

* fix: React Hook useCallback has a missing dependency

* chore: i18n

---------

Co-authored-by: Slinetrac <realakayuki@gmail.com>
2026-03-16 08:17:12 +00:00
renovate[bot]
13538914be
chore(deps): update dependency @eslint-react/eslint-plugin to v3 (#6522)
* chore(deps): update dependency @eslint-react/eslint-plugin to v3

* chore: remove deprecated rules

* chore: remove eslint from pre-push

* chore: update lint-staged config

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Slinetrac <realakayuki@gmail.com>
2026-03-16 05:40:15 +00:00
Slinetrac
c672a6fef3
refactor: lint (#6511)
* refactor: lint

* chore: remove eslint-plugin/config-prettier
2026-03-15 07:40:11 +00:00
Slinetrac
837508c02c
feat(monaco): reintroduce meta-json-schema (#6509)
* refactor(editor): make EditorViewer controlled and unify document state handling

* fix(monaco-yaml): add patchCreateWebWorker

* feat(monaco): reintroduce meta-json-schema

* fix(editor): reset document state on target change
2026-03-15 06:04:59 +00:00
Slinetrac
9989bff4e6
refactor(monaco): simplify editor worker bootstrap (#6500) 2026-03-13 09:33:25 +00:00
Slinetrac
ece1862fae
refactor: monaco init (#6496) 2026-03-13 07:28:15 +00:00
renovate[bot]
b707dd264e
build(vite)!: migrate to Vite 8, switch to Oxc-based @vitejs/plugin-react, and clean up legacy compatibility config (#6492)
* chore(deps): update npm dependencies to v8

* build(vite)!: migrate to Vite 8, switch to Oxc-based @vitejs/plugin-react, and clean up legacy compatibility config

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Slinetrac <realakayuki@gmail.com>
2026-03-13 06:42:09 +00:00
Slinetrac
7ebf27ba52
refactor: do not trigger autobackup on profile change (#6464)
* refactor: do not trigger autobackup on profile change

* chore: i18n
2026-03-11 06:56:15 +00:00
Tunglies
0e89afb01f
fix(window-provider): maximize avoiding loop detection 2026-03-09 06:46:36 +08:00
Slinetrac
0bbf9407d8
feat(tun): validate route-exclude-address as CIDR (#6440)
* feat(tun): validate route-exclude-address as CIDR

* refactor(network): replace ipaddr.js helpers with cidr-block and validator

* docs: Changelog
2026-03-07 09:18:35 +00:00
Tunglies
c429632d80
refactor: update PointerSensor activation constraint to improve responsiveness 2026-03-07 13:58:50 +08:00
Tunglies
262b6f8adf
fix: unexpected latency when switching nodes #6363 2026-02-26 15:47:02 +08:00
AetherWing
4dc515ba4d
docs: del useless word (#6358) 2026-02-23 15:40:14 +00:00
AetherWing
e1d914e61d
Chore(i18n): Improve Chinese–English typesetting (#6351)
* chore(i18n): add spacing after "TUN"

* docs: Changelog

* chore(i18n): Improve Chinese–English typesetting

* Apply suggestions from code review

* chore: i18n

---------

Co-authored-by: Slinetrac <realakayuki@gmail.com>
2026-02-23 05:17:23 +00:00
wonfen
321017413d
chore: replace node test with cp.cloudflare.com 2026-02-21 14:28:27 +08:00
wonfen
ec6f259794
chore: replace node test with 1.0.0.1 2026-02-19 11:55:09 +08:00
wonfen
ddf455508f
chore: replace node test with 104.16.132.229 2026-02-14 04:41:14 +08:00
wonfen
cf9f235270
chore: replace node test with 8888 2026-02-12 14:52:36 +08:00
Jelipo
44851466cf
fix: add margin and border radius to group svg image (#6300) 2026-02-12 04:24:30 +00:00
wonfen
81c56d46c1
perf: optimize IP info card 2026-02-12 08:49:41 +08:00
Sline
31c0910919
feat: Masque (#6303) 2026-02-11 12:38:44 +00:00
JingxinXu
bba71aaa4c
feat: added clear btn in filter component (#6229) (#6295)
Co-authored-by: Slinetrac <realakayuki@gmail.com>
2026-02-11 06:40:47 +00:00
Sline
a019b26ceb
fix: types (#6298) 2026-02-11 05:48:31 +00:00
wonfen
a4617d1fed
feat: add clear ingress/egress and data flow indicators for proxy chain 2026-02-11 04:41:46 +08:00