diff options
| author | Can Celik <ogulcancelik@gmail.com> | 2026-09-02 14:24:33 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-02 14:24:33 +0300 |
| commit | 6c0bb273d5d5405a00985621b17e36f8b4d64609 (patch) | |
| tree | ceef5ea8adf337bf3c1e977b133e76cb763c6f1b /src/client/shell | |
| parent | cc88b3b8e5bb9f7d9f23ed6ae85a52fd7b5b9ed6 (diff) | |
feat: support independent multi-client tab views (#3526)
Diffstat (limited to 'src/client/shell')
| -rw-r--r-- | src/client/shell/actions.rs | 7 | ||||
| -rw-r--r-- | src/client/shell/tests/keybindings_settings.rs | 4 |
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())); |
