diff options
author | Patrick Sier <pjsier@users.noreply.github.com> | 2020-10-15 08:28:45 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-15 15:28:45 +0200 |
commit | f330d852848305b002200e53cee3e10de8e4fb6a (patch) | |
tree | 52b74ad4fa0ab7032d0eeb501ef640e9db81d723 | |
parent | 9f94e941fbadc83025384ef3aea44a4544e8736d (diff) |
feat(ui): only show small files legend when visible (#75)
* feat: only show small files legend when visible
* refactor: add render_small_files_legend function
35 files changed, 123 insertions, 77 deletions
diff --git a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__clear_selection_when_moving_off_screen_edges.snap b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__clear_selection_when_moving_off_screen_edges.snap index ee4ed28..d65a9f8 100644 --- a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__clear_selection_when_moving_off_screen_edges.snap +++ b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__clear_selection_when_moving_off_screen_edges.snap @@ -50,6 +50,6 @@ expression: "&terminal_draw_events_mirror[0]" │ │ │ │ │ │ └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────────────────────────────────────────────────────────┘ - (x = Small files) - <arrows> - move around, <ENTER> - enter folder, <ESC> - parent folder, <BACKSPACE> - delete, <+/-/0> - zoom in/out/reset, <q> - quit + + <arrows> - move around, <ENTER> - enter folder, <ESC> - parent folder, <BACKSPACE> - delete, <+/-/0> - zoom in/out/reset, <q> - quit diff --git a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_file.snap b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_file.snap index a866a43..8eb2359 100644 --- a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_file.snap +++ b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_file.snap @@ -50,6 +50,6 @@ expression: "&terminal_draw_events_mirror[0]" │ │ │ │ │ │ └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────────────────────────────────────────────────────────┘ - (x = Small files) - <arrows> - move around, <ENTER> - enter folder, <ESC> - parent folder, <BACKSPACE> - delete, <+/-/0> - zoom in/out/reset, <q> - quit + + <arrows> - move around, <ENTER> - enter folder, <ESC> - parent folder, <BACKSPACE> - delete, <+/-/0> - zoom in/out/reset, <q> - quit diff --git a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_file_no_confirmation.snap b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_file_no_confirmation.snap index b6b5f1e..eda1008 100644 --- a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_file_no_confirmation.snap +++ b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_file_no_confirmation.snap @@ -50,6 +50,6 @@ expression: "&terminal_draw_events_mirror[0]" │ │ │ │ │ │ └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────────────────────────────────────────────────────────┘ - (x = Small files) + <arrows> - move around, <ENTER> - enter folder, <ESC> - parent folder, <BACKSPACE> - delete, <+/-/0> - zoom in/out/reset, <q> - quit diff --git a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_file_press_n.snap b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_file_press_n.snap index 826fed0..70fc896 100644 --- a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_file_press_n.snap +++ b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_file_press_n.snap @@ -50,6 +50,6 @@ expression: "&terminal_draw_events_mirror[0]" │ │ │ │ │ │ └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────────────────────────────────────────────────────────┘ - (x = Small files) - <arrows> - move around, <ENTER> - enter folder, <ESC> - parent folder, <BACKSPACE> - delete, <+/-/0> - zoom in/out/reset, <q> - quit + + <arrows> - move around, <ENTER> - enter folder, <ESC> - parent folder, <BACKSPACE> - delete, <+/-/0> - zoom in/out/reset, <q> - quit diff --git a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_folder.snap b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_folder.snap index b93f282..fdcb6d9 100644 --- a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_folder.snap +++ b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_folder.snap @@ -50,6 +50,6 @@ expression: "&terminal_draw_events_mirror[0]" │ │ │ │ │ │ └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────────────────────────────────────────────────────────┘ - (x = Small files) - <arrows> - move around, <ENTER> - enter folder, <ESC> - parent folder, <BACKSPACE> - delete, <+/-/0> - zoom in/out/reset, <q> - quit + + <arrows> - move around, <ENTER> - enter folder, <ESC> - parent folder, <BACKSPACE> - delete, <+/-/0> - zoom in/out/reset, <q> - quit diff --git a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_folder_no_confirmation.snap b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_folder_no_confirmation.snap index 7d6c399..62c868d 100644 --- a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_folder_no_confirmation.snap +++ b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_folder_no_confirmation.snap @@ -50,6 +50,6 @@ expression: "&terminal_draw_events_mirror[0]" │ │ │ │ │ │ └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────────────────────────────────────────────────────────┘ - (x = Small files) + <arrows> - move around, <ENTER> - enter folder, <ESC> - parent folder, <BACKSPACE> - delete, <+/-/0> - zoom in/out/reset, <q> - quit diff --git a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_folder_small_window.snap b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_folder_small_window.snap index 8ce895e..e8ab39a 100644 --- a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_folder_small_window.snap +++ b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_folder_small_window.snap @@ -50,6 +50,6 @@ expression: "&terminal_draw_events_mirror[0]" │ │ │ │ └──────────────────────────────────────────────────────────┘ - (x = Small files) + ←↓↑→/<ENTER>/<ESC>: navigate, <BACKSPACE>: del diff --git a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_folder_small_window_no_confirmation.snap b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_folder_small_window_no_confirmation.snap index 2738e46..6d43751 100644 --- a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_folder_small_window_no_confirmation.snap +++ b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_folder_small_window_no_confirmation.snap @@ -50,6 +50,6 @@ expression: "&terminal_draw_events_mirror[0]" │ │ │ │ └──────────────────────────────────────────────────────────┘ - (x = Small files) + ←↓↑→/<ENTER>/<ESC>: navigate, <BACKSPACE>: del diff --git a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_folder_with_multiple_children.snap b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_folder_with_multiple_children.snap index 78627e0..1fe0262 100644 --- a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_folder_with_multiple_children.snap +++ b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_folder_with_multiple_children.snap @@ -50,6 +50,6 @@ expression: "&terminal_draw_events_mirror[0]" │ │ │ │ │ │ └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴───────────────────────────────────────────────────┘ - (x = Small files) - <arrows> - move around, <ENTER> - enter folder, <ESC> - parent folder, <BACKSPACE> - delete, <+/-/0> - zoom in/out/reset, <q> - quit + + <arrows> - move around, <ENTER> - enter folder, <ESC> - parent folder, <BACKSPACE> - delete, <+/-/0> - zoom in/out/reset, <q> - quit diff --git a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_folder_with_multiple_children_no_confirmation.snap b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_folder_with_multiple_children_no_confirmation.snap index 70bb43b..2dc9e33 100644 --- a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_folder_with_multiple_children_no_confirmation.snap +++ b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__delete_folder_with_multiple_children_no_confirmation.snap @@ -50,6 +50,6 @@ expression: "&terminal_draw_events_mirror[0]" │ │ │ │ │ │ └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴───────────────────────────────────────────────────┘ - (x = Small files) + <arrows> - move around, <ENTER> - enter folder, <ESC> - parent folder, <BACKSPACE> - delete, <+/-/0> - zoom in/out/reset, <q> - quit diff --git a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__eleven_files.snap b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__eleven_files.snap index 780b77f..75fb53f 100644 --- a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__eleven_files.snap +++ b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__eleven_files.snap @@ -50,6 +50,6 @@ expression: "&terminal_draw_events_mirror[0]" │ │ │ │ │ │ │ 8.0K (2%) │ └─────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────────────────────────────────────────┴───────────────────────────────────┘ - (x = Small files) - <arrows> - move around, <ENTER> - enter folder, <ESC> - parent folder, <BACKSPACE> - delete, <+/-/0> - zoom in/out/reset, <q> - quit + + <arrows> - move around, <ENTER> - enter folder, <ESC> - parent folder, <BACKSPACE> - delete, <+/-/0> - zoom in/out/reset, <q> - quit diff --git a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__empty_folder.snap b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__empty_folder.snap index ec97ce5..7de0d86 100644 --- a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__empty_folder.snap +++ b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__empty_folder.snap @@ -50,6 +50,6 @@ expression: "&terminal_draw_events_mirror[0]" │████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████│ │████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████│ └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ - (x = Small files) - <arrows> - move around, <ENTER> - enter folder, <ESC> - parent folder, <BACKSPACE> - delete, <+/-/0> - zoom in/out/reset, <q> - quit + + <arrows> - move around, <ENTER> - enter folder, <ESC> - parent folder, <BACKSPACE> - delete, <+/-/0> - zoom in/out/reset, <q> - quit diff --git a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__enter_folder.snap b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__enter_folder.snap index d6b31a4..c841217 100644 --- a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__enter_folder.snap +++ b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__enter_folder.snap @@ -50,6 +50,6 @@ expression: "&terminal_draw_events_mirror[0]" │ │ │ │ │ │ └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────────────────────────────────────────┘ - (x = Small files) - <arrows> - move around, <ENTER> - enter folder, <ESC> - parent folder, <BACKSPACE> - delete, <+/-/0> - zoom in/out/reset, <q> - quit + + <arrows> - move around, <ENTER> - enter folder, <ESC> - parent folder, <BACKSPACE> - delete, <+/-/0> - zoom in/out/reset, <q> - quit diff --git a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__enter_folder_medium_width.snap b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__enter_folder_medium_width.snap index 33d6acd..a0f5260 100644 --- a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__enter_folder_medium_width.snap +++ b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__enter_folder_medium_width.snap @@ -50,6 +50,6 @@ expression: "&terminal_draw_events_mirror[0]" │ │ │ │ └────────────────────────────────────────────────────────────────────────────────────────┘ - (x = Small files) - ←↓↑→/<ENTER>/<ESC>: navigate, <BACKSPACE>: del + + ←↓↑→/<ENTER>/<ESC>: navigate, <BACKSPACE>: del diff --git a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__enter_folder_small_width-2.snap b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__enter_folder_small_width-2.snap index 68035d2..00dd5d2 100644 --- a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__enter_folder_small_width-2.snap +++ b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__enter_folder_small_width-2.snap @@ -50,6 +50,6 @@ expression: "&terminal_draw_events_mirror[1]" - subfolder_with_quite_a_long_name + SELECTED: subfolder_with_quite_a_long_name (8.0K, 1 files) diff --git a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__enter_folder_small_width.snap b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__enter_folder_small_width.snap index 66ec93d..01ecc22 100644 --- a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__enter_folder_small_width.snap +++ b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__enter_folder_small_width.snap @@ -50,6 +50,6 @@ expression: "&terminal_draw_events_mirror[0]" │ │ │ │ └──────────────────────────────────────────────────────────┘ - (x = Small files) - ←↓↑→/<ENTER>/<ESC>: navigate, <BACKSPACE>: del + + ←↓↑→/<ENTER>/<ESC>: navigate, <BACKSPACE>: del diff --git a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__enter_largest_folder_with_no_selected_tile.snap b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__enter_largest_folder_with_no_selected_tile.snap index 886027f..75fae39 100644 --- a/src/tests/cases/snapshots/diskonaut__tests__cases__ui__enter_largest_folder_with_no_selected_tile.snap +++ b/src/tests/cases/snapshots/diskonaut__tests__cases__ui__enter_largest_folder_with_no_selected_tile.snap @@ -50,6 +50,6 @@ expression: "&terminal_draw_events_mirror[0]" │ │ │ │ │ │ └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────────────────────────────────────────┘ - (x = Small files) - <arrows> - move around, <ENTER> - enter folder, <ESC> - parent folder, <BACKSPACE> - delete, <+/-/0> |