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.
This commit is contained in:
Danilo Leal 2025-05-12 06:19:20 -03:00 committed by GitHub
parent 4deb8cce8d
commit 83319c8a6d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -38,8 +38,10 @@ impl IntoElement for InstructionListItem {
(self.button_label, self.button_link) (self.button_label, self.button_link)
{ {
let link = button_link.clone(); let link = button_link.clone();
let unique_id = SharedString::from(format!("{}-button", self.label));
h_flex().flex_wrap().child(Label::new(self.label)).child( 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) .style(ButtonStyle::Subtle)
.icon(IconName::ArrowUpRight) .icon(IconName::ArrowUpRight)
.icon_size(IconSize::XSmall) .icon_size(IconSize::XSmall)