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 #6939

Merged

Conversation

wordpressfan
Copy link
Contributor

@wordpressfan wordpressfan commented Sep 3, 2024

Description

Fixes #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:

#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:
#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.00% (target: -0.10%) (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (4d7b54b) 37912 16541 43.63%
Head commit (efd6556) 37912 (+0) 16541 (+0) 43.63% (+0.00%)

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 (#6939) 0 0 ∅ (not applicable)

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
@Mai-Saad
Copy link
Contributor

Mai-Saad commented Sep 5, 2024

@wordpressfan Thanks for the PR
=> If all page not in threshold : no hashes ===> remove hashes after clear cache is handled on other GH
=> If Parent in threshold then only parent LR ✅
=> If Child in threshold and not parent then Child is LR ✅
=> If parent or child at 1800 then it's LR ✅
=> If threshold changed to small value i.e 200 => this is 200 below the fold ✅
=> -ve threshold isnot applied ==> nothing is captured in this case and no notice in debug.log (LRC will be empty) @wp-media/product is this ok?
=> inacceptable screen , bailout (not adding to DB ) ✅

@MathieuLamiot MathieuLamiot merged commit 51fc999 into feature/lrc Sep 5, 2024
13 checks passed
@MathieuLamiot MathieuLamiot deleted the fix/6933-consider-viewport-on-calculation branch September 5, 2024 19:10
@DahmaniAdame
Copy link
Contributor

@wp-media/product is this ok?
=> inacceptable screen , bailout (not adding to DB ) ✅

Yes.

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
4 participants