site-kit-wp icon indicating copy to clipboard operation
site-kit-wp copied to clipboard

UX Updates to User Input Questionnaire

Open zutigrm opened this issue 1 year ago • 5 comments

Feature Description

User input questionnaire needs to be updated, following the new UX design updates which are bringing a bit of polishing to the existing component. Minor functionality updates are required given the removal of the "Review your answers" step.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • Existing user input questionnaire component is updated to match the figma design
  • The final "Review your answers" step is removed, and current save logic attached thereto is transferred to the last answer screen where the "Complete setup" CTA will match the current save behaviour.

Implementation Brief

  • [x] Update assets/js/components/user-input/util/constants.js
    • Include new helper function getUserInputAnswersDescription
      • Similarly how answers are mapped now in getUserInputAnswers, do the same here, but map the descriptions, as shown in the figma
      • For now map this only for the USER_INPUT_ANSWERS_PURPOSE, as this is the only group which includes descriptions for now.
  • [x] In assets/js/components/user-input/UserInputQuestionnaire.js
    • include new descriptions prop to the component rendering site purpose answers https://github.com/google/site-kit-wp/blob/8a6a275c708b3f2efbdb7cd809ae0dc792351b6e/assets/js/components/user-input/UserInputQuestionnaire.js#L169 and pass value retrieved from getUserInputAnswersDescription
    • In new design the left panel that renders UserInputQuestionInfo, will now render static text for all questions. Remove title and questionNumber props from UserInputQuestionWrapper component, and use static description from figma for all occurrences of this component.
      • Usage of title and questionNumber in UserInputQuestionInfo should be removed, as they won't be needed any more
  • [x] Update assets/js/components/user-input/UserInputSelectOptions.js
    • Include new prop descriptions
    • Extract the proper description based on the optionSlug and pass it as description prop to existing item component https://github.com/google/site-kit-wp/blob/8a6a275c708b3f2efbdb7cd809ae0dc792351b6e/assets/js/components/user-input/UserInputSelectOptions.js#L169
  • [x] In assets/js/components/user-input/UserInputQuestionWrapper.js remove usage of title and render UserInputQuestionInfo unconditionally and remove title prop from UserInputQuestionInfo
  • [x] in assets/js/components/user-input/UserInputQuestionInfo.js
    • Remove title and googlesitekit-user-input__question-number markup and questionNumber, and move it to the assets/js/components/user-input/UserInputApp.js
  • [x] In assets/js/components/user-input/UserInputApp.js
    • Move the question number to the above the PageHeader
    • Implement the question number count using the CORE_FORMS datastore, by retrieving the data and storing in say FORM_USER_INPUT_QUESTION_NUMBER
    • Remove subtitle
  • [x] In assets/js/components/user-input/UserInputQuestionnaire.js
    • Update nextCallback and backCallback to store the currently active step (numerical step, not the slug) in FORM_USER_INPUT_QUESTION_NUMBER
    • Adjust the ProgressBar component to match the new look in the design
  • [x] Update the styles in assets/sass/components/user-input/googlesitekit-user-input-questions.scss to apply any needed changes
    • Have in mind that footer should be sticky at the bottom and takes full screen width

Remove the "Review your answers" step

  • [x] Update assets/js/components/user-input/UserInputQuestionWrapper.js add a new prop, complete, when passed the copy of the field should be "Complete setup" by rendering a new block, using a SpinnerButton instead of a standard Button: https://github.com/google/site-kit-wp/blob/db3699f1b5503195665a0e84a976d621bd44f3c7/assets/js/components/user-input/UserInputQuestionWrapper.js#L81-L89
    • This button should be disabled and show a spinner while answers are being saved by using the isSavingUserInputSettings and isNavigating selectors, passing the resulting boolean to disabled and isSaving prop on the new spinner button.
  • [x] Update assets/js/components/user-input/UserInputQuestionnaire.js:
    • Move the onSaveClick function from assets/js/components/user-input/UserInputPreview.js into this component.
    • Replace the nextCallback use in the final UserInputSelectOptions to call onSaveClick instead and use the complete prop instead of the next prop in the UserInputQuestionWrapper component. https://github.com/google/site-kit-wp/blob/db3699f1b5503195665a0e84a976d621bd44f3c7/assets/js/components/user-input/UserInputQuestionnaire.js#L227-L238
  • [x] Refactor the ErrorNotice for any change submission errors to show in a fixed position banner. https://github.com/google/site-kit-wp/blob/db3699f1b5503195665a0e84a976d621bd44f3c7/assets/js/components/user-input/UserInputPreview.js#L181
  • [ ] Remove the now unused assets/js/components/user-input/UserInputPreview.js component.
  • [x] Remove all uses and references to the preview slug panel in this app.

Test Coverage

  • Update any failing VRT
    • Take special note of the changes to the user input questionnaire regarding removal of the "Review your answers" step.
  • Update any failing test

QA Brief

  • Check the updated designs for the User Input Questionnaire in storybook confirming it matches the Figma designs.
  • Test the User Input Questionnaire by going to Settings -> Admin Settings -> Personalize your metrics (in the Key Metrics panel).
    • To test the error banner you can run the following code in the developer console:
    googlesitekit.data.dispatch('core/user').receiveError(
    	{
    		code: 'test_code',
    		message: 'Test error message',
    		data: {
    			reason: '',
    		},
    	},
    	'saveUserInputSettings',
    	[]
    )
    
  • Confirm there are no regressions in the Key Metrics section and editing the user input questions in the settings after setup.

Changelog entry

zutigrm avatar Sep 19 '24 12:09 zutigrm

AC ✔️

eugene-manuilov avatar Sep 26 '24 10:09 eugene-manuilov

@zutigrm IB ✅ moving to EB

10upsimon avatar Oct 02 '24 13:10 10upsimon

@zutigrm comment for your attention here, should I split the "Sell products or services" into the two new categories that are now in Figma?

Without doing this the copy for the description for this combined option will need to be created.

benbowler avatar Oct 07 '24 13:10 benbowler

Based on call 7 October 2024, it would be best to stick to the combined question "Sell products or services" we use now if possible.

In this case I need new approved copy for that answer.

CC @sigal-teller @10upsimon @zutigrm

benbowler avatar Oct 07 '24 14:10 benbowler

@benbowler following a sync with @sigal-teller , the decision to remove the final "Review answers" screen was made a while back in response to a UXR study. I am going to update AC, and upon approval, the IB as well.

10upsimon avatar Oct 09 '24 07:10 10upsimon

QA Update ❌

  • Tested on dev environment.
  • Verified and compared Storybook Story with Figma.
  • Verified complete user input flow and KMW functionality for regression.
  • Verified user input flow admin settings.
  • Verified user input flow settings for multiple admins.
  • Verified main, view only and secondary admin dashboard and settings.

@benbowler

Issue 1 : Padding between radio button and content is not same as figma.

Figma -

Image

Storybook

Image

Issue 2 : The story is displaying "The question is answered by: Admin name" for the wrong question. It should show this text for the first question instead of the third.

Image

PASS CASES

Error state

Image

mohitwp avatar Oct 30 '24 08:10 mohitwp

Hey @mohitwp, I've created a follow up to update the gap between the radio and content and fixed the stories to correctly show the multi admin case.

benbowler avatar Oct 30 '24 10:10 benbowler

QA Update ✅

  • Padding between radio button and content is same as figma.
  • The story is no longer displaying "The question is answered by: Admin name" for the wrong question. It showed this text for the first question instead of the third.

wpdarren avatar Nov 01 '24 09:11 wpdarren