Conversation
There was a problem hiding this comment.
Pull request overview
This PR modifies network management callbacks to ensure the systray menu is refreshed whenever networks are added, edited, or deleted, not just when the current network changes. The changes ensure consistent UI updates across all network configuration operations.
- Modified callback invocation logic in AddNetwork, EditNetwork, and DeleteNetwork to always trigger callbacks
- Removed binary file pattern from release workflow artifacts
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| int/config/manager.go | Updated AddNetwork, EditNetwork, and DeleteNetwork to always invoke the onNetworkChange callback to support systray menu refresh functionality |
| .github/workflows/release.yml | Removed massastation binary file pattern from release artifacts |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Always call callback when a network is added (even if not default) to refresh systray menu | ||
| n.networkChangeMutex.RLock() | ||
| callback := n.onNetworkChange | ||
| n.networkChangeMutex.RUnlock() | ||
| if callback != nil { | ||
| callback() | ||
| } |
There was a problem hiding this comment.
The callback is now invoked unconditionally when a network is added, but there are no tests validating this new callback behavior. Consider adding tests to verify that the callback is triggered correctly in all scenarios (when makeDefault is true and false).
| // Always call callback when a network is edited to refresh systray menu | ||
| n.networkChangeMutex.RLock() | ||
| callback := n.onNetworkChange | ||
| n.networkChangeMutex.RUnlock() | ||
| if callback != nil { | ||
| callback() | ||
| } |
There was a problem hiding this comment.
The callback is now invoked unconditionally when a network is edited, but there are no tests validating this new callback behavior. Consider adding tests to verify that the callback is triggered correctly in various edit scenarios (URL changes, renames, makeDefault changes).
| // Call the network change callback if set | ||
| // Always call callback when a network is deleted to refresh systray menu | ||
| n.networkChangeMutex.RLock() | ||
| callback := n.onNetworkChange | ||
| n.networkChangeMutex.RUnlock() | ||
| if callback != nil { | ||
| callback() | ||
| } |
There was a problem hiding this comment.
A callback invocation has been added to DeleteNetwork, but there are no tests validating this new callback behavior. Consider adding tests to verify that the callback is triggered correctly when a network is deleted.
Delivery Quality Checklist
Breaking Changes in API:
Does this PR introduce breaking changes in the API?
Changelog:
Version Update Handling:
Have you ensured that the version update by user is handled correctly?
PR Dependency:
Does this PR depend on another PR?
Documentation: