Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,10 @@
'';
};
}
);
)
// {
herculesCI = {
onPush = { };
};
};
}
8 changes: 8 additions & 0 deletions rust/src/tui/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,14 @@ impl App {
}
}

if self
.keymap
.action_for_key_in(&key, &[KeyAction::Help])
.is_some()
{
return self.run_keymap_action(KeyAction::Help);
}
Comment on lines +156 to +162

// ── Single-key fallthrough (no active chord) ──────────────────
match &mut self.view {
View::Search(search) => {
Expand Down
20 changes: 20 additions & 0 deletions rust/src/tui/harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,26 @@ mod tests {
);
}

#[test]
fn default_keymap_question_mark_opens_search_help() {
let fx = Fixture::new();
let mut h = TuiHarness::with_keymap(&fx.ctx, 120, 30, KeyMap::default());
assert_eq!(h.app.current_view(), "search");

h.press(KeyCode::Char('?'));

assert!(
h.contains("filter results"),
"question mark should open search help, not filter text:\n{}",
h.rendered()
);
assert!(
!h.contains("no matches"),
"question mark was treated as search input:\n{}",
h.rendered()
);
}

/// A user who rebinds `new_secret` to `F2` should be able to press F2
/// and land in the new-secret form — and the former default (Ctrl+N)
/// must stop working, proving the override fully replaces that action.
Expand Down
2 changes: 1 addition & 1 deletion rust/src/tui/views/envs_dsl_editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ fn fuzzy_top(corpus: &[String], pattern_str: &str, n: usize) -> Vec<String> {
pattern.score(h, &mut matcher).map(|s| (s, c.clone()))
})
.collect();
scored.sort_by(|a, b| b.0.cmp(&a.0));
scored.sort_by_key(|item| std::cmp::Reverse(item.0));
scored.into_iter().take(n).map(|(_, s)| s).collect()
}

Expand Down
14 changes: 6 additions & 8 deletions rust/src/tui/views/init_wizard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,15 +275,13 @@ impl InitWizardView {
_ => {}
},
Step::Provider => match key.code {
KeyCode::Up | KeyCode::Char('k') => {
if self.provider_index > 0 {
self.provider_index -= 1;
}
KeyCode::Up | KeyCode::Char('k') if self.provider_index > 0 => {
self.provider_index -= 1;
}
KeyCode::Down | KeyCode::Char('j') => {
if self.provider_index + 1 < self.provider_options.len() {
self.provider_index += 1;
}
KeyCode::Down | KeyCode::Char('j')
if self.provider_index + 1 < self.provider_options.len() =>
{
self.provider_index += 1;
}
KeyCode::Enter => self.begin_init(),
KeyCode::Esc => {
Expand Down
Loading