From ea8e8453d7ae59862f326f8e5111fd3d0b5ea9cc Mon Sep 17 00:00:00 2001 From: Michael Mallan Date: Wed, 23 Apr 2025 12:20:50 +0100 Subject: [PATCH 1/4] fix: clarify available recovery paths wording The previous wording could be misleading for recovery paths that had already been available since many blocks ago. For the user, it's enough to know that the path is available, i.e. a spend on this recovery path can be created and broadcast. --- liana-gui/src/app/view/recovery.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/liana-gui/src/app/view/recovery.rs b/liana-gui/src/app/view/recovery.rs index a3faa87f..a896d608 100644 --- a/liana-gui/src/app/view/recovery.rs +++ b/liana-gui/src/app/view/recovery.rs @@ -48,8 +48,13 @@ pub fn recovery<'a>( Column::new() .spacing(20) .push(text(format!( - "{} recovery paths will be available at the next block, select one:", - recovery_paths.len() + "{} recovery path{} available:", + recovery_paths.len(), + if recovery_paths.len() > 1 { + "s are" + } else { + " is" + }, ))) .push(Column::with_children(recovery_paths).spacing(20)), ) From eb45d6ef8f50ea4384b1f5ce9fd4f0c0aaf98237 Mon Sep 17 00:00:00 2001 From: Michael Mallan Date: Wed, 23 Apr 2025 12:26:21 +0100 Subject: [PATCH 2/4] fix: show tooltip above to improve legibility --- liana-gui/src/app/view/recovery.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/liana-gui/src/app/view/recovery.rs b/liana-gui/src/app/view/recovery.rs index a896d608..d02e3b79 100644 --- a/liana-gui/src/app/view/recovery.rs +++ b/liana-gui/src/app/view/recovery.rs @@ -118,7 +118,7 @@ pub fn recovery_path_view<'a>( .padding(5) .style(theme::pill::simple), liana_ui::widget::Text::new(fg.to_string()), - tooltip::Position::Bottom, + tooltip::Position::Top, ) .style(theme::card::simple), ) From 30aedb3e5b8b10cb0df9f937a5d362fccb91bf34 Mon Sep 17 00:00:00 2001 From: Michael Mallan Date: Wed, 23 Apr 2025 12:29:01 +0100 Subject: [PATCH 3/4] fix: use singular for one coin --- liana-gui/src/app/view/recovery.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/liana-gui/src/app/view/recovery.rs b/liana-gui/src/app/view/recovery.rs index d02e3b79..de3dcb83 100644 --- a/liana-gui/src/app/view/recovery.rs +++ b/liana-gui/src/app/view/recovery.rs @@ -137,7 +137,7 @@ pub fn recovery_path_view<'a>( .push(text(format!( "{} coin{} totalling", number_of_coins, - if number_of_coins > 0 { "s" } else { "" } + if number_of_coins > 1 { "s" } else { "" } ))) .push(amount(&total_amount)), ) From 356301c79c6f621e8329287f70a112ddbb16d43d Mon Sep 17 00:00:00 2001 From: Michael Mallan Date: Wed, 23 Apr 2025 15:13:34 +0100 Subject: [PATCH 4/4] feat: add brief overview of recovery feature This adds some explantory text about the recovery panel. For consistency, the text stating that no recovery paths are available will be shown in the same card as when recovery paths are available, which will help differentiate between this text and the explanatory text. --- liana-gui/src/app/view/recovery.rs | 35 ++++++++++++++++++------------ 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/liana-gui/src/app/view/recovery.rs b/liana-gui/src/app/view/recovery.rs index de3dcb83..e866f2dc 100644 --- a/liana-gui/src/app/view/recovery.rs +++ b/liana-gui/src/app/view/recovery.rs @@ -34,33 +34,40 @@ pub fn recovery<'a>( warning: Option<&Error>, ) -> Element<'a, Message> { let no_recovery_paths = recovery_paths.is_empty(); + const INFO_TEXT: &str = "Recover your funds by sending them to another wallet if you have lost access to your primary spending path."; dashboard( &Menu::Recovery, cache, warning, Column::new() .push(Container::new(h3("Recovery")).width(Length::Fill)) + .push(Container::new(text(INFO_TEXT))) .push(Space::with_height(Length::Fixed(20.0))) - .push(if no_recovery_paths { - Container::new(text("No recovery path is currently available")) - } else { + .push( Container::new( Column::new() - .spacing(20) - .push(text(format!( - "{} recovery path{} available:", - recovery_paths.len(), - if recovery_paths.len() > 1 { - "s are" + .push( + text(if no_recovery_paths { + "No recovery path is currently available.".to_string() } else { - " is" - }, - ))) + format!( + "{} recovery path{} available:", + recovery_paths.len(), + if recovery_paths.len() > 1 { + "s are" + } else { + " is" + }, + ) + }) + .width(Length::Fill), + ) + .push_maybe((!no_recovery_paths).then_some(Space::with_height(20))) .push(Column::with_children(recovery_paths).spacing(20)), ) .style(theme::card::simple) - .padding(20) - }) + .padding(20), + ) .push_maybe(if no_recovery_paths { None } else {