Skip to content

Conversation

@grafviktor
Copy link
Owner

No description provided.

@grafviktor grafviktor self-assigned this Nov 23, 2025
@grafviktor grafviktor linked an issue Nov 23, 2025 that may be closed by this pull request
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.
Copy link

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.

Fix in Cursor Fix in Web

@codecov
Copy link

codecov bot commented Nov 23, 2025

Codecov Report

❌ Patch coverage is 93.10345% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.23%. Comparing base (f11d6d9) to head (50ee810).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
internal/ui/model.go 16.66% 5 Missing ⚠️
internal/ui/component/hostlist/hostlist.go 96.77% 1 Missing ⚠️
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              
Flag Coverage Δ
go-1.22.x 87.15% <93.10%> (-0.01%) ⬇️
go-1.25.x 87.23% <93.10%> (+0.25%) ⬆️
macOS 86.82% <93.10%> (+0.17%) ⬆️
ubuntu 86.73% <93.10%> (+0.08%) ⬆️
unit 87.23% <93.10%> (+0.07%) ⬆️
windows 84.98% <93.10%> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

m.logger.Debug("[UI] Enter key. Select item in group list view.")
return nil
}
}
Copy link

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.

Fix in Cursor Fix in Web

cmd = m.handleKeyboardEvent(msg)
return m, cmd
case message.OpenViewSelectGroup:
cmds = append(cmds, cmd)
Copy link

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.

Fix in Cursor Fix in Web

Copy link
Owner Author

@grafviktor grafviktor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked

@grafviktor grafviktor merged commit af69977 into develop Nov 24, 2025
11 checks passed
@grafviktor grafviktor deleted the feature/91 branch November 24, 2025 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Add filtering in groups

2 participants