From 3834fd3d0f77a809cf3e394fca31fd036d3173dd Mon Sep 17 00:00:00 2001 From: JJ Liebig Date: Sun, 13 Sep 2026 21:14:00 +0400 Subject: fix: auto-expire worktree action error banners (#4063) * fix: auto-expire worktree action error banners refs #1827 * fix: restart endpoint error timeout on repeated errors Route every transient client-side action error through a setter that installs a fresh deadline, so an identical repeated message cannot inherit an older, nearly-expired deadline. refs #1827 * test: derive endpoint error expiry assertions from stored deadline refs #1827 --- src/client/shell/worktrees.rs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src/client/shell/worktrees.rs') diff --git a/src/client/shell/worktrees.rs b/src/client/shell/worktrees.rs index c50b86be..31ddbeee 100644 --- a/src/client/shell/worktrees.rs +++ b/src/client/shell/worktrees.rs @@ -213,9 +213,8 @@ impl ClientShellState { .is_some_and(|worktree| worktree.is_linked_worktree); let kind = match action { KeybindAction::NewWorktree | KeybindAction::OpenWorktree if linked => { - self.endpoint_error = Some( - "New and open worktree actions start from the repo parent workspace." - .to_owned(), + self.set_endpoint_error( + "New and open worktree actions start from the repo parent workspace.", ); outcome.repaint = true; return; @@ -227,8 +226,7 @@ impl ClientShellState { workspace_id: workspace_id.clone(), }, KeybindAction::RemoveWorktree if !linked => { - self.endpoint_error = - Some("This workspace is not a Herdr-managed worktree checkout.".to_owned()); + self.set_endpoint_error("This workspace is not a Herdr-managed worktree checkout."); outcome.repaint = true; return; } @@ -442,7 +440,7 @@ impl ClientShellState { }) .collect::>(); if entries.is_empty() { - self.endpoint_error = Some("No Git worktrees found for this repo.".to_owned()); + self.set_endpoint_error("No Git worktrees found for this repo."); } else { self.overlay = Some(ClientShellOverlay::WorktreeOpen( ClientWorktreeOpenOverlay { @@ -477,8 +475,9 @@ impl ClientShellState { }, )); } else { - self.endpoint_error = - Some("This workspace is not a Herdr-managed worktree checkout.".to_owned()); + self.set_endpoint_error( + "This workspace is not a Herdr-managed worktree checkout.", + ); } true } @@ -543,8 +542,7 @@ impl ClientShellState { Err(_), ) => true, (_, Ok(_)) => { - self.endpoint_error = - Some("endpoint returned an unexpected worktree result".to_owned()); + self.set_endpoint_error("endpoint returned an unexpected worktree result"); true } ( -- cgit v1.2.3