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

Refactor: Update UNSTABLE_EmptyState according to design #DS-1311 #1481

Merged

Conversation

curdaj
Copy link
Contributor

@curdaj curdaj commented Jun 14, 2024

Description

Additional context

Issue reference

@github-actions github-actions bot added the feature New feature or request label Jun 14, 2024
Copy link

netlify bot commented Jun 14, 2024

Deploy Preview for spirit-design-system ready!

Name Link
🔨 Latest commit 6513af0
🔍 Latest deploy log https://app.netlify.com/sites/spirit-design-system/deploys/667563da017486000788f202
😎 Deploy Preview https://deploy-preview-1481--spirit-design-system.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 96 (no change from production)
Accessibility: 93 (no change from production)
Best Practices: 100 (no change from production)
SEO: 82 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@coveralls
Copy link

Coverage Status

coverage: 96.911%. remained the same
when pulling 5ff9981 on feat/ds-1311-emptystate-update
into 2d62ffb on integration/unstable-emptystate.

@coveralls
Copy link

Coverage Status

coverage: 77.727% (-19.2%) from 96.911%
when pulling 5ff9981 on feat/ds-1311-emptystate-update
into 2d62ffb on integration/unstable-emptystate.

3 similar comments
@coveralls
Copy link

Coverage Status

coverage: 77.727% (-19.2%) from 96.911%
when pulling 5ff9981 on feat/ds-1311-emptystate-update
into 2d62ffb on integration/unstable-emptystate.

@coveralls
Copy link

Coverage Status

coverage: 77.727% (-19.2%) from 96.911%
when pulling 5ff9981 on feat/ds-1311-emptystate-update
into 2d62ffb on integration/unstable-emptystate.

@coveralls
Copy link

Coverage Status

coverage: 77.727% (-19.2%) from 96.911%
when pulling 5ff9981 on feat/ds-1311-emptystate-update
into 2d62ffb on integration/unstable-emptystate.

@coveralls
Copy link

Coverage Status

coverage: 96.911%. remained the same
when pulling a27f0ca on feat/ds-1311-emptystate-update
into 2d62ffb on integration/unstable-emptystate.

@coveralls
Copy link

Coverage Status

coverage: 96.911%. remained the same
when pulling 80c99c6 on feat/ds-1311-emptystate-update
into 2d62ffb on integration/unstable-emptystate.

@coveralls
Copy link

Coverage Status

coverage: 76.855% (-20.1%) from 96.911%
when pulling 80c99c6 on feat/ds-1311-emptystate-update
into 2d62ffb on integration/unstable-emptystate.

linkUrl="#"
title="Empty State Title"
/>
<UNSTABLE_EmptyState spacing="space-700">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, nice idea :-) Let's discuss this and there is no right or wrong answer.

From the point of a developer who will be using this, I can now do:

<EmptyState>
  <Heading>Heading</Heading>
  <Text>This is an empty state</Text>
  <Link href="/">Back to homepage</Link>
</EmptyState>

// or 

<EmptyState>
  <EmptyStateContent
        description="This is an empty state"
        heading="Heading"
    />
  <EmptyStateButtons
        buttonPrimaryText="Back to homepage"
        buttonPrimaryUrl="/"
    />
</EmptyState>

// what about the third option? are we letting it go?

<EmptyState
  description="This is an empty state"
   heading="Heading"
   buttonPrimaryText="Back to homepage"
   buttonPrimaryUrl="/"
/>

I am not suggesting that we must do this right now. I am just trying to find the point where we should stop our iterations and merge this and let the developer decide about the ease of use.

There could also be another option, that also makes sense. However the naming of the subcomponent EmptyStateButtons make no sense here:

<EmptyState>
  <EmptyStateContent>
    <Heading>Heading</Heading>
    <Text>This is an empty state</Text>
  </EmptyStateContent>
  <EmptyStateButtons>
    <Link href="/">Back to homepage</Link>
  </EmptyStateButtons>
</EmptyState>

As I wrote at the beginning, there is no right or wrong, just the ease of using the API we fabricate. So maybe just let it be as it is right now and test if the usability is good enough :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to discussion it will be:

<EmptyState>
    <EmptyStateSection>
        <Icon name="icon-name" />
    </EmptyStateSection>
    <EmptyStateSection>
        <Heading>Heading</Heading>
        <Text>This is an empty state</Text>
    </EmptyStateSection>
    <EmptyStateSection>
        <ActionsLayout>
            <ButtonLink href="/" color="primary">Back to homepage</ButtonLink>
            <ButtonLink href="/" color="primary">Back to homepage</ButtonLink>
        </ActionsLayout>
    </EmptyStateSection>
    <EmptyStateSection>
        <Link href="/">Back to homepage</Link>
    </EmptyStateSection>
</EmptyState>

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we are able to make the structure a lot simpler:

<EmptyState>
    <Icon name="icon-name" />
    <Heading>Heading</Heading>
    <Text>This is an empty state</Text>
    <ActionsLayout>
        <ButtonLink href="/" color="primary">Back to homepage</ButtonLink>
        <ButtonLink href="/" color="primary">Back to homepage</ButtonLink>
    </ActionsLayout>
    <Link href="/">Back to homepage</Link>
