From 2fc0a8b6ba309bfdd3c0d0e502142a3edb700aac Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sun, 8 Nov 2026 20:58:46 -0500 Subject: [PATCH] review: say why a read-only signature field can't be signed --- crates/ui-egui/src/tools/sign_ui/panel.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/tools/sign_ui/panel.rs b/crates/ui-egui/src/tools/sign_ui/panel.rs index 96e8723673..c9b3306de1 100644 --- a/crates/ui-egui/src/tools/sign_ui/panel.rs +++ b/crates/ui-egui/src/tools/sign_ui/panel.rs @@ -120,8 +120,20 @@ pub(crate) fn panel(ui: &mut egui::Ui, t: &Tokens, sigs: &[SignatureInfo], expan egui::Frame::NONE.inner_margin(egui::Margin { left: 44, right: 4, top: 2, bottom: 8 }).show(ui, |ui| { ui.spacing_mut().item_spacing.y = 3.0; if !s.signed { - // The writer refuses a read-only field, so the panel does not offer to sign it. - if !s.read_only && widgets::pill_button(ui, tl!("Sign this field…"), true).clicked() { + // The writer refuses a read-only field, so the panel does not offer to sign it, + // and says why instead of showing an empty expansion. + if s.read_only { + ui.add( + egui::Label::new( + egui::RichText::new(tl!("This field is read-only, so it can't be signed.")) + .font(theme::regular(11.5)) + .color(t.text_muted), + ) + .wrap(), + ); + return; + } + if widgets::pill_button(ui, tl!("Sign this field…"), true).clicked() { action = Some(PanelAction::Sign(s.field.clone())); } return;