fix(dialog): keep DialogManagerProvider mounted on first render and stabilize manager identity#3104
Open
MartinCupela wants to merge 2 commits intomasterfrom
Open
fix(dialog): keep DialogManagerProvider mounted on first render and stabilize manager identity#3104MartinCupela wants to merge 2 commits intomasterfrom
MartinCupela wants to merge 2 commits intomasterfrom
Conversation
…tabilize manager identity
|
Size Change: +223 B (+0.04%) Total Size: 615 kB 📦 View Changed
ℹ️ View Unchanged
|
…ilize dialog manager lifecycle
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3104 +/- ##
==========================================
- Coverage 82.21% 82.18% -0.04%
==========================================
Files 418 418
Lines 12044 12054 +10
Branches 3875 3884 +9
==========================================
+ Hits 9902 9906 +4
- Misses 2142 2148 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
oliverlaz
approved these changes
Apr 9, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
🎯 Goal
This PR fixes an initial-render bug in
DialogManagerProviderthat could causeChatchildren to be skipped on first render (notably affecting SSR), and also fixes manager identity mismatches that could break anchored dialog UIs (for example channel action context menus).Problem
DialogManagerProviderpreviously initialized withnullforid-based managers untiluseEffectran.That introduced two issues:
null, so children were not rendered in SSR/initial pass.idwere involved, causing dialog open state and portal destination to use different manager instances.Changes
nullgating behavior forDialogManagerProvider.idare still mounted.===) where needed to prevent stale instance reuse.Tests
Added regression coverage in both branches to verify SSR behavior:
DialogManagerProvideris used with anid.DialogPortalDestinationin the SSR-specific test to keep the assertion focused on provider rendering behavior.Validation
yarn test src/components/Dialog/__tests__/DialogManagerContext.test.tsxImpact
masterandrelease-v13implementations where APIs differ.