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

Block Theme Previews: Activate button has no loading state #55273

Closed
scruffian opened this issue Oct 11, 2023 · 4 comments · Fixed by #55658
Closed

Block Theme Previews: Activate button has no loading state #55273

scruffian opened this issue Oct 11, 2023 · 4 comments · Fixed by #55658
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@scruffian
Copy link
Contributor

scruffian commented Oct 11, 2023

What problem does this address?

When activating a block theme from a preview, the "Activate" button should show a loading state, but instead it just stays blue:

Screen.Recording.2023-10-11.at.16.51.40.mov

What is your proposed solution?

The activate button needs a loading state to communicate clearly to the user that an action is happening in the background. This is how the save button usually works in the site editor.

Props to @autumnfjeld for raising this.

@scruffian scruffian added [Type] Bug An existing feature does not function as intended [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") labels Oct 11, 2023
@scruffian
Copy link
Contributor Author

I spent a long time investigating this today. Here are my findings.:

  1. The state of the button that we care about is the one in this file.
  2. Setting isBusy to true on this button gives it a loading state.
  3. At present this state is connected to the isSavingEntityRecord selector.
  4. This selector doesn't work for activating a theme, since a theme activation isn't an entity.
  5. The action that activates the theme is triggered by the save panel not the save button, which makes it very difficult to connect the two together.

I am not sure how to proceed. I think we need a way to save the state of the activation in the global state, which means we probably need a new key for it in the store.

@autumnfjeld
Copy link

autumnfjeld commented Oct 12, 2023

Props to @autumnfjeld for raising this.

I'm just the messenger props go @fushar and also our great testers. :)

@okmttdhr
Copy link
Contributor

I am not sure how to proceed. I think we need a way to save the state of the activation in the global state, which means we probably need a new key for it in the store.

@scruffian
This seems to make sense to me, as the two components are independent!

@arthur791004
Copy link
Contributor

@scruffian I proposed #55658 to resolve this issue. It's simple but I'm unsure whether it's a good idea. WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
4 participants