From 56ce2cb7396e6e0015119dbf3174b7a52381c9fe Mon Sep 17 00:00:00 2001 From: faumaray Date: Sat, 24 Oct 2026 19:39:49 +0300 Subject: [PATCH] Pin the notice kind names and the settings page title again The social split deleted `notice_names_and_setting_pages` from voelin-ui without moving it. The Slint side picks the bell's colours and icons by the kind names ("poke", "mention", "event", "friend") and nothing but the one "mention" assertion and the Keybinds search pinned them. The names of all five kinds are tested next to `NoticeKind`, and the "Voice & Video" title next to the list it is in. Co-Authored-By: Claude Sonnet 5.5 --- crates/voelin-ui-vm/src/social/logic.rs | 8 ++++++++ crates/voelin-ui-vm/src/social/mod.rs | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/crates/voelin-ui-vm/src/social/logic.rs b/crates/voelin-ui-vm/src/social/logic.rs index a3745b3..480a543 100644 --- a/crates/voelin-ui-vm/src/social/logic.rs +++ b/crates/voelin-ui-vm/src/social/logic.rs @@ -1552,6 +1552,14 @@ mod tests { assert!(ups[0].refresh.conversations && ups[0].rest.is_none()); } + /// The search lists the settings pages by these titles, which the pages + /// are shown under. + #[test] + fn the_settings_pages_the_search_finds_are_named_as_the_settings_name_them() { + let titles: Vec<&str> = SETTING_PAGES.iter().map(|(title, _, _)| *title).collect(); + assert!(titles.contains(&"Voice & Video"), "{titles:?}"); + } + fn spot(session: i64, channel: &str) -> FriendSpot { FriendSpot { session: session as u64, diff --git a/crates/voelin-ui-vm/src/social/mod.rs b/crates/voelin-ui-vm/src/social/mod.rs index ca10266..a973cf6 100644 --- a/crates/voelin-ui-vm/src/social/mod.rs +++ b/crates/voelin-ui-vm/src/social/mod.rs @@ -441,6 +441,18 @@ mod tests { NaiveDateTime::parse_from_str(text, "%Y-%m-%d %H:%M").unwrap() } + /// The bell's rows carry the kind's name and the Slint side picks the + /// colour and the icon by it (`ui/screens/overlays.slint`; the message is + /// what no other name matches), so a renamed kind must fail here. + #[test] + fn notice_kinds_are_named_as_the_bell_keys_them() { + use NoticeKind::{Event, Friend, Mention, Message, Poke}; + assert_eq!( + [Mention, Poke, Message, Event, Friend].map(NoticeKind::name), + ["mention", "poke", "message", "event", "friend"] + ); + } + #[test] fn times() { let now = 1_800_000_000_000;