From e79cc7a12d693bba13e9363ecb3812a5f19fafdc Mon Sep 17 00:00:00 2001 From: Alex Clarke Date: Thu, 10 Sep 2026 12:35:56 -0600 Subject: [PATCH] fix(radarr): show a loading block while the updates popup refreshes The updates popup only checked whether its text was empty, so during a refresh it kept rendering the previously fetched text. Opening the system updates view dispatches a request for the update notes, so the popup could sit on stale content until the response landed. Guard on the loading flag as well, matching the sonarr, lidarr and readarr updates popups, and add the loading-state test those trees have so both halves of the condition are exercised. The pre-existing empty-updates test never reaches the second half on its own. --- ...p_is_loading_when_updates_are_present.snap | 48 +++++++++++++++++++ src/ui/radarr_ui/system/system_details_ui.rs | 2 +- .../system/system_details_ui_tests.rs | 15 ++++++ 3 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 src/ui/radarr_ui/system/snapshots/managarr__ui__radarr_ui__system__system_details_ui__system_details_ui_tests__tests__snapshot_tests__system_details_ui_updates_popup_is_loading_when_updates_are_present.snap diff --git a/src/ui/radarr_ui/system/snapshots/managarr__ui__radarr_ui__system__system_details_ui__system_details_ui_tests__tests__snapshot_tests__system_details_ui_updates_popup_is_loading_when_updates_are_present.snap b/src/ui/radarr_ui/system/snapshots/managarr__ui__radarr_ui__system__system_details_ui__system_details_ui_tests__tests__snapshot_tests__system_details_ui_updates_popup_is_loading_when_updates_are_present.snap new file mode 100644 index 00000000..c8e5896f --- /dev/null +++ b/src/ui/radarr_ui/system/snapshots/managarr__ui__radarr_ui__system__system_details_ui__system_details_ui_tests__tests__snapshot_tests__system_details_ui_updates_popup_is_loading_when_updates_are_present.snap @@ -0,0 +1,48 @@ +--- +source: src/ui/radarr_ui/system/system_details_ui_tests.rs +expression: output +--- + + + + + + + ╭ Updates ───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ + │ │ + │ │ + │ Loading ... │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ diff --git a/src/ui/radarr_ui/system/system_details_ui.rs b/src/ui/radarr_ui/system/system_details_ui.rs index bc8db27f..465677b7 100644 --- a/src/ui/radarr_ui/system/system_details_ui.rs +++ b/src/ui/radarr_ui/system/system_details_ui.rs @@ -126,7 +126,7 @@ fn draw_updates_popup(f: &mut Frame<'_>, app: &mut App<'_>) { let updates = app.data.radarr_data.updates.get_text(); let block = title_block("Updates"); - if !updates.is_empty() { + if !updates.is_empty() && !app.is_loading { let updates_paragraph = Paragraph::new(Text::from(updates)) .block(borderless_block()) .scroll((app.data.radarr_data.updates.offset, 0)); diff --git a/src/ui/radarr_ui/system/system_details_ui_tests.rs b/src/ui/radarr_ui/system/system_details_ui_tests.rs index 77f5ef37..2ff9f596 100644 --- a/src/ui/radarr_ui/system/system_details_ui_tests.rs +++ b/src/ui/radarr_ui/system/system_details_ui_tests.rs @@ -87,6 +87,21 @@ mod tests { insta::assert_snapshot!(output); } + #[test] + fn test_system_details_ui_updates_popup_is_loading_when_updates_are_present() { + let mut app = App::test_default_fully_populated(); + app.is_loading = true; + app.push_navigation_stack(ActiveRadarrBlock::SystemUpdates.into()); + + assert!(!app.data.radarr_data.updates.get_text().is_empty()); + + let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| { + SystemDetailsUi::draw(f, app, f.area()); + }); + + insta::assert_snapshot!(output); + } + #[test] fn test_system_details_ui_renders_updates_loading_when_empty() { let mut app = App::test_default_fully_populated();