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

LG-3787: Create waiting experience for address checking, ID resolution and DocAuth #4517

Merged
merged 16 commits into from
Dec 22, 2020

Conversation

aduth
Copy link
Member

@aduth aduth commented Dec 16, 2020

Why: As a user, I want to know that my data is processing so that I understand that things are progressing as expected.

Screenshots:

Animation:

wait mov

Message after long wait:

Screen Shot 2020-12-16 at 11 54 10 AM

To do:

  • Implement in other async steps (Edit: Done in 9ba5029)
  • Verify no regressions for existing spinner buttons
  • Add spec for spinner-button.html.erb partial, which has increasingly non-trivial logic (Edit: Done in 0d4d3da)
  • Add spec for form-steps-wait.js (Edit: Done in 96b774b)

<%= button_to(
t('forms.buttons.continue'),
url_for,
method: :put,
form: {
class: 'button_to read-after-submit',
Copy link
Member Author

Choose a reason for hiding this comment

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

Note to self: Research why accessible-forms.js exists, since in cases like this it prevents screen readers from announcing intended status texts after a submission. At the very least, it could be improved to respect event.defaultPrevented in a submit event.

@aduth aduth requested a review from bpdesigns December 16, 2020 19:04
Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

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

Just to check my understanding: this PR submits the form on the page as a .fetch request, then checks the HTML response we get back to see if it should advance or not?

Should we consider making a separate API endpoint for polling like we did for the doc auth endpoints?

app/javascript/packs/form-steps-wait.js Outdated Show resolved Hide resolved
@aduth
Copy link
Member Author

aduth commented Dec 16, 2020

Just to check my understanding: this PR submits the form on the page as a .fetch request, then checks the HTML response we get back to see if it should advance or not?

Should we consider making a separate API endpoint for polling like we did for the doc auth endpoints?

Correct. It essentially submits the same form in JavaScript, then requests the /verify_wait path to see when it redirects to the next step as an indication of when the user should be navigated along.

The nice thing about it is that it doesn't require any changes to the code that already exists, which we may still want as the progressive enhancement fallback for environments with JavaScript disabled (as long as we care to support no-JS in this flow, that is).

To your question: We could, yes. Per the above, it adds more code that we don't necessarily need. On the other hand, it is a bit unconventional and wasteful to use window.fetch to request full page responses. I'd been looking at whether we could use respond_to to return a simpler response for the fetch request, and/or allow the "wait" step to respond to a HEAD request or similar to what we do with hybrid status checks to return and distinguish between 202 status code (as pending) vs. a redirect.

@aduth
Copy link
Member Author

aduth commented Dec 18, 2020

Should we consider making a separate API endpoint for polling like we did for the doc auth endpoints?

One thought here is to have an endpoint which simply returns the active step of the current user. This would make the logic a bit easier to know whether the user has completed the current step to redirect them along. It could possibly even absorb what we have for /doc_auth/link_sent/poll, where instead of having a dedicated controller for the hybrid completion of the document_capture step, we could simply check to see if the user has advanced past that step.

One complication may be that the CaptureDocStatusController does a bit of extra handling for "failure" cases.

@aduth
Copy link
Member Author

aduth commented Dec 18, 2020

Implement in other async steps

Added to the CAC verification flow in 9ba5029. From the ticket description, it's not clear to me where else we have these sorts of async flows. I don't see any other references in code to this meta_refresh auto-reload-til-complete implementation.

@zachmargolis, @bpdesigns Can you clarify if there are other places this spinner should be implemented?

@aduth
Copy link
Member Author

aduth commented Dec 18, 2020

Should we consider making a separate API endpoint for polling like we did for the doc auth endpoints?

One thought here is to have an endpoint which simply returns the active step of the current user. [...]

On second though, I don't know that we need anything new or custom here? FlowStateMachine#index gives us this information already. We could just send a HEAD request to /verify/doc_auth (or /verify/cac) to know where we should be at in the flow.

@aduth aduth marked this pull request as ready for review December 18, 2020 19:04
**Why**: Kinda the motivation behind the discussion here: #4517 (comment)
@aduth aduth merged commit 9d5f678 into master Dec 22, 2020
@aduth aduth deleted the aduth-spinner-button-dots branch December 22, 2020 16:09
aduth added a commit that referenced this pull request Jan 6, 2021
aduth added a commit that referenced this pull request Jan 6, 2021
* Revert "Add spinner button to phone step (#4546)"

This reverts commit c5d3a21.

* Revert "LG-3787: Create waiting experience for address checking, ID resolution and DocAuth (#4517)"

This reverts commit 9d5f678.
aduth added a commit to 18F/identity-design-system that referenced this pull request Jan 26, 2021
**Why**: This is out of sync with current guidance, where buttons which trigger a waiting experience have since been refined within the IdP to display with a pulsing dot animation.

See: LG-3730, LG-3787, 18F/identity-idp#4517
aduth added a commit to 18F/identity-design-system that referenced this pull request Jan 27, 2021
* Remove Spinner component button variant

**Why**: This is out of sync with current guidance, where buttons which trigger a waiting experience have since been refined within the IdP to display with a pulsing dot animation.

See: LG-3730, LG-3787, 18F/identity-idp#4517

* Merge 3.0.1 into unreleased changelog

A 3.0.1 hasn't yet been published
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

2 participants