diff options
| author | JJ Liebig <jonathan.liebig@gmail.com> | 2026-09-13 21:14:00 +0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-13 19:14:00 +0200 |
| commit | 3834fd3d0f77a809cf3e394fca31fd036d3173dd (patch) | |
| tree | b24702d12d9b951a8bb6cbe2a4386ec3b3b42152 /src/client/shell/worktrees.rs | |
| parent | f0cb0e0683953e7dbc32d911268931f25d3e448f (diff) | |
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
Diffstat (limited to 'src/client/shell/worktrees.rs')
| -rw-r--r-- | src/client/shell/worktrees.rs | 18 |
1 files changed, 8 insertions, 10 deletions
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::<Vec<_>>(); 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 } ( |
