From 94fede7cc4eed8dd94dbe691b7b37fe90ddf0976 Mon Sep 17 00:00:00 2001 From: "Rodrigo Rodriguez (Pragmatismo)" Date: Thu, 29 Jan 2026 23:55:50 -0300 Subject: [PATCH] feat: Add search_enabled and menu_launcher_enabled directives to .product file - Add search_enabled field to ProductConfig to control omnibox visibility (defaults to false) - Add menu_launcher_enabled field to ProductConfig to control apps menu button visibility (defaults to false) - Update .product file to set both directives to false by default - Update get_product_config_json to include new fields in API response - Parse search_enabled and menu_launcher_enabled from .product file with support for true/false, 1/0, yes/no values This allows disabling the suite search mechanism and hiding the menu launcher when empty, providing a cleaner UI for deployments that don't need these features. --- .product | 11 +++++++++++ src/core/product.rs | 26 ++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/.product b/.product index 3d8dc5669..53589f7a4 100644 --- a/.product +++ b/.product @@ -14,6 +14,17 @@ name=General Bots # Only listed apps will be visible in the UI and have their APIs enabled. apps=chat,drive,tasks,sources,settings +# Search mechanism enabled +# Controls whether the omnibox/search toolbar is displayed in the suite +# Set to false to disable the search mechanism +search_enabled=false + +# Menu launcher enabled +# Controls whether the apps menu launcher is displayed in the suite +# Set to false to hide the menu launcher button +# When the menu is empty (no apps to show), it will be automatically hidden +menu_launcher_enabled=false + # Default theme # Available themes: dark, light, blue, purple, green, orange, sentient, cyberpunk, # retrowave, vapordream, y2kglow, arcadeflash, discofever, grungeera, diff --git a/src/core/product.rs b/src/core/product.rs index ef2cfe7b3..8f7a55e0f 100644 --- a/src/core/product.rs +++ b/src/core/product.rs @@ -44,6 +44,14 @@ pub struct ProductConfig { /// Copyright text (optional) pub copyright: Option, + + /// Search mechanism enabled (optional) + /// Controls whether the omnibox/search toolbar is displayed in the suite + pub search_enabled: Option, + + /// Menu launcher enabled (optional) + /// Controls whether the apps menu launcher is displayed in the suite + pub menu_launcher_enabled: Option, } impl Default for ProductConfig { @@ -81,6 +89,8 @@ impl Default for ProductConfig { support_email: None, docs_url: None, copyright: None, + search_enabled: Some(false), + menu_launcher_enabled: Some(false), } } } @@ -179,6 +189,18 @@ impl ProductConfig { config.copyright = Some(value.to_string()); } } + "search_enabled" => { + let enabled = value.eq_ignore_ascii_case("true") + || value == "1" + || value.eq_ignore_ascii_case("yes"); + config.search_enabled = Some(enabled); + } + "menu_launcher_enabled" => { + let enabled = value.eq_ignore_ascii_case("true") + || value == "1" + || value.eq_ignore_ascii_case("yes"); + config.menu_launcher_enabled = Some(enabled); + } _ => { warn!("Unknown product configuration key: {}", key); } @@ -331,6 +353,8 @@ pub fn get_product_config_json() -> serde_json::Value { "primary_color": c.primary_color, "docs_url": c.docs_url, "copyright": c.get_copyright(), + "search_enabled": c.search_enabled.unwrap_or(false), + "menu_launcher_enabled": c.menu_launcher_enabled.unwrap_or(false), }), None => serde_json::json!({ "name": "General Bots", @@ -338,6 +362,8 @@ pub fn get_product_config_json() -> serde_json::Value { "compiled_features": compiled, "version": env!("CARGO_PKG_VERSION"), "theme": "sentient", + "search_enabled": false, + "menu_launcher_enabled": false, }), } }