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

CC-1284 Use smooth scroll library in concepts page #1859

Closed
wants to merge 3 commits into from

Conversation

libmartinito
Copy link
Contributor

@libmartinito libmartinito commented Jun 13, 2024

Checklist:

  • I've thoroughly self-reviewed my changes
  • I've added tests for my changes, unless they affect admin-only areas (or are otherwise not worth testing)
  • I've verified any visual changes using Percy (add a commit with [percy] in the message to trigger)

Summary by CodeRabbit

  • New Features

    • Introduced smooth scrolling functionality in specific components.
  • Chores

    • Added lenis version 1.1.3 as a new dependency.

Copy link

linear bot commented Jun 13, 2024

Copy link
Contributor

coderabbitai bot commented Jun 13, 2024

Walkthrough

In the recent update, the Lenis library has been integrated into the ConceptComponent class within the application to enhance scrolling functionality. The package.json has also been updated to include Lenis as a dependency. Additionally, new properties and methods have been added to support the initialization and usage of Lenis within the component.

Changes

Files Change Summary
app/components/concept.ts Added Lenis import and initialization, included new properties and methods to manage Lenis integration.
package.json Added "lenis": "^1.1.3" dependency.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ConceptComponent
    participant Lenis

    User->>ConceptComponent: Initialize
    ConceptComponent-->>Lenis: Initialize Lenis()
    Lenis-->>ConceptComponent: Lenis instance created
    User->>Lenis: Scroll Interaction
    Lenis->>ConceptComponent: Scroll updates

Poem

In the code, a scroll so smooth,
With Lenis' touch, it starts to groove.
Concepts glide and gently rise,
Enhanced by Lenis, what a prize!
The journey's swift, just like the breeze,
As scrolling now doth truly please. 🌬️🐇


Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Jun 13, 2024

Bundle Report

Changes will increase total bundle size by 12.54kB ⬆️

Bundle name Size Change
client-array-push 26.03MB 12.54kB ⬆️

Copy link

Test Results

  1 files  ±0    1 suites  ±0   9m 47s ⏱️ - 1m 48s
541 tests ±0  506 ✅ + 6  35 💤 ±0  0 ❌ ±0 
556 runs  ±0  521 ✅ +12  35 💤 ±0  0 ❌  - 6 

Results for commit d8e53cb. ± Comparison against base commit b90ae26.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range and nitpick comments (2)
app/components/concept.ts (2)

196-205: Review the potential performance implications of the recursive requestAnimationFrame in initializeLenis.

Consider implementing a mechanism to stop the animation frame when not needed to conserve resources.


Line range hint 104-106: Consider simplifying the control flow by removing unnecessary else clauses as suggested by static analysis.

- else {
+ // Omitted unnecessary else clause
}

Also applies to: 128-131, 175-184

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b90ae26 and d8e53cb.

Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
Files selected for processing (2)
  • app/components/concept.ts (5 hunks)
  • package.json (1 hunks)
Files skipped from review due to trivial changes (1)
  • package.json
Additional context used
Biome
app/components/concept.ts

[error] 104-106: This else clause can be omitted because previous branches break early. (lint/style/noUselessElse)

Unsafe fix: Omit the else clause.


[error] 128-131: This else clause can be omitted because previous branches break early. (lint/style/noUselessElse)

Unsafe fix: Omit the else clause.


[error] 175-184: This else clause can be omitted because previous branches break early. (lint/style/noUselessElse)

Unsafe fix: Omit the else clause.

Additional comments not posted (3)
app/components/concept.ts (3)

7-7: Ensure Lenis is correctly imported and compatible with the current project setup.


36-36: The nullable declaration of lenis is suitable given its asynchronous initialization.


224-227: Ensure the scrolling calculations in updateLastRevealedBlockGroupIndex align with the intended user experience for smooth scrolling.

Copy link

codecov bot commented Jun 13, 2024

Codecov Report

Attention: Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files Patch % Lines
app/components/concept.ts 90.90% 0 Missing and 1 partial ⚠️
Additional details and impacted files

📢 Thoughts on this report? Let us know!

@libmartinito
Copy link
Contributor Author

closing in favor of this

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

1 participant