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

Mandatory exit survey for users going back to OldDot #34925

Merged
merged 97 commits into from
Feb 24, 2024

Conversation

roryabraham
Copy link
Contributor

@roryabraham roryabraham commented Jan 22, 2024

Details

This PR introduces a mandatory exit survey to gather feedback from users going from NewDot -> OldDot.

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/358172

Tests

  1. Press on your avatar in the LHN to open the account settings page.

  2. Click on Go to Expensify Classic

  3. Verify that you see a page titled Before you go and has three radio buttons with the reasons:

    image

  4. Verify all options of the radio buttons can be selected, and that only one can be selected at a time.

  5. Proceed with I need a feature that's only available in Expensify Classic selected.

  6. Verify that the next page shows a text input with the title What feature do you need that isn't available in New Expensify?

  7. Try to proceed without composing a response. Verify that you see an error saying that the response is required.

  8. Compose a response. Verify that it can be multiple lines, not just one.

  9. Press back, then Next. Verify that your response was saved.

  10. Refresh the page, verify your response was saved.

  11. press back. Verify that you are taken to the reason page with the radio buttons.

  12. press Next and verify your response was still there.

  13. (you only need to do this step exactly once) add a bunch of newlines and verify that the response expands to fill the page, but doesn't interfere with the next button or push it off the page.

  14. Press Next to submit the form. Verify you are taken to a confirmation page that looks like this:

    image

    The copy should be:

    Your responses will help us build a better product to get stuff done. Thank you so much!

  15. (web/desktop only) Press back, and verify your response was saved. Edit the response, then press CMD+Enter (macos) or CTRL+Enter (windows). Verify that the form submits and you are taken to the confirmation page again.

  16. Press Go to Expensify Classic and verify that you are taken to the OldDot inbox page. Note that OldDot web doesn't really work well on mobile, and hybrid web isn't really in place yet. The purpose of this PR is just to test the survey – the connection between NewDot and OldDot has not been changed at all.

  17. Open OldDot web in the same account on a desktop or laptop computer, then open the JS console and run NVP.get('tryNewDot'). Verify that under the classicRedirect->dismissedReason key you see the reason you selected in the first page of the form and the response you entered in the second.

  18. Repeat steps 1-17 for the other two options in the response page. Expected copy

    Reason page Response page
    I need a feature that's only available in Expensify Classic What feature do you need that isn't available in New Expensify?
    I don't understand how to use New Expensify What are you trying to do?
    I understand how to use New Expensify, but I prefer Expensify Classic Why do you prefer Expensify Classic?
  19. Switch to Spanish, and repeat steps 1-18 in Spanish. Expected copy:

    Reason page Response page
    Necesito una función que sólo está disponible en Expensify Classic ¿Qué función necesitas que no esté disponible en New Expensify?
    No entiendo cómo usar New Expensify ¿Qué estás tratando de hacer?
    Entiendo cómo usar New Expensify, pero prefiero Expensify Classic ¿Por qué prefieres Expensify Classic?

    The expected copy for the confirmation page will be:

    Sus respuestas nos ayudarán a crear un mejor producto para hacer las cosas bien. ¡Muchas gracias!

  • Verify that no errors appear in the JS console

Offline tests

  1. For each page in the survey:
    1. Go offline.

    2. Verify the UI updates to show this (note center-aligned text):

      image

    3. Verify that the Next button is disabled.

    4. Go back online

    5. Verify that the form restores to the state it was in before you go offline.

  2. Repeat the previous steps in Spanish, make sure the copy for the offline page is in Spanish.

QA Steps

  1. Same as test steps
  2. Complete steps 2-8 in this PR, and verify that the questions look like they are formatted correctly (i.e: not wrapping off the screen)
  3. Important: Create a GitHub issue to add these test steps to the regression suite.
  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
    • MacOS: Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
android.mp4
Android: mWeb Chrome
android.mp4
iOS: Native
ios.mov
iOS: mWeb Safari
iosWeb.mov
MacOS: Chrome / Safari
web.mov

image

image

image

MacOS: Desktop
desktop720.mov

image

image

image

@roryabraham roryabraham self-assigned this Jan 22, 2024
Copy link
Contributor

@mollfpr
Copy link
Contributor

mollfpr commented Feb 21, 2024

The issue that @danieldoglas encountering seems to only happen on the ad-hoc build. It's actually not a crash, but when the page refreshed, the URL is changed and is not readable in our app so that's why it's showing the NotFoundPage.

https://34925.pr-testing.expensify.com/https://34925.pr-testing.expensify.com/settings/exit-survey/response?reason=dontUnderstand&backTo=settings%2Fexit-survey%2Freason

Screen.Recording.2024-02-21.at.17.55.48.mp4

Also, refreshing the report page is showing the NotFoundPage first.

Screen.Recording.2024-02-21.at.18.09.48.mp4

@mollfpr
Copy link
Contributor

mollfpr commented Feb 21, 2024

Regarding the bug I found, I agree it shouldn't be a blocker and there's maybe a big chance that happens because of the ideal-nav project.

danieldoglas
danieldoglas previously approved these changes Feb 21, 2024
Copy link
Contributor

@danieldoglas danieldoglas left a comment

Choose a reason for hiding this comment

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

LGTM

@danieldoglas
Copy link
Contributor

@roryabraham I'll leave it to you to merge since we're kind of in a merge/deploy freeze until Friday

# Conflicts:
#	package-lock.json
#	package.json
#	src/ONYXKEYS.ts
#	src/libs/API/parameters/index.ts
#	src/libs/API/types.ts
#	src/libs/Navigation/linkingConfig/config.ts
@roryabraham
Copy link
Contributor Author

conflicts resolved

@roryabraham
Copy link
Contributor Author

TS failing on main, PR to fix it: #37171

@roryabraham roryabraham merged commit d0d77c1 into main Feb 24, 2024
17 checks passed
@roryabraham roryabraham deleted the Rory-TransitionSurvey branch February 24, 2024 17:48
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/roryabraham in version: 1.4.44-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/puneetlath in version: 1.4.44-13 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

onInputChange?: (value: string) => void;

/** The checked value, if you're using this component as a controlled input. */
value?: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

Coming from #37290. Since value is optional, we missed checking if value is undefined in cases where the component is not used as a controlled input in order for it to still work as expected without it. More details here.

success
text={translate('exitSurvey.goToExpensifyClassic')}
onPress={() => {
ExitSurvey.switchToOldDot();
Copy link
Contributor

Choose a reason for hiding this comment

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

Coming from #44926 (BZ Checklist)

we should also close the RHP after switching to Olddot

Comment on lines +71 to +79
const formMaxHeight = Math.floor(
windowHeight -
keyboardHeight -
safeAreaInsetsTop -
// Minus the height of HeaderWithBackButton
variables.contentHeaderHeight -
// Minus the top margins on the form
formTopMarginsStyle.marginTop,
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Coming from #47280 (BZ checklist), The formMaxHeight calculation is not correct for Android native, the window height on Android doesn't take the inset top height into account, so subtracting it from the inset top will make it smaller, we need to add StatusBar.currentHeight to window height. More info in this proposal: #47280 (comment)

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.

10 participants