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

VACMS-18974 DUW v2 flow update #31562

Merged
merged 22 commits into from
Sep 9, 2024
Merged

VACMS-18974 DUW v2 flow update #31562

merged 22 commits into from
Sep 9, 2024

Conversation

chriskim2311
Copy link
Contributor

@chriskim2311 chriskim2311 commented Aug 23, 2024

Are you removing, renaming or moving a folder in this PR?

  • No, I'm not changing any folders (skip to Summary and delete the rest of this section)
  • Yes, I'm removing, renaming or moving a folder

Did you change site-wide styles, platform utilities or other infrastructure?

Summary

This PR updates the flow and button functionality of DUW v2. We made changes to the continue/back and edit logic throughout the entire flow.

Branching Questions: Discharge Year, Reason, Previous Application, Previous Application Type, Previous Application Year

Related issue(s)

department-of-veterans-affairs/va.gov-cms#18974

Testing done

Tested flows and all AC functionality throughout the flow and the review page.

Testing URL: /discharge-upgrade-instructions/introduction/
Mural for testing: https://app.mural.co/t/departmentofveteransaffairs9999/m/departmentofveteransaffairs9999/1696352911500/80253b1c7200212cbcbcfb940d2cf4a29fed8417?sender=ua4eca0cc168eff677bd03940

Screenshots

What areas of the site does it impact?

DUW v2

Acceptance criteria

  • Back/Continue buttons work as expected for all questions
  • Question flows match mural
  • [Back button] Normal back to previous question when going though the flow.
  • [Back button] When in edit mode should go back to previous question if answer has changed for forked question.
  • [Back button] If answer has not changed or has been changed on non-forked question should go back to review screen.
  • [Continue button] Normal continue to next question when going through the flow.
  • [Continue button] When in edit mode should continue to next question if answer has changed for forked question.
  • [Continue button] If answer has changed for a forked question should continue to next question until last new question then go to review screen.
  • [Continue button] When clicking in edit mode on non-fork question should go to review screen even with an answer change.
  • Design review.
  • a11y review

Quality Assurance & Testing

  • I fixed|updated|added unit tests and integration tests for each feature (if applicable).
  • No sensitive information (i.e. PII/credentials/internal URLs/etc.) is captured in logging, hardcoded, or specs
  • Linting warnings have been addressed
  • Documentation has been updated (link to documentation *if necessary)
  • Screenshot of the developed feature is added
  • Accessibility testing has been performed

Error Handling

  • Browser console contains no warnings or errors.
  • Events are being sent to the appropriate logging solution
  • Feature/bug has a monitor built into Datadog or Grafana (if applicable)

@va-vfs-bot va-vfs-bot temporarily deployed to master/18974-flow-update/main August 23, 2024 18:10 Inactive
@chriskim2311 chriskim2311 marked this pull request as ready for review August 26, 2024 23:03
@chriskim2311 chriskim2311 requested review from a team as code owners August 26, 2024 23:03
@laflannery
Copy link

laflannery commented Aug 27, 2024

@chriskim2311, could you make sure everything in the new form matches the mural before we continue reviewing and if there are deviations for specific reasons we call these out? I think I'm specifically looking at the edit logic. So far I've found at least one scenario that doesn't look to match the mural:

  1. I tested the last flow in the mural as my example flow.

@chriskim2311
Copy link
Contributor Author

chriskim2311 commented Aug 27, 2024

@laflannery Thanks for the call out! The questions that branch are the following: Discharge Year, Reason, Previous Application, Previous Application Type, Previous Application Year. There are scenarios where the Previous Application Type answer can change the flow to Prior Service or Failure to Exhaust.

@laflannery
Copy link

This was just confusion/misunderstanding on my part. Chris explained it to me in slack

@eselkin
Copy link
Contributor

eselkin commented Aug 27, 2024

Was it expected that the styles would not be the same when reviewing the answers
on va.gov
Screenshot 2024-08-27 at 12 46 28 PM
vs how it appears on RI:
Screenshot 2024-08-27 at 12 46 20 PM

