Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
Also remove the assets if we don't need them no more.
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.
BTW this is also the reason for the Playwright test failure:
Notice the upper part of the monitor in the left screenshot?
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.
BTW originally I had meant not to compare screenshots, but to overlay with a really blurry
<div>and then measure the pixel brightness, then verify that it is relatively bright for light mode and dark for dark mode. But IIRC I got stuck somewhere along the lines. Maybe it was the "measure pixel brightness".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.
Whoa, I can't believe that I couldn't make it work back then. It's relatively easy:
For me, this prints:
Therefore, I think the best idea would be to change the Playwright tests that want to verify that dark mode is dark, light mode is bright, with a variation of this code, say, dividing the return value by 255 to limit it to the range between 0 and 1, and then assert something like
expect(await getBrightness()).toBeCloseTo(0.25, 2)for dark mode (and 0.85 for light mode).@RafaelJohn9 do you want to run with this and replace the screenshot-based assertions (and likewise these assertions) with this kind of more robust approach?
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.
Sure thing 👍,
Will update the tests 🤝
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.
@RafaelJohn9 maybe that update should be split out into its own PR, which could then be fast-tracked?
Uh oh!
There was an error while loading. Please reload this page.
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.
ooh okay,
lemme reset 👍
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.
I didn't mean the deletion of the resources that are no longer referenced. I meant the test update.
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.
misunderstood that 😅 ,
Awesome, so should I open another PR referencing the same issue, or should I create a separate issue for it ?
Uh oh!
There was an error while loading. Please reload this page.
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.
In git-scm.com, we play a bit looser (albeit not as loose as the Git mailing list): We don't require an issue for every PR. Just open another PR with the updated test (and removing the stored screenshots), maybe referencing this finding about the Playwright tests being broken by benign updated as justification.