Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tui): bind to toggle task selection pinning #9609

Merged
merged 1 commit into from
Dec 12, 2024
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
3 changes: 3 additions & 0 deletions crates/turborepo-ui/src/tui/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,9 @@ fn update(
Event::ToggleHelpPopup => {
app.showing_help_popup = !app.showing_help_popup;
}
Event::TogglePinnedTask => {
app.is_task_selection_pinned = !app.is_task_selection_pinned;
}
Event::Input { bytes } => {
app.forward_input(&bytes)?;
}
Expand Down
1 change: 1 addition & 0 deletions crates/turborepo-ui/src/tui/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ pub enum Event {
},
ToggleSidebar,
ToggleHelpPopup,
TogglePinnedTask,
SearchEnter,
SearchExit {
restore_scroll: bool,
Expand Down
1 change: 1 addition & 0 deletions crates/turborepo-ui/src/tui/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ fn translate_key_event(options: InputOptions, key_event: KeyEvent) -> Option<Eve
Some(Event::ScrollDown)
}
KeyCode::Char('m') => Some(Event::ToggleHelpPopup),
KeyCode::Char('p') => Some(Event::TogglePinnedTask),
KeyCode::Up | KeyCode::Char('k') => Some(Event::Up),
KeyCode::Down | KeyCode::Char('j') => Some(Event::Down),
KeyCode::Enter | KeyCode::Char('i') => Some(Event::EnterInteractive),
Expand Down
3 changes: 2 additions & 1 deletion crates/turborepo-ui/src/tui/popup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ use ratatui::{
widgets::{Block, List, ListItem, Padding},
};

const BIND_LIST: [&str; 11] = [
const BIND_LIST: [&str; 12] = [
"m - Toggle this help popup",
"↑ or j - Select previous task",
"↓ or k - Select next task",
"h - Toggle task list",
"p - Toggle pinned task selection",
"/ - Filter tasks to search term",
"ESC - Clear filter",
"i - Interact with task",
Expand Down
Loading