fix: remove panel bare letter shortcuts
This commit is contained in:
parent
9341c8049e
commit
a5fa3d840b
|
|
@ -144,11 +144,6 @@ pub(crate) async fn run(
|
||||||
return Ok(MultiPodOutcome::Open(request));
|
return Ok(MultiPodOutcome::Open(request));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MultiPodAction::Refresh => {
|
|
||||||
if !pending_reload.start() {
|
|
||||||
app.notice = Some("Refresh already in progress.".to_string());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
MultiPodAction::DispatchTicketAction(request) => {
|
MultiPodAction::DispatchTicketAction(request) => {
|
||||||
pending_reload.abort();
|
pending_reload.abort();
|
||||||
terminal.draw(|f| draw(f, app))?;
|
terminal.draw(|f| draw(f, app))?;
|
||||||
|
|
@ -1193,20 +1188,10 @@ impl MultiPodApp {
|
||||||
self.select_next();
|
self.select_next();
|
||||||
MultiPodAction::None
|
MultiPodAction::None
|
||||||
}
|
}
|
||||||
KeyCode::Char('k') if !ctrl && !alt => {
|
|
||||||
self.select_prev();
|
|
||||||
MultiPodAction::None
|
|
||||||
}
|
|
||||||
KeyCode::Char('j') if !ctrl && !alt => {
|
|
||||||
self.select_next();
|
|
||||||
MultiPodAction::None
|
|
||||||
}
|
|
||||||
KeyCode::Char('t') if ctrl => {
|
KeyCode::Char('t') if ctrl => {
|
||||||
self.cycle_composer_target();
|
self.cycle_composer_target();
|
||||||
MultiPodAction::None
|
MultiPodAction::None
|
||||||
}
|
}
|
||||||
KeyCode::Char('o') if !ctrl && !alt => MultiPodAction::Open,
|
|
||||||
KeyCode::Char('r') if !ctrl && !alt => MultiPodAction::Refresh,
|
|
||||||
KeyCode::Enter if alt => {
|
KeyCode::Enter if alt => {
|
||||||
self.input.insert_newline();
|
self.input.insert_newline();
|
||||||
MultiPodAction::None
|
MultiPodAction::None
|
||||||
|
|
@ -1272,7 +1257,6 @@ enum MultiPodAction {
|
||||||
None,
|
None,
|
||||||
Quit,
|
Quit,
|
||||||
Open,
|
Open,
|
||||||
Refresh,
|
|
||||||
DispatchTicketAction(TicketActionRequest),
|
DispatchTicketAction(TicketActionRequest),
|
||||||
LaunchIntake(IntakeLaunchRequest),
|
LaunchIntake(IntakeLaunchRequest),
|
||||||
SendCompanion(CompanionSendRequest),
|
SendCompanion(CompanionSendRequest),
|
||||||
|
|
@ -2147,7 +2131,7 @@ fn open_disabled_reason(entry: &PodListEntry) -> String {
|
||||||
}
|
}
|
||||||
return match live.status {
|
return match live.status {
|
||||||
Some(PodStatus::Running) => {
|
Some(PodStatus::Running) => {
|
||||||
"Selected Pod is running; press o or empty Enter to open/attach.".to_string()
|
"Selected Pod is running; press empty Enter to open/attach.".to_string()
|
||||||
}
|
}
|
||||||
Some(PodStatus::Paused) => {
|
Some(PodStatus::Paused) => {
|
||||||
"Selected Pod is paused; open it explicitly to resume or start a new turn."
|
"Selected Pod is paused; open it explicitly to resume or start a new turn."
|
||||||
|
|
@ -2158,7 +2142,7 @@ fn open_disabled_reason(entry: &PodListEntry) -> String {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if entry.stored.is_some() {
|
if entry.stored.is_some() {
|
||||||
return "Selected Pod is stopped; press o or empty Enter to restore/open.".to_string();
|
return "Selected Pod is stopped; press empty Enter to restore/open.".to_string();
|
||||||
}
|
}
|
||||||
entry
|
entry
|
||||||
.actions
|
.actions
|
||||||
|
|
@ -2407,11 +2391,11 @@ fn draw_title(frame: &mut Frame<'_>, app: &MultiPodApp, area: Rect) {
|
||||||
.composer
|
.composer
|
||||||
.is_available(ComposerTarget::TicketIntake)
|
.is_available(ComposerTarget::TicketIntake)
|
||||||
{
|
{
|
||||||
" Empty Enter dispatches selected Ticket action · Ctrl+T target · o/empty Enter open/attach · r refresh"
|
" Empty Enter dispatches selected Ticket action/open · Ctrl+T target"
|
||||||
} else if app.panel.header.ticket_configured {
|
} else if app.panel.header.ticket_configured {
|
||||||
" Empty Enter dispatches selected Ticket action · o/empty Enter open/attach Pod · r refresh"
|
" Empty Enter dispatches selected Ticket action/open Pod"
|
||||||
} else {
|
} else {
|
||||||
" Pod-centric view · o/empty Enter open/attach selected Pod · r refresh"
|
" Pod-centric view · empty Enter open/attach selected Pod"
|
||||||
};
|
};
|
||||||
let mut spans = vec![
|
let mut spans = vec![
|
||||||
Span::styled(
|
Span::styled(
|
||||||
|
|
@ -2836,9 +2820,9 @@ fn draw_actionbar(frame: &mut Frame<'_>, app: &MultiPodApp, area: Rect) {
|
||||||
.composer
|
.composer
|
||||||
.is_available(ComposerTarget::TicketIntake)
|
.is_available(ComposerTarget::TicketIntake)
|
||||||
{
|
{
|
||||||
"↑/↓ select Empty Enter target/open Ctrl+T target o open r refresh Esc quit"
|
"↑/↓ select Empty Enter target/open Ctrl+T target Esc quit"
|
||||||
} else {
|
} else {
|
||||||
"↑/↓ select Empty Enter open non-empty Enter diagnose o open r refresh Esc quit"
|
"↑/↓ select Empty Enter open non-empty Enter diagnose Esc quit"
|
||||||
};
|
};
|
||||||
let left_width = area
|
let left_width = area
|
||||||
.width
|
.width
|
||||||
|
|
@ -3257,6 +3241,39 @@ mod tests {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn multi_bare_panel_letters_append_to_composer_and_arrows_select() {
|
||||||
|
let mut app = test_app(vec![
|
||||||
|
live_info("alpha", PodStatus::Idle),
|
||||||
|
live_info("beta", PodStatus::Idle),
|
||||||
|
]);
|
||||||
|
assert_eq!(app.list.selected_entry().unwrap().name, "alpha");
|
||||||
|
|
||||||
|
for c in ['j', 'k', 'o', 'r'] {
|
||||||
|
assert!(matches!(
|
||||||
|
app.handle_key(key(KeyCode::Char(c))),
|
||||||
|
MultiPodAction::None
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
assert_eq!(input_text(&app), "jkor");
|
||||||
|
assert_eq!(app.list.selected_entry().unwrap().name, "alpha");
|
||||||
|
|
||||||
|
assert!(matches!(
|
||||||
|
app.handle_key(key(KeyCode::Down)),
|
||||||
|
MultiPodAction::None
|
||||||
|
));
|
||||||
|
assert_eq!(input_text(&app), "jkor");
|
||||||
|
assert_eq!(app.list.selected_entry().unwrap().name, "beta");
|
||||||
|
|
||||||
|
assert!(matches!(
|
||||||
|
app.handle_key(key(KeyCode::Up)),
|
||||||
|
MultiPodAction::None
|
||||||
|
));
|
||||||
|
assert_eq!(input_text(&app), "jkor");
|
||||||
|
assert_eq!(app.list.selected_entry().unwrap().name, "alpha");
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn multi_selection_changes_preserve_composer_contents() {
|
fn multi_selection_changes_preserve_composer_contents() {
|
||||||
let mut app = test_app(vec![
|
let mut app = test_app(vec![
|
||||||
|
|
@ -4205,23 +4222,15 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn multi_empty_enter_on_non_openable_row_matches_o_diagnostic() {
|
fn multi_empty_enter_on_non_openable_row_reports_open_diagnostic() {
|
||||||
let mut enter_app = test_app(vec![unreachable_live_info("unreachable")]);
|
let mut app = test_app(vec![unreachable_live_info("unreachable")]);
|
||||||
assert!(matches!(
|
assert!(matches!(
|
||||||
enter_app.handle_key(key(KeyCode::Enter)),
|
app.handle_key(key(KeyCode::Enter)),
|
||||||
MultiPodAction::Open
|
MultiPodAction::Open
|
||||||
));
|
));
|
||||||
assert!(enter_app.prepare_open().is_none());
|
assert!(app.prepare_open().is_none());
|
||||||
let enter_notice = enter_app.notice.clone();
|
|
||||||
|
|
||||||
let mut open_app = test_app(vec![unreachable_live_info("unreachable")]);
|
assert!(app.notice.as_deref().unwrap().contains("cannot be opened"));
|
||||||
assert!(matches!(
|
|
||||||
open_app.handle_key(key(KeyCode::Char('o'))),
|
|
||||||
MultiPodAction::Open
|
|
||||||
));
|
|
||||||
assert!(open_app.prepare_open().is_none());
|
|
||||||
|
|
||||||
assert_eq!(enter_notice, open_app.notice);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn test_app(live: Vec<LivePodInfo>) -> MultiPodApp {
|
fn test_app(live: Vec<LivePodInfo>) -> MultiPodApp {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user