Skip to content

Hide 'Add staging site' button while loading staging sites #105134

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

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

gcsecsey
Copy link
Contributor

@gcsecsey gcsecsey commented Aug 8, 2025

Resolves DOTCOM-14138 Staging Sites Redesign: Add staging site button appears briefly when reloading

Proposed Changes

  • Added a loading condition to showAddStagingButton
  • Now the button only shows when not loading AND there are no staging sites

Why are these changes being made?

When reloading a page that has a staging site, the Add staging site + button has been appearing briefly.

Testing Instructions

  • Apply these changes or open the Calypso Live link below
  • Navigate to a site with a staging site and refresh the page
  • Check in the header that the Add staging site + button is not rendered at all
  • Navigate to a site that doesn't have a staging site and refresh the page
  • Check in the header that the Add staging site + button is rendered after the page is initially loaded
CleanShot.2025-08-08.at.13.08.16.mp4

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you tested accessibility for your changes? Ensure the feature remains usable with various user agents (e.g., browsers), interfaces (e.g., keyboard navigation), and assistive technologies (e.g., screen readers) (PCYsg-S3g-p2).
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@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 Aug 8, 2025
Copy link

github-actions bot commented Aug 8, 2025

@matticbot
Copy link
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • blaze-dashboard
  • notifications

To test WordPress.com changes, run install-plugin.sh $pluginSlug dotcom-14138-staging-sites-redesign-add-staging-site-button-appears on your sandbox.

Copy link
Contributor

@epeicher epeicher left a comment

Choose a reason for hiding this comment

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

Thanks Gergely for improving this! I have tested it, and it works as expected. I cannot see the button there when refreshing. LGTM! :shipit:

CleanShot.2025-08-08.at.18.48.11.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants