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

Add TrailingAction support to NavList #4697

Merged
merged 22 commits into from
Jul 2, 2024
Merged

Conversation

khiga8
Copy link
Contributor

@khiga8 khiga8 commented Jun 25, 2024

Fixes: https://github.com/github/primer/issues/1966
Unblocks: https://github.com/github/accessibility-audits/issues/2942

Changelog

New

This PR adds TrailingAction support to NavList, extending the support we added to ActionList in #4634.

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 Jun 25, 2024

🦋 Changeset detected

Latest commit: 27e01a8

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

Copy link
Contributor

github-actions bot commented Jun 25, 2024

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 91.07 KB (+0.12% 🔺)
packages/react/dist/browser.umd.js 91.32 KB (+0.08% 🔺)

@github-actions github-actions bot temporarily deployed to storybook-preview-4697 June 25, 2024 13:18 Inactive
@khiga8 khiga8 requested a review from TylerJDev June 25, 2024 13:23
@github-actions github-actions bot temporarily deployed to storybook-preview-4697 June 25, 2024 13:26 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.

Just some comments, most aren't blocking!

packages/react/src/NavList/NavList.stories.tsx Outdated Show resolved Hide resolved

export type NavListTrailingActionProps = ActionListTrailingActionProps

const TrailingAction = ActionList.TrailingAction
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed when using TrailingAction and there's already an "expand" button/icon, the styling is a bit off. I'm wondering if we'd want to disable TrailingAction in these instances, or allow them?

Screen capture of NavList storybook example, showing multiple items, specifically the TrailingAction feature, which is a book icon. Adjacent to it is a chevron up icon.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right! I think we should disallow it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This has been addressed in this diff.

Let me know what you think of this approach!

I've supplemented this with:

@@ -246,4 +247,26 @@ export const WithGroup = () => (
</PageLayout>
)

export const WithTrailingAction = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Non-blocking: A story showing this feature within sub items could be cool!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@khiga8
Copy link
Contributor Author

khiga8 commented Jun 25, 2024

The failing test is a snapshot test which seems to be failing unrelated to my changes.

@khiga8 khiga8 force-pushed the add-trailing-action-to-nav-list branch from 2a0a687 to 646110e Compare June 27, 2024 13:46
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.

LGTM! Left a few comments, but not truly blocking. Will take a look at the failing CI test to see what's up.

)
}

export const WithBadExampleOfSubNavAndTrailingAction = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this test just to show a bad implementation of NavList? If so, I'm wondering if we should add this under "DevOnly" story as I think this is what it's for 🤔 (e.g. "DevOnly" story)

@@ -0,0 +1,5 @@
---
"@primer/react": patch
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm thinking this might be a minor, but will leave it up to you!

packages/react/src/NavList/NavList.docs.json Outdated Show resolved Hide resolved
khiga8 and others added 2 commits June 28, 2024 07:51
Co-authored-by: Tyler Jones <tylerjdev@github.com>
@khiga8 khiga8 added this pull request to the merge queue Jul 2, 2024
Merged via the queue into main with commit a7d1e4f Jul 2, 2024
30 checks passed
@khiga8 khiga8 deleted the add-trailing-action-to-nav-list branch July 2, 2024 13:38
@primer primer bot mentioned this pull request Jul 2, 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.

3 participants