ui: Implement ParentElement for Banner (#29834)

This PR implements the `ParentElement` trait for the `Banner` component
so that it can use the real children APIs instead of a bespoke one.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers
2025-05-03 02:36:53 +00:00
committed by GitHub
parent f0515d1c34
commit 7f8e3fd482
3 changed files with 16 additions and 18 deletions
+3 -3
View File
@@ -1890,7 +1890,7 @@ impl AssistantPanel {
.child(
Banner::new()
.severity(ui::Severity::Warning)
.children(
.child(
Label::new(
"Configure at least one LLM provider to start using the panel.",
)
@@ -1923,7 +1923,7 @@ impl AssistantPanel {
.child(
Banner::new()
.severity(ui::Severity::Warning)
.children(
.child(
h_flex()
.w_full()
.children(
@@ -1985,7 +1985,7 @@ impl AssistantPanel {
Some(
Banner::new()
.severity(ui::Severity::Info)
.children(h_flex().child(Label::new(format!(
.child(h_flex().child(Label::new(format!(
"Consecutive tool use limit reached.{max_mode_upsell}"
))))
.into_any_element(),
+1 -1
View File
@@ -66,7 +66,7 @@ impl RenderOnce for UsageBanner {
}),
};
Banner::new().severity(severity).children(
Banner::new().severity(severity).child(
h_flex().flex_1().gap_1().child(Label::new(message)).child(
h_flex()
.flex_1()