summaryrefslogtreecommitdiffstats
path: root/pkg/integration
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2024-01-29 17:50:45 +0100
committerStefan Haller <stefan@haller-berlin.de>2024-02-16 13:51:15 +0100
commit649048c3369f03f5f5f1d5fd107c616f676d5caf (patch)
tree0f2df53bbdb360cac3c1f2a62a75e9ea68b959ce /pkg/integration
parent57ac9c2189458a7f0e63c2e9cac8334694a3d545 (diff)
Optionally keep sort order stable when filtering lists
For some lists it is useful to keep the same sort order when filtering (rather than sorting by best match like we usually do). Add an optional function to FilteredList to make this possible, and use it whenever we show lists of things sorted by date (branches, stashes, reflog entries), as well as menu items because this allows us to keep the section headers in the keybindings menu, which is useful for understanding what you are looking at when filtering.
Diffstat (limited to 'pkg/integration')
-rw-r--r--pkg/integration/tests/filter_and_search/filter_updates_when_model_changes.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/integration/tests/filter_and_search/filter_updates_when_model_changes.go b/pkg/integration/tests/filter_and_search/filter_updates_when_model_changes.go
index ae3c862c0..60ce9b580 100644
--- a/pkg/integration/tests/filter_and_search/filter_updates_when_model_changes.go
+++ b/pkg/integration/tests/filter_and_search/filter_updates_when_model_changes.go
@@ -27,9 +27,10 @@ var FilterUpdatesWhenModelChanges = NewIntegrationTest(NewIntegrationTestArgs{
).
FilterOrSearch("branch").
Lines(
- Contains("branch-to-delete").IsSelected(),
- Contains("checked-out-branch"),
+ Contains("checked-out-branch").IsSelected(),
+ Contains("branch-to-delete"),
).
+ SelectNextItem().
Press(keys.Universal.Remove).
Tap(func() {
t.ExpectPopup().