feat: show detailed results in hotkey notifications (#6639)

* feat: show detailed results in hotkey notifications

* fix: Japanese locale appears to have a truncated translation key label

* fix: variable naming

* Update documentation to English

* Remove unnecessary mut

* feat: enhance system proxy notifications with toggle state

* chore: update changelog to include new shortcut notification feature

* fix: remove unnecessary quotes from system proxy toggle messages in localization files

* fix: tun mode toggled hotkey notifications

* fix: correct toggle_tun_mode logic to handle current state and errors

---------

Co-authored-by: Tunglies <77394545+Tunglies@users.noreply.github.com>
This commit is contained in:
wysha-object
2026-03-30 17:06:45 +00:00
committed by GitHub
co-authored by Tunglies
parent 071f92635f
commit b7230967b4
17 changed files with 93 additions and 44 deletions
+17 -6
View File
@@ -9,8 +9,8 @@ pub enum NotificationEvent<'a> {
ClashModeChanged {
mode: &'a str,
},
SystemProxyToggled,
TunModeToggled,
SystemProxyToggled(bool),
TunModeToggled(bool),
LightweightModeEntered,
ProfilesReactivated,
AppQuit,
@@ -37,14 +37,25 @@ pub async fn notify_event<'a>(event: NotificationEvent<'a>) {
.into();
notify(title, body);
}
NotificationEvent::SystemProxyToggled => {
NotificationEvent::SystemProxyToggled(enabled) => {
let title = clash_verge_i18n::t!("notifications.systemProxyToggled.title");
let body = clash_verge_i18n::t!("notifications.systemProxyToggled.body");
let key = if enabled {
"notifications.systemProxyToggled.on"
} else {
"notifications.systemProxyToggled.off"
};
let body = clash_verge_i18n::t!(key);
notify(title, body);
}
NotificationEvent::TunModeToggled => {
NotificationEvent::TunModeToggled(enabled) => {
let title = clash_verge_i18n::t!("notifications.tunModeToggled.title");
let body = clash_verge_i18n::t!("notifications.tunModeToggled.body");
let key = if enabled {
"notifications.tunModeToggled.on"
} else {
"notifications.tunModeToggled.off"
};
let body = clash_verge_i18n::t!(key);
notify(title, body);
}
NotificationEvent::LightweightModeEntered => {