From 54d33dedca48f5409a574f4675ecbe4ad996f447 Mon Sep 17 00:00:00 2001 From: Olalalao <1176328868@qq.com> Date: Sat, 28 Feb 2026 13:35:08 +0800 Subject: [PATCH] fix: after clicking the mouse, j/k cannot be used. --- internal/adapters/ui/handlers.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/internal/adapters/ui/handlers.go b/internal/adapters/ui/handlers.go index 897e053..514bc3a 100644 --- a/internal/adapters/ui/handlers.go +++ b/internal/adapters/ui/handlers.go @@ -146,7 +146,7 @@ func (t *tui) handleTagsEdit() { } func (t *tui) handleNavigateDown() { - if t.app.GetFocus() == t.serverList { + if t.isServerListFocused() { currentIdx := t.serverList.GetCurrentItem() itemCount := t.serverList.GetItemCount() if currentIdx < itemCount-1 { @@ -158,7 +158,7 @@ func (t *tui) handleNavigateDown() { } func (t *tui) handleNavigateUp() { - if t.app.GetFocus() == t.serverList { + if t.isServerListFocused() { currentIdx := t.serverList.GetCurrentItem() if currentIdx > 0 { t.serverList.SetCurrentItem(currentIdx - 1) @@ -177,6 +177,14 @@ func (t *tui) handleSearchInput(query string) { } } +func (t *tui) isServerListFocused() bool { + if t == nil || t.app == nil || t.serverList == nil { + return false + } + focus := t.app.GetFocus() + return focus == t.serverList || focus == t.serverList.List +} + func (t *tui) handleSearchFocus() { if t.app != nil && t.searchBar != nil { t.app.SetFocus(t.searchBar)