fix: Fix 'q' key handling and connectivity status issues

- Fix 'q' key in detail/add/help screens to return to list instead of quitting
- Only quit application with 'q' when on main list screen
- Fix parseHandshake to accumulate all time units instead of returning early
  This resolves handshake timing discrepancy with wg show output
- Increase connection status threshold from 3 to 5 minutes
  Allows ~12 missed keepalive intervals (25s each)
  Improves connectivity status accuracy for peers with marginal connections
This commit is contained in:
Calmcacil
2026-01-12 19:17:51 +01:00
parent 85f2e521c9
commit e0f8210c17
3 changed files with 22 additions and 9 deletions

View File

@@ -47,10 +47,13 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
switch msg := msg.(type) {
case tea.KeyMsg:
switch msg.String() {
case "q", "ctrl+c":
// 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
}
switch msg.String() {
case "?":
// Switch to help screen
m.previousScreen = m.currentScreen