feat: Add new system for multi-selections.

This commit is contained in:
2026-03-14 13:55:55 -04:00
parent f6f1efdf8e
commit 2e29dfc103
13 changed files with 930 additions and 63 deletions

View File

@@ -286,6 +286,48 @@ pikl_tests! {
}
}
menu mod multi_select_basic {
items: ["alpha", "bravo", "charlie", "delta"];
multi: true;
test toggle_one_then_confirm {
actions: [toggle-select, confirm]
selected_items: ["alpha"]
}
test toggle_two_then_confirm {
actions: [toggle-select, move-down, move-down, toggle-select, confirm]
selected_items: ["alpha", "charlie"]
}
test no_selection_falls_back_to_cursor {
actions: [move-down, confirm]
selected: "bravo"
}
test select_all_then_confirm {
actions: [select-all, confirm]
selected_items: ["alpha", "bravo", "charlie", "delta"]
}
test clear_selections_resets {
actions: [toggle-select, move-down, toggle-select, clear-selections, confirm]
// Falls back to cursor item (bravo, since we moved down once)
selected: "bravo"
}
test undo_restores_previous {
actions: [toggle-select, move-down, toggle-select, undo-selection, confirm]
// Undo reverts the second toggle, only alpha remains
selected_items: ["alpha"]
}
test redo_after_undo {
actions: [toggle-select, move-down, toggle-select, undo-selection, redo-selection, confirm]
selected_items: ["alpha", "bravo"]
}
}
nav mod half_page_small_height {
viewport: { height: 2, count: 10 };