Add appearance settings surface
This commit is contained in:
@@ -30,6 +30,7 @@ fn internal_page_title(url: &str) -> Option<&'static str> {
|
||||
"ely://about" => Some("About ELY Browser"),
|
||||
"ely://settings" => Some("Settings"),
|
||||
"ely://settings/general" => Some("General Settings"),
|
||||
"ely://settings/appearance" => Some("Appearance Settings"),
|
||||
"ely://settings/sidebar-tabs" => Some("Sidebar & Tabs Settings"),
|
||||
"ely://settings/search" => Some("Search Settings"),
|
||||
"ely://settings/privacy-security" => Some("Privacy & Security Settings"),
|
||||
@@ -233,6 +234,9 @@ fn settings_page_route(query: &str) -> Option<&'static str> {
|
||||
match query {
|
||||
"settings" => Some("ely://settings"),
|
||||
"general" | "browser" | "new tab" | "new-tab" | "startup" => Some("ely://settings/general"),
|
||||
"appearance" | "theme" | "visual" | "design" | "colors" => {
|
||||
Some("ely://settings/appearance")
|
||||
}
|
||||
"about" | "about ely browser" => Some("ely://about"),
|
||||
"sidebar" | "tabs" | "sidebar tabs" | "sidebar & tabs" => {
|
||||
Some("ely://settings/sidebar-tabs")
|
||||
|
||||
@@ -45,6 +45,27 @@ fn settings_scoped_search_opens_general_page() -> Result<(), Box<dyn Error>> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn settings_scoped_search_opens_appearance_page() -> Result<(), Box<dyn Error>> {
|
||||
let mut core = BrowserCore::new(InitialBrowserConfig::ely_defaults()?)?;
|
||||
|
||||
core.set_command_query("@settings appearance");
|
||||
let intent = core.submit_command()?;
|
||||
let active_tab = core.active_tab()?;
|
||||
|
||||
assert_eq!(
|
||||
intent,
|
||||
Some(CommandIntent::ScopedSearch {
|
||||
scope: CommandScope::Settings,
|
||||
query: "appearance".to_string(),
|
||||
})
|
||||
);
|
||||
assert_eq!(active_tab.title(), "Appearance Settings");
|
||||
assert_eq!(active_tab.url().as_str(), "ely://settings/appearance");
|
||||
assert_eq!(core.snapshot()?.command_query, "");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn settings_scoped_search_opens_shortcuts_page() -> Result<(), Box<dyn Error>> {
|
||||
let mut core = BrowserCore::new(InitialBrowserConfig::ely_defaults()?)?;
|
||||
|
||||
Reference in New Issue
Block a user