Skip to content
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

Reduced Personnel Table Right-Click Menu Clutter #3970

Merged
merged 2 commits into from Apr 15, 2024

Conversation

IllianiCBT
Copy link
Collaborator

Current Implementation

Currently, when right-clicking on an employee on the Personnel Table, users are presented with a long list of options.

image

Problem

As shown in the above image, this list has gotten pretty lengthy and some options (such as 'edit personnel log...' and 'add single log entry') effectively replicate functionality. While, yes, clicking 'add single log entry' (instead of 'edit personnel log') does save one click, I don't think it warrants the clutter.

Solution

I went through and grouped a couple of similar functions together, as outlined below.

image

Edit Logs

Edit Logs has different functionality depending on whether one, or more, employees are selected. This ensures that prior functionality is maintained, while also reducing the number of available options.

image image

Edit Profile

Edit Profile encompasses 'Change Portrait' (single), 'Change Biography', and 'Change Callsign'. When multiple employees are selected, 'Edit Profile' is no longer available, and is replaced by the 'Bulk Change to a Single Portrait' option. As with 'Edit Logs', this retains prior functionality, while also reducing the number of available options.

image image

General Changes

I also went through and adjusted the wording of a couple options and removed the ellipses from options in this menu. This gives the menu a cleaner look.

Notes

JMenuHelpers.addMenuIfNonEmpty() is used extensively throughout MekHQ/src/mekhq/gui/adapter/PersonnelTableMouseAdapter.java and is marked as Depreciated.

@codecov-commenter
Copy link

codecov-commenter commented Apr 6, 2024

Codecov Report

Attention: Patch coverage is 0% with 32 lines in your changes are missing coverage. Please review.

Project coverage is 10.65%. Comparing base (eaeb54e) to head (453cd3c).
Report is 2 commits behind head on master.

Files Patch % Lines
.../mekhq/gui/adapter/PersonnelTableMouseAdapter.java 0.00% 32 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3970      +/-   ##
============================================
- Coverage     10.65%   10.65%   -0.01%     
  Complexity     5536     5536              
============================================
  Files           841      841              
  Lines        114411   114418       +7     
  Branches      17209    17208       -1     
============================================
  Hits          12189    12189              
- Misses       100992   100999       +7     
  Partials       1230     1230              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

popup.add(menuItem);
menu.add(menuItem);

JMenuHelpers.addMenuIfNonEmpty(popup, menu);

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note

Invoking
JMenuHelpers.addMenuIfNonEmpty
should be avoided because it has been deprecated.
}

JMenuHelpers.addMenuIfNonEmpty(popup, menu);

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note

Invoking
JMenuHelpers.addMenuIfNonEmpty
should be avoided because it has been deprecated.
@HammerGS HammerGS merged commit 5bd14ff into MegaMek:master Apr 15, 2024
4 checks passed
HammerGS added a commit that referenced this pull request Apr 19, 2024
+ Fix #3348: Added Ability to Collapse/Expand Logs, Missions and Kills
in Personnel Unit Screen
+ PR #3970: Reduced Personnel Table Right-Click Menu Clutter
+ Fix #3981: Removed Unnecessary Error Log
+ PR #3988: Added Scenario & Mission Tracking to Kills, Added Ability to
Assign Kills to Scenario and/or Mission
+ Fix #3989: Fixed Ship Search Overvaluing Ultra-Green Personnel
+ PR #3996: Add new player deployment variables to Scenario
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.

None yet

4 participants