sanity
sanity copied to clipboard
fix(core): move `ToastProvider` inside `LocaleProvider`
Description
This change fixes a bug that occurs when a Toast
component contains a Translate
component, because the Translate
component now depends on LocaleContext
.
Notably, this occurs when some document operations (e.g. publication) succeed.
This is caused by the order of the providers. ToastProvider
is a parent of LocaleProvider
, but it needs to be a descendant of it. This branch adjusts the order of the providers in order to fix the problem.
What to review
- We've moved
ToastProvider
down the tree. It doesn't appear anything further up the tree depends on it. Is that correct? - We've moved
ErrorLogger
down the tree (because it depends onToastProvider
); notably, it is now insideStudioErrorBoundary
. Are there any concerns with that?
Testing
- Existing Studio e2e tests.
- Manually testing Studio.
Notes for release
- Fixes a bug that caused Studio to crash if a
Translate
component appeared inside aToast
component.