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

Consider viewport on element distance calculation #28

Merged

Conversation

wordpressfan
Copy link
Collaborator

@wordpressfan wordpressfan commented Sep 3, 2024

Description

Part of wp-media/wp-rocket#6933

Here we will calculate the threshold below the viewport.

Type of change

  • Bug fix (non-breaking change which fixes an issue).
  • Enhancement (non-breaking change which improves an existing functionality).

Detailed scenario

Now we will calculate the threshold starting from the end of viewport as discussed here:

wp-media/wp-rocket#6929 (comment)

Technical description

Documentation

As mentioned in the issue itself we will consider having viewport height in the calculation.

New dependencies

No

Risks

One risk is mentioned and shared with product team here:
wp-media/wp-rocket#6933 (comment)
and we are fine with that.

Mandatory Checklist

Code validation

  • I validated all the Acceptance Criteria. If possible, provide screenshots or videos.
  • I triggered all changed lines of code at least once without new errors/warnings/notices.
  • I implemented built-in tests to cover the new/changed code.

Code style

  • I wrote a self-explanatory code about what it does.
  • I protected entry points against unexpected inputs.
  • I did not introduce unnecessary complexity.
  • Output messages (errors, notices, logs) are explicit enough for users to understand the issue and are actionnable.

Additional Checks

  • In the case of complex code, I wrote comments to explain it.
  • When possible, I prepared ways to observe the implemented system (logs, data, etc.).
  • I added error handling logic when using functions that could throw errors (HTTP/API request, filesystem, etc.)

@wordpressfan wordpressfan self-assigned this Sep 3, 2024
Copy link

codacy-production bot commented Sep 3, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.60% (target: -1.00%) 76.92% (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (96cb6c5) 571 287 50.26%
Head commit (ecdac7a) 578 (+7) 294 (+7) 50.87% (+0.60%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#28) 13 10 76.92%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

@wordpressfan wordpressfan marked this pull request as ready for review September 4, 2024 09:32
@MathieuLamiot MathieuLamiot merged commit 6463cee into feature/lrc-script Sep 5, 2024
6 of 7 checks passed
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.17 - Consider the viewport while calculating _getElementDistance
2 participants