feat(native): Tier B — WinRT rich toasts (P5-41/35) + Focus Assist sync (P5-56)

- toast.rs: Windows.UI.Notifications rich toast (reply input + Send action);
  in-process Activated event → emit lotus-notification-activate {path} (click) /
  lotus-notification-reply {roomId,text}. Falls back to tauri-plugin-notification
  (WinRT error / non-Windows). The NOTIFICATION_BRIDGE now routes notifications
  carrying a roomId (tag) to show_rich_toast. Features: UI_Notifications,
  Data_Xml_Dom, Foundation_Collections.
- focus_assist.rs: SHQueryUserNotificationState poll thread → emit
  focus-assist-changed {active} on QUNS_QUIET_TIME/PRESENTATION/D3D_FULLSCREEN/BUSY.
  No new Cargo features.

CI Windows compile pending (no local Rust toolchain). Runtime caveat: WinRT toasts
need a Start-menu shortcut + matching AppUserModelID (org.lotusguild.lotus-chat);
without it CreateToastNotifier errors and the code falls back to the plugin.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-01 10:01:31 -04:00
parent 73d15b13d2
commit a923650d02
5 changed files with 367 additions and 5 deletions
+3
View File
@@ -9,11 +9,13 @@
use tauri::{AppHandle, Manager};
pub mod chrome;
pub mod focus_assist;
pub mod jumplist;
pub mod network;
pub mod power;
pub mod smtc;
pub mod thumbbar;
pub mod toast;
/// Dispatch a DOM `CustomEvent` to the web client (mirrors `forward_deeplink` in
/// lib.rs) so native modules can push data to the frontend without pulling in
@@ -35,5 +37,6 @@ pub fn setup(app: &AppHandle) -> tauri::Result<()> {
thumbbar::setup(app)?;
smtc::setup(app)?;
network::setup(app)?;
focus_assist::setup(app)?;
Ok(())
}