feat(tray): routing switch, live tooltip/icon, ping in recent list - #188
Merged
Conversation
loss-and-quick
force-pushed
the
feat/tray-context-menu-ux
branch
from
July 1, 2026 20:44
0803166 to
0ee3db5
Compare
Borrow v2rayN's tray UX where it fits kasumi's TUN model: - Routing-mode radio submenu (Rules/Global/Custom) that writes settings.routingMode; clicks route through the existing TrayAction catch-all as routing:<mode>. - Live tooltip + state icon via a new lightweight set_tray_status command called each status tick; icon variants (colour/desaturated/muted) are derived at runtime from the bundled icon, so no new assets. Menu is rebuilt only on content changes, not per traffic tick; the icon only swaps on a state transition. - Recent-profile entries show the last ping when available. Reuses settings.routing* i18n keys and formatRate/testResults; no new locale keys.
loss-and-quick
force-pushed
the
feat/tray-context-menu-ux
branch
from
August 18, 2026 19:11
0ee3db5 to
d1406f2
Compare
The routing submenu writes settings.routingMode, which the running core only picks up on restart. Overview says so in its banner; the tray said nothing, so a mode switched from the tray looked applied while traffic kept flowing under the old rules.
tray_icon ran inside set_tray_status, which fires on every status tick, so a decode failure would panic in a command handler rather than leave the tray on the icon it already had.
19 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Overhauls the system-tray right-click menu, borrowing v2rayN's tray UX where it fits kasumi's TUN-only model (system-proxy set/clear/PAC was intentionally left out — kasumi has no OS-proxy concept).
settings.routingModewithout opening the window, mirroring v2rayN's routing submenu. Clicks come back through the existingTrayActioncatch-all asrouting:<mode>; Tauri has no native radio item, so (like v2rayN) exactly one entry is check-marked.set_tray_statuscommand pushes a tooltip (Kasumi Proxy — <state> · <profile>+ live ↓/↑ rate) and a state icon on every status tick. Icon variants (full colour / desaturated / muted) are derived at runtime from the bundled icon, so no new art is committed. The menu is rebuilt only when its contents change (not per traffic tick), and the icon is swapped only on a state transition.· N ms) when a result exists.Reuses existing
settings.routing*i18n keys,formatRate, andtestResults— no new locale keys, no duplicated values.Tooltips are honoured on Windows/macOS; the Linux app-indicator ignores them, but the state icon still updates there.
Affected layer
frontend/— React Web UIcrates/·src-tauri/— Rust core / backend / Tauri desktopmodule/— Android installable zip (thin launcher over the Rust daemon)scripts/— build / release helpers.github/Verification
Rust (
crates/·src-tauri/):cargo fmt --all --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspace— green except one pre-existing, network-dependent test (net::tcp_ping_fails_on_unreachable_host) that also fails onmainin the sandbox; unrelated to this change.cargo test -p kasumi-desktopis fully green (28/28).cargo run -p kasumi-desktop --bin codegenleavesgitcleanWeb UI (
frontend/):bun run check— Biome lint + format cleanbun run test— vitest green (68/68)bun run build—tsc -b+ vite build succeedbun run check:i18n— locale dictionaries in syncModule shell (
module/):shellcheck -s sh module/*.sh— n/a, not touchedChecklist
frontend/src/generated/was regenerated from Rust, not hand-editedsettings.routing*keysNotes for reviewers
useEffectdeps line and the regeneratedbindings.tsboth mix features), so they land as one commit rather than an artificial split into non-compiling intermediates.128x128.pngviaImage::from_bytes/new_owned) rather than shipping extra PNGs —image-pngis already enabled.