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

Site Profiler: Open get report form when clicking the Metrics CTA #90581

Merged
merged 7 commits into from May 13, 2024

Conversation

epeicher
Copy link
Contributor

@epeicher epeicher commented May 10, 2024

Fixes https://github.com/Automattic/dotcom-forge/issues/6909

Proposed Changes

  • Adds functionality to open the Get Report form when clicking the menu CTA
  • Adds functionality to close the form when clicking on the X icon
  • The arrow icon in the top-right of the form has been replaced by a X icon to indicate closing
  • The form is fixed positioned at the bottom of the viewport

CleanShot 2024-05-10 at 18 27 17@2x

Testing Instructions

  • Apply this patch to your environment
  • Navigate to the site-profiler and analyze a website
  • Click on the main CTA button in the basic metrics menu
    CleanShot 2024-05-10 at 18 23 36@2x
  • Check the form is displayed at the bottom and that you can scroll through the results
  • Click on the X icon in the form
  • Check the form is closed as expected
  • Check the style and behavior is similar to the production version

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
    - [ ] Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
    - [ ] Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    - [ ] For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

This commit also adds the close functionality
@matticbot
Copy link
Contributor

matticbot commented May 10, 2024

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Sections (~43 bytes added 📈 [gzipped])

name           parsed_size           gzip_size
site-profiler       +165 B  (+0.2%)      +43 B  (+0.2%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@epeicher epeicher marked this pull request as ready for review May 10, 2024 16:28
Copy link
Collaborator

@WBerredo WBerredo left a comment

Choose a reason for hiding this comment

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

CleanShot 2024-05-10 at 16 36 42@2x

I think this button was different to give the impression of sliding up and down. I think the current show/hide behavior is a bit abrupt so I would also prefer the sliding transition.

) }
/>
{ errors?.termsAccepted && (
<FormInputValidation isError={ !! errors } text={ errors.termsAccepted } />
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: Is this check isError={ !! errors } needed? Considering its checked on the previous line.

Suggested change
<FormInputValidation isError={ !! errors } text={ errors.termsAccepted } />
<FormInputValidation isError text={ errors.termsAccepted } />

The same for the previous components.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not needed here, removing it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@epeicher
Copy link
Contributor Author

I think this button was different to give the impression of sliding up and down. I think the current show/hide behavior is a bit abrupt so I would also prefer the sliding transition.

I agree that this form will benefit from a sliding animation, and the behavior is currently abrupt. I will work on that

@epeicher
Copy link
Contributor Author

epeicher commented May 13, 2024

I have implemented slide-up and slide-down animations, but I have observed that the behavior is not consistent among browsers:

  • It works on Chrome and Arc
  • It works for slide-up but not for slide-down in Firefox and Safari
    - It does not seem to work at all in Arc

This is the Chrome behavior:
CleanShot 2024-05-13 at 12 39 55

@Automattic/bespin , any suggestions

Comment on lines +12 to +33
&--hidden {
display: none;
animation: 500ms ease-out slideDown;
}
}

@keyframes slideUp {
from {
transform: translateY(100%);
}
to {
transform: translateY(0);
}
}
@keyframes slideDown {
from {
display: block;
transform: translateY(0);
}
to {
display: none;
transform: translateY(100%);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
&--hidden {
display: none;
animation: 500ms ease-out slideDown;
}
}
@keyframes slideUp {
from {
transform: translateY(100%);
}
to {
transform: translateY(0);
}
}
@keyframes slideDown {
from {
display: block;
transform: translateY(0);
}
to {
display: none;
transform: translateY(100%);
&--hidden {
animation: 500ms ease-out slideDown;
transform: translateY(100%);
}
}
@keyframes slideUp {
from {
transform: translateY(100%);
}
to {
transform: translateY(0);
}
}
@keyframes slideDown {
from {
transform: translateY(0);
}
to {
transform: translateY(100%);

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 have tried this, but it displays the form initially U02M8SCS6RE/F073J5UBW8H-slack-file

We will investigate this and other options as part of the linked task https://github.com/Automattic/dotcom-forge/issues/7130

@epeicher
Copy link
Contributor Author

A follow-up task has been created to investigate a fix so the animation is consistent between browsers:

Copy link
Contributor

@gcsecsey gcsecsey left a comment

Choose a reason for hiding this comment

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

LGTM and works great!

@epeicher epeicher merged commit f366926 into trunk May 13, 2024
11 checks passed
@epeicher epeicher deleted the update/show-get-report-form branch May 13, 2024 14:14
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

5 participants