</EmptyState>

It just requires something like the following CSS:

.UNSTABLE_EmptyState {
  //

  max-width: 582px; // if this is the desired limit for the component and not just the demo
  justify-items: center;
}

What do you think? Or did I miss anything?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Based on the design, there is some space between the sections. That is why we use the subcomponent. Please, look at the Figma file. Maybe we missed something but the offset between the sections is different than between components themselves.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately, the problem seems to be in this part:

    <Heading>Heading</Heading>
    <Text>This is an empty state</Text>
    

because it should be a one block. Technically there are 4 blocks in the component:

  • Image/Illustration
  • Headline+Text
  • Action (buttons)
  • Link

and I need to ensure that they all have a gap between them.

Technically it could be:

<EmptyState>
    <Icon name="icon-name" />
    <div>
        <Heading>Heading</Heading>
        <Text>This is an empty state</Text>
    </div>
    <ActionsLayout>
        <ButtonLink href="/" color="primary">Back to homepage</ButtonLink>
        <ButtonLink href="/" color="primary">Back to homepage</ButtonLink>
    </ActionsLayout>
    <Link href="/">Back to homepage</Link>
</EmptyState>

Copy link
Contributor

Choose a reason for hiding this comment

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

@curdaj I'm totally OK with what you suggest. You would use CSS to add a gap among anything inside EmptyState, plus the syntax of the whole EmptyState composition is much simpler.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@adamkudrna Based on discussion with @literat , we decided to keep EmptyStateSection for now. We consider it as an unstable component and may change it in the future

@coveralls
Copy link

Coverage Status

coverage: 96.911%. remained the same
when pulling 208ca04 on feat/ds-1311-emptystate-update
into 2d62ffb on integration/unstable-emptystate.

@coveralls
Copy link

Coverage Status

coverage: 77.727% (-19.2%) from 96.911%
when pulling 208ca04 on feat/ds-1311-emptystate-update
into 2d62ffb on integration/unstable-emptystate.

@curdaj curdaj marked this pull request as ready for review June 18, 2024 12:39
Copy link

@rhrebecek rhrebecek left a comment

Choose a reason for hiding this comment

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

👍

@coveralls
Copy link

Coverage Status

coverage: 96.911%. remained the same
when pulling bf56eab on feat/ds-1311-emptystate-update
into 2d62ffb on integration/unstable-emptystate.

@coveralls
Copy link

Coverage Status

coverage: 77.727% (-19.2%) from 96.911%
when pulling bf56eab on feat/ds-1311-emptystate-update
into 2d62ffb on integration/unstable-emptystate.

Copy link
Contributor

@adamkudrna adamkudrna left a comment

Choose a reason for hiding this comment

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

If I get it right, I think we are able to get rid of the EmptyStateSection subcomponent.

linkUrl="#"
title="Empty State Title"
/>
<UNSTABLE_EmptyState spacing="space-700">
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we are able to make the structure a lot simpler:

<EmptyState>
    <Icon name="icon-name" />
    <Heading>Heading</Heading>
    <Text>This is an empty state</Text>
    <ActionsLayout>
        <ButtonLink href="/" color="primary">Back to homepage</ButtonLink>
        <ButtonLink href="/" color="primary">Back to homepage</ButtonLink>
    </ActionsLayout>
    <Link href="/">Back to homepage</Link>
</EmptyState>

It just requires something like the following CSS:

.UNSTABLE_EmptyState {
  //

  max-width: 582px; // if this is the desired limit for the component and not just the demo
  justify-items: center;
}

What do you think? Or did I miss anything?

@coveralls
Copy link

Coverage Status

coverage: 77.886% (-19.0%) from 96.838%
when pulling 8626f16 on feat/ds-1311-emptystate-update
into 8f4375f on integration/unstable-emptystate.

7 similar comments
@coveralls
Copy link

Coverage Status

coverage: 77.886% (-19.0%) from 96.838%
when pulling 8626f16 on feat/ds-1311-emptystate-update
into 8f4375f on integration/unstable-emptystate.

@coveralls
Copy link

Coverage Status

coverage: 77.886% (-19.0%) from 96.838%
when pulling 8626f16 on feat/ds-1311-emptystate-update
into 8f4375f on integration/unstable-emptystate.

@coveralls
Copy link

Coverage Status

coverage: 77.886% (-19.0%) from 96.838%
when pulling 8626f16 on feat/ds-1311-emptystate-update
into 8f4375f on integration/unstable-emptystate.

@coveralls
Copy link

Coverage Status

coverage: 77.886% (-19.0%) from 96.838%
when pulling 8626f16 on feat/ds-1311-emptystate-update
into 8f4375f on integration/unstable-emptystate.

@coveralls
Copy link

Coverage Status

coverage: 77.886% (-19.0%) from 96.838%
when pulling 8626f16 on feat/ds-1311-emptystate-update
into 8f4375f on integration/unstable-emptystate.

