Implement snowballing tab controls

This commit is contained in:
Andreas Tsouchlos 2025-12-31 02:46:14 +02:00
parent 8c11630801
commit 2e51ae8064

View File

@ -262,10 +262,10 @@ impl App {
) -> Result<(), SendError<Action>> { ) -> Result<(), SendError<Action>> {
match (self.state.current_tab, key) { match (self.state.current_tab, key) {
(_, KeyCode::Esc) => { (_, KeyCode::Esc) => {
self.action_tx.send(GlobalAction::Quit.into())?; self.action_tx.send(GlobalAction::Quit.into())?
} }
(_, KeyCode::Tab) => { (_, KeyCode::Tab) => {
self.action_tx.send(GlobalAction::NextTab.into())?; self.action_tx.send(GlobalAction::NextTab.into())?
} }
(Tab::Seeding, KeyCode::Char(c)) => { (Tab::Seeding, KeyCode::Char(c)) => {
self.action_tx.send(SeedingAction::EnterChar(c).into())?; self.action_tx.send(SeedingAction::EnterChar(c).into())?;
@ -276,6 +276,23 @@ impl App {
(Tab::Seeding, KeyCode::Enter) => { (Tab::Seeding, KeyCode::Enter) => {
self.action_tx.send(GlobalAction::FetchPub.into())?; self.action_tx.send(GlobalAction::FetchPub.into())?;
} }
(Tab::Snowballing, KeyCode::Enter) => {
self.action_tx.send(SnowballingAction::Search.into())?;
}
(Tab::Snowballing, KeyCode::Char('h')) => {
self.action_tx
.send(SnowballingAction::SelectLeftPane.into())?;
}
(Tab::Snowballing, KeyCode::Char('l')) => {
self.action_tx
.send(SnowballingAction::SelectRightPane.into())?;
}
(Tab::Snowballing, KeyCode::Char('j')) => {
self.action_tx.send(SnowballingAction::NextItem.into())?;
}
(Tab::Snowballing, KeyCode::Char('k')) => {
self.action_tx.send(SnowballingAction::PrevItem.into())?;
}
_ => {} _ => {}
} }