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

[BD-46] Add fixed increment scroll behavior to useOverflowScroll #2151

Merged
merged 2 commits into from
Jun 9, 2023

Conversation

UvgenGen
Copy link
Contributor

Description

Added fixed increment scroll behavior to useOverflowScroll

Merge Checklist

  • If your update includes visual changes, have they been reviewed by a designer? Send them a link to the Netlify deploy preview, if applicable.
  • Does your change adhere to the documented style conventions?
  • Do any prop types have missing descriptions in the Props API tables in the documentation site (check deploy preview)?
  • Were your changes tested using all available themes (see theme switcher in the header of the deploy preview, under the "Settings" icon)?
  • Were your changes tested in the example app?
  • Is there adequate test coverage for your changes?
  • Consider whether this change needs to reviewed/QA'ed for accessibility (a11y). If so, please add wittjeff and adamstankiewicz as reviewers on this PR.

Post-merge Checklist

  • Verify your changes were released to NPM at the expected version.
  • If you'd like, share your contribution in #show-and-tell.
  • 🎉 🙌 Celebrate! Thanks for your contribution.

@openedx-webhooks openedx-webhooks added the blended PR is managed through 2U's blended developmnt program label Mar 21, 2023
@openedx-webhooks
Copy link

Thanks for the pull request, @UvgenGen!

When this pull request is ready, tag your edX technical lead.

@netlify
Copy link

netlify bot commented Mar 21, 2023

Deploy Preview for paragon-openedx ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 6f587a0
🔍 Latest deploy log https://app.netlify.com/sites/paragon-openedx/deploys/6479b871c231d700085f05d4
😎 Deploy Preview https://deploy-preview-2151--paragon-openedx.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.

@UvgenGen UvgenGen changed the title [BD-46] DRAFT: Add fixed increment scroll behavior to useOverflowScroll [BD-46] Add fixed increment scroll behavior to useOverflowScroll Mar 21, 2023
Copy link
Member

@adamstankiewicz adamstankiewicz left a comment

Choose a reason for hiding this comment

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

Overall, this is looking good. A few other comments:

  • Linting errors (npm run lint) will need to be resolved.
  • Include tests for new functionality.
  • Document and include example(s) of new functionality in documentation website.

Comment on lines 26 to 28
if (offsetString.endsWith("px")) {
offset = parseInt(offsetString);
} else if (offsetString.endsWith("%")) {
Copy link
Member

Choose a reason for hiding this comment

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

[suggestion] Would it be helpful to potentially treat the offset value as a distinct argument than the offset type (pixel or percent). For example, something like:

useOverflowScrollActions({
  offset: 25, // number or string
  offsetType: 'fixed', // "percentage" or "fixed" (default)
});

This way, this logic wouldn't need to have conditionals based on px or % in a string itself.

Curious to hear your thoughts :)

@codecov
Copy link

codecov bot commented Jun 2, 2023

Codecov Report

Patch coverage: 90.62% and project coverage change: -0.02 ⚠️

Comparison is base (088eab4) 91.38% compared to head (6f587a0) 91.36%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2151      +/-   ##
==========================================
- Coverage   91.38%   91.36%   -0.02%     
==========================================
  Files         234      234              
  Lines        4120     4148      +28     
  Branches      982      997      +15     
==========================================
+ Hits         3765     3790      +25     
- Misses        348      351       +3     
  Partials        7        7              
Impacted Files Coverage Δ
src/OverflowScroll/OverflowScroll.jsx 100.00% <ø> (ø)
...rc/OverflowScroll/data/useOverflowScrollActions.js 91.66% <90.00%> (-2.46%) ⬇️
src/OverflowScroll/data/useOverflowScroll.js 63.82% <100.00%> (+1.60%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@viktorrusakov viktorrusakov linked an issue Jun 9, 2023 that may be closed by this pull request
2 tasks
@viktorrusakov viktorrusakov merged commit 4f54e62 into openedx:master Jun 9, 2023
@openedx-webhooks
Copy link

@UvgenGen 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@edx-semantic-release
Copy link
Contributor

🎉 This PR is included in version 20.44.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blended PR is managed through 2U's blended developmnt program released
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add fixed increment scroll behavior to useOverflowScroll
5 participants