From 7b5af94f19bb885c3434b49ca582fc086847c3fb Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sun, 22 Nov 2026 17:37:16 -0500 Subject: [PATCH] Dialog footer: Cancel is a ghost button beside the accent answer, as production (trial a_footer_cancel_is_a_ghost_button_beside_the_accent_answer) --- crates/ui-panels/src/sections/footer.rs | 4 +++- crates/ui-panels/tests/it/dialogs.rs | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/crates/ui-panels/src/sections/footer.rs b/crates/ui-panels/src/sections/footer.rs index 807f8f344..2fea5318b 100644 --- a/crates/ui-panels/src/sections/footer.rs +++ b/crates/ui-panels/src/sections/footer.rs @@ -640,7 +640,9 @@ impl FooterBar { let variant = match button.role { DialogRole::Accept => Variant::PRIMARY, DialogRole::Destructive => Variant::DANGER, - DialogRole::Cancel | DialogRole::Other | DialogRole::Alternative => Variant::SECONDARY, + // Production shows Cancel as plain text beside the accented answer. + DialogRole::Cancel => Variant::GHOST, + DialogRole::Other | DialogRole::Alternative => Variant::SECONDARY, }; let mut widget = Button::new(button.label.clone()).variant(variant).enabled(button.enabled).least_width(least); if column { diff --git a/crates/ui-panels/tests/it/dialogs.rs b/crates/ui-panels/tests/it/dialogs.rs index 33912b5cb..8f743c177 100644 --- a/crates/ui-panels/tests/it/dialogs.rs +++ b/crates/ui-panels/tests/it/dialogs.rs @@ -457,3 +457,20 @@ fn a_space_between_row_in_a_dialog_keeps_its_children_apart_at_both_edges() { let dialog = fixture.by_role(craft_ui::contract::Role::DIALOG).first().map(|d| d.rect).expect("the dialog is shown"); assert!(dialog.max.x - remove.max.x < 40.0, "Remove sits at the row's end edge: {remove:?} in {dialog:?}"); } + +/// Production's dialogs show Cancel as plain text beside the accented answer: a footer's Cancel is a ghost button, not +/// an outlined one. +#[trial] +fn a_footer_cancel_is_a_ghost_button_beside_the_accent_answer() { + use craft_theme::Variant; + let mut fixture = Fixture::new(|ui| { + let _ = StandardPrompt::custom("Revert?") + .button(craft_ui::dialog::PromptChoice::Proceed, "Revert") + .button(craft_ui::dialog::PromptChoice::Cancel, "Cancel") + .show(ui); + }); + fixture.settle(); + let seen = fixture.styles_of(std::any::type_name::>()); + assert!(seen.iter().any(|style| style.variant == Variant::GHOST), "Cancel is a ghost button: {:?}", seen.iter().map(|s| s.variant).collect::>()); + assert!(!seen.iter().any(|style| style.variant == Variant::SECONDARY), "no outlined button in the footer"); +}