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

CLS diff not showing on compare screen #784

Merged

Conversation

vikasrohit
Copy link
Contributor

@vikasrohit vikasrohit commented Apr 18, 2022

#689 CLS diff not showing on compare screen

Known issues in the PR:

  • I have added duplicate declaration for SCORE_LEVEL_METRIC_THRESHOLDS in score-icon.jsx because I was not sure what is the ideal way for having it at common place as I didn't see any constant or utils file for the server module. Please let me know, I can fix that quickly.
  • Not able to resolve the linting error for const thresholds = SCORE_LEVEL_METRIC_THRESHOLDS[numericDiff.auditId]; in score-icon.jsx#30

@google-cla
Copy link

google-cla bot commented Apr 18, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

For more information, open the CLA check for this pull request.

Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

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

thanks @vikasrohit! a few questions :)

if (
group !== 'metrics' && // if metrics group audit is found, don't skip it
Copy link
Collaborator

Choose a reason for hiding this comment

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

this changes the behavior that was intentional if both were passing, is there a specific case you have in mind for changing this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think @patrickhulce we agreed here on skipping this check when the group id is metrics.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah thanks for the reminder it had been awhile :) sg!

// @ts-ignore
const thresholds = SCORE_LEVEL_METRIC_THRESHOLDS[numericDiff.auditId];
if (thresholds) {
if (numericDiff.compareValue <= thresholds[0]) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why are you doing this? the score already has its own thresholds and we want them to match the actual score.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

With current implementation, CLS audit always get score of 1 for me and because it is always 1, it always show passing icon for CLS audit diff. I may be wrong with my observation for having score 1 for CLS. Please correct me if my observation is wrong here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@patrickhulce I just tried again with a page which has bad CLS score and I can see non 1 score for CLS, which means my assumption was wrong there. Let me fix the changes accordingly and come back.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@patrickhulce I have reverted the changes for this file as I have verified that scores are working fine and we don't need to handle the thresholds separately for CLS.

Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

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

thanks for the contribution @vikasrohit! just one more revert and I think we're good here

@@ -58,7 +58,10 @@ const ChangedAuditList = props => {
onClick={() => props.setSelectedAuditId(audit.id || null)}
>
<div className="audit-group__audit-score">
<ScoreIcon score={audit.score || 0} />
<ScoreIcon
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we can revert these too now :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Thanks for noticing it, my bad I missed it with last revert.

@patrickhulce patrickhulce merged commit 0fe44dd into GoogleChrome:main Apr 19, 2022
@patrickhulce
Copy link
Collaborator

thanks very much @vikasrohit!

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

2 participants