You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for pushing this. The direction makes sense, but I see a few blocking issues before this can go in:
The dark-mode snapshots currently use the same snapshot name as the light-mode ones. That means they will either overwrite the light reference when recording or compare against the light baseline and fail. The dark pass needs a distinct test/snapshot name, for example with a -dark suffix.
This changes the public PrefireSnapshot API in a source-breaking way. The existing closure-based initializers were replaced with value-based ones, so consumer code like PrefireSnapshot({ MyView() }, ...) will stop compiling. If this is not intended as a breaking release, the old overloads should stay and just gain isDark.
The non-dark path now forces light mode. That changes existing behavior for previews that explicitly opt into dark mode or depend on the ambient color scheme. I think only the dark pass should force a color scheme; the default pass should preserve current behavior.
I also do not see tests covering the new dark-mode generation path yet. Please add coverage for:
generating the extra dark snapshot assertion when record_in_dark_mode is enabled
distinct snapshot naming for dark mode
preserving the existing public PrefireSnapshot API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Short description 📝
Add support for Dark mode theme.
When config is set to record dark mode images as well it will do so, record dark and light images
Solution 📦
Implementation 👩💻👨💻
It's a bit raw now, just want to get feedback @BarredEwe and then if fine I can cleanup and add tests