Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4095 +/- ##
==========================================
+ Coverage 68.56% 68.62% +0.05%
==========================================
Files 448 448
Lines 45779 45774 -5
==========================================
+ Hits 31389 31411 +22
+ Misses 11967 11943 -24
+ Partials 2423 2420 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Follow-up to #3889 with four mechanical refactors (no behavior change): - Replace hand-rolled loop with slices.Contains in isClientRegisteredInAllGroups - Move ErrAllClientsRegistered sentinel from cmd/thv/app/ui/ to pkg/client/ - Extract selectedGroups() helper to deduplicate map-to-slice logic - Add bounds check on group indices before indexing m.Groups Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
a9cf0ea to
514a072
Compare
rdimitrov
approved these changes
Mar 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR #3889 added client filtering in
thv client setup. Code review identified four mechanical cleanup items — no behavior changes, just improved consistency and safety.ErrAllClientsRegisteredsentinel fromcmd/thv/app/ui/topkg/client/to match project convention (sentinel errors live inpkg/)slices.ContainsinisClientRegisteredInAllGroups, matching the pattern used inpkg/groups/skills.goselectedGroups()helper to deduplicate the map-to-groups-slice logic shared byfilterClientsBySelectedGroups()andRunClientSetup()m.Groupsto guard against out-of-bounds panicsType of change
Test plan
task test)task lint-fix)Changes
pkg/client/filter.goErrAllClientsRegisteredsentinel, useslices.Containscmd/thv/app/ui/clients_setup.goselectedGroups()with bounds check, use it infilterClientsBySelectedGroups,sortedSelectedGroupNames, andRunClientSetupcmd/thv/app/client.goui.ErrAllClientsRegistered→client.ErrAllClientsRegisteredcmd/thv/app/ui/selected_groups_test.goDoes this introduce a user-facing change?
No
Generated with Claude Code