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

Adds loading state to ActionList items #4051

Merged
merged 33 commits into from
Jul 5, 2024
Merged

Conversation

mperrotti
Copy link
Contributor

@mperrotti mperrotti commented Dec 11, 2023

Relates to https://github.com/github/primer/issues/2681

Kapture.2023-12-11.at.13.38.49.mp4

Changelog

New

  • ActionList.item accepts loading prop

Changed

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

Copy link

changeset-bot bot commented Dec 11, 2023

🦋 Changeset detected

Latest commit: 2c2f814

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

@mperrotti
Copy link
Contributor Author

This will be a draft until #3913 is merged

Copy link
Contributor

github-actions bot commented Dec 11, 2023

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 91.25 KB (+0.16% 🔺)
packages/react/dist/browser.umd.js 91.51 KB (+0.19% 🔺)

@mperrotti mperrotti marked this pull request as ready for review December 12, 2023 14:44
@mperrotti mperrotti requested review from a team and broccolinisoup December 12, 2023 14:44
@github-actions github-actions bot temporarily deployed to storybook-preview-4051 December 12, 2023 14:48 Inactive
Copy link
Contributor

@TylerJDev TylerJDev left a comment

Choose a reason for hiding this comment

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

I have two suggestions, but otherwise looks good!

Comment on lines 228 to 232
export const WithLoadingItems: StoryFn = () => (
<PageLayout>
<PageLayout.Pane position="start">
<NavList>
<NavList.Item href="#" loading>
Copy link
Contributor

Choose a reason for hiding this comment

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

Now that we don't have loading for links, should this prop & story be removed from NavList? I noticed that this story wasn't working, and I think it's because all NavList.Item(s) utilize ActionList.LinkItem by default.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks - I missed this one.

@@ -456,7 +428,8 @@ export const Item = React.forwardRef<HTMLLIElement, ActionListItemProps>(
{slots.blockDescription}
</Box>
</ItemWrapper>
{!inactive && !menuContext && Boolean(slots.trailingAction) && slots.trailingAction}
{!inactive && !loading && !menuContext && Boolean(slots.trailingAction) && slots.trailingAction}
{loading === true && <VisuallyHidden>Loading</VisuallyHidden>}
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 might need to put this in the Box above so that it is referenced to via aria-labelledby, or we could include it in the aria-labelledby list and generate a unique ID for the VisuallyHidden component that we could add to the list.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh ok I understand.

@mperrotti mperrotti enabled auto-merge July 5, 2024 18:02
@mperrotti mperrotti added this pull request to the merge queue Jul 5, 2024
Merged via the queue into main with commit 7e644b7 Jul 5, 2024
30 checks passed
@mperrotti mperrotti deleted the mp/loading-actionlist-item branch July 5, 2024 18:29
@primer primer bot mentioned this pull request Jul 3, 2024
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.

4 participants