Fix the WebKit view not transitioning from light to dark mode #2542
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.
adaptReleaseNotesAppearance was over-engineered to update the transparent background state of the web view (which was causing the issue) and the background NSBox view when the system changes to dark or light mode. This is partly because when dark mode support was originally written, it used to use a stylesheet that was only specific to dark aqua (and then the code worsened over time to adapt other view changes only to dark mode). This code has since changed some time ago to use a universal stylesheet for both light/dark mode.
So now when the WebKit view is created, we just opt into a transparent background and set up a background NSBox view once and don't do anything when the effectiveAppearance of the views change. This fixes visual issues on current and older OS systems when changing system appearance.
Fixes #2541
Misc Checklist
Testing
I tested and verified my change by using one or multiple of these methods:
Tested modern and legacy WebKit views being initially started in dark or light mode, and switching to other appearance.
macOS version tested:
macOS 14.4.1
macOS 12 VM
macOS 10.15 VM
macOS 10.14 VM