Skip to content

Change loading state label to 'Loading' to cover both start and stop - #581

Merged
wojtekn merged 2 commits into
trunkfrom
update/loading-label
Oct 4, 2024
Merged

Change loading state label to 'Loading' to cover both start and stop#581
wojtekn merged 2 commits into
trunkfrom
update/loading-label

Conversation

@wojtekn

@wojtekn wojtekn commented Oct 3, 2024

Copy link
Copy Markdown
Contributor

Related to https://github.com/Automattic/dotcom-forge/issues/9292

Proposed Changes

I propose to change the loading state label from 'Starting' to 'Loading' to cover both start and stop.

I considered splitting the 'loading' status into 'starting' and 'stopping', so we could display different labels each time, but it would make the code more complex and wouldn't provide value to the user, especially since stopping is quick in most cases.

I thought about using 'Processing', too, but 'Loading' seems clearer in this case.

Screenshot 2024-10-03 at 15 25 44

Testing Instructions

  1. Start and stop site
  2. Confirm that new label shows 'Loading...'

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
@wojtekn
wojtekn requested a review from a team October 3, 2024 13:26
@wojtekn wojtekn self-assigned this Oct 3, 2024

@katinthehatsite katinthehatsite left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The changes look good to me. I think that it is not worth it to split the label for starting and stopping at this point since, as you mentioned, it would complicate the code quite a bit and the stopping part is not even that noticeable.

@sejas sejas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me.
If we prefer displaying two different labels, then we can do it without increasing the complexity of the code.
See my comment below.

Approving, since It's not a strong opinion and Loading is a good solution, but probably keeping two different labels is a better solution.
One way to delay the process of stopping is just opening a new window in Playground before clicking Stop.

Uv2Y4g.mp4
Comment thread src/components/action-button.tsx Outdated
break;
case 'loading':
buttonLabel = __( 'Starting…' );
buttonLabel = __( 'Loading…' );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What do you think about displaying different labels?

Suggested change
buttonLabel = __( 'Loading…' );
buttonLabel = isRunning ? __( 'Stopping…' ) : __( 'Starting…' );
jR31Fc.mp4

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks, makes sense. Changed: 5d72de8

@wojtekn
wojtekn merged commit e258f74 into trunk Oct 4, 2024
@wojtekn
wojtekn deleted the update/loading-label branch October 4, 2024 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants