Skip to content

Conversation

BrunoQuaresma
Copy link
Collaborator

@BrunoQuaresma BrunoQuaresma commented Sep 4, 2024

Abstracts the Spinner component to control the display of the CircularProgress component. This allows us to make it static during Chromatic tests, making loading tests easier to visualize.

Before:
Screenshot 2024-09-04 at 14 00 44

After:
Screenshot 2024-09-04 at 14 00 49

Abstracts the Spinner component to control the display of the CircularProgress component. This allows us to make it static during Chromatic tests, making loading tests easier to visualize.
@BrunoQuaresma BrunoQuaresma self-assigned this Sep 4, 2024
@BrunoQuaresma BrunoQuaresma requested review from a team and Kira-Pilot and removed request for a team September 4, 2024 17:01
@@ -18,7 +18,7 @@ export const Loader: FC<LoaderProps> = ({
data-testid="loader"
{...attrs}
>
<CircularProgress size={size} />
<Spinner aria-label="Loading..." size={size} />
Copy link
Member

Choose a reason for hiding this comment

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

I might be misunderstanding but it seems we have a Loader component wrapping a Spinner component wrapping a CircularProgress component. Is there a reason to have 3 levels nesting here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point! The purpose of the 'Loader' is to act as a container that centrally positions the loading spinner on the page or within a section, with some padding around it. Meanwhile, the 'Spinner' can be utilized in other components, such as loading buttons. Perhaps 'Loader' is not the most suitable name, but I can't think of anything better at the moment.

Copy link
Member

Choose a reason for hiding this comment

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

Ahh, makes sense! Loader works for me :)

@Kira-Pilot
Copy link
Member

Kira-Pilot commented Sep 4, 2024

One suggestion: we could stick the aria on the actual component so the Spinner is always labeled correctly. Then consumers of the component could pass in a more specific label and override the default, e.g. "Loading the Workspaces Page".

*/
if (isChromatic()) {
props.variant = "determinate";
props.value = 75;
Copy link
Member

Choose a reason for hiding this comment

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

nice

@BrunoQuaresma
Copy link
Collaborator Author

One suggestion: we could stick the aria on the actual component so the Spinner is always labeled correctly. Then consumers of the component could pass in a more specific label and override the default, e.g. "Loading the Workspaces Page".

I like the idea! 👍

@BrunoQuaresma BrunoQuaresma merged commit c3f0db3 into main Sep 4, 2024
27 checks passed
@BrunoQuaresma BrunoQuaresma deleted the bq/determinate-loading-on-storybook branch September 4, 2024 18:20
@github-actions github-actions bot locked and limited conversation to collaborators Sep 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy