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

Add/loading state to unified nav #45831

Merged
merged 7 commits into from
Sep 24, 2020
Merged

Conversation

getdave
Copy link
Contributor

@getdave getdave commented Sep 22, 2020

Screen Shot 2020-09-22 at 12 03 21

Changes proposed in this Pull Request

  • Amend state shape to allow for tracking state of the API request.
  • Add temporary loading UI <Spinner />.

Testing instructions

  • Checkout this PR.
  • Apply D49005-code
  • Apply blog sticker
  • Run calypso
  • Visit http://calypso.localhost:3000/?flags=nav-unification.
  • You should see a loading spinner appear in the sidebar whilst the Nav data is being loaded.
  • The Nav should then appear once loading and loading state should disappear.

For debugging purposes you can force this UI state to appear by opening browser dev tools and typing state.adminMenu.requesting.isRequesting = true.

Fixes #45830

@matticbot
Copy link
Contributor

@getdave getdave self-assigned this Sep 22, 2020
@getdave getdave added the [Feature] Calypso & wp-admin Navigation All navigation in Calypso and wp-admin, and the unified transitions between the two. label Sep 22, 2020
@matticbot
Copy link
Contributor

matticbot commented Sep 22, 2020

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Async-loaded Components (~150 bytes added 📈 [gzipped])

name                                          parsed_size           gzip_size
async-load-my-sites-sidebar-unified-switcher       +494 B  (+0.2%)     +150 B  (+0.3%)

React components that are loaded lazily, when a certain part of UI is displayed for the first time.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@getdave getdave requested a review from a team September 22, 2020 13:06
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Sep 22, 2020
@getdave
Copy link
Contributor Author

getdave commented Sep 22, 2020

I'm going to amend this to follow a reducer/state pattern more closely aligned with client/state/plans/reducer.js.

@getdave getdave force-pushed the add/loading-state-to-unified-nav branch from adbc084 to 45e0d58 Compare September 23, 2020 13:03
Copy link
Contributor

@cpapazoglou cpapazoglou left a comment

Choose a reason for hiding this comment

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

Thanks Dave!
Tests pass and the UX is better than having no visual indicator 👍 !

@getdave getdave merged commit d57d62e into master Sep 24, 2020
@getdave getdave deleted the add/loading-state-to-unified-nav branch September 24, 2020 10:37
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Calypso & wp-admin Navigation All navigation in Calypso and wp-admin, and the unified transitions between the two.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nav Unificaiton - create visual "loading" state for the menu
3 participants