feat: switch between provider sessions without restarting

This commit is contained in:
2026-10-22 13:25:54 +02:00
parent d8e26612e4
commit acfb3be1e7
4 changed files with 150 additions and 52 deletions
+23
View File
@@ -15,6 +15,29 @@ fn press(
bindings.resolve(context, KeyEvent::new(code, modifiers))
}
#[test]
fn provider_choice_is_configurable_and_normal_only() {
let defaults = Bindings::default();
let overrides = configured("[keys.app]\nprovider = 'alt+p'\n").unwrap();
for &context in ALL {
let expected = matches!(context, Context::Normal | Context::CollectionNormal)
.then_some(Action::ProviderChoose);
assert_eq!(
press(&defaults, context, KeyCode::Char('p'), KeyModifiers::NONE)
.filter(|action| *action == Action::ProviderChoose),
expected,
);
assert_eq!(
press(&overrides, context, KeyCode::Char('p'), KeyModifiers::ALT),
expected,
);
assert_ne!(
press(&overrides, context, KeyCode::Char('p'), KeyModifiers::NONE),
Some(Action::ProviderChoose),
);
}
}
#[test]
fn only_section_headers_are_bold_in_the_grouped_overview() {
use ratatui::{