(e7612de) Close the detail overlay on q instead of quitting, and bump to 0.13.5
q set should_quit outright, so a reader who pressed it to put a ticket away lost the whole board instead. That is not what q means anywhere else that lays a document over a list, and esc two arms below already did the right thing. The rule is Board::dismiss: close what is open, quit when there is nothing left to close. On Board rather than in the match arm because the dispatch in main.rs is not reachable from a test, so a rule written there is a rule nothing can check. q and esc now share one arm, since two arms carrying one rule is how a later edit changes it for one key and not the other. The footer is the other half. Its last slot answers the same question in both states, how to get out, and with a ticket open the honest answer is ctrl-c: it is the only key left that quits in one press. Going on saying q quit there would be 1b78a24 in the other direction, a footer describing a key by what it used to do. The close entry names both keys as enter/q close rather than repeating close twice. Criteria 3 and 7 live in a dispatch no test can reach, so the_dispatch_gives_q_and_esc_one_arm_and_leaves_ctrl_c_quitting scans main.rs for them, over whitespace-collapsed source so rustfmt cannot fail it, the way util.rs is already scanned for colour_text callers. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
a16169ce8c
commit
4502de7ee3
+8
-7
@@ -164,16 +164,17 @@ fn run_tui(paths: &[std::path::PathBuf], start: &std::path::Path) -> Result<()>
|
||||
}
|
||||
|
||||
match key.code {
|
||||
KeyCode::Char('q') => board.should_quit = true,
|
||||
// One arm, because the two keys mean one thing: close what is open, and
|
||||
// quit when there is nothing left to close. Two arms carrying one rule
|
||||
// is how a later edit changes it for one key and not the other, which is
|
||||
// what `q` quitting out from under an open ticket already was. The rule
|
||||
// itself is `Board::dismiss`, where a test can reach it.
|
||||
KeyCode::Esc | KeyCode::Char('q') => board.dismiss(),
|
||||
// The only key that leaves the board from an open ticket, which is why
|
||||
// the footer names it there.
|
||||
KeyCode::Char('c') if key.modifiers.contains(KeyModifiers::CONTROL) => {
|
||||
board.should_quit = true
|
||||
}
|
||||
// Esc closes the detail view, and only quits when there is nothing
|
||||
// left to dismiss.
|
||||
KeyCode::Esc => match board.detail {
|
||||
Some(_) => board.toggle_detail(),
|
||||
None => board.should_quit = true,
|
||||
},
|
||||
KeyCode::Enter | KeyCode::Char(' ') => board.toggle_detail(),
|
||||
KeyCode::Left | KeyCode::Char('h') => board.select_column(-1, screen),
|
||||
KeyCode::Right | KeyCode::Char('l') => board.select_column(1, screen),
|
||||
|
||||
Reference in New Issue
Block a user