Skip to content

client: normalise context menu delete behaviour#7370

Open
thc202 wants to merge 1 commit into
zaproxy:mainfrom
thc202:client/delete-disable-root
Open

client: normalise context menu delete behaviour#7370
thc202 wants to merge 1 commit into
zaproxy:mainfrom
thc202:client/delete-disable-root

Conversation

@thc202
Copy link
Copy Markdown
Member

@thc202 thc202 commented May 19, 2026

Make it behave like the delete of the Sites tree, show it disabled if only the root node is selected (since the root node can't be deleted).

Make it behave like the delete of the Sites tree, show it disabled if
only the root node is selected (since the root node can't be deleted).

Signed-off-by: thc202 <thc202@gmail.com>
@psiinon
Copy link
Copy Markdown
Member

psiinon commented May 19, 2026

Logo
Checkmarx One – Scan Summary & Detailsc11e319f-848c-4c21-ae5b-5e36a5d56675

Great job! No new security vulnerabilities introduced in this pull request


Use @Checkmarx to interact with Checkmarx PR Assistant.
Examples:
@Checkmarx how are you able to help me?
@Checkmarx rescan this PR

@Override
public boolean isButtonEnabled() {
List<ClientNode> nodes = getClientMapPanel().getSelectedNodes();
return !(nodes.size() == 1 && nodes.get(0).isRoot());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does the selection always follow a top down list?

Ex: if a user control + clicks for multi-select and root is the third thing selected, will it still be the zeroth item in the list?

Copy link
Copy Markdown
Member Author

@thc202 thc202 May 19, 2026

Choose a reason for hiding this comment

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

It's fine to include the root when selecting multiple nodes, the root is simply ignored in that case. What this addresses is the case of selecting just the root node, which would prompt the user to delete but then nothing happened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants