From 60e02ca4533f54a54750a419b094c5e48dcb3fcf Mon Sep 17 00:00:00 2001 From: mathieu Date: Sat, 16 May 2026 21:33:28 +0200 Subject: [PATCH] fix(host-detail): move modals outside Suspense and auto-close Effect to parent Modals rendered inside were unmounted each time the host resource re-fetched, killing their reactive subscriptions and preventing them from reopening. Moving them to the
level above keeps them alive across re-fetches. The auto-close Effect for the add-app modal is also moved from AddAppModal to HostDetailPage so it is never recreated across open/close cycles, avoiding the stale-value re-trigger bug. Co-Authored-By: Claude Sonnet 4.6 --- src/client/host_detail.rs | 66 ++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 35 deletions(-) diff --git a/src/client/host_detail.rs b/src/client/host_detail.rs index 80b7ea7..84958c8 100644 --- a/src/client/host_detail.rs +++ b/src/client/host_detail.rs @@ -39,19 +39,6 @@ fn AddAppModal( // Full Application structs so names are available in the selected tag list. let selected: RwSignal> = RwSignal::new(vec![]); - // Close the modal when the action transitions from in-flight → completed with Ok. - // Tracking the pending→false transition (rather than watching value directly) avoids - // closing the modal on mount when value still holds a previous session's Ok result. - Effect::new(move |was_pending: Option| { - let is_pending = add_action.pending().get(); - if was_pending == Some(true) && !is_pending { - if let Some(Ok(_)) = add_action.value().get() { - show_modal.set(false); - } - } - is_pending - }); - view! {