From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id D289F1FF13A for ; Wed, 10 Jun 2026 14:39:51 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 6616CD187; Wed, 10 Jun 2026 14:39:51 +0200 (CEST) From: Dominik Csapak To: pmg-devel@lists.proxmox.com Subject: [PATCH pmg-yew-quarantine-gui 2/2] spam list: use new slidable interface Date: Wed, 10 Jun 2026 14:39:10 +0200 Message-ID: <20260610123916.2651267-3-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260610123916.2651267-1-d.csapak@proxmox.com> References: <20260610123916.2651267-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.049 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: WDZXIN6PXPXLWKKGK6CHMDLOWDUHU624 X-Message-ID-Hash: WDZXIN6PXPXLWKKGK6CHMDLOWDUHU624 X-MailFrom: d.csapak@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Mail Gateway development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: the slidable widget has a new 'with_x_action' interface which makes it obsolete to create an inline row here. In addition to be a better interface and having less code here, it works around a browser bug with nested Rows in pwt 0.8.8. Since this new interface is only available in 0.8.8, bump the version in Cargo.toml too. Signed-off-by: Dominik Csapak --- Cargo.toml | 2 +- src/spam_list.rs | 54 ++++++++++++++++++++---------------------------- 2 files changed, 23 insertions(+), 33 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4ded122..7f62243 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,7 @@ proxmox-schema = "5" proxmox-uuid = "1" proxmox-subscription = { version = "1", features = ["api-types"], default-features = false } -pwt = "0.8" +pwt = "0.8.8" pwt-macros = "0.5" proxmox-login = "1" diff --git a/src/spam_list.rs b/src/spam_list.rs index 7a34df8..95a0611 100644 --- a/src/spam_list.rs +++ b/src/spam_list.rs @@ -319,39 +319,29 @@ fn render_list_item( } } }) - .left_actions( - Row::new() - .style("height", "100%") // FIXME better solved in scss of slidable? - .class(AlignItems::Center) - .with_child( - SlidableAction::new(tr!("Deliver")) - .class(ColorScheme::SuccessContainer) - .icon_class("fa fa-paper-plane") - .on_activate(make_cb(MailAction::Deliver)), - ) - .with_child( - SlidableAction::new(tr!("Welcomelist")) - .icon_class("fa fa-check") - .on_activate(make_cb(MailAction::Welcomelist)), - ) - .with_child(seen_action), + .with_left_action( + SlidableAction::new(tr!("Deliver")) + .class(ColorScheme::SuccessContainer) + .icon_class("fa fa-paper-plane") + .on_activate(make_cb(MailAction::Deliver)), ) - .right_actions( - Row::new() - .style("height", "100%") // FIXME better solved in scss of slidable? - .class(AlignItems::Center) - .with_child( - SlidableAction::new(tr!("Blocklist")) - .class(ColorScheme::WarningContainer) - .icon_class("fa fa-times") - .on_activate(make_cb(MailAction::Blocklist)), - ) - .with_child( - SlidableAction::new(tr!("Delete")) - .class(ColorScheme::ErrorContainer) - .icon_class("fa fa-trash") - .on_activate(make_cb(MailAction::Delete)), - ), + .with_left_action( + SlidableAction::new(tr!("Welcomelist")) + .icon_class("fa fa-check") + .on_activate(make_cb(MailAction::Welcomelist)), + ) + .with_left_action(seen_action) + .with_right_action( + SlidableAction::new(tr!("Blocklist")) + .class(ColorScheme::WarningContainer) + .icon_class("fa fa-times") + .on_activate(make_cb(MailAction::Blocklist)), + ) + .with_right_action( + SlidableAction::new(tr!("Delete")) + .class(ColorScheme::ErrorContainer) + .icon_class("fa fa-trash") + .on_activate(make_cb(MailAction::Delete)), ) .into() } -- 2.47.3