Skip to content

Conversation

@IllianiBird
Copy link
Collaborator

Fix #8162

We were unintentionally excluding transit & on order stock for armor when the unit was set to salvage. I also cleaned up the methods a little.

@IllianiBird IllianiBird self-assigned this Nov 16, 2025
@IllianiBird IllianiBird requested a review from a team as a code owner November 16, 2025 21:00
@IllianiBird IllianiBird added Bug GUI Severity: Low Issues described as low severity as per the new issue form labels Nov 16, 2025
@codecov
Copy link

codecov bot commented Nov 16, 2025

Codecov Report

❌ Patch coverage is 0% with 49 lines in your changes missing coverage. Please review.
✅ Project coverage is 11.75%. Comparing base (b2a85f2) to head (e29a925).
⚠️ Report is 60 commits behind head on main.

Files with missing lines Patch % Lines
MekHQ/src/mekhq/campaign/parts/Armor.java 0.00% 23 Missing ⚠️
.../src/mekhq/campaign/parts/missing/MissingPart.java 0.00% 19 Missing ⚠️
...HQ/src/mekhq/campaign/parts/equipment/AmmoBin.java 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8172   +/-   ##
=========================================
  Coverage     11.74%   11.75%           
+ Complexity     7526     7525    -1     
=========================================
  Files          1267     1267           
  Lines        162223   162212   -11     
  Branches      24446    24444    -2     
=========================================
+ Hits          19061    19062    +1     
+ Misses       141155   141142   -13     
- Partials       2007     2008    +1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@HammerGS HammerGS requested a review from Copilot November 17, 2025 01:35
Copilot finished reviewing on behalf of HammerGS November 17, 2025 01:37
Copy link
Contributor

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

This PR fixes issue #8162 where transit and on-order stock information was incorrectly hidden in the Repair Bay when armor parts were being salvaged from units. The changes also include code cleanup through the introduction of static imports for ReportingUtilities methods.

Key changes:

  • Fixed the visibility of transit and on-order stock for armor during salvage operations
  • Refactored code to use static imports for ReportingUtilities helper methods, improving readability
  • Standardized the string building pattern for formatted messages across multiple files

Reviewed Changes

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

File Description
Armor.java Restructured conditional logic to display stock and transit/order information for both repair and salvage operations; added static imports and removed direct MekHQ reference
AmmoBin.java Refactored to use static imports for ReportingUtilities methods, replacing verbose MekHQ.getMHQOptions() calls with cleaner helper method calls
MissingPart.java Applied consistent static imports and improved string building pattern for transit/order details display, replacing string concatenation with builder pattern

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@Sleet01 Sleet01 left a comment

Choose a reason for hiding this comment

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

LGTM

@IllianiBird IllianiBird merged commit 6803656 into MegaMek:main Nov 18, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug GUI Severity: Low Issues described as low severity as per the new issue form

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Issue] In-Transit armor being counted as In Stock while in "Strip" mode in repair bay

2 participants