* remove dimmed

* clearer list ui

* fix integration tests

* rustfmt

* move hint to tab-bar

* redesign stack list

* rustfmt

* fix e2e

* add pr
This commit is contained in:
Aram Drevekenin
2026-07-06 22:09:06 +02:00
committed by GitHub
parent 7b823f972a
commit 5b310ada79
45 changed files with 253 additions and 196 deletions
+2 -2
View File
@@ -454,7 +454,7 @@ fn new_stacked_pane() {
zellij.send_stdin(&keys::ctrl('p'));
zellij.send_stdin(&keys::key('s'));
let grid_snapshot = spawn_second_pane_and_wait_for_grid(&zellij, col(2).row(3));
let grid_snapshot = spawn_second_pane_and_wait_for_grid(&zellij, col(2).row(4));
assert_snapshot!(normalized(&grid_snapshot));
zellij.quit();
}
@@ -630,7 +630,7 @@ fn toggle_frames_with_stacked_panes() {
zellij.send_stdin(&keys::ctrl('p'));
zellij.send_stdin(&keys::key('s'));
spawn_second_pane_and_wait_for_grid(&zellij, col(2).row(3));
spawn_second_pane_and_wait_for_grid(&zellij, col(2).row(4));
zellij.wait_until("stacked panes show their titles", |grid_snapshot| {
grid_snapshot.contains("Pane #1")
@@ -1,10 +1,9 @@
---
source: zellij-integration-tests/tests/misc.rs
assertion_line: 135
expression: normalized(&grid_snapshot)
---
Zellij (test)  Tab #1  + 
Pane #1
<↓↑> [ Pane #2 ]
Pane #1
> Pane #2
$ █
Ctrl + <g> LOCK  <p> PANE  <t> TAB  <n> RESIZE  <h> MOVE  <s> SEARCH  <o> SESSION  <q> QUIT  ...
@@ -3,7 +3,7 @@ source: zellij-integration-tests/tests/panes.rs
expression: normalized(&grid_snapshot)
---
Zellij (test)  Tab #1  + 
Pane #1
<↓↑> [ Pane #2 ]
Pane #1
> Pane #2
$ █
Ctrl + <g> LOCK  <p> PANE  <t> TAB  <n> RESIZE  <h> MOVE  <s> SEARCH  <o> SESSION  <q> QUIT  ...
@@ -3,8 +3,8 @@ source: zellij-integration-tests/tests/panes.rs
expression: normalized(&grid_snapshot)
---
Zellij (test)  Tab #1  + 
Pane #1
<↓↑> [ Pane #2 ]
Pane #1
> Pane #2
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│$ █ │
│ │
@@ -23,6 +23,5 @@ expression: normalized(&grid_snapshot)
│ │
│ │
│ │
│ │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Ctrl + <g> LOCK  <p> PANE  <t> TAB  <n> RESIZE  <h> MOVE  <s> SEARCH  <o> SESSION  <q> QUIT  ...
@@ -3,7 +3,7 @@ source: zellij-integration-tests/tests/stacked_pane_list.rs
expression: normalized(&grid_snapshot)
---
Zellij (test)  Tab #1  + 
<↓↑> [ Pane #1 ]
member-command [ EXIT CODE: 2 ]
> Pane #1
member-command [ EXIT CODE: 2 ]
█
Ctrl + <g> LOCK  <p> PANE  <t> TAB  <n> RESIZE  <h> MOVE  <s> SEARCH  <o> SESSION  <q> QUIT  ...
@@ -3,8 +3,8 @@ source: zellij-integration-tests/tests/stacked_pane_list.rs
expression: normalized(&grid_snapshot)
---
Zellij (test)  Tab #1  + 
Pane #1
<↓↑> [ Pane #3 ]
Pane #1
> Pane #3
$ third-member
$ █
Ctrl + <g> LOCK  <p> PANE  <t> TAB  <n> RESIZE  <h> MOVE  <s> SEARCH  <o> SESSION  <q> QUIT  ...
@@ -3,8 +3,8 @@ source: zellij-integration-tests/tests/stacked_pane_list.rs
expression: normalized(&grid_snapshot)
---
Zellij (test)  Tab #1  + 
<↓↑> [ Pane #1 ]
Pane #2
Pane #3
> Pane #1
Pane #2
Pane #3
$ █
Ctrl + <g> LOCK  <p> PANE  <t> TAB  <n> RESIZE  <h> MOVE  <s> SEARCH  <o> SESSION  <q> QUIT  ...
@@ -3,8 +3,8 @@ source: zellij-integration-tests/tests/stacked_pane_list.rs
expression: normalized(&grid_snapshot)
---
Zellij (test)  Tab #1  + 
Pane #1
Pane #2
<↓↑> [ Pane #3 ]
Pane #1
Pane #2
> Pane #3
$ █
Ctrl + <g> LOCK  <p> PANE  <t> TAB  <n> RESIZE  <h> MOVE  <s> SEARCH  <o> SESSION  <q> QUIT  ...
@@ -3,8 +3,8 @@ source: zellij-integration-tests/tests/stacked_pane_list.rs
expression: normalized(&grid_snapshot)
---
Zellij (test)  Tab #1  Tab #2  + 
Pane #1
<↓↑> [ Pane #2 ]
Pane #1
> Pane #2
$ second-member
$ █
Ctrl + <g> LOCK  <p> PANE  <t> TAB  <n> RESIZE  <h> MOVE  <s> SEARCH  <o> SESSION  <q> QUIT  ...
@@ -3,9 +3,9 @@ source: zellij-integration-tests/tests/stacked_pane_list.rs
expression: normalized(&swapped_in)
---
Zellij (test)  Tab #1  + 
<↓↑> [ Pane #1 ]
Pane #2
Pane #3
> Pane #1
Pane #2
Pane #3
$ first-member
$ █
Ctrl + <g> LOCK  <p> PANE  <t> TAB  <n> RESIZE  <h> MOVE  <s> SEARCH  <o> SESSION  <q> QUIT  ...
@@ -3,8 +3,8 @@ source: zellij-integration-tests/tests/stacked_pane_list.rs
expression: normalized(&grid_snapshot)
---
Zellij (test)  Tab #1  + 
Pane #1
<↓↑> [ Pane #2 ]
Pane #1
> Pane #2
$ second-member
$ █
Ctrl + <g> LOCK  <p> PANE  <t> TAB  <n> RESIZE  <h> MOVE  <s> SEARCH  <o> SESSION  <q> QUIT  ...
@@ -3,7 +3,7 @@ source: zellij-integration-tests/tests/stacked_pane_list.rs
expression: normalized(&grid_snapshot)
---
Zellij (test)  Tab #1  + 
<↓↑> [ Pane #1 ]
member-command
> Pane #1
member-command
$ █
Ctrl + <g> LOCK  <p> PANE  <t> TAB  <n> RESIZE  <h> MOVE  <s> SEARCH  <o> SESSION  <q> QUIT  ...
@@ -3,8 +3,8 @@ source: zellij-integration-tests/tests/stacked_pane_list.rs
expression: normalized(&grid_snapshot)
---
Zellij (test)  Tab #1  + 
Pane #1
<↓↑> [ Pane #2 ]
Pane #1
> Pane #2
$ second-member
$
┌ Pane #3 ──────────────────────────────────────── PIN [ ] ┐
@@ -3,9 +3,9 @@ source: zellij-integration-tests/tests/stacked_pane_list.rs
expression: normalized(&grid_snapshot)
---
Zellij (test)  Tab #1  + 
Pane #1
Pane #2
<↓↑> [ Pane #3 ]
Pane #1
Pane #2
> Pane #3
$ third-member
$ █
Ctrl + <g> LOCK  <p> PANE  <t> TAB  <n> RESIZE  <h> MOVE  <s> SEARCH  <o> SESSION  <q> QUIT  ...
@@ -7,8 +7,8 @@ expression: normalized(&grid_snapshot)
$ first-member
$
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
<↓↑> [ Pane #3 ]
Pane #2
> Pane #3
Pane #2
$ third-member
$ █
Ctrl + <g> LOCK  <p> PANE  <t> TAB  <n> RESIZE  <h> MOVE  <s> SEARCH  <o> SESSION  <q> QUIT  ...
@@ -7,7 +7,7 @@ expression: normalized(&grid_snapshot)
$ first-member
$
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Pane #2
<↓↑> [ Pane #3 ]
Pane #2
> Pane #3
$ █
Ctrl + <g> LOCK  <p> PANE  <t> TAB  <n> RESIZE  <h> MOVE  <s> SEARCH  <o> SESSION  <q> QUIT  ...
@@ -3,9 +3,9 @@ source: zellij-integration-tests/tests/stacked_pane_list.rs
expression: normalized(&grid_snapshot)
---
Zellij (test)  Tab #1  + 
Pane #1
Pane #2
<↓↑> [ Pane #3 ]
Pane #1
Pane #2
> Pane #3
$ third-member
$
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
@@ -3,9 +3,9 @@ source: zellij-integration-tests/tests/stacked_pane_list.rs
expression: normalized(&grid_snapshot)
---
Zellij (test)  Tab #1  + 
Pane #1
Pane #2
<↓↑> [ Pane #3 ]
Pane #1
Pane #2
> Pane #3
$ third-member
$ █
Ctrl + <g> LOCK  <p> PANE  <t> TAB  <n> RESIZE  <h> MOVE  <s> SEARCH  <o> SESSION  <q> QUIT  ...
@@ -3,9 +3,8 @@ source: zellij-integration-tests/tests/stacked_pane_list.rs
expression: normalized(&grid_snapshot)
---
Zellij (test)  Tab #1  + 
Pane #1
<↓↑> [ Pane #2 ] [ SCROLL: 21/21 ]
$ line0
Pane #1
> Pane #2 [ SCROLL: 21/22 ]
line1
line2
line3
@@ -3,9 +3,9 @@ source: zellij-integration-tests/tests/stacked_pane_list.rs
expression: normalized(&middle_member_selected)
---
Zellij (test)  Tab #1  + 
Pane #1
<↓↑> [ Pane #2 ]
Pane #3
Pane #1
> Pane #2
Pane #3
$ second-member
$ █
Ctrl + <g> LOCK  <p> PANE  <t> TAB  <n> RESIZE  <h> MOVE  <s> SEARCH  <o> SESSION  <q> QUIT  ...
@@ -49,6 +49,10 @@ layout {
}
"#;
fn selected_entry(title: &str) -> String {
format!("> {}", title)
}
fn add_stacked_pane_and_wait_for_selected_entry(
zellij: &TestSession,
selected_entry_title: &str,
@@ -57,9 +61,9 @@ fn add_stacked_pane_and_wait_for_selected_entry(
zellij.send_stdin(&keys::key('s'));
let terminal = zellij.expect_pty_spawn();
terminal.output(PROMPT);
let bracketed_entry = format!("[ {} ]", selected_entry_title);
let selected_marker = selected_entry(selected_entry_title);
zellij.wait_until("stacked pane added and selected", |grid_snapshot| {
grid_snapshot.status_bar_appears() && grid_snapshot.contains(&bracketed_entry)
grid_snapshot.status_bar_appears() && grid_snapshot.contains(&selected_marker)
});
terminal
}
@@ -124,7 +128,7 @@ fn stack_renders_as_title_list_above_the_visible_pane() {
grid_snapshot.status_bar_appears()
&& grid_snapshot.contains("Pane #1")
&& grid_snapshot.contains("Pane #2")
&& grid_snapshot.contains("[ Pane #3 ]")
&& grid_snapshot.contains(&selected_entry("Pane #3"))
&& grid_snapshot.contains("third-member")
});
assert_snapshot!(normalized(&grid_snapshot));
@@ -143,7 +147,7 @@ fn a_layout_stack_renders_as_a_title_list() {
let grid_snapshot = zellij.wait_until("layout stack rendered as a list", |grid_snapshot| {
grid_snapshot.status_bar_appears()
&& grid_snapshot.contains("[ Pane #1 ]")
&& grid_snapshot.contains(&selected_entry("Pane #1"))
&& grid_snapshot.contains("Pane #2")
&& grid_snapshot.contains("Pane #3")
});
@@ -168,7 +172,7 @@ fn disabling_stacked_pane_list_restores_the_classic_stack() {
grid_snapshot.status_bar_appears()
&& grid_snapshot.contains("Pane #1")
&& grid_snapshot.contains("Pane #2")
&& !grid_snapshot.contains("[ Pane #2 ]")
&& !grid_snapshot.contains(&selected_entry("Pane #2"))
&& grid_snapshot.cursor_is_at(col(2).row(3))
});
assert_snapshot!(normalized(&grid_snapshot));
@@ -183,20 +187,21 @@ fn up_and_down_move_the_selection_through_the_list() {
zellij.send_stdin(&keys::alt('k'));
let middle_member_selected = zellij.wait_until("middle member swapped in", |grid_snapshot| {
grid_snapshot.contains("<g> LOCK")
&& grid_snapshot.contains("[ Pane #2 ]")
&& grid_snapshot.contains(&selected_entry("Pane #2"))
&& grid_snapshot.contains("second-member")
&& !grid_snapshot.contains("[ Pane #3 ]")
&& !grid_snapshot.contains(&selected_entry("Pane #3"))
});
assert_snapshot!(normalized(&middle_member_selected));
zellij.send_stdin(&keys::alt('k'));
zellij.wait_until("top member swapped in", |grid_snapshot| {
grid_snapshot.contains("[ Pane #1 ]") && grid_snapshot.contains("first-member")
grid_snapshot.contains(&selected_entry("Pane #1")) && grid_snapshot.contains("first-member")
});
zellij.send_stdin(&keys::alt('j'));
zellij.wait_until("selection moved back down", |grid_snapshot| {
grid_snapshot.contains("[ Pane #2 ]") && grid_snapshot.contains("second-member")
grid_snapshot.contains(&selected_entry("Pane #2"))
&& grid_snapshot.contains("second-member")
});
zellij.quit();
}
@@ -211,21 +216,23 @@ fn navigating_past_the_top_entry_leaves_the_stack() {
zellij.send_stdin(&keys::alt('k'));
zellij.wait_until("selection on the middle entry", |grid_snapshot| {
grid_snapshot.contains("[ Pane #3 ]")
grid_snapshot.contains(&selected_entry("Pane #3"))
});
zellij.send_stdin(&keys::alt('k'));
zellij.wait_until("selection on the top entry", |grid_snapshot| {
grid_snapshot.contains("[ Pane #2 ]")
grid_snapshot.contains(&selected_entry("Pane #2"))
});
zellij.send_stdin(&keys::alt('k'));
zellij.wait_until("focus left the stack to the pane above", |grid_snapshot| {
grid_snapshot.contains("[ Pane #2 ]") && grid_snapshot.cursor_is_at(col(2).row(2))
grid_snapshot.contains(&selected_entry("Pane #2"))
&& grid_snapshot.cursor_is_at(col(2).row(2))
});
zellij.send_stdin(&keys::alt('j'));
zellij.wait_until("focus re-entered the stack", |grid_snapshot| {
grid_snapshot.contains("[ Pane #2 ]") && grid_snapshot.cursor_is_at(col(2).row(15))
grid_snapshot.contains(&selected_entry("Pane #2"))
&& grid_snapshot.cursor_is_at(col(2).row(16))
});
zellij.quit();
}
@@ -242,7 +249,7 @@ fn closing_the_visible_member_promotes_its_neighbor() {
zellij.wait_until("third member closed, second promoted", |grid_snapshot| {
grid_snapshot.status_bar_appears()
&& !grid_snapshot.contains("Pane #3")
&& grid_snapshot.contains("[ Pane #2 ]")
&& grid_snapshot.contains(&selected_entry("Pane #2"))
&& grid_snapshot.contains("second-member")
});
assert_snapshot!(normalized(&grid_snapshot));
@@ -280,7 +287,7 @@ fn a_hidden_member_exiting_removes_its_entry() {
grid_snapshot.status_bar_appears()
&& !grid_snapshot.contains("Pane #2")
&& grid_snapshot.contains("Pane #1")
&& grid_snapshot.contains("[ Pane #3 ]")
&& grid_snapshot.contains(&selected_entry("Pane #3"))
});
assert_snapshot!(normalized(&grid_snapshot));
zellij.quit();
@@ -304,7 +311,7 @@ fn breaking_the_visible_member_out_promotes_and_moves_it_to_a_new_tab() {
let grid_snapshot = zellij.wait_until("stack shrank to two members", |grid_snapshot| {
grid_snapshot.status_bar_appears()
&& grid_snapshot.contains("Pane #1")
&& grid_snapshot.contains("[ Pane #2 ]")
&& grid_snapshot.contains(&selected_entry("Pane #2"))
&& !grid_snapshot.contains("Pane #3")
&& grid_snapshot.contains("second-member")
});
@@ -322,7 +329,7 @@ fn floating_the_visible_member_promotes_its_neighbor() {
let grid_snapshot = zellij.wait_until("member floated over the stack", |grid_snapshot| {
grid_snapshot.status_bar_appears()
&& grid_snapshot.contains("[ Pane #2 ]")
&& grid_snapshot.contains(&selected_entry("Pane #2"))
&& grid_snapshot.contains("Pane #3")
&& grid_snapshot.contains("third-member")
});
@@ -338,7 +345,8 @@ fn fullscreen_suspends_the_list_and_restores_it() {
zellij.send_stdin(&keys::ctrl('p'));
zellij.send_stdin(&keys::key('f'));
zellij.wait_until("stack member fullscreened", |grid_snapshot| {
grid_snapshot.contains("(FULLSCREEN)") && !grid_snapshot.contains("[ Pane #3 ]")
grid_snapshot.contains("(FULLSCREEN)")
&& !grid_snapshot.contains(&selected_entry("Pane #3"))
});
zellij.send_stdin(&keys::ctrl('p'));
@@ -348,7 +356,7 @@ fn fullscreen_suspends_the_list_and_restores_it() {
&& !grid_snapshot.contains("(FULLSCREEN)")
&& grid_snapshot.contains("Pane #1")
&& grid_snapshot.contains("Pane #2")
&& grid_snapshot.contains("[ Pane #3 ]")
&& grid_snapshot.contains(&selected_entry("Pane #3"))
&& grid_snapshot.contains("third-member")
});
assert_snapshot!(normalized(&grid_snapshot));
@@ -363,14 +371,14 @@ fn clicking_a_hidden_entry_swaps_it_in() {
build_three_member_stack(&zellij);
let grid_snapshot = zellij.wait_until("stack list rendered", |grid_snapshot| {
grid_snapshot.contains("Pane #1") && grid_snapshot.contains("[ Pane #3 ]")
grid_snapshot.contains("Pane #1") && grid_snapshot.contains(&selected_entry("Pane #3"))
});
let (entry_column, entry_line) = entry_click_coordinates(&grid_snapshot, "Pane #1");
zellij.send_stdin(&sgr_left_click(entry_column, entry_line));
let swapped_in = zellij.wait_until("clicked member swapped in", |grid_snapshot| {
grid_snapshot.contains("<g> LOCK")
&& grid_snapshot.contains("[ Pane #1 ]")
&& grid_snapshot.contains(&selected_entry("Pane #1"))
&& grid_snapshot.contains("first-member")
});
assert_snapshot!(normalized(&swapped_in));
@@ -385,7 +393,7 @@ fn alt_clicking_a_hidden_entry_marks_it_without_selecting() {
build_three_member_stack(&zellij);
let grid_snapshot = zellij.wait_until("stack list rendered", |grid_snapshot| {
grid_snapshot.contains("Pane #1") && grid_snapshot.contains("[ Pane #3 ]")
grid_snapshot.contains("Pane #1") && grid_snapshot.contains(&selected_entry("Pane #3"))
});
let (entry_column, entry_line) = entry_click_coordinates(&grid_snapshot, "Pane #1");
zellij.send_stdin(&sgr_alt_left_click(entry_column, entry_line));
@@ -393,7 +401,8 @@ fn alt_clicking_a_hidden_entry_marks_it_without_selecting() {
zellij.wait_until(
"hidden member marked, selection unchanged",
|grid_snapshot| {
grid_snapshot.contains("GROUP ACTIONS") && grid_snapshot.contains("[ Pane #3 ]")
grid_snapshot.contains("GROUP ACTIONS")
&& grid_snapshot.contains(&selected_entry("Pane #3"))
},
);
zellij.quit();
@@ -435,13 +444,13 @@ fn entries_share_a_uniform_width_sized_by_the_widest_title() {
let grid_snapshot = zellij.wait_until("mixed-width entries rendered", |grid_snapshot| {
grid_snapshot.status_bar_appears()
&& grid_snapshot.contains("member-command")
&& grid_snapshot.contains("[ Pane #1")
&& grid_snapshot.contains(&selected_entry("Pane #1"))
});
let lines = grid_snapshot.lines();
let selected_entry_line = lines
.iter()
.find(|line| line.contains("[ Pane #1"))
.find(|line| line.contains(&selected_entry("Pane #1")))
.expect("selected entry is on a header row");
let hidden_entry_line = lines
.iter()
@@ -452,14 +461,6 @@ fn entries_share_a_uniform_width_sized_by_the_widest_title() {
let hidden_title_column = display_column_of(hidden_entry_line, "member-command")
.expect("hidden title is on the line");
assert_eq!(selected_title_column, hidden_title_column);
let widest_title_width = "member-command".chars().count();
let closing_bracket_column =
display_column_of(selected_entry_line, "]").expect("selected entry has a closing bracket");
assert_eq!(
closing_bracket_column,
selected_title_column + widest_title_width + 1
);
assert_snapshot!(normalized(&grid_snapshot));
zellij.quit();
}
@@ -489,7 +490,7 @@ fn a_hidden_held_members_exit_code_shows_on_its_entry() {
|grid_snapshot| {
grid_snapshot.status_bar_appears()
&& grid_snapshot.contains("member-command")
&& grid_snapshot.contains("[ Pane #1")
&& grid_snapshot.contains(&selected_entry("Pane #1"))
},
);
@@ -497,7 +498,8 @@ fn a_hidden_held_members_exit_code_shows_on_its_entry() {
let grid_snapshot =
zellij.wait_until("exit code rendered on the hidden entry", |grid_snapshot| {
grid_snapshot.contains("EXIT CODE: 2") && grid_snapshot.contains("[ Pane #1")
grid_snapshot.contains("EXIT CODE: 2")
&& grid_snapshot.contains(&selected_entry("Pane #1"))
});
assert_snapshot!(normalized(&grid_snapshot));
zellij.quit();
@@ -523,7 +525,7 @@ fn the_visible_members_scroll_state_shows_on_its_entry() {
let grid_snapshot = zellij.wait_until("scroll indicator on the entry row", |grid_snapshot| {
grid_snapshot.contains("SCROLL: ")
&& !grid_snapshot.contains("SCROLL: 0/")
&& grid_snapshot.contains("[ Pane #2 ]")
&& grid_snapshot.contains(&selected_entry("Pane #2"))
&& grid_snapshot.contains("PgDn|PgUp")
});
assert_snapshot!(normalized(&grid_snapshot));
@@ -589,7 +591,7 @@ fn a_scrollback_editor_follows_its_member_through_selection_changes() {
editor.exit(Some(0));
zellij.wait_until("editor closed back into its member", |grid_snapshot| {
grid_snapshot.contains("[ Pane #2 ]")
grid_snapshot.contains(&selected_entry("Pane #2"))
&& grid_snapshot.contains("second-member")
&& !grid_snapshot.contains("editor-open")
});
@@ -613,7 +615,7 @@ fn a_hidden_scrollback_editor_pair_survives_fullscreen() {
zellij.send_stdin(&keys::ctrl('p'));
zellij.send_stdin(&keys::key('f'));
zellij.wait_until("list re-formed after fullscreen", |grid_snapshot| {
grid_snapshot.contains("[ Pane #1") && grid_snapshot.contains("first-member")
grid_snapshot.contains(&selected_entry("Pane #1")) && grid_snapshot.contains("first-member")
});
zellij.send_stdin(&keys::alt('j'));
@@ -623,7 +625,8 @@ fn a_hidden_scrollback_editor_pair_survives_fullscreen() {
editor.exit(Some(0));
zellij.wait_until("editor closed back into its member", |grid_snapshot| {
grid_snapshot.contains("[ Pane #2 ]") && grid_snapshot.contains("second-member")
grid_snapshot.contains(&selected_entry("Pane #2"))
&& grid_snapshot.contains("second-member")
});
zellij.quit();
}
@@ -644,7 +647,8 @@ fn closing_a_hidden_editor_member_substitutes_its_parked_pane() {
zellij.send_stdin(&keys::alt('j'));
zellij.wait_until("substituted member swapped in", |grid_snapshot| {
grid_snapshot.contains("[ Pane #2 ]") && grid_snapshot.contains("second-member")
grid_snapshot.contains(&selected_entry("Pane #2"))
&& grid_snapshot.contains("second-member")
});
zellij.quit();
}
@@ -663,7 +667,7 @@ fn splitting_a_new_pane_reforms_the_list_around_it() {
grid_snapshot.contains("<g> LOCK")
&& grid_snapshot.contains("Pane #1")
&& grid_snapshot.contains("Pane #2")
&& grid_snapshot.contains("[ Pane #3 ]")
&& grid_snapshot.contains(&selected_entry("Pane #3"))
&& grid_snapshot.contains("Pane #4")
});
assert_snapshot!(normalized(&grid_snapshot));
@@ -678,12 +682,12 @@ fn resizing_the_visible_member_keeps_the_list() {
let _lower_terminal = split_down_and_wait_for_prompt(&zellij);
add_stacked_pane_and_wait_for_selected_entry(&zellij, "Pane #3");
let before_resize = zellij.wait_until("list settled before resize", |grid_snapshot| {
grid_snapshot.contains("<g> LOCK") && grid_snapshot.contains("[ Pane #3 ]")
grid_snapshot.contains("<g> LOCK") && grid_snapshot.contains(&selected_entry("Pane #3"))
});
let entry_row_before = before_resize
.lines()
.iter()
.position(|line| line.contains("[ Pane #3 ]"))
.position(|line| line.contains(&selected_entry("Pane #3")))
.expect("selected entry is on a header row");
zellij.send_stdin(&keys::ctrl('n'));
@@ -696,7 +700,7 @@ fn resizing_the_visible_member_keeps_the_list() {
&& grid_snapshot
.lines()
.iter()
.position(|line| line.contains("[ Pane #3 ]"))
.position(|line| line.contains(&selected_entry("Pane #3")))
.map_or(false, |entry_row| entry_row < entry_row_before)
});
assert_snapshot!(normalized(&grid_snapshot));
@@ -726,7 +730,7 @@ fn moving_the_visible_member_reorders_the_list() {
grid_snapshot.contains("<g> LOCK")
&& grid_snapshot.contains("third-member")
&& matches!(
(row_of("[ Pane #3 ]"), row_of("Pane #2")),
(row_of(&selected_entry("Pane #3")), row_of("Pane #2")),
(Some(selected_row), Some(hidden_row)) if selected_row < hidden_row
)
});
@@ -755,7 +759,7 @@ fn a_stack_list_survives_session_resurrection() {
grid_snapshot.status_bar_appears()
&& grid_snapshot.contains("Pane #1")
&& grid_snapshot.contains("Pane #2")
&& grid_snapshot.contains("[ Pane #3 ]")
&& grid_snapshot.contains(&selected_entry("Pane #3"))
});
assert_snapshot!(normalized(&grid_snapshot));
zellij.quit();
@@ -2,7 +2,7 @@
use zellij_integration_tests::{
claim_first_terminal_and_wait_for_prompt, keys, split_right_and_wait_for_prompt, FakePtyHandle,
Size, TestRunner, TestSession, PROMPT,
GridSnapshot, Size, TestRunner, TestSession, PROMPT,
};
const FOCUSED_PANE_COLUMN: usize = 90;
@@ -31,6 +31,10 @@ fn sgr_motion(column: usize, line: usize) -> Vec<u8> {
format!("\u{1b}[<35;{};{}M", column, line).into_bytes()
}
fn tab_bar_line(grid_snapshot: &GridSnapshot) -> String {
grid_snapshot.lines().first().cloned().unwrap_or_default()
}
fn two_pane_session_with_handles() -> (TestSession, FakePtyHandle, FakePtyHandle) {
let zellij = start_zellij_with_mouse();
let left_terminal = claim_first_terminal_and_wait_for_prompt(&zellij);
@@ -67,19 +71,19 @@ fn full_frame_two_pane_session(cols: usize) -> TestSession {
}
#[test]
fn hovering_a_pane_shows_a_hint_on_the_status_bar() {
fn hovering_a_pane_shows_a_hint_on_the_tab_bar() {
let mut zellij = two_pane_session();
zellij.send_stdin(&sgr_motion(FOCUSED_PANE_COLUMN, HOVER_LINE));
zellij.wait_until(
"resize hint shown when hovering the focused pane",
|grid_snapshot| grid_snapshot.contains("resize"),
"resize hint shown on the tab bar when hovering the focused pane",
|grid_snapshot| tab_bar_line(grid_snapshot).contains("resize"),
);
zellij.send_stdin(&sgr_motion(OTHER_PANE_COLUMN, HOVER_LINE));
zellij.wait_until(
"group hint shown when hovering the other pane",
|grid_snapshot| grid_snapshot.contains("group"),
"group hint shown on the tab bar when hovering the other pane",
|grid_snapshot| tab_bar_line(grid_snapshot).contains("group"),
);
zellij.quit();
@@ -143,13 +147,19 @@ fn hint_only_re_fires_when_entering_a_different_pane() {
}
#[test]
fn full_frame_help_renders_on_the_pane_not_the_status_bar() {
fn full_frame_help_renders_on_the_pane_not_the_tab_bar() {
let mut zellij = full_frame_two_pane_session(120);
zellij.send_stdin(&sgr_motion(FOCUSED_PANE_COLUMN, HOVER_LINE));
let grid_snapshot = zellij.wait_until("resize help drawn on the pane frame", |grid_snapshot| {
grid_snapshot.contains("to resize")
});
let tab_bar = tab_bar_line(&grid_snapshot);
assert!(
!tab_bar.contains("resize"),
"in full-frame mode the resize help belongs on the pane frame, not the tab bar:\n{}",
grid_snapshot.text
);
let status_bar = grid_snapshot.lines().last().cloned().unwrap();
assert!(
!status_bar.contains("resize"),
@@ -161,20 +171,55 @@ fn full_frame_help_renders_on_the_pane_not_the_status_bar() {
}
#[test]
fn resize_hint_shortens_when_the_status_bar_narrows() {
fn resize_hint_shortens_when_the_tab_bar_narrows() {
let mut zellij = two_pane_session();
zellij.send_stdin(&sgr_motion(FOCUSED_PANE_COLUMN, HOVER_LINE));
zellij.wait_until(
"full-width status bar shows the long resize hint",
|grid_snapshot| grid_snapshot.contains("to resize"),
"full-width tab bar shows the long resize hint",
|grid_snapshot| tab_bar_line(grid_snapshot).contains("to resize"),
);
zellij.resize(Size { cols: 46, rows: 24 });
zellij.resize(Size { cols: 68, rows: 24 });
zellij.wait_until(
"narrowed status bar shortens the resize hint",
"narrowed tab bar shortens the resize hint",
|grid_snapshot| {
grid_snapshot.contains("drag borders") && !grid_snapshot.contains("to resize")
let tab_bar = tab_bar_line(grid_snapshot);
tab_bar.contains("drag borders") && !tab_bar.contains("to resize")
},
);
zellij.resize(Size { cols: 50, rows: 24 });
zellij.wait_until(
"very narrow tab bar drops the hint and keeps the tabs",
|grid_snapshot| !grid_snapshot.contains("drag borders") && grid_snapshot.tab_bar_appears(),
);
zellij.quit();
}
#[test]
fn hint_replaces_the_swap_layout_indicator_until_dismissed() {
let mut zellij = two_pane_session();
zellij.wait_until("swap layout indicator shown", |grid_snapshot| {
tab_bar_line(grid_snapshot).contains("BASE")
});
zellij.send_stdin(&sgr_motion(FOCUSED_PANE_COLUMN, HOVER_LINE));
zellij.wait_until(
"hint takes over the swap layout indicator slot",
|grid_snapshot| {
let tab_bar = tab_bar_line(grid_snapshot);
tab_bar.contains("resize") && !tab_bar.contains("BASE")
},
);
zellij.send_stdin(b"x");
zellij.wait_until(
"swap layout indicator returns after the hint is dismissed",
|grid_snapshot| {
let tab_bar = tab_bar_line(grid_snapshot);
tab_bar.contains("BASE") && !tab_bar.contains("resize")
},
);