-
Notifications
You must be signed in to change notification settings - Fork 835
Forms: Fix plugin button activating state #45471
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
Conversation
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Code Coverage SummaryCoverage changed in 1 file.
Full summary · PHP report · JS report If appropriate, add one of these labels to override the failing coverage check:
Covered by non-unit tests
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worked great!
Works well in my testing as well! nicely done |
Proposed changes:
When you click the Install or Activate button to install or activate a plugin from our form integrations dashboard or modal, there's a bug where it goes into loading state, then returns to normal state once the plugin is installed, then disappears when we fetch integration status and find the plugin is installed.
This occurs because we're sending two separate requests - one to activate the plugin, and another to fetch integration status. The install button only shows loading state during the first.
I was going to fix this by showing button loading state when integrations are loading, but that would mean when you click to install one button, all the integrations buttons might suddenly show loading state, which is jarring.
So the fix just tracks a 'reconciling' status for the current component. We set that to true once a plugin is active, but we're awaiting integration data, and set it back to false when we get the updated integration status.
The result is the button just shows loading until it fully disappears.
Before
https://github.com/user-attachments/assets/ee5665c6-761d-43ca-ba17-d70bf42b7674
After
https://github.com/user-attachments/assets/a448dec8-352d-447f-ad8d-69335599124d
Other information:
Jetpack product discussion
None.
Does this pull request change what data or activity we track or use?
No.
Testing instructions:
Go to the forms dashboard. Install or activate a plugin. Confirm that the install/activate button doesn't re-show in normal active state before disappearing. It should just stay loading until it disappears.