Updated context menu selection logic
- Preserves selection: Previously selected items remain selected when the context menu is opened.
- Prevents group selection: Selecting specific items within a group no longer selects the entire group automatically when the context menu is opened.
Fixes: #4721 (closed) Fixes: #4750 (closed)