From 83319c8a6d7deda285c82c381e35c8209f26d550 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Mon, 12 May 2025 06:19:20 -0300 Subject: [PATCH] agent: Fix instruction list item with multiple buttons not working (#30541) This was a particular problem in the Amazon Bedrock section (at least for now) where there were multiple buttons and none of them actually worked because they all had the same id. Release Notes: - agent: Fixed Amazon Bedrock settings link buttons not working. --- crates/language_models/src/ui/instruction_list_item.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/language_models/src/ui/instruction_list_item.rs b/crates/language_models/src/ui/instruction_list_item.rs index d3442cf815..af744b0ae3 100644 --- a/crates/language_models/src/ui/instruction_list_item.rs +++ b/crates/language_models/src/ui/instruction_list_item.rs @@ -38,8 +38,10 @@ impl IntoElement for InstructionListItem { (self.button_label, self.button_link) { let link = button_link.clone(); + let unique_id = SharedString::from(format!("{}-button", self.label)); + h_flex().flex_wrap().child(Label::new(self.label)).child( - Button::new("link-button", button_label) + Button::new(unique_id, button_label) .style(ButtonStyle::Subtle) .icon(IconName::ArrowUpRight) .icon_size(IconSize::XSmall)