feat: scroll_down_many & scroll_up_many removed.

`scroll_down_one`/`scroll_up_one` renamed `scroll_up`/`scroll_down`
This commit is contained in:
Jack Wills
2025-09-13 09:52:52 +00:00
parent 487c3faf96
commit 52a04ec1d0
14 changed files with 49 additions and 139 deletions
+1 -1
View File
@@ -110,7 +110,7 @@ In application controls, these, amongst many other settings, can be customized w
| button| result|
|--|--|
| ```( tab )``` or ```( shift+tab )``` | Change panel, clicking on a panel also changes the selected panel.|
| ```( ↑ ↓ )``` or ```( j k )``` or ```( PgUp PgDown )``` or ```( Home End )```| Scroll line in selected panel - mouse wheel will also scroll.|
| ```( ↑ ↓ )``` or ```( j k )``` or ```( Home End )```| Scroll line in selected panel - mouse wheel will also scroll.|
| ```( ← → )``` | When logs panel selected, scroll horizontally across the text of the logs.|
| ```( ctrl )``` | Increase scroll speed, used in conjuction with scroll keys.|
| ```( enter )```| Run selected docker command.|
+3 -15
View File
@@ -75,14 +75,8 @@
"save_logs": [
"s"
],
// TODO "scroll_down_many" will be removed in the next release
// Scroll down a list by many
"scroll_down_many": [
"pagedown"
],
// TODO rename in next release
// Scroll down a list by one item
"scroll_down_one": [
"scroll_down": [
"down",
"j"
],
@@ -90,20 +84,14 @@
"scroll_end": [
"end"
],
// Modifier to scroll by 10 lines isntead of one, used in conjunction with scroll_up_x/scroll_down_x
// Modifier to scroll by 10 lines instead of one, used in conjunction with scroll_up/scroll_down
"scroll_many": ["control"],
// Scroll up to the start of a list
"scroll_start": [
"home"
],
// TODO "scroll_up_many" will be removed in the next release
// Scroll up a list by many
"scroll_up_many": [
"pageup"
],
// TODO rename in next release
// Scroll up a list by one item
"scroll_up_one": [
"scroll_up": [
"up",
"k"
],
+3 -11
View File
@@ -76,25 +76,17 @@ filter_mode = ["/", "F1"]
quit = ["q"]
# Save logs of selected container to file on disk
save_logs = ["s"]
# TODO "scroll_down_many" will be removed in the next release
# scroll down a list by many
scroll_down_many = ["pagedown"]
# TODO rename in next release
# scroll down a list by one item
scroll_down_one = ["down", "j"]
scroll_down = ["down", "j"]
# scroll down to the end of a list
scroll_end = ["end"]
# Modifier to scroll by 10 lines isntead of one, used in conjunction with scroll_up_x/scroll_down_x
# Modifier to scroll by 10 lines instead of one, used in conjunction with scroll_up/scroll_down
scroll_many = ["control"]
# scroll up to the start of a list
scroll_start = ["home"]
# TODO "scroll_up_many" will be removed in the next release
# scroll up a list by many
scroll_up_many = ["pageup"]
# TODO rename in next release
# scroll up a list by one item
scroll_up_one = ["up", "k"]
scroll_up = ["up", "k"]
# Horizontal scroll of the logs
log_scroll_forward = ["right"]
log_scroll_back = ["left"]
+3 -11
View File
@@ -76,25 +76,17 @@ filter_mode = ["/", "F1"]
quit = ["q"]
# Save logs of selected container to file on disk
save_logs = ["s"]
# TODO "scroll_down_many" will be removed in the next release
# scroll down a list by many
scroll_down_many = ["pagedown"]
# TODO rename in next release
# scroll down a list by one item
scroll_down_one = ["down", "j"]
scroll_down = ["down", "j"]
# scroll down to the end of a list
scroll_end = ["end"]
# Modifier to scroll by 10 lines isntead of one, used in conjunction with scroll_up_x/scroll_down_x
# Modifier to scroll by 10 lines instead of one, used in conjunction with scroll_up/scroll_down
scroll_many = ["control"]
# scroll up to the start of a list
scroll_start = ["home"]
# TODO "scroll_up_many" will be removed in the next release
# scroll up a list by many
scroll_up_many = ["pageup"]
# TODO rename in next release
# scroll up a list by one item
scroll_up_one = ["up", "k"]
scroll_up = ["up", "k"]
# Horizontal scroll of the logs
log_scroll_forward = ["right"]
log_scroll_back = ["left"]
+14 -42
View File
@@ -49,16 +49,10 @@ optional_config_struct!(
log_scroll_back,
quit,
save_logs,
// TODO remove in next release
scroll_down_many,
// TODO rename in next release
scroll_down_one,
scroll_down,
scroll_end,
scroll_start,
// TODO remove in next release
scroll_up_many,
// TODO rename in next release
scroll_up_one,
scroll_up,
select_next_panel,
select_previous_panel,
sort_by_name,
@@ -90,16 +84,10 @@ config_struct!(
log_scroll_back,
quit,
save_logs,
// TODO remove in next release
scroll_down_many,
// TODO rename in next release
scroll_down_one,
scroll_down,
scroll_end,
scroll_start,
// TODO remove in next release
scroll_up_many,
// TODO rename in next release
scroll_up_one,
scroll_up,
select_next_panel,
select_previous_panel,
sort_by_name,
@@ -132,17 +120,13 @@ impl Keymap {
log_scroll_forward: (KeyCode::Right, None),
quit: (KeyCode::Char('q'), None),
save_logs: (KeyCode::Char('s'), None),
// TODO remove in next release
scroll_down_many: (KeyCode::PageDown, None),
// TODO rename in next release
scroll_down_one: (KeyCode::Down, Some(KeyCode::Char('j'))),
scroll_down: (KeyCode::Down, Some(KeyCode::Char('j'))),
scroll_end: (KeyCode::End, None),
scroll_start: (KeyCode::Home, None),
scroll_many: KeyModifiers::CONTROL,
// TODO remove in next release
scroll_up_many: (KeyCode::PageUp, None),
// TODO rename in next release
scroll_up_one: (KeyCode::Up, Some(KeyCode::Char('k'))),
scroll_up: (KeyCode::Up, Some(KeyCode::Char('k'))),
select_next_panel: (KeyCode::Tab, None),
select_previous_panel: (KeyCode::BackTab, None),
sort_by_cpu: (KeyCode::Char('4'), None),
@@ -216,16 +200,10 @@ impl From<Option<ConfigKeymap>> for Keymap {
update_keymap(ck.force_redraw, &mut keymap.force_redraw, &mut clash);
update_keymap(ck.quit, &mut keymap.quit, &mut clash);
update_keymap(ck.save_logs, &mut keymap.save_logs, &mut clash);
update_keymap(
ck.scroll_down_many,
&mut keymap.scroll_down_many,
&mut clash,
);
update_keymap(ck.scroll_down_one, &mut keymap.scroll_down_one, &mut clash);
update_keymap(ck.scroll_down, &mut keymap.scroll_down, &mut clash);
update_keymap(ck.scroll_end, &mut keymap.scroll_end, &mut clash);
update_keymap(ck.scroll_start, &mut keymap.scroll_start, &mut clash);
update_keymap(ck.scroll_up_many, &mut keymap.scroll_up_many, &mut clash);
update_keymap(ck.scroll_up_one, &mut keymap.scroll_up_one, &mut clash);
update_keymap(ck.scroll_up, &mut keymap.scroll_up, &mut clash);
update_keymap(
ck.log_scroll_forward,
&mut keymap.log_scroll_forward,
@@ -422,13 +400,11 @@ mod tests {
log_section_toggle: None,
quit: None,
save_logs: None,
scroll_down_many: None,
scroll_down_one: None,
scroll_down: None,
scroll_end: None,
scroll_start: None,
scroll_many: None,
scroll_up_many: None,
scroll_up_one: None,
scroll_up: None,
select_next_panel: None,
select_previous_panel: None,
sort_by_cpu: None,
@@ -469,13 +445,11 @@ mod tests {
log_section_toggle: gen_v(("u", "v")),
quit: gen_v(("w", "x")),
save_logs: gen_v(("y", "z")),
scroll_down_many: gen_v(("1", "2")),
scroll_down_one: gen_v(("3", "4")),
scroll_down: gen_v(("3", "4")),
scroll_end: gen_v(("5", "6")),
scroll_many: Some(vec!["alt".to_owned()]),
scroll_start: gen_v(("7", "8")),
scroll_up_many: gen_v(("9", "0")),
scroll_up_one: gen_v(("F1", "F2")),
scroll_up: gen_v(("F1", "F2")),
select_next_panel: gen_v(("F3", "F4")),
select_previous_panel: gen_v(("F5", "F6")),
sort_by_cpu: gen_v(("F7", "F8")),
@@ -508,12 +482,10 @@ mod tests {
log_scroll_back: (KeyCode::Char('s'), Some(KeyCode::Char('t'))),
quit: (KeyCode::Char('w'), Some(KeyCode::Char('x'))),
save_logs: (KeyCode::Char('y'), Some(KeyCode::Char('z'))),
scroll_down_many: (KeyCode::Char('1'), Some(KeyCode::Char('2'))),
scroll_down_one: (KeyCode::Char('3'), Some(KeyCode::Char('4'))),
scroll_down: (KeyCode::Char('3'), Some(KeyCode::Char('4'))),
scroll_end: (KeyCode::Char('5'), Some(KeyCode::Char('6'))),
scroll_start: (KeyCode::Char('7'), Some(KeyCode::Char('8'))),
scroll_up_many: (KeyCode::Char('9'), Some(KeyCode::Char('0'))),
scroll_up_one: (KeyCode::F(1), Some(KeyCode::F(2))),
scroll_up: (KeyCode::F(1), Some(KeyCode::F(2))),
select_next_panel: (KeyCode::F(3), Some(KeyCode::F(4))),
select_previous_panel: (KeyCode::F(5), Some(KeyCode::F(6))),
sort_by_name: (KeyCode::Up, Some(KeyCode::Down)),
+4 -20
View File
@@ -569,34 +569,18 @@ impl InputHandler {
self.scroll_end_key();
}
_ if self.keymap.scroll_up_one.0 == key_code
|| self.keymap.scroll_up_one.1 == Some(key_code) =>
_ if self.keymap.scroll_up.0 == key_code
|| self.keymap.scroll_up.1 == Some(key_code) =>
{
self.scroll_up(modifier);
}
_ if self.keymap.scroll_up_many.0 == key_code
|| self.keymap.scroll_up_many.1 == Some(key_code) =>
{
for _ in 0..=6 {
self.scroll_up(modifier);
}
}
_ if self.keymap.scroll_down_one.0 == key_code
|| self.keymap.scroll_down_one.1 == Some(key_code) =>
_ if self.keymap.scroll_down.0 == key_code
|| self.keymap.scroll_down.1 == Some(key_code) =>
{
self.scroll_down(modifier);
}
_ if self.keymap.scroll_down_many.0 == key_code
|| self.keymap.scroll_down_many.1 == Some(key_code) =>
{
for _ in 0..=6 {
self.scroll_down(modifier);
}
}
_ if self.keymap.filter_mode.0 == key_code
|| self.keymap.filter_mode.1 == Some(key_code) =>
{
+10 -28
View File
@@ -106,8 +106,6 @@ impl HelpInfo {
or(),
button_item("j k"),
or(),
button_item("PgUp PgDown"),
or(),
button_item("Home End"),
button_desc("scroll vertically"),
]),
@@ -277,10 +275,8 @@ impl HelpInfo {
let descriptions = [
or_secondary(km.select_next_panel, "select next panel"),
or_secondary(km.select_previous_panel, "select previous panel"),
or_secondary(km.scroll_down_one, "scroll list down by one"),
or_secondary(km.scroll_up_one, "scroll list up by one"),
or_secondary(km.scroll_down_many, "scroll list down by many"),
or_secondary(km.scroll_up_many, "scroll list by up many"),
or_secondary(km.scroll_down, "scroll list down by one"),
or_secondary(km.scroll_up, "scroll list up by one"),
or_secondary(km.scroll_end, "scroll list to end"),
or_secondary(km.scroll_start, "scroll list to start"),
or_secondary(km.log_scroll_forward, "horizontal scroll logs right"),
@@ -482,14 +478,6 @@ mod tests {
for (row_index, result_row) in get_result(&setup) {
for (result_cell_index, result_cell) in result_row.iter().enumerate() {
println!(
"{} {} {} {} {}",
row_index,
result_cell_index,
result_cell.symbol(),
result_cell.bg,
result_cell.fg
);
match (row_index, result_cell_index) {
// first & last row, and first & last char on each row, is reset/reset, making sure that the help info is centered in the given area
(0 | 36, _) | (0..=35, 0 | 86) => {
@@ -505,7 +493,7 @@ mod tests {
(2..=10, 2..=85)
| (12, 19..=66)
| (14, 2..=10 | 13..=27)
| (15, 2..=10 | 13..=21 | 24..=40 | 43..=56)
| (15, 2..=10 | 13..=21 | 24..=37)
| (16 | 27 | 29, 2..=10)
| (17, 2..=11)
| (18 | 26, 2..=12)
@@ -574,7 +562,7 @@ mod tests {
(2..=10, 2..=85)
| (12, 19..=66)
| (14, 2..=10 | 13..=27)
| (15, 2..=10 | 13..=21 | 24..=40 | 43..=56)
| (15, 2..=10 | 13..=21 | 24..=37)
| (16 | 27 | 29, 2..=10)
| (17, 2..=11)
| (18 | 26, 2..=12)
@@ -618,13 +606,11 @@ mod tests {
log_section_toggle: (KeyCode::Char('k'), None),
quit: (KeyCode::Char('l'), None),
save_logs: (KeyCode::Char('m'), None),
scroll_down_many: (KeyCode::Char('n'), None),
scroll_down_one: (KeyCode::Char('o'), None),
scroll_down: (KeyCode::Char('o'), None),
scroll_end: (KeyCode::Char('p'), None),
scroll_many: KeyModifiers::ALT,
scroll_start: (KeyCode::Char('q'), None),
scroll_up_many: (KeyCode::Char('r'), None),
scroll_up_one: (KeyCode::Char('s'), None),
scroll_up: (KeyCode::Char('s'), None),
select_next_panel: (KeyCode::Char('t'), None),
select_previous_panel: (KeyCode::Char('u'), None),
sort_by_cpu: (KeyCode::Char('v'), None),
@@ -670,13 +656,11 @@ mod tests {
log_section_toggle: (KeyCode::Char('j'), Some(KeyCode::Char('J'))),
quit: (KeyCode::Char('k'), Some(KeyCode::Char('K'))),
save_logs: (KeyCode::Char('l'), Some(KeyCode::Char('L'))),
scroll_down_many: (KeyCode::Char('m'), Some(KeyCode::Char('M'))),
scroll_down_one: (KeyCode::Char('n'), Some(KeyCode::Char('N'))),
scroll_down: (KeyCode::Char('n'), Some(KeyCode::Char('N'))),
scroll_end: (KeyCode::Char('o'), Some(KeyCode::Char('O'))),
scroll_many: KeyModifiers::ALT,
scroll_start: (KeyCode::Char('p'), Some(KeyCode::Char('P'))),
scroll_up_many: (KeyCode::Char('q'), Some(KeyCode::Char('Q'))),
scroll_up_one: (KeyCode::Char('r'), Some(KeyCode::Char('R'))),
scroll_up: (KeyCode::Char('r'), Some(KeyCode::Char('R'))),
select_next_panel: (KeyCode::Char('s'), Some(KeyCode::Char('S'))),
select_previous_panel: (KeyCode::Char('t'), Some(KeyCode::Char('T'))),
sort_by_cpu: (KeyCode::Char('u'), Some(KeyCode::Char('U'))),
@@ -722,13 +706,11 @@ mod tests {
log_section_toggle: (KeyCode::Char('k'), Some(KeyCode::Char('K'))),
quit: (KeyCode::Char('l'), None),
save_logs: (KeyCode::Char('m'), Some(KeyCode::Char('M'))),
scroll_down_many: (KeyCode::Char('n'), None),
scroll_down_one: (KeyCode::Char('o'), Some(KeyCode::Char('O'))),
scroll_down: (KeyCode::Char('o'), Some(KeyCode::Char('O'))),
scroll_end: (KeyCode::Char('p'), None),
scroll_many: KeyModifiers::ALT,
scroll_start: (KeyCode::Char('q'), Some(KeyCode::Char('Q'))),
scroll_up_many: (KeyCode::Char('r'), None),
scroll_up_one: (KeyCode::Char('s'), Some(KeyCode::Char('S'))),
scroll_up: (KeyCode::Char('s'), Some(KeyCode::Char('S'))),
select_next_panel: (KeyCode::Char('t'), None),
select_previous_panel: (KeyCode::Char('u'), Some(KeyCode::Char('U'))),
sort_by_cpu: (KeyCode::Char('v'), None),
@@ -17,7 +17,7 @@ expression: setup.terminal.backend()
" │ A simple tui to view & control docker containers │ "
" │ │ "
" │ ( tab ) or ( shift+tab ) change panels │ "
" │ ( ↑ ↓ ) or ( j k ) or ( PgUp PgDown ) or ( Home End ) scroll vertically │ "
" │ ( ↑ ↓ ) or ( j k ) or ( Home End ) scroll vertically │ "
" │ ( ← → ) horizontal scroll across logs │ "
" │ ( ctrl ) increase scroll speed, used in conjuction scroll keys │ "
" │ ( enter ) send docker container command │ "
@@ -17,7 +17,7 @@ expression: setup.terminal.backend()
" │ A simple tui to view & control docker containers │ "
" │ │ "
" │ ( tab ) or ( shift+tab ) change panels │ "
" │ ( ↑ ↓ ) or ( j k ) or ( PgUp PgDown ) or ( Home End ) scroll vertically │ "
" │ ( ↑ ↓ ) or ( j k ) or ( Home End ) scroll vertically │ "
" │ ( ← → ) horizontal scroll across logs │ "
" │ ( ctrl ) increase scroll speed, used in conjuction scroll keys │ "
" │ ( enter ) send docker container command │ "
@@ -19,8 +19,6 @@ expression: setup.terminal.backend()
" │ ( u ) select previous panel │ "
" │ ( o ) scroll list down by one │ "
" │ ( s ) scroll list up by one │ "
" │ ( n ) scroll list down by many │ "
" │ ( r ) scroll list by up many │ "
" │ ( p ) scroll list to end │ "
" │ ( q ) scroll list to start │ "
" │ ( h ) horizontal scroll logs right │ "
@@ -51,4 +49,6 @@ expression: setup.terminal.backend()
" │ │ "
" │ currently an early work in progress, all and any input appreciated │ "
" │ https://github.com/mrjackwills/oxker │ "
" │ │ "
" │ │ "
" ╰────────────────────────────────────────────────────────────────────────────────────╯ "
@@ -19,8 +19,6 @@ expression: setup.terminal.backend()
" │ ( t ) or ( T ) select previous panel │ "
" │ ( n ) or ( N ) scroll list down by one │ "
" │ ( r ) or ( R ) scroll list up by one │ "
" │ ( m ) or ( M ) scroll list down by many │ "
" │ ( q ) or ( Q ) scroll list by up many │ "
" │ ( o ) or ( O ) scroll list to end │ "
" │ ( p ) or ( P ) scroll list to start │ "
" │ ( g ) or ( G ) horizontal scroll logs right │ "
@@ -51,4 +49,6 @@ expression: setup.terminal.backend()
" │ │ "
" │ currently an early work in progress, all and any input appreciated │ "
" │ https://github.com/mrjackwills/oxker │ "
" │ │ "
" │ │ "
" ╰────────────────────────────────────────────────────────────────────────────────────────────────────╯ "
@@ -19,8 +19,6 @@ expression: setup.terminal.backend()
" │ ( u ) or ( U ) select previous panel │ "
" │ ( o ) or ( O ) scroll list down by one │ "
" │ ( s ) or ( S ) scroll list up by one │ "
" │ ( n ) scroll list down by many │ "
" │ ( r ) scroll list by up many │ "
" │ ( p ) scroll list to end │ "
" │ ( q ) or ( Q ) scroll list to start │ "
" │ ( h ) horizontal scroll logs right │ "
@@ -51,4 +49,6 @@ expression: setup.terminal.backend()
" │ │ "
" │ currently an early work in progress, all and any input appreciated │ "
" │ https://github.com/mrjackwills/oxker │ "
" │ │ "
" │ │ "
" ╰────────────────────────────────────────────────────────────────────────────────────────────╯ "
@@ -18,7 +18,7 @@ expression: setup.terminal.backend()
" │ logs timezone: Asia/Tokyo │ "
" │ │ "
" │ ( tab ) or ( shift+tab ) change panels │ "
" │ ( ↑ ↓ ) or ( j k ) or ( PgUp PgDown ) or ( Home End ) scroll vertically │ "
" │ ( ↑ ↓ ) or ( j k ) or ( Home End ) scroll vertically │ "
" │ ( ← → ) horizontal scroll across logs │ "
" │ ( ctrl ) increase scroll speed, used in conjuction scroll keys │ "
" │ ( enter ) send docker container command │ "
@@ -18,7 +18,7 @@ expression: setup.terminal.backend()
"│ │ A simple tui to view & control docker containers │ │"
"│ │ │ │"
"│ │ ( tab ) or ( shift+tab ) change panels │ │"
"│ │ ( ↑ ↓ ) or ( j k ) or ( PgUp PgDown ) or ( Home End ) scroll vertically │ │"
"│ │ ( ↑ ↓ ) or ( j k ) or ( Home End ) scroll vertically │ │"
"│ │ ( ← → ) horizontal scroll across logs │ │"
"│ │ ( ctrl ) increase scroll speed, used in conjuction scroll keys │ │"
"│ │ ( enter ) send docker container command │ │"