Fix false enable of highlights when opening the editor menu#21535
Fix false enable of highlights when opening the editor menu#21535LoukasPap wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #21535 +/- ##
=======================================
Coverage 89.40% 89.41%
=======================================
Files 262 262
Lines 66762 66748 -14
=======================================
- Hits 59690 59683 -7
+ Misses 7072 7065 -7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
timvandermeij
left a comment
There was a problem hiding this comment.
Code-wise this patch LGTM with the comments addressed, but I'd prefer @calixteman also review this to given his familiarity with this particular code.
After addressing the review comments, please keep the commits squashed into one; see https://github.com/mozilla/pdf.js/wiki/Squashing-Commits if you're not familiar with how to do that.
Thank you for your contribution!
| }); | ||
| }); | ||
|
|
||
| describe("Show all disabled status must be persistence", () => { |
There was a problem hiding this comment.
Nit: s/persistence/persistent
| ) | ||
| .toBe(true); | ||
|
|
||
| const visibilityState = await page.evaluate(selector => { |
There was a problem hiding this comment.
It looks like we can just call this const hasHiddenClass and then return a boolean value instead of an object with just a single property, which overall seems simpler.
The same applies to the test below that has a similar pattern.
|
I'll wait for @calixteman to see the PR too and address all issues together (and then squash). Thank you for reviewing! |
|
|
||
| await page.waitForSelector(".editToolbar"); | ||
| const highlightFromToolbar = await page.$( | ||
| ".floatingToolbar button[data-action='highlight']" |
There was a problem hiding this comment.
Is it an AI hallucination ?
.floatingToolbar exists only in the geckoview and is unrelated to highlighting.
| const highlightFromToolbar = await page.$( | ||
| ".floatingToolbar button[data-action='highlight']" | ||
| ); | ||
| if (highlightFromToolbar) { |
There was a problem hiding this comment.
I don't understand this check by itself... except that it's fixing the floatingToolbar mentioned issue.
So this code is just dead code.
Fixes #21498
The fix ensures that the "Show all" toggle button remains consistent across updates in editor mode and it reflects the correct highlight state (even if we highlight from floating toolbar).
The two integration tests cover the following cases:
Test 1
Test 2