feat(slint): add NavEntry::Search history variant

The Search variant carries the query. apply_entry gets a stub arm that
switches the view; Task 6 upgrades it to a full navigate_search call.

cc
This commit is contained in:
vicrodh committed 2026-05-19 11:26:48 -06:00
1 parent b040a1d359
commit acfb6a05cb
2 files changed
+17

No files matched your search

+11
View File
@@ -16,6 +16,8 @@ pub enum NavEntry {
Album(String),
Artist(String),
Settings,
/// A search results page; the string is the query.
Search(String),
}
struct History {
@@ -123,6 +125,15 @@ mod tests {
assert_eq!(go_back(), Some(NavEntry::Album("1".into())));
}
#[test]
fn search_entry_round_trips_history() {
reset();
record(NavEntry::Search("metallica".into()));
record(NavEntry::Album("5".into()));
assert_eq!(go_back(), Some(NavEntry::Search("metallica".into())));
assert_eq!(go_back(), Some(NavEntry::Home));
}
#[test]
fn record_dedupes_current_entry() {
reset();