Add sidebar tab archive settings

This commit is contained in:
2026-05-08 02:40:16 -04:00
parent 7f479ff9e1
commit 8b75b33761
6 changed files with 308 additions and 2 deletions
@@ -27,6 +27,7 @@ fn internal_page_title(url: &str) -> Option<&'static str> {
url if SiteOrigin::from_site_route(url).ok().flatten().is_some() => Some("Site Settings"),
"ely://about" => Some("About ELY Browser"),
"ely://settings" => Some("Settings"),
"ely://settings/sidebar-tabs" => Some("Sidebar & Tabs Settings"),
"ely://settings/plugins" => Some("Plugin Settings"),
"ely://settings/profiles" => Some("Profile Settings"),
"ely://settings/sync" => Some("Sync Settings"),
@@ -153,6 +154,9 @@ fn settings_page_route(query: &str) -> Option<&'static str> {
match query {
"settings" | "general" | "browser" => Some("ely://settings"),
"about" | "about ely browser" => Some("ely://about"),
"sidebar" | "tabs" | "sidebar tabs" | "sidebar & tabs" => {
Some("ely://settings/sidebar-tabs")
}
"sync" | "sync settings" => Some("ely://settings/sync"),
"profile" | "profiles" | "profile settings" | "profiles settings" => {
Some("ely://settings/profiles")
@@ -0,0 +1,25 @@
use std::error::Error;
use ely_browser_core::{BrowserCore, InitialBrowserConfig};
use ely_domain::{CommandIntent, CommandScope};
#[test]
fn settings_scoped_search_opens_sidebar_tabs_page() -> Result<(), Box<dyn Error>> {
let mut core = BrowserCore::new(InitialBrowserConfig::ely_defaults()?)?;
core.set_command_query("@settings sidebar tabs");
let intent = core.submit_command()?;
let active_tab = core.active_tab()?;
assert_eq!(
intent,
Some(CommandIntent::ScopedSearch {
scope: CommandScope::Settings,
query: "sidebar tabs".to_string(),
})
);
assert_eq!(active_tab.title(), "Sidebar & Tabs Settings");
assert_eq!(active_tab.url().as_str(), "ely://settings/sidebar-tabs");
assert_eq!(core.snapshot()?.command_query, "");
Ok(())
}