eselkin
eselkin previously approved these changes Aug 27, 2024
Copy link
Contributor

@eselkin eselkin left a comment

Choose a reason for hiding this comment

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

LGTM. Tested on the flow mentioned. Back and continue seem to retain information and flow seems correct re:Mural

@laflannery
Copy link

@chriskim2311 @thejordanwood and I ended up reviewing together because it was helpful, we have a few additional notes:

  • We found that some questions, while not technically branching questions were impacting the flow and adding new questions. That being said, and with approval from Amanda, we would like to make a change the the alert display:
    • Can we show the "Changing your answer..." alert on every question when the user hits edit, regardless of if it's a branching question?
    • And can we show the "Your information..." alert on the review screen always when they get back to here?
  • There is something not quite right with the edit flow on the Year/Month questions:
    • Review screen > Edit Year > Change from any other year to 2009 > Hit Back > Go to Service Branch question > Either change or don’t change answer here (doesn’t matter) > Click Continue > You will be taken to the review screen
    • You will see that the year is correctly updated to 2009, and branch is updated (if you chose to change this)
    • However, the issue is that I have skipped the month question which is required
    • When I hit “Back” on the branching question, that should have reset the flow so that “Continue” on the Service Branch question went through the flow instead of to the review screen
  • We are also finding issues when testing some of the more complex flows in the mural with the edit logic. For example:
    • I am finding instances where the Back and Continue buttons simple stop working during the edit process. I keep trying to click on them but they aren't doing anything any more. This seems very inconsistent though.
    • Jordan and I both have experienced issues where the back button is not working as noted in the edit flow for branching questions:
      • I am on the review screen > Click edit on a branching question > Change my answer > Click Continue > I am correctly taken to the next new question in the flow > Click back > I should be taken back to the branching question that I was on but instead I have skipped that question and I am taken to the question before that in the flow

Let me know if there are any technical limitations to the issues we are seeing with the buttons. I do know this is complex and if there needs to be a discussion about a different solution let us know.

@thejordanwood
Copy link

That being said, and with approval from Amanda, we would like to make a change the the alert display:

  • Can we show the "Changing your answer..." alert on every question when the user hits edit, regardless of if it's a branching question?
  • And can we show the "Your information..." alert on the review screen always when they get back to here?

@chriskim2311 I'm going to update the Mural tomorrow to reflect this change if this is something you can do.

@chriskim2311
Copy link
Contributor Author

@laflannery @thejordanwood Thanks for reviewing! I have some comments below.

  • Can we show the "Changing your answer..." alert on every question when the user hits edit, regardless of if it's a branching question?

I have added this to all questions when a user clicks edit, if Amanda does not approve it I can revert the change.

  • There is something not quite right with the edit flow on the Year/Month questions

I did make some changes for this to work as well.

  • When I hit “Back” on the branching question, that should have reset the flow so that “Continue” on the Service Branch question went through the flow instead of to the review screen

Completing the wizard then editing and clicking back to the home screen do we not want to save any answers?

Also from my understanding we want to only show empty questions in the new flow and skip any answered questions. This was based on Dave's original logic.

  • We are also finding issues when testing some of the more complex flows in the mural with the edit logic.

I did find a bug that I believed resolved this issue. If you hit a scenario where the buttons aren't working can you open the console and send me a screenshot, there should be an error shown, so I can debug further.

@va-vfs-bot va-vfs-bot temporarily deployed to master/18974-flow-update/main August 28, 2024 05:44 Inactive
@laflannery
Copy link

@chriskim2311 I'm not done with functionality testing but I needed a break so I switched to accessibility testing. Only one note:

  • The expandable alerts need the content in the expanded section to be wrapped in a semantic tag, without a <p> the font will not resize properly and it is being ignored by screen readers because it's just floating out there without meaning.

@thejordanwood
Copy link

