-
Notifications
You must be signed in to change notification settings - Fork 30
FEATURE-91: Add filtering in groups view #120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| return m.editItem() | ||
| case key.Matches(msg, m.keyMap.append): | ||
| return message.TeaCmd(message.OpenViewHostEdit{}) // When create a new item, jump to edit mode. | ||
| return message.TeaCmd(message.ViewHostEditOpen{}) // When create a new item, jump to edit mode. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Escape key behavior changed when group selected
The special handling for the Escape key when a group is selected was removed. Previously, pressing Escape with an active group would open the group list view, allowing users to quickly change or deselect the group. Now it always enters close app mode regardless of group selection. The test at line 1024 in hostlist_test.go still expects the old behavior, indicating this change was unintentional.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #120 +/- ##
===========================================
+ Coverage 87.15% 87.23% +0.07%
===========================================
Files 40 40
Lines 3380 3401 +21
===========================================
+ Hits 2946 2967 +21
Misses 354 354
Partials 80 80
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| m.logger.Debug("[UI] Enter key. Select item in group list view.") | ||
| return nil | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Filter state check incomplete in handleEnterKey
The handleEnterKey function only checks if FilterState() == list.Filtering when determining whether to allow manual selection. When the filter state is list.FilterApplied (after user applies a filter by pressing Down/Enter while typing), the check is bypassed, causing Enter to immediately select and close the view even when multiple filtered items exist. This prevents users from navigating through filtered results. The condition should also check for list.FilterApplied state.
| cmd = m.handleKeyboardEvent(msg) | ||
| return m, cmd | ||
| case message.OpenViewSelectGroup: | ||
| cmds = append(cmds, cmd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Keyboard events processed twice in group list
The tea.KeyMsg case doesn't return early after handling keyboard events, causing the message to fall through to m.Model.Update(msg) at line 91. This results in keyboard events being processed twice: once by the custom handleKeyboardEvent and again by the underlying list model. The previous code returned immediately after handling keyboard events. This double-processing can cause unexpected behavior, especially for Enter and Escape keys which trigger view changes.
grafviktor
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked
No description provided.