fix: Properly parse compound handshake time and fix q key handling

- Fix parseHandshake to correctly parse number-unit pairs from '14 hours, 24 minutes, 40 seconds ago'
  Previous logic tried to parse unit words instead of finding associated numbers
  Now correctly accumulates all time units (hours, minutes, seconds)
- Fix q key handling to properly check screen type before quitting
  Only quit application when 'q' is pressed on list screen
  Other screens (detail, add, help) now handle 'q' to navigate back

Note: q key navigation may still need investigation for edge cases
This commit is contained in:
Calmcacil
2026-01-12 19:27:21 +01:00
parent e0f8210c17
commit 5d129562e2
3 changed files with 35 additions and 22 deletions

View File

@@ -47,11 +47,14 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
switch msg := msg.(type) {
case tea.KeyMsg:
// Only quit on 'q' when on list screen
// Other screens handle 'q' to navigate back
if _, ok := m.currentScreen.(*screens.ListScreen); ok && (msg.String() == "q" || msg.String() == "ctrl+c") {
m.quitting = true
return m, tea.Quit
// Only quit on 'q' or ctrl+c when on list screen
// Other screens handle their own navigation keys
if msg.String() == "q" || msg.String() == "ctrl+c" {
if _, ok := m.currentScreen.(*screens.ListScreen); ok {
m.quitting = true
return m, tea.Quit
}
// For other screens, let them handle the key
}
switch msg.String() {
case "?":