@chriskim2311 I've updated the Mural to show:

  • That alerts should show on every question when the user hits edit
  • That the alert on the Review page should show after editing any question
  • I also created a Edit Year Discharge flow to show how that should work

Let me know if something is unclear!

@chriskim2311
Copy link
Contributor Author

@laflannery Thanks I have updated the alert mark up.
@thejordanwood Thanks I have updated all edit flows to have the alert and if a question is changed then the review shows the review page alert as well.

@va-vfs-bot va-vfs-bot temporarily deployed to master/18974-flow-update/main September 5, 2024 02:08 Inactive
@laflannery
Copy link

@chriskim2311 Jordan and I put the edge cases we were finding in this google doc because it was easier to format and make sense than in a comment. Can you take a look and then let the group know if you feel these are highlighting larger issues and we maybe should go with a simpler option as MVP or if we might be able to sort this out, thanks!

Word doc for other folks:
Discharge upgrade Flows PR testing.docx

@va-vfs-bot va-vfs-bot temporarily deployed to master/18974-flow-update/main September 5, 2024 17:55 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to master/18974-flow-update/main September 5, 2024 22:21 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to master/18974-flow-update/main September 5, 2024 23:46 Inactive
@randimays
Copy link
Contributor

(From Slack DMs) I reviewed against Laura's doc.

I used the answers from Laura's screenshot on #2 and saw that the red text is still happening. I saw that she mentioned Jordan couldn't reproduce but I tested twice with those answers and it happened both times.

Screenshot 2024-09-06 at 10 02 28 AM

Random thing I noticed: while clicking Edit on the review screen, you can see two focus boxes (yellow squares)

Question: should the review screen show the Your information was updated info box if the answer wasn't changed when editing? My suspicion is yes (to keep logic simpler) but I wanted to double check.

I didn't see any other issues; logic looks good!

randimays
randimays previously approved these changes Sep 6, 2024
Copy link
Contributor

@randimays randimays left a comment

Choose a reason for hiding this comment

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

Chris and I discussed #2 (above) in DMs; this is intentional behavior. All is good! Great work, Chris

@chriskim2311
Copy link
Contributor Author

Going to add a span and remove padding on the edit link to only show one focus box

Copy link
Contributor

@randimays randimays left a comment

Choose a reason for hiding this comment

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

Some non-blocking comments for consideration

@@ -74,6 +77,9 @@ const Dropdown = ({

if (forkableQuestions.includes(shortName) && editMode) {
toggleQuestionsFlowChanged(true);
toggleAnswerChanged(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider: I've noticed in a few files in this PR that we're duplicating toggleAnswerChanged(true) on both sides of an if statement. Is this for readability / clarity? Perhaps we could consolidate and place it once above the if statement.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! I'll clean this up it needs to be in the if statement only. But I can rewrite it to only write it once.

@@ -93,31 +93,53 @@ export const navigateForward = (
!formResponses[nextShortName] &&
editMode
) {
updateRouteMap([...routeMap, ROUTES?.[nextShortName]]);
if (routeMap[routeMap.length - 1] !== ROUTES?.[nextShortName]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we could benefit from a comment(s) explaining what's going on here briefly, and/or smaller utility functions that navigateForward uses to help keep things more readable.

pushToRoute(nextShortName, router);
return;
}

// This handles the edge case of the edit question not being skipped
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider: don't be afraid of longer variable names or more detailed comments to explain complex behavior. For instance, "edit question" may not be clear to a stranger to this code; maybe "question being edited." (Same with variable editQuestion; this could be questionSelectedToEdit) Not sure if my suggestions make it more clear; just offering some perspective

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That makes sense I can make these changes

@laflannery
Copy link

Approved...finally!

@thejordanwood
Copy link

Approved!

randimays
randimays previously approved these changes Sep 9, 2024
@chriskim2311 chriskim2311 merged commit 6076936 into main Sep 9, 2024
79 of 80 checks passed
@chriskim2311 chriskim2311 deleted the 18974-flow-update branch September 9, 2024 19:46
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.

6 participants