More efficient project tree context menu

Fixes #10115