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

Feature: Add navigation.isLoading state to core/router store #67680

Merged

Conversation

fabiankaegy
Copy link
Member

What?

Adds a new navigation.isLoading state to the core/router interactivity store

Why?

Today the router only has the navigation.hasStarted and navigation.hasFinished states. These only get set if the loadingAnimation option is not set to false.

Because of this it is not possible to hide the global loading indicator whilst still knowing whether or not the router is currently loading something.

How?

Adds a new state to the store

@fabiankaegy fabiankaegy added [Type] Enhancement A suggestion for improvement. [Package] Interactivity Router /packages/interactivity-router labels Dec 6, 2024
@fabiankaegy fabiankaegy self-assigned this Dec 6, 2024
Copy link

github-actions bot commented Dec 6, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: fabiankaegy <fabiankaegy@git.wordpress.org>
Co-authored-by: michalczaplinski <czapla@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link

github-actions bot commented Dec 9, 2024

Flaky tests detected in 4fe358e.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12196351428
📝 Reported issues:

Copy link
Contributor

@michalczaplinski michalczaplinski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. Thanks for the quick PR, @fabiankaegy.

We can now use this flag to add UI in #67181 to show a custom UI when the user is waiting for search results.

@sirreal sirreal merged commit e85937f into trunk Dec 9, 2024
69 of 71 checks passed
@sirreal sirreal deleted the fix/store-loading-state-regadless-of-loading-animation branch December 9, 2024 14:51
@github-actions github-actions bot added this to the Gutenberg 19.9 milestone Dec 9, 2024
@luisherranz
Copy link
Member

luisherranz commented Dec 10, 2024

I believe this API needs more consideration for WP 6.8, but we can test it as it is until then.

I have added it to the WordPress 6.8 iteration, by the way.

@sirreal
Copy link
Member

sirreal commented Dec 10, 2024

I unintentionally enabled auto-merge on this PR. Feel free to proceed as necessary if it needs to be reverted or needs additional changes.

@michalczaplinski
Copy link
Contributor

michalczaplinski commented Dec 10, 2024

I just noticed it after approving 🙂. No worries, we can try out the API while it's in Gutenberg.

It would also need some e2e tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Interactivity Router /packages/interactivity-router [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants