aboutsummaryrefslogtreecommitdiff
path: root/src/client/shell/tests/copy.rs
diff options
context:
space:
mode:
authorEric Yue <jiacheng.yue@foxmail.com>2026-09-24 19:45:59 +0800
committerGitHub <noreply@github.com>2026-09-24 13:45:59 +0200
commitb7781a67e2d7f89ce07022d8ecdf39687ea552b0 (patch)
tree549f2722a0bdf9c75c5d0c0cc19efecc3c6664a8 /src/client/shell/tests/copy.rs
parent9c96f7ddb3be2cc575a159d4d1f1d49fb10d7006 (diff)
fix: match navigator search terms independently (#4535)
* fix: match navigator search terms independently refs #4273 * docs: remove redundant navigator search note refs #4273
Diffstat (limited to 'src/client/shell/tests/copy.rs')
-rw-r--r--src/client/shell/tests/copy.rs36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/client/shell/tests/copy.rs b/src/client/shell/tests/copy.rs
index 617af89b..112417fc 100644
--- a/src/client/shell/tests/copy.rs
+++ b/src/client/shell/tests/copy.rs
@@ -1081,6 +1081,42 @@ fn navigator_renders_every_terminal_in_workspace_sections() {
}
#[test]
+fn navigator_search_matches_non_adjacent_words_without_losing_the_pane_target() {
+ let mut projected = snapshot();
+ projected.panes[0].label = Some("alpha beta gamma".into());
+ let mut state = ClientShellState::new(ClientShellConfig::from_config(&Config::default()));
+ state.set_snapshot(Box::new(projected));
+ state.set_pane_surface(surface());
+ state.open_navigator_overlay();
+ let Some(ClientShellOverlay::Navigator(navigator)) = state.overlay.as_mut() else {
+ panic!("navigator");
+ };
+ for (query, matches) in [
+ ("alpha gamma", true),
+ (" ALP\tGAM ", true),
+ ("gamma alpha", true),
+ ("beta gamma", true),
+ ("alpha missing", false),
+ ("alphagamma", false),
+ ] {
+ navigator.query = query.into();
+ navigator.selected = None;
+ let rows =
+ render::client_navigator_rows(&state.endpoints, &state.active_endpoint_id, navigator);
+ let target =
+ super::super::aggregate_navigation::selected_navigator_target(&rows, navigator);
+ assert_eq!(
+ target,
+ matches.then(|| ClientNavigatorTarget::Pane {
+ endpoint_id: state.active_endpoint_id.clone(),
+ pane_id: "pane_1".into(),
+ }),
+ "query={query:?}"
+ );
+ }
+}
+
+#[test]
fn navigator_searches_ancestor_context_and_keeps_split_agents_individually_actionable() {
let mut projected = snapshot();
projected.tabs[0].label = "review".into();