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-02 22:36:53 -04:00 committed by GitHub
parent f0515d1c34
commit 7f8e3fd482
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 18 deletions

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(),

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()