Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theme changes (colors) are not applied until you close and reopen the editor #2637

Closed
antonis opened this issue Sep 17, 2020 · 5 comments
Closed
Assignees
Labels

Comments

@antonis
Copy link

antonis commented Sep 17, 2020

Describe the bug
When you switch theme in the app the theme color palette does not change. This is reproduced both on iOS and Android.
If you switch site and get back, the theme changes are applied.
If you close the editor and reopen it, the theme changes are applied.

To Reproduce
Steps to reproduce the behavior:

  1. Create a post/page
  2. Add a block that has color palette (e.g. Cover or Buttons)
  3. Check the available palette colors
  4. Change the theme
  5. Create a post/page
  6. Add a block that has color palette (e.g. Cover or Buttons)
  7. The available palette colors have not changed
  8. Switch to another site Close the editor
  9. Switch back to the original site Create a post/page
  10. Add a block that has color palette (e.g. Cover or Buttons)
  11. The available palette colors are now updated

Expected behavior
The palette colors should change (step 7) when the user changes theme

Screenshots
A video replicating the issue can be downloaded here.

Smartphone (please complete the following information):

  • Device: iPhone SE 2020 (iOS 14), Pixel 2 XL (Android 11)
@antonis antonis added [Type] Bug Something isn't working [OS] iOS [OS] Android labels Sep 17, 2020
@chipsnyder
Copy link
Contributor

Hey @antonis I have a question on what you're experiencing to make sure I'm seeing the same issue.
If I modify the repo steps to the below steps do you see the same behavior:

  1. Create a post/page
  2. Add a block that has color palette (e.g. Cover or Buttons)
  3. Check the available palette colors
  4. Change the theme
  5. Create a post/page
  6. Add a block that has color palette (e.g. Cover or Buttons)
  7. The available palette colors have not changed
  8. Switch to another site Close the editor
  9. Switch back to the original site Create a post/page
  10. Add a block that has color palette (e.g. Cover or Buttons)
  11. The available palette colors are now updated

@chipsnyder chipsnyder self-assigned this Sep 17, 2020
@antonis
Copy link
Author

antonis commented Sep 17, 2020

If I modify the repo steps to the below steps do you see the same behavior:

@chipsnyder I confirm that I see the same behavior with your steps. The second time I open the editor the theme is applied.
Switching site is not necessary but I was biased to believe that a refresh occurs only this way. I updated the issue.

@antonis antonis changed the title Theme changes (colors) are not applied until you switch site Theme changes (colors) are not applied until you close and reopen the editor Sep 17, 2020
@chipsnyder
Copy link
Contributor

Awesome thanks @antonis it seems like this might be a case of the update event being lost as part of the bridge call. Now that we've done some work to improve that communication I'll look to see if there is a better API we can use to ensure those payloads go through

@chipsnyder
Copy link
Contributor

Sharing here what @antonis and I both discovered. It seems the theme is being passed to the JS side successfully and is correct up to where it gets applied to the settings. So this looks to be a change on the JS side

@chipsnyder
Copy link
Contributor

For the theme showing up with the wrong values, it looks like there might be a timing issue. If the new theme downloads and calls update before the editor loads then the editor will load with the correct theme then revert back to the wrong values do to the initial theme finally being passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants