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

feat: implemented/added scroll-area component to design-system #1283

Merged

Conversation

babblebey
Copy link
Contributor

@babblebey babblebey commented Jun 21, 2023

What type of PR is this? (check all applicable)

  • πŸ• Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation Update
  • 🎨 Style
  • πŸ§‘β€πŸ’» Code Refactor
  • πŸ”₯ Performance Improvements
  • βœ… Test
  • πŸ€– Build
  • πŸ” CI
  • πŸ“¦ Chore (Release)
  • ⏩ Revert

Description

This PR Implements @radix-ui/react-scroll-area primitive to create the ScrollArea component which was in turn implemented in the Select component to allow scrolling of overflowing SelectItems value within the component which wasn't caught by the avoidCollisions prop because of our preferred position value i.e. popper

I had initially intended to address this with the ScrollUpButton/ScrollDownButton sub-component of the already-implemented @radix-ui/react-select primitive, but there was a certain challenge with this approach.

In order for to use the ScrollUpButton and ScrollDownButton components, we'd need to have the position prop of the Select Primitive Content set to the default item-aligned instead of our preferred popper (as seen below)

Code Sample

// components\atoms\Select\select.tsx

<SelectPrimitive.Content
    ref={ref}
    ....
    // 'popper' set as default via component props
    position="popper"
    ...
  >
  <SelectPrimitive.Viewport>
    {children}
  </SelectPrimitive.Viewport>
</SelectPrimitive.Content>

But doing this, i.e. setting the Select Primitive Content position to the default item-aligned it makes the content behave similarly to a native MacOS menu by positioning it relative to the active item as seen below on a responsive layout.

2023-06-21 (1)

Unlike our current preferred position of popper which positions the content below the select trigger making it behave like a "dropdown menu" or "popover" as seen below on a responsive layout.

2023-06-21 (2)

At the point when position defaults/sets to item-aligned, the ScrollUpButton and ScrollDownButton components, if implemented displays on demand when the content collides with the top/bottom of the viewport, as seen below on a responsive layout.

screencast-localhost_3000-2023 06 21-23_37_35

But this come at the expense of our preferred positioning value, enforcing the item-aligned which doesn't really seem to look aesthetically good nor great UX-wise.

The Trade-off

I thought it was a better to stick with our preferred position value of popper, coupling it with the ScrollArea component implementation, we let our Select component behave like a dropdown menu, and also improve the usability experience by enhancing its general responsiveness, as seen in screenshot below.

screencast-localhost_3000-2023 06 22-14_45_23 (1)

Related Tickets & Documents

fixes #1273

Mobile & Desktop Screenshots/Recordings

Before
screencast-localhost_3000-2023.06.21-17_53_10.webm

After
screencast-localhost_3000-2023.06.21-17_38_47.webm

Added tests?

  • πŸ‘ yes
  • πŸ™… no, because they aren't needed
  • πŸ™‹ no, because I need help

Added to documentation?

  • πŸ“œ README.md
  • πŸ““ docs.opensauced.pizza
  • πŸ• dev.to/opensauced
  • πŸ“• storybook
  • πŸ™… no documentation needed

[optional] Are there any post-deployment tasks we need to perform?

Nothing much, Its important to note that I added a new package though i.e. @radix-ui/react-scroll-area

[optional] What gif best describes this PR or how it makes you feel?

@netlify
Copy link

netlify bot commented Jun 21, 2023

βœ… Deploy Preview for design-insights ready!

Name Link
πŸ”¨ Latest commit b2a2ba1
πŸ” Latest deploy log https://app.netlify.com/sites/design-insights/deploys/6495a7df2c41d50008f535bb
😎 Deploy Preview https://deploy-preview-1283--design-insights.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@netlify
Copy link

netlify bot commented Jun 21, 2023

βœ… Deploy Preview for oss-insights ready!

Built without sensitive environment variables

Name Link
πŸ”¨ Latest commit b2a2ba1
πŸ” Latest deploy log https://app.netlify.com/sites/oss-insights/deploys/6495a7dfc2e1c70008d84d29
😎 Deploy Preview https://deploy-preview-1283--oss-insights.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@babblebey babblebey marked this pull request as ready for review June 22, 2023 17:29
@babblebey babblebey changed the title feat: implemented design-system scroll-area component feat: implemented/added scroll-area component to design-system Jun 22, 2023
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

PR Compliance Checks

Thank you for your Pull Request! We have run several checks on this pull request in order to make sure it's suitable for merging into this project. The results are listed in the following section.

Watched Files

This pull request modifies specific files that require careful review by the maintainers.

Files Matched

  • npm-shrinkwrap.json
  • package.json

@brandonroberts brandonroberts requested a review from OgDev-01 June 23, 2023 13:34
Copy link
Contributor

@OgDev-01 OgDev-01 left a comment

Choose a reason for hiding this comment

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

LGTM πŸ•πŸ•

babblebey and others added 2 commits June 23, 2023 15:10
Co-authored-by: ( Nechiforel David-Samuel ) NsdHSO  <37635083+NsdHSO@users.noreply.github.com>
Co-authored-by: ( Nechiforel David-Samuel ) NsdHSO  <37635083+NsdHSO@users.noreply.github.com>
@babblebey babblebey requested a review from NsdHSO June 23, 2023 14:15
Copy link
Contributor

@NsdHSO NsdHSO left a comment

Choose a reason for hiding this comment

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

LGTM

@brandonroberts brandonroberts merged commit b7280ab into open-sauced:beta Jun 26, 2023
github-actions bot pushed a commit that referenced this pull request Jun 26, 2023
## [1.54.0-beta.2](v1.54.0-beta.1...v1.54.0-beta.2) (2023-06-26)

### πŸ• Features

* add highlight prompt to design system ([#1297](#1297)) ([4a85e74](4a85e74))
* implemented/added scroll-area component to design-system  ([#1283](#1283)) ([b7280ab](b7280ab))
@github-actions
Copy link
Contributor

πŸŽ‰ This PR is included in version 1.54.0-beta.2 πŸŽ‰

The release is available on GitHub release

Your semantic-release bot πŸ“¦πŸš€

github-actions bot pushed a commit that referenced this pull request Jun 28, 2023
## [1.54.0](v1.53.0...v1.54.0) (2023-06-28)

### πŸ› Bug Fixes

* fix yellow color for `<Pill />` component ([#1299](#1299)) ([2f2d9f5](2f2d9f5))

### πŸ• Features

*  hide highlights tab components on profiles without highlights ([#1304](#1304)) ([976739f](976739f))
* add `BillBoard` component to design system ([#1306](#1306)) ([1181cfd](1181cfd))
* add `FeaturedHighlightPanel` component to design system ([#1307](#1307)) ([452213c](452213c))
* add `UserCard` component to storybook design system ([#1295](#1295)) ([6867011](6867011))
* add highlight prompt to design system ([#1297](#1297)) ([4a85e74](4a85e74))
* add top users panel component to design system ([#1300](#1300)) ([9c05fec](9c05fec))
* add URL for collaboration requests ([#1305](#1305)) ([b3f8ea5](b3f8ea5))
* allow login flow after selecting repositories to add to insight page (close [#1132](#1132)) ([#1184](#1184)) ([21aaa0b](21aaa0b))
* implemented/added scroll-area component to design-system  ([#1283](#1283)) ([b7280ab](b7280ab))
@github-actions
Copy link
Contributor

πŸŽ‰ This PR is included in version 1.54.0 πŸŽ‰

The release is available on GitHub release

Your semantic-release bot πŸ“¦πŸš€

ElpisHelle added a commit to ElpisHelle/next.js-tailwindcss that referenced this pull request Aug 17, 2023
## [1.54.0-beta.2](open-sauced/app@v1.54.0-beta.1...v1.54.0-beta.2) (2023-06-26)

### πŸ• Features

* add highlight prompt to design system ([#1297](open-sauced/app#1297)) ([4a85e74](open-sauced/app@4a85e74))
* implemented/added scroll-area component to design-system  ([#1283](open-sauced/app#1283)) ([b7280ab](open-sauced/app@b7280ab))
ElpisHelle added a commit to ElpisHelle/next.js-tailwindcss that referenced this pull request Aug 17, 2023
## [1.54.0](open-sauced/app@v1.53.0...v1.54.0) (2023-06-28)

### πŸ› Bug Fixes

* fix yellow color for `<Pill />` component ([#1299](open-sauced/app#1299)) ([2f2d9f5](open-sauced/app@2f2d9f5))

### πŸ• Features

*  hide highlights tab components on profiles without highlights ([#1304](open-sauced/app#1304)) ([976739f](open-sauced/app@976739f))
* add `BillBoard` component to design system ([#1306](open-sauced/app#1306)) ([1181cfd](open-sauced/app@1181cfd))
* add `FeaturedHighlightPanel` component to design system ([#1307](open-sauced/app#1307)) ([452213c](open-sauced/app@452213c))
* add `UserCard` component to storybook design system ([#1295](open-sauced/app#1295)) ([6867011](open-sauced/app@6867011))
* add highlight prompt to design system ([#1297](open-sauced/app#1297)) ([4a85e74](open-sauced/app@4a85e74))
* add top users panel component to design system ([#1300](open-sauced/app#1300)) ([9c05fec](open-sauced/app@9c05fec))
* add URL for collaboration requests ([#1305](open-sauced/app#1305)) ([b3f8ea5](open-sauced/app@b3f8ea5))
* allow login flow after selecting repositories to add to insight page (close [#1132](open-sauced/app#1132)) ([#1184](open-sauced/app#1184)) ([21aaa0b](open-sauced/app@21aaa0b))
* implemented/added scroll-area component to design-system  ([#1283](open-sauced/app#1283)) ([b7280ab](open-sauced/app@b7280ab))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: Python is not in the list
4 participants