SDRefugeeTutoring / sdrt-custom-functions

Custom Functions for SDRefugeeTutoring.com
The Unlicense
2 stars 0 forks source link

[VOLUNTEER PORTAL] Capability to Auto Refresh? #90

Open dreazee opened 1 year ago

dreazee commented 1 year ago

Hi @JasonTheAdams Seeing the "Next Scheduled Event" not populate automatically made me look at other instances, too. Is it possible to make the Dashboard auto-refresh when navigating? And what about after submitting the Code of Conduct or Volunteer Waiver? Currently, I am directed to a separate page to fill that out. I fill it out, close the window, and go back to the Volunteer Portal where the permission obviously wouldn't be updated without a manual refresh. But what if we had the form open in the same tab so that when the user went back to the Volunteer Dashboard their Volunteer Permission would be updated... ?

JasonTheAdams commented 1 year ago

Hi @dreazee!

This is a very reasonable request. I considered this when I was building the application, similarly to updating the Next Event in #88. As handy as it is to have data auto-fetch in these circumstances, I decided to keep it simple to save (quite a bit of) time. In my experience, most users don't use multiple tabs, and will instead go to do their thing and return. So relying on the page load to grab the latest data is often safe. If the user sees something they don't expect, their instinct is also to refresh the page. I'm not saying this is an ideal user experience, to be sure, but it's simple and usually is fine.

Once we have everything else working as expected, I'm totally happy to circle back and spend the time to make all the data fetch and re-fetch automatically. In that case, when the user flips between sections or returns from another tab, the newest data will automatically be fetched. It's slick, but takes hours of work to accomplish.

Let's see if real users run into the problem and let that determine its priority. We can always tell folks "just refresh". If the solution is simple, most users just take it at face value and move along.

dreazee commented 1 year ago

@JasonTheAdams "Okay...okay...okay" is what I kept saying aloud as I was reading your comment. Thanks for laying this all out there. Although I would love for SDRT to be considered "slick" we're more humble at this point and telling folks to "just refresh" is a great solution. And yes, you are totally right in thinking that the majority of people will have that instinct to refresh. And if they don't this is a great teachable moment for our volunteers to make them better webpage navigators! WIN, WIN for everyone!

If you don't think we need to have the Code of Conduct or Volunteer Waiver open up in the same tab, then I'm cool with everything staying the same!

JasonTheAdams commented 1 year ago

Leaving a development note, here:

It's incredibly serendipitous that React Router 6.4 just came out. In this version it's possible to provide a Route loader which retrieves the data on a per route basis. It also had the ability to control revalidation so when the user, for example, moves from the Upcoming Events to the Dashboard the Dashboard data will reload the data should the Next Event have changed from their RSVPs.

It may be useful as well to employ the Route actions for handling the mutations (e.g. updating the user profile), but I don't think that's as critical as it won't affect the user experience like the loaders will.