Complete chooser invocation before reopening pre-selected option
Some checks are pending
Portable Eve contracts and browser lowering / ubuntu-latest eve-browser-lowering (push) Successful in 15m12s
Portable Eve contracts and browser lowering / ubuntu-latest eve-contracts (push) Has started running

This commit is contained in:
Meta Vens 2026-12-06 12:36:26 +01:00
commit efe479b290

View file

@ -454,9 +454,13 @@ fn scrollable_chooser_reveals_highlight_on_keys_and_alt_down_does_not_leak() {
};
assert_eq!(pgup_idx, 14 - expected_page, "{mode:?}: PageUp from 14 by {expected_page}");
// Now v(14 - expected_page) is drafted; opening again immediately reveals that pre-selected
// row, and Home -> Down -> PageDown lands at 1 + expected_page.
// Complete the invocation (keeping draft) so "pick" is idle again; reopening immediately
// reveals the pre-selected row (which is past the first page when scroll starts at 0).
let res = CommandResult::completed(&pgup_chosen.outbound[0], seq(1), None, false, None);
host.state.put(&ProviderId::new(PROVIDER), &res);
host.frame(vec![]);
let reopened = host.frame(vec![key(Key::Enter)]);
assert_eq!(surface_fills(&reopened).len(), 1, "{mode:?}: reopened after completion");
let expected_label = format!("Opt {pgup_idx:02} *");
let pre_row = drawn_texts(&reopened).into_iter().find(|(_, _, t)| t == &expected_label).expect("pre-selected revealed");
assert!(pre_row.1 >= list_rect.y && pre_row.1 < list_rect.y + list_rect.h, "{mode:?}: {pre_row:?}");