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

[UnderlineNav] : Introduce loading counters #2378

Merged
merged 5 commits into from
Sep 28, 2022

Conversation

broccolinisoup
Copy link
Member

@broccolinisoup broccolinisoup commented Sep 27, 2022

We need loading states for the UnderlineNav counters. See the Figma file as a ref.

Closes #1314

I wasn't sure if we should introduce a loading state to the CounterLabel component (we still can with a minor changeset) but I solved this in an isolation to UnderlineNav for now. Mainly because I needed to make something quick due to working towards Universe deadline and also there are still unknowns on the design (I couldn't find a reference to the background colours, there is only a demo video to check on the Figma file) and also the react CounterLabel and view component CounterLabel looks very different. So I thought maybe sticking to solving this in iso might be better as a start? Please let me know what you think 👀

Screen Recordings

Light Theme

layout-underlinenav-examples--counter-loading.-.27.September.2022.1.mp4

Dark Theme

layout-underlinenav-examples--counter-loading.-.27.September.2022.mp4

On coarse pointer devices (Scroll Behaviour)

layout-underlinenav-examples--counters-loading-state.-.29.September.2022.mp4

Please provide before/after screenshots for any visual changes

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

@broccolinisoup broccolinisoup requested review from a team and rezrah September 27, 2022 11:53
@changeset-bot
Copy link

changeset-bot bot commented Sep 27, 2022

🦋 Changeset detected

Latest commit: 516749a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Sep 27, 2022

size-limit report 📦

Path Size
dist/browser.esm.js 77.1 KB (0%)
dist/browser.umd.js 77.71 KB (0%)

@broccolinisoup broccolinisoup temporarily deployed to github-pages September 27, 2022 12:01 Inactive
src/UnderlineNav2/LoadingCounter.tsx Outdated Show resolved Hide resolved
src/UnderlineNav2/LoadingCounter.tsx Outdated Show resolved Hide resolved
width: 22px;
height: 16px;
display: inline-block;
border-radius: 20px;`
Copy link
Contributor

Choose a reason for hiding this comment

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

Is 20 an arbitrary number?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, I got it from the CounterLabel's styles I currently don't have much design details for the loading counters except a demo on the Figma file So I tried to use CounterLabel's style for a minimal layout shift. I am not too sure about the animation colours either but I'll check it when @danielguillan is back

@broccolinisoup broccolinisoup temporarily deployed to github-pages September 28, 2022 03:07 Inactive
Base automatically changed from broccolinisoup/underlineNav-overflow to main September 28, 2022 03:19
@broccolinisoup broccolinisoup temporarily deployed to github-pages September 28, 2022 03:44 Inactive
@broccolinisoup broccolinisoup temporarily deployed to github-pages September 28, 2022 04:13 Inactive
Copy link
Contributor

@colebemis colebemis left a comment

Choose a reason for hiding this comment

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

Looks great! I just left a small naming suggestion.

docs/content/drafts/UnderlineNav2.mdx Outdated Show resolved Hide resolved
### Loading State for Counters

```jsx live drafts
<UnderlineNav counterLoading={true}>
Copy link
Contributor

Choose a reason for hiding this comment

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

How do you feel about renaming this prop to loadingCounters? I think it's a little more clear that applies to all the counters in the underline nav.

Suggested change
<UnderlineNav counterLoading={true}>
<UnderlineNav loadingCounters={true}>

Copy link
Member Author

Choose a reason for hiding this comment

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

I debated it yesterday myself 😃 I wasn't sure but now you recommended it as well, so I'll update it, it makes more sense!

Co-authored-by: Cole Bemis <colebemis@github.com>
@broccolinisoup broccolinisoup temporarily deployed to github-pages September 28, 2022 22:50 Inactive
@broccolinisoup broccolinisoup temporarily deployed to github-pages September 28, 2022 23:26 Inactive
@broccolinisoup broccolinisoup merged commit c35c2ac into main Sep 28, 2022
@broccolinisoup broccolinisoup deleted the broccolinisoup/loading-counters branch September 28, 2022 23:33
@primer-css primer-css mentioned this pull request Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants