feat(native): register AUMID so Windows rich toasts work (D6)
Build Lotus Chat Desktop / prepare (push) Successful in 3s
Build Lotus Chat Desktop / build-windows (push) Failing after 25m37s
Build Lotus Chat Desktop / build-linux (push) Successful in 25m29s
Build Lotus Chat Desktop / update-manifest (push) Has been skipped

The WinRT rich toast (reply box P5-41, click-to-open-room P5-35) was inert on
Windows: CreateToastNotifier needs the process under an AppUserModelID mapped to
a Start-Menu shortcut, and none was registered — so it errored and silently fell
back to the plain plugin toast.

New native/aumid.rs (Windows-only; no-op elsewhere), called first in
native::setup: (1) SetCurrentProcessExplicitAppUserModelID("LotusGuild.LotusChat"),
(2) install/refresh a Start-Menu "Lotus Chat.lnk" carrying PKEY_AppUserModel_ID,
reusing jumplist.rs's IShellLinkW + IPropertyStore + PROPVARIANT + IPersistFile
pattern (best-effort; failures logged + swallowed). toast.rs now binds the
notifier via CreateToastNotifierWithId(AUMID).

CI-compile-only (windows runner); runtime needs a Windows build to confirm the
toast shows a reply box + opens the room. windows-crate 0.61 symbol assumptions
(IPersistFile, SetCurrentProcessExplicitAppUserModelID, PROPERTYKEY,
GUID::from_u128, CreateToastNotifierWithId) validated by CI — all mirror existing
jumplist.rs usage where possible.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-02 22:32:37 -04:00
co-authored by Claude Opus 4.8
parent 3a48771588
commit f9ed3d7116
3 changed files with 120 additions and 2 deletions
+5 -2
View File
@@ -224,8 +224,11 @@ fn show_windows_toast(
}
}
// No AUMID argument: relies on the process AppUserModelID (see module note).
let notifier = ToastNotificationManager::CreateToastNotifier()?;
// Bind the notifier to our registered AUMID (native::aumid) so it resolves to
// the "Lotus Chat" Start-Menu shortcut rather than an ambient/absent default.
let notifier = ToastNotificationManager::CreateToastNotifierWithId(&HSTRING::from(
crate::native::aumid::APP_USER_MODEL_ID,
))?;
notifier.Show(&toast)?;
Ok(())