-
Notifications
You must be signed in to change notification settings - Fork 334
Issue: correct issues with the unittooltip not displaying correctly in the report #7222
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
Issue: correct issues with the unittooltip not displaying correctly in the report #7222
Conversation
kuronekochomusuke
commented
Jun 7, 2025
- correct issues with the unittooltip not displaying correctly in the report
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7222 +/- ##
============================================
- Coverage 30.75% 30.73% -0.02%
+ Complexity 17581 17546 -35
============================================
Files 2974 2974
Lines 290337 290346 +9
Branches 50611 50599 -12
============================================
- Hits 89285 89239 -46
- Misses 194338 194409 +71
+ Partials 6714 6698 -16 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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 addresses formatting issues for unit tooltips within the report view by removing legacy <pre> tag injections in the server report generator and gating sensor‐only tooltips on the report flag in the client.
- Remove hard‐coded closing/opening
<pre>wrappers around the status report - Always generate the report section for unit tooltips at a fixed position
- Skip sensor‐only tooltips when rendering in report mode on the client
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| megamek/src/megamek/server/totalwarfare/TWGameManager.java | Stripped out <pre> tag inserts and adjusted report creation sequence |
| megamek/src/megamek/client/ui/clientGUI/tooltip/UnitToolTip.java | Added !report check to prevent sensor‐only tooltips from appearing in reports |
Comments suppressed due to low confidence (2)
megamek/src/megamek/server/totalwarfare/TWGameManager.java:1857
- Here
rstill refers to the previous Report instance instead of a new one that would re-enable<pre>formatting. This will add the wrong object and drop necessary<pre>tags, breaking report layout. Consider reinstating a new Report with<pre>before this call.
reports.add(r);
megamek/src/megamek/client/ui/clientGUI/tooltip/UnitToolTip.java:131
- [nitpick] This new
reportflag check changes tooltip logic; there may not be existing tests covering both branches. Add a unit test to verify sensor-only tooltips are correctly skipped whenreportis true.
if ((!report) && (EntityVisibilityUtils.onlyDetectedBySensors(localPlayer, entity))) {
| boolean inGameValue, boolean showBV, boolean showSensors, boolean showSeenBy, boolean report) { | ||
| // Tooltip info for a sensor blip | ||
| if (EntityVisibilityUtils.onlyDetectedBySensors(localPlayer, entity)) { | ||
| if ((!report) && (EntityVisibilityUtils.onlyDetectedBySensors(localPlayer, entity))) { |
Copilot
AI
Jun 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The extra parentheses around each condition are unnecessary. Simplify to if (!report && EntityVisibilityUtils.onlyDetectedBySensors(localPlayer, entity)) for improved readability.
| if ((!report) && (EntityVisibilityUtils.onlyDetectedBySensors(localPlayer, entity))) { | |
| if (!report && EntityVisibilityUtils.onlyDetectedBySensors(localPlayer, entity)) { |