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

A4A > Feedback: Logical implementation of in-product feedback mechanism #97100

Merged
merged 5 commits into from
Dec 9, 2024

Conversation

yashwin
Copy link
Contributor

@yashwin yashwin commented Dec 5, 2024

Related to https://github.com/Automattic/automattic-for-agencies-dev/issues/1246

Proposed Changes

This PR makes the logical implementation of the in-product feedback mechanism.

Why are these changes being made?

  • To show the feedback form after specific actions are performed:

• Sending a referral
• Adding a team member
• Filling out partner directory information

NOTE: The UI is not yet integrated with the API endpoint, as it is in progress.

Testing Instructions

  • Open the A4A live link
  • Append the URL with ?flags=-a4a-product-feedback, perform the below actions and verify no feedback form is shown. Please ensure you don't refresh the page, as it will add the feature flag back.

• Sending a referral (/marketplace/products > Toggle the refer mode on and send a referral)
• Adding a team member (/team/invite > Send invite)
• Filling out partner directory information (/partner-directory/agency-details > Save public profile)

  • Remove the feature flag > Refresh the page and perform the below actions and verify the feedback is shown as displayed below. Submitting or skipping the form should hide it and not show again when performing the same action. You can verify it by visiting the page manually with #feedback appended, you can find the URLs below.

• Sending a referral (/marketplace/products > Toggle the refer mode on and send a referral)

Manual testing URL: /referrals/dashboard#feedback

Screenshot 2024-12-05 at 10 28 38 AM

• Adding a team member (/team/invite > Send invite)

Manual testing URL: /team/invite#feedback

Screenshot 2024-12-05 at 10 12 24 AM

• Filling out partner directory information (/partner-directory/agency-details > Save public profile)

Manual testing URL: /partner-directory/agency-details#feedback

Screenshot 2024-12-05 at 10 28 01 AM

How the preferences are stored:

Screenshot 2024-12-05 at 11 06 08 AM

Preferences can be reset from staging

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 UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • 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)?

@yashwin yashwin requested review from madebynoam and a team December 5, 2024 06:53
@yashwin yashwin self-assigned this Dec 5, 2024
@matticbot matticbot added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Dec 5, 2024
@matticbot
Copy link
Contributor

matticbot commented Dec 5, 2024

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

App Entrypoints (~12 bytes removed 📉 [gzipped])

name           parsed_size           gzip_size
entry-stepper        +55 B  (+0.0%)      -12 B  (-0.0%)
entry-main           +55 B  (+0.0%)      -12 B  (-0.0%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Sections (~4700 bytes added 📈 [gzipped])

name                                parsed_size           gzip_size
a8c-for-agencies-team                  +40104 B  (+4.3%)   +12402 B  (+4.9%)
a8c-for-agencies-partner-directory     +39866 B  (+8.5%)   +11730 B  (+7.9%)
a8c-for-agencies-marketplace            +3364 B  (+0.4%)     +837 B  (+0.3%)
a8c-for-agencies-client                 +3364 B  (+0.3%)     +980 B  (+0.3%)
a8c-for-agencies-referrals              +1331 B  (+0.1%)     +319 B  (+0.1%)

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.

Copy link
Contributor

@cleacos cleacos left a comment

Choose a reason for hiding this comment

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

Side note: During our initial exploration, I suggested using the feedback data returned from one of our endpoints and not storing it in the app when the feedback form was sent. I mean, the backend would send to the app when the feedback forms were sent. That way, we are storing the information at the account level instead of the browser level. No matter the browser or computer the user uses, if the user already sent the form, it won't show it again.

The show/hide logic is executed in the app, but the information about it is provided inside one of the existing endpoints (i.e. agency). Something like agency.feedback.forms['the_feedback_reference'].sent_at.

@yashwin
Copy link
Contributor Author

yashwin commented Dec 5, 2024

@cleacos: Thanks for the feedback!

During our initial exploration, I suggested using the feedback data returned from one of our endpoints and not storing it in the app when the feedback form was sent. I mean, the backend would send to the app when the feedback forms were sent. That way, we are storing the information at the account level instead of the browser level. No matter the browser or computer the user uses, if the user already sent the form, it won't show it again.

We are not storing the data at the browser/app level. We are using the https://public-api.wordpress.com/rest/v1.1/me/preferences API endpoint to store. This is stored at the user level. So, no matter the browser the user uses, it will be shown only once. We already use this in multiple places.

Base automatically changed from a4a/automated-feedbacks-ui to trunk December 5, 2024 09:23
@yashwin yashwin force-pushed the update/a4a/feedback/implement-feedback-logic branch from 215b11b to eba0ebe Compare December 5, 2024 09:31
@cleacos
Copy link
Contributor

cleacos commented Dec 5, 2024

We are not storing the data at the browser/app level. We are using the https://public-api.wordpress.com/rest/v1.1/me/preferences

Nice! I was thinking in the app preferences :)

Copy link
Contributor

@travisw travisw left a comment

Choose a reason for hiding this comment

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

Makes sense and works well 🚀

@travisw
Copy link
Contributor

travisw commented Dec 9, 2024

This should be safe to deploy as it's behind a feature flag. I'll go ahead and deploy.

@travisw travisw merged commit 6370a65 into trunk Dec 9, 2024
11 checks passed
@travisw travisw deleted the update/a4a/feedback/implement-feedback-logic branch December 9, 2024 22:41
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants