From c2c52e0fe592166660dc1cad1be9768d44f14b1b Mon Sep 17 00:00:00 2001 From: piquel Date: Sun, 22 Nov 2026 21:26:30 +0100 Subject: [PATCH] docs(ui): every private component says what its parameters hold --- crates/ui/src/admin/alerts.rs | 20 +++- crates/ui/src/admin/announcements.rs | 13 +++ crates/ui/src/admin/audit.rs | 11 ++- crates/ui/src/admin/clients.rs | 44 ++++++++- crates/ui/src/admin/deliveries.rs | 5 + crates/ui/src/admin/events.rs | 15 ++- crates/ui/src/admin/handles.rs | 10 +- crates/ui/src/admin/keys.rs | 13 ++- crates/ui/src/admin/lists.rs | 14 +++ crates/ui/src/admin/mod.rs | 84 +++++++++++++--- crates/ui/src/admin/overview/mod.rs | 10 +- crates/ui/src/admin/recoveries.rs | 5 +- crates/ui/src/admin/users.rs | 30 +++++- crates/ui/src/clients.rs | 105 ++++++++++++++++---- crates/ui/src/developers.rs | 47 ++++++++- crates/ui/src/email/mod.rs | 22 ++++- crates/ui/src/form.rs | 121 +++++++++++++++++++----- crates/ui/src/icons.rs | 5 +- crates/ui/src/layout/frames.rs | 28 +++++- crates/ui/src/layout/html.rs | 19 +++- crates/ui/src/layout/parts.rs | 50 ++++++++-- crates/ui/src/layout/search.rs | 10 +- crates/ui/src/layout/sections.rs | 32 ++++++- crates/ui/src/layout/signed_in.rs | 41 ++++++-- crates/ui/src/lib.rs | 3 + crates/ui/src/login/mod.rs | 50 +++++++++- crates/ui/src/oidc.rs | 34 ++++++- crates/ui/src/recovery/mod.rs | 22 ++++- crates/ui/src/settings/connected.rs | 8 ++ crates/ui/src/settings/data.rs | 7 ++ crates/ui/src/settings/emails.rs | 26 ++++- crates/ui/src/settings/mod.rs | 7 +- crates/ui/src/settings/notifications.rs | 36 +++++-- crates/ui/src/settings/overview.rs | 2 + crates/ui/src/settings/profile.rs | 22 ++++- crates/ui/src/settings/sessions/mod.rs | 9 +- crates/ui/src/settings/sign_in.rs | 34 ++++++- crates/ui/src/settings/timeline.rs | 14 +++ 38 files changed, 896 insertions(+), 132 deletions(-) diff --git a/crates/ui/src/admin/alerts.rs b/crates/ui/src/admin/alerts.rs index f2baee2b4..88db93f2f 100644 --- a/crates/ui/src/admin/alerts.rs +++ b/crates/ui/src/admin/alerts.rs @@ -56,7 +56,12 @@ fn author(update: &AlertUpdate) -> String { /// The current alerts, `cards`, newest first, each with posting an update on /// it, and a link to the alerts that cleared, at `previous`. #[component] -pub async fn alert_list<'a>(cards: &'a [AlertCard<'a>], previous: &'a str) -> Result { +pub async fn alert_list<'a>( + /// The alerts, newest first. + cards: &'a [AlertCard<'a>], + /// Where the cleared alerts are listed. + previous: &'a str, +) -> Result { Ok(view! { page_head( title: "Alerts", @@ -76,8 +81,11 @@ pub async fn alert_list<'a>(cards: &'a [AlertCard<'a>], previous: &'a str) -> Re /// `limit`, and a link back to the current ones, at `current`. #[component] pub async fn previous_alerts<'a>( + /// The cleared alerts, most recently cleared first. cards: &'a [AlertCard<'a>], + /// Where the current alerts are listed. current: &'a str, + /// The most alerts shown. limit: u32, ) -> Result { let full = u32::try_from(cards.len()).is_ok_and(|shown| shown >= limit); @@ -102,7 +110,10 @@ pub async fn previous_alerts<'a>( /// One alert: what it says, when it was raised, last seen and cleared, the /// updates posted on it, newest first, and posting one while it is current. #[component] -async fn alert_card<'a>(card: &'a AlertCard<'a>) -> Result { +async fn alert_card<'a>( + /// The alert shown. + card: &'a AlertCard<'a>, +) -> Result { let detail = card.detail; let alert = &detail.alert; let subject = alert.alert.as_ref().map_or(Alert::UNKNOWN, Alert::subject); @@ -157,8 +168,11 @@ async fn alert_card<'a>(card: &'a AlertCard<'a>) -> Result { pub async fn alert_update_fields<'a>( #[into] #[default] + /// The status the form holds, if a refused update set one. status: Option, - #[default] note: &'a str, + /// The note the form holds. + #[default] + note: &'a str, ) -> Result { Ok(view! {