From 56b357fb3acdaf08a30cc428d66e2eba000f3b50 Mon Sep 17 00:00:00 2001 From: Ryan Ward Date: Tue, 6 Oct 2026 15:13:19 -0500 Subject: [PATCH] Fix orchestration provider labels and checkbox theme colors --- app/src/ai/execution_profiles/editor/mod.rs | 6 +++++- .../ai/execution_profiles/editor/ui_helpers.rs | 4 ++-- .../galaxyui_core/src/ui_components/checkbox.rs | 15 ++++++++++++++- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/app/src/ai/execution_profiles/editor/mod.rs b/app/src/ai/execution_profiles/editor/mod.rs index 7b67f4a2..32caea06 100644 --- a/app/src/ai/execution_profiles/editor/mod.rs +++ b/app/src/ai/execution_profiles/editor/mod.rs @@ -28,6 +28,7 @@ use crate::ai::execution_profiles::{ }; use crate::ai::llms::{ DisableReason, LLMContextWindow, LLMId, LLMInfo, LLMPreferences, LLMPreferencesEvent, + LLMProvider, }; use crate::cloud_object::model::generic_string_model::StringModel; use crate::editor::{ @@ -556,7 +557,10 @@ impl ExecutionProfileEditorView { self.command_allowlist_mouse_state_handles = current_permissions.command_allowlist.iter().map(|_| Default::default()).collect(); let mut names: Vec<_> = LLMPreferences::as_ref(app).get_base_llm_choices_for_agent_mode(app) .filter(|model| !matches!(model.id.as_str(), "none" | "placeholder") && !crate::ai::custom_model_routers::is_custom_router_id(model.id.as_str())) - .filter_map(|model| model.description.clone()).collect(); + // Cloud catalog descriptions name vendors, not configured connections. + // Direct registry models already carry the user's connection name. + .filter(|model| matches!(model.provider, LLMProvider::LiteLLM | LLMProvider::Bedrock | LLMProvider::Acp)) + .map(|model| LLMPreferences::as_ref(app).orchestration_provider_name(model).to_string()).collect(); names.extend(AISettings::as_ref(app).openai_providers.value().iter().map(|provider| provider.name.clone())); names.retain(|name| !name.trim().is_empty()); names.sort(); names.dedup(); diff --git a/app/src/ai/execution_profiles/editor/ui_helpers.rs b/app/src/ai/execution_profiles/editor/ui_helpers.rs index f64c2896..f92c2f76 100644 --- a/app/src/ai/execution_profiles/editor/ui_helpers.rs +++ b/app/src/ai/execution_profiles/editor/ui_helpers.rs @@ -647,7 +647,7 @@ fn render_orchestration_providers( let checkbox = appearance.ui_builder() .checkbox(view.all_providers_checkbox.clone(), Some(14.)) .with_label(Span::new("All providers", Default::default())) - .with_style(UiComponentStyles { foreground: Some(appearance.theme().active_ui_text_color().into()), ..Default::default() }) + .with_label_style(UiComponentStyles { font_color: Some(appearance.theme().active_ui_text_color()), ..Default::default() }) .check(all) .build() .on_click(move |ctx, _, _| { @@ -671,7 +671,7 @@ fn render_orchestration_providers( let checkbox = appearance.ui_builder() .checkbox(state.clone(), Some(14.)) .with_label(Span::new(name.clone(), Default::default())) - .with_style(UiComponentStyles { foreground: Some(appearance.theme().active_ui_text_color().into()), ..Default::default() }) + .with_label_style(UiComponentStyles { font_color: Some(appearance.theme().active_ui_text_color()), ..Default::default() }) .check(included) .build() .on_click(move |ctx, _, _| { diff --git a/crates/galaxyui_core/src/ui_components/checkbox.rs b/crates/galaxyui_core/src/ui_components/checkbox.rs index a47db814..59185401 100644 --- a/crates/galaxyui_core/src/ui_components/checkbox.rs +++ b/crates/galaxyui_core/src/ui_components/checkbox.rs @@ -34,6 +34,7 @@ pub struct Checkbox { /// Optional, clickable text rendered to the right of the checkbox label: Option, + label_styles: UiComponentStyles, } impl UiComponent for Checkbox { @@ -46,7 +47,12 @@ impl UiComponent for Checkbox { .with_cross_axis_alignment(crate::elements::CrossAxisAlignment::Center) .with_child(checkbox) .with_child( - Container::new(label.with_style(self.styles(state)).build().finish()) + Container::new( + label + .with_style(self.styles(state).merge(self.label_styles)) + .build() + .finish(), + ) .with_margin_left(LABEL_LEFT_MARGIN) .finish(), ) @@ -102,6 +108,7 @@ impl Checkbox { disabled: false, checked: false, label: None, + label_styles: Default::default(), } } @@ -120,6 +127,12 @@ impl Checkbox { self } + /// Styles the label independently of the checkbox and its checkmark. + pub fn with_label_style(mut self, styles: UiComponentStyles) -> Self { + self.label_styles = styles; + self + } + fn styles(&self, state: &MouseState) -> UiComponentStyles { let styles = if self.disabled { self.disabled_styles