feat: Add complete keyboard navigation system

Implemented a full keyboard navigation system with directional commands (C-h/j/k/l) for moving between views,
vim-style navigation (j/k for rows, h/l for columns), and TAB cycling.
Added table header navigation mode where users can move between columns and change sort order with keyboard shortcuts.
The navigation follows visual position: left sidebar, table, and filter bar can all be reached with directional keys.

Created a keymap system with context-aware bindings that resolve commands based on
current focus (Table, TableHeaders, FilterBar, Sidebar).
Commands are dispatched through a centralized handler that manages focus transitions and view state.
Added helper methods to cycle through column headers with proper wrapping.

Auto-select first task on load when tasks exist, and set initial window focus so keyboard shortcuts
work immediately without requiring a mouse click.
This commit is contained in:
Ignacio Perez
2025-12-28 20:48:19 -03:00
parent 785e8ee932
commit 893e382d7f
18 changed files with 2445 additions and 87 deletions
+32
View File
@@ -0,0 +1,32 @@
use super::ContextId;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum FocusTarget {
App,
Table,
TableHeaders,
SidebarProjects,
SidebarTags,
}
impl FocusTarget {
pub fn to_context(&self) -> ContextId {
match self {
Self::App => ContextId::Global,
Self::Table => ContextId::Table,
Self::TableHeaders => ContextId::TableHeaders,
Self::SidebarProjects => ContextId::SidebarProjects,
Self::SidebarTags => ContextId::SidebarTags,
}
}
pub fn is_sidebar(&self) -> bool {
matches!(self, Self::SidebarProjects | Self::SidebarTags)
}
}
impl Default for FocusTarget {
fn default() -> Self {
Self::App
}
}