Skip to content

Staging sites redesign: Focus add staging site button #105130

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 3 commits into
base: trunk
Choose a base branch
from

Conversation

katinthehatsite
Copy link
Contributor

@katinthehatsite katinthehatsite commented Aug 8, 2025

Related to DOTCOM-14115

Proposed Changes

This PR adds a highlight around the Add staging site button when you click on Located in top navigation button in the Create new staging site card. It should be available only on production and not on staging sites:

Screenshot 2025-08-08 at 2 17 52 PM

Testing Instructions

  • Pull the changes from this branch or use the Calypso Live Link below
  • Ensure that you have at least one Atomic site
  • Ensure that Atomic site does not have a staging site
  • Navigate to /staging-site/{yourAtomicSite}
  • Click on Staging site tab
  • Observe that there is a link under Create staging site card
  • Click on Located in the top navigation
  • Observe that the Add staging site gets highlighted
  • Observe that the highlight goes away after 3 seconds

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)?

@katinthehatsite katinthehatsite self-assigned this Aug 8, 2025
Copy link

github-actions bot commented Aug 8, 2025

@katinthehatsite katinthehatsite marked this pull request as draft August 8, 2025 10:24

setTimeout( () => {
button.classList.remove( 'staging-button-highlighted' );
}, 3000 );
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if three seconds is enough or not, leaving it here for feedback

Copy link
Contributor

Choose a reason for hiding this comment

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

Just based on my testing, I think the 3 seconds is plenty, I'll add a video of it to my review.

@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

  • notifications

To test WordPress.com changes, run install-plugin.sh $pluginSlug fix/highlight-buttons-when-clicked on your sandbox.

@katinthehatsite katinthehatsite requested a review from a team August 8, 2025 12:43
@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
@katinthehatsite katinthehatsite marked this pull request as ready for review August 8, 2025 12:43
@katinthehatsite
Copy link
Contributor Author

For now, I just did one button to experiment with how this might look like. This is very much open to feedback cc @epeicher

Copy link
Contributor

@ivan-ottinger ivan-ottinger left a comment

Choose a reason for hiding this comment

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

The changes works nicely and the Add staging site + button gets highlighted as expected. 👌🏼🙂

Markup on 2025-08-08 at 16:59:29

When a staging site is already created, the link is gone as it should be:

Markup on 2025-08-08 at 16:58:01

I left one code suggestion inline.


Not related to the code itself: I have a little bit mixed feelings about using this specific pattern of a click highlighting another button.

It indeed helps focusing attention to the right place. I don't think we have used anything like this anywhere in Calypso before though (if I am not mistaken). I see that Marina is pinged in the related Linear issue so curious to hear what designers think too.

Comment on lines +129 to +142
<button
onClick={ onLocationClick }
style={ {
background: 'none',
border: 'none',
padding: 0,
textDecoration: 'none',
cursor: 'pointer',
color: '#3858e9',
font: 'inherit',
} }
>
{ item.location }
</button>
Copy link
Contributor

Choose a reason for hiding this comment

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

What if we used the Button component with its link variant instead? https://wordpress.github.io/gutenberg/?path=/docs/components-button--docs

Less styling should be necessary:

diff --git a/client/sites/staging-site/components/staging-site-management-move-info/index.tsx b/client/sites/staging-site/components/staging-site-management-move-info/index.tsx
index 924ff94d3b7..f4203a24a97 100644
--- a/client/sites/staging-site/components/staging-site-management-move-info/index.tsx
+++ b/client/sites/staging-site/components/staging-site-management-move-info/index.tsx
@@ -3,6 +3,7 @@ import {
 	Card,
 	CardBody,
 	Icon,
+	Button,
 	__experimentalText as Text,
 	__experimentalHeading as Heading,
 	__experimentalVStack as VStack,
@@ -126,20 +127,13 @@ const InfoCard: FunctionComponent< InfoCardProps > = ( { item, onLocationClick }
 									</a>
 								) }
 								{ onLocationClick && ! item.link && (
-									<button
+									<Button
 										onClick={ onLocationClick }
-										style={ {
-											background: 'none',
-											border: 'none',
-											padding: 0,
-											textDecoration: 'none',
-											cursor: 'pointer',
-											color: '#3858e9',
-											font: 'inherit',
-										} }
+										variant="link"
+										style={ { textDecoration: 'none' } }
 									>
 										{ item.location }
-									</button>
+									</Button>
 								) }
 								{ ! item.link && ! onLocationClick && item.location }
 							</Text>

Copy link
Contributor

@gcsecsey gcsecsey left a comment

Choose a reason for hiding this comment

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

IMO the highlight works well and the 3 second duration is enough to get my attention:

CleanShot.2025-08-08.at.16.16.47.mp4

When clicking the Add button while it's highlighted, the highlight class is removed as described. However, the focused state of the button looks very similar to the highlight. Maybe we should reset the focus state as well when the button is disabled. 🤔


setTimeout( () => {
button.classList.remove( 'staging-button-highlighted' );
}, 3000 );
Copy link
Contributor

Choose a reason for hiding this comment

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

Just based on my testing, I think the 3 seconds is plenty, I'll add a video of it to my review.

@epeicher
Copy link
Contributor

epeicher commented Aug 8, 2025

For now, I just did one button to experiment with how this might look like. This is very much open to feedback cc @epeicher

I like the functionality, as it indicates to the user where to click, helping with the transition to the new dashboard. I updated the priority to Low as this is a temporary banner, and @wojtekn suggested not to overcomplicate it. But if we improve UX, I would go for it as long the complexity is encapsulated in the components that will be deleted in the future 🙁

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.

5 participants