host: keyword alert settings are the host's (AppConfig::with_alerts, commands::ALERTS)

alerts_commands keeps the owner's AlertSettings (saved in app data, validated by alerts), serves
the shell-only alerts_get / alerts_set (testkit::assert_alerts_guards) and builds the script that
hands the page runtime the keywords to watch. The app names the file and the runtime member
(AlertsConfig); store()/script() are the app's own writers (backup import).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
CRTkafa 2026-10-01 14:14:34 +07:00
parent d47a77d95d
commit 1539cb68e1
5 changed files with 128 additions and 22 deletions

View file

@ -267,6 +267,14 @@ pub fn assert_theme_guards() {
}
}
/// The alert settings' wrappers check their caller first. Runs against the host's source.
pub fn assert_alerts_guards() {
let source = include_str!("alerts_commands.rs");
for command in commands::ALERTS {
assert_guarded(source, command, "shell_only(&webview)?");
}
}
/// The backup commands' wrappers check their caller first. Runs against the host's source.
pub fn assert_backup_guards() {
let source = include_str!("backup_commands.rs");
@ -289,6 +297,7 @@ mod tests {
assert_dev_guards();
assert_backup_guards();
assert_theme_guards();
assert_alerts_guards();
}
fn caps_with(shell_extra: &str, tab_extra: &str, site_extra: &str) -> Capabilities {