XML: render dark/light modes in a single paparazzi snapshot instance.#6506
Conversation
Walkthrough
ChangesRuntime Night-Mode Snapshot Support
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
andremion
left a comment
There was a problem hiding this comment.
Thanks for working on this. The approach is right: createConfigurationContext is ignored by Paparazzi, so calling unsafeUpdateConfig before each inflation is the correct way to do it, and the regenerated header golden confirms light and dark now render together.
One blocking issue: the device config is set in two places that can differ, so one test renders on the wrong device. I left the details inline. After the fix, the affected goldens need re-recording. Nothing else is required to merge.
|
@coderabbitai review |
✅ Action performedReview finished.
|
Goal
Dark and light mode snapshots in
PaparazziViewTestwere not rendering correctly. Both halves of the combined snapshot appeared identical becausecreateConfigurationContextis ignored by Paparazzi, so the night mode flag had no effect.Implementation
Replace
createConfigurationContextwithpaparazzi.unsafeUpdateConfig, passing aDeviceConfigwith the correctNightModebefore each view is inflated.Testing
Explain how this change can be tested (or why it can't be tested)
Provide a patch below if it is necessary for testing
Provide the patch summary here
☑️Contributor Checklist
General
developbranchCode & documentation
☑️Reviewer Checklist
🎉 GIF
Please provide a suitable gif that describes your work on this pull request
Summary by CodeRabbit