aboutsummaryrefslogtreecommitdiff
path: root/src/client/shell
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/shell')
-rw-r--r--src/client/shell/actions.rs7
-rw-r--r--src/client/shell/tests/keybindings_settings.rs4
2 files changed, 10 insertions, 1 deletions
diff --git a/src/client/shell/actions.rs b/src/client/shell/actions.rs
index 34c780da..1ebd4e29 100644
--- a/src/client/shell/actions.rs
+++ b/src/client/shell/actions.rs
@@ -388,11 +388,16 @@ impl ClientShellState {
} else if !self.endpoint_notice_seen.insert(key.clone()) {
return false;
}
+ let duration_seconds = if kind == ClientEndpointNoticeKind::Rejected {
+ 3
+ } else {
+ 8
+ };
self.visible_endpoint_notice = Some(ClientVisibleEndpointNotice {
key,
title: title.into(),
body,
- deadline: std::time::Instant::now() + std::time::Duration::from_secs(8),
+ deadline: std::time::Instant::now() + std::time::Duration::from_secs(duration_seconds),
});
true
}
diff --git a/src/client/shell/tests/keybindings_settings.rs b/src/client/shell/tests/keybindings_settings.rs
index 5b0fced7..d20485b3 100644
--- a/src/client/shell/tests/keybindings_settings.rs
+++ b/src/client/shell/tests/keybindings_settings.rs
@@ -505,6 +505,7 @@ fn generic_endpoint_failures_and_control_errors_are_visible() {
[ClientShellAction::Endpoint { request, .. }] => request.id.clone(),
other => panic!("expected generic endpoint request, got {other:?}"),
};
+ let rejected_at = std::time::Instant::now();
let (repaint, actions) = state.handle_endpoint_result(
"boot-1",
&request_id,
@@ -522,6 +523,9 @@ fn generic_endpoint_failures_and_control_errors_are_visible() {
assert_eq!(notice.key.kind, ClientEndpointNoticeKind::Rejected);
assert_eq!(notice.key.code, "workspace.focus:not_found");
assert_eq!(notice.body, "workspace no longer exists");
+ let observed_at = std::time::Instant::now();
+ assert!(notice.deadline >= rejected_at + std::time::Duration::from_secs(3));
+ assert!(notice.deadline <= observed_at + std::time::Duration::from_secs(3));
assert!(state.endpoint_error.is_none());
assert!(state.receive_endpoint_error("Paste rejected: too large".into()));