@coveralls
Copy link

Coverage Status

coverage: 77.886% (-19.0%) from 96.838%
when pulling 8626f16 on feat/ds-1311-emptystate-update
into 8f4375f on integration/unstable-emptystate.

@coveralls
Copy link

Coverage Status

coverage: 77.886% (-19.0%) from 96.838%
when pulling 8626f16 on feat/ds-1311-emptystate-update
into 8f4375f on integration/unstable-emptystate.

Copy link
Contributor

Here is the URL of the uploaded artifact:

@coveralls
Copy link

Coverage Status

coverage: 77.886% (-19.0%) from 96.838%
when pulling 8626f16 on feat/ds-1311-emptystate-update
into 8f4375f on integration/unstable-emptystate.

3 similar comments
@coveralls
Copy link

Coverage Status

coverage: 77.886% (-19.0%) from 96.838%
when pulling 8626f16 on feat/ds-1311-emptystate-update
into 8f4375f on integration/unstable-emptystate.

@coveralls
Copy link

Coverage Status

coverage: 77.886% (-19.0%) from 96.838%
when pulling 8626f16 on feat/ds-1311-emptystate-update
into 8f4375f on integration/unstable-emptystate.

@coveralls
Copy link

Coverage Status

coverage: 77.886% (-19.0%) from 96.838%
when pulling 8626f16 on feat/ds-1311-emptystate-update
into 8f4375f on integration/unstable-emptystate.

@coveralls
Copy link

Coverage Status

coverage: 96.838%. remained the same
when pulling 6513af0 on feat/ds-1311-emptystate-update
into 8f4375f on integration/unstable-emptystate.

2 similar comments
@coveralls
Copy link

Coverage Status

coverage: 96.838%. remained the same
when pulling 6513af0 on feat/ds-1311-emptystate-update
into 8f4375f on integration/unstable-emptystate.

@coveralls
Copy link

Coverage Status

coverage: 96.838%. remained the same
when pulling 6513af0 on feat/ds-1311-emptystate-update
into 8f4375f on integration/unstable-emptystate.

@coveralls
Copy link

Coverage Status

coverage: 77.886% (-19.0%) from 96.838%
when pulling 6513af0 on feat/ds-1311-emptystate-update
into 8f4375f on integration/unstable-emptystate.

11 similar comments
@coveralls
Copy link

Coverage Status

coverage: 77.886% (-19.0%) from 96.838%
when pulling 6513af0 on feat/ds-1311-emptystate-update
into 8f4375f on integration/unstable-emptystate.

@coveralls
Copy link

Coverage Status

coverage: 77.886% (-19.0%) from 96.838%
when pulling 6513af0 on feat/ds-1311-emptystate-update
into 8f4375f on integration/unstable-emptystate.

@coveralls
Copy link

Coverage Status

coverage: 77.886% (-19.0%) from 96.838%
when pulling 6513af0 on feat/ds-1311-emptystate-update
into 8f4375f on integration/unstable-emptystate.

@coveralls
Copy link

Coverage Status

coverage: 77.886% (-19.0%) from 96.838%
when pulling 6513af0 on feat/ds-1311-emptystate-update
into 8f4375f on integration/unstable-emptystate.

@coveralls
Copy link

Coverage Status

coverage: 77.886% (-19.0%) from 96.838%
when pulling 6513af0 on feat/ds-1311-emptystate-update
into 8f4375f on integration/unstable-emptystate.

@coveralls
Copy link

Coverage Status

coverage: 77.886% (-19.0%) from 96.838%
when pulling 6513af0 on feat/ds-1311-emptystate-update
into 8f4375f on integration/unstable-emptystate.

@coveralls
Copy link

Coverage Status

coverage: 77.886% (-19.0%) from 96.838%
when pulling 6513af0 on feat/ds-1311-emptystate-update
into 8f4375f on integration/unstable-emptystate.

@coveralls
Copy link

Coverage Status

coverage: 77.886% (-19.0%) from 96.838%
when pulling 6513af0 on feat/ds-1311-emptystate-update
into 8f4375f on integration/unstable-emptystate.

@coveralls
Copy link

Coverage Status

coverage: 77.886% (-19.0%) from 96.838%
when pulling 6513af0 on feat/ds-1311-emptystate-update
into 8f4375f on integration/unstable-emptystate.

@coveralls
Copy link

Coverage Status

coverage: 77.886% (-19.0%) from 96.838%
when pulling 6513af0 on feat/ds-1311-emptystate-update
into 8f4375f on integration/unstable-emptystate.

@coveralls
Copy link

Coverage Status

coverage: 77.886% (-19.0%) from 96.838%
when pulling 6513af0 on feat/ds-1311-emptystate-update
into 8f4375f on integration/unstable-emptystate.

@curdaj curdaj merged commit 99e3c8b into integration/unstable-emptystate Jun 24, 2024
24 of 25 checks passed
@curdaj curdaj deleted the feat/ds-1311-emptystate-update branch June 24, 2024 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request run-visual-tests Runs visual regression testing on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants