Repository navigation
fix(ui): let dialogs below StreamChat follow the app's brightness - #3005
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
xsahil03x
left a comment
There was a problem hiding this comment.
The fix is right for apps that register their own StreamTheme. One regression to address before merging, plus a test and a changelog tweak.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Key the subtree so switching between a light and dark theme where only one registers a StreamTheme no longer unmounts everything below StreamChat. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
59cbcc5 to
c8d4688
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3005 +/- ##
=======================================
Coverage 78.27% 78.27%
=======================================
Files 450 450
Lines 29347 29350 +3
=======================================
+ Hits 22970 22973 +3
Misses 6377 6377 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Submit a pull request
Linear: FLU-
Github Issue: #
CLA
Description of the pull request
StreamChatwraps its child in aThemecarrying theStreamThemeextension.showDialogandshowModalBottomSheetcopy everyThemebetween the caller and the root navigator into the route when it opens, so a dialog opened belowStreamChatkept the colors of the moment it opened and did not follow a light/dark switch.A dialog is not a descendant of the screen that opened it. It is a separate route in the root navigator's overlay, so
StreamChat'sThemecan never notify it of a change:InheritedTheme.capturebridges the two branches by copying theThemeDatavalues into the dialog route. It only copies, so the dialog keeps the values from the moment it opened. Without aThemebetween the caller and the navigator nothing is copied, and the dialog readsMaterialApp'sTheme, which is an ancestor of its branch and does notify it.The
Themeis now only inserted when the app has not registered aStreamThemeitself. An app that registers one, such as the Stream Video sample app (GetStream/stream-video-flutter#1378), gets dialogs that follow the app theme.Tested in
stream_chat_test.dart: a dialog opened belowStreamChatgets the darkStreamThemeafter the brightness changes. It failed before this change.Screenshots / Videos
🤖 Generated with Claude Code
Summary by CodeRabbit
StreamChatnow reflect the app’s current light or dark theme when brightness changes.