Skip to content

[client] Add "Deselect All" Menu Item to Exit Node Menu #3877

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

Merged
merged 4 commits into from
Jun 3, 2025

Conversation

hakansa
Copy link
Member

@hakansa hakansa commented May 26, 2025

Describe your changes

  • Add "Deselect All" Menu Item to Exit Node Menu
  • Only rebuild the Exit Nodes menu if the state is changed.
Ekran Resmi 2025-05-23 16 07 34 Ekran Resmi 2025-05-23 16 05 21

Issue ticket number and link

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

@Copilot Copilot AI review requested due to automatic review settings May 26, 2025 04:42
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds a “Deselect All” item to the system tray Exit Node menu so users can clear all selected exit nodes in one action.

  • Introduces an exitNodeState struct and a cached exitNodeStates slice to skip redundant menu rebuilds.
  • Updates recreateExitNodeMenu to append a “Deselect All” sub‐menu when any node is selected and wires up its click handler.
  • Implements handleExitNodeMenuDeselectAll to call the existing deselect API and refresh the menu.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
client/ui/network.go Added exitNodeState, updated menu rebuild logic, and new handler.
client/ui/client_ui.go Introduced fields for caching exit node states and the deselect item.
Comments suppressed due to low confidence (1)

client/ui/network.go:480

  • [nitpick] This new handler controls exit-node deselection and menu refresh logic but lacks any dedicated tests. Adding unit tests for both success and failure paths would help prevent regressions.
func (s *serviceClient) handleExitNodeMenuDeselectAll() ([]*proto.Network, error) {

Copy link

sonarqubecloud bot commented May 26, 2025

Quality Gate Passed Quality Gate passed

Issues
0 New issues
1 Accepted issue

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@mlsmaycon mlsmaycon merged commit 616b19c into main Jun 3, 2025
32 checks passed
@mlsmaycon mlsmaycon deleted the fix/client-exitnode-gui branch June 3, 2025 07:49
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.

2 participants