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

Put TopMenuStyle detection under a debug flag #1869

Merged
merged 1 commit into from
Aug 1, 2023
Merged

Conversation

Veracity0
Copy link
Contributor

Captain Scotch and others noticed that their "relay scripts" dropdown occasionally disappeared from their awesomemenu.

Since we only set topmenu style in three places:

  1. MoonPhaseRequest
  2. Visiting Interface tab in account.php
  3. Changing menu style in account.php

this was confusing.

I inserted debug code to deduce the topmenu style from the responseText every time we decorated it to add the relay scripts dropdown.

Turns out that "visiting interface tab in account.php" was broken: KoL had changed the tag on the radio button, so if you had the "fancy" style selected, we'd think it was "normal".

With that fixed - and there are now extensive tests in AccountRequestTest - everything seems to be peachy.

Doing text searches to deduce menu style every time we decorate it is (again) no longer necessary.

I considered just ripping out that code, but I left it in under a debug conditional, controlled by debugTopMenuStyle, just in case we want to test with it in the future.

@Veracity0 Veracity0 requested a review from a team as a code owner August 1, 2023 17:28
@codecov
Copy link

codecov bot commented Aug 1, 2023

Codecov Report

Merging #1869 (06c1d16) into main (cc754fa) will decrease coverage by 0.01%.
Report is 1 commits behind head on main.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1869      +/-   ##
============================================
- Coverage     36.37%   36.36%   -0.01%     
+ Complexity    18782    18778       -4     
============================================
  Files          1081     1081              
  Lines        166359   166360       +1     
  Branches      35397    35398       +1     
============================================
- Hits          60509    60495      -14     
- Misses        95966    95986      +20     
+ Partials       9884     9879       -5     
Files Changed Coverage Δ
...t/sourceforge/kolmafia/webui/TopMenuDecorator.java 82.17% <100.00%> (+0.13%) ⬆️

... and 8 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b3d22c3...06c1d16. Read the comment docs.

@Veracity0 Veracity0 merged commit 0adb71b into main Aug 1, 2023
8 checks passed
@Veracity0 Veracity0 deleted the topmenu-debug-flag branch August 1, 2023 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants