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

EQM: What happens when I refresh? #12393

Conversation

nucleogenesis
Copy link
Member

@nucleogenesis nucleogenesis commented Jul 2, 2024

Summary

Makes some changes to improve behavior on page refresh, such that:

  • If you enter the route onto the "replace questions" route and didn't come from quiz creation, then you'll be redirected to the quiz root page. This is because when the page loads you don't have any replacements in your pool so it'd always be empty anyway.
  • Listens to the beforeunload event and uses the close confirmation message in it. I tried to inject our modal but the beforeunload event doesn't really allow for that so I used our message there.

References

Fixes #12390

Reviewer guidance

Try refreshing the page in various places.

If the quiz is one you've saved before, then you should reload to the place you were at, but without your changes having been saved.

  • Add sections, then refresh, they should be gone
  • Delete sections, then refresh, they should return
  • etc

But! When you refresh on the replacements page, you should see the page load up with the side panel having been closed.

a11y

  • Can you use the confirmation window that pops up on page refresh with keyboard nav?
  • Does it announce as you'd expect, the message that is in the window on a screen reader?

@github-actions github-actions bot added APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend labels Jul 2, 2024
Copy link
Member

@rtibbles rtibbles left a comment

Choose a reason for hiding this comment

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

Code changes make sense - if @radinamatic signs off, this is good to go!

@radinamatic
Copy link
Member

radinamatic commented Jul 3, 2024

This still needs some work: refreshing the page always (after adding or deleting sections) gives me the TypeError: activeSection.value is undefined error, blank sidebar, and an empty space under the first section in the main window.

refresh.mp4

As I expected, the default browser alert popup/modal, is fully keyboard navigable 🙂
Tested on both Firefox and Chrome in Ubuntu 20.04
DB-logs.zip

@nucleogenesis
Copy link
Member Author

@radinamatic thank you!

I've updated the PR to account for the case you ran into! Should now be the case that if you ever are on a section which doesn't exist in the URL parameters, then we redirect you to the first section, which should always exist by the nature of how the useQuizCreation module works.

Copy link
Member

@rtibbles rtibbles left a comment

Choose a reason for hiding this comment

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

Have verified the updates since @radinamatic's review. All working with no errors in the console, and properly redirecting to an existent section on refresh!

@rtibbles rtibbles merged commit 6f2dca9 into learningequality:develop Jul 4, 2024
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Blank/error state when refreshing the "create" or "edit" section side panel is open
3 participants