When to fetch records from the backend service? #37
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This issue relates to several other open issues:
Background of the related functionality can be found here:
When to fetch records from the backend service?
The main question is: when exactly, during the process of a user interacting with the application, should requests to the server be made to fetch records of specific types.
And a follow-up question: when should calls to the same endpoints as were made previously, be made again (or ignored).
How we approach these questions will have an important influence on the UX, both in terms of which data will be available at which points in time (meaning that some data might be unavailable when they are needed, or vice versa), and in terms of how the user experiences delay. The (un)availability of data is likely the cause of #11, while the delay is evident in #31.
How is it done currently?
At the moment, data will be fetched:
service_fetch_beforeoption:get-record, with elements being specific recordpids; these specific records will be fetched up frontget-records, with elements being specific class names; all records of these types will be fetched up frontPerson:InstancesSelectEditor, when the component mounts:In addition, multiple calls to the same endpoint are prevented by default.
How should it be done?
I am honestly not sure. I have no previous experience building such UX workflows that have to fetch data from a server constantly, so I'm curious if there might be some design patterns that I'm unaware of. The important thing is to make the UI/UX experience as seamless and as intuitive as possible, i.e. remove delays as much as possible, and render data in the most intuitive form as early in the workflow as possible.
I have a couple of ideas that would be good to get feedback on:
InstancesSelectEditor, rather than fetching all records of the main class and all of its subclasses when the component mounts, we can fetch it when the user actually interacts with the component, i.e. when they click on the component to see the options? One could show a busy indicator inside the opened dropdown while the fetching happens.InstancesSelectEditor, this issue has been proposed before: https://github.com/psychoinformatics-de/shacl-vue/issues/69service_fetch_beforeconfiguration option, i.e. shift the delay to a once-off up front cost, and get the seamless and correct rendering of related records as benefitThree thoughts come to my mind:
@mih thanks! Sorry I missed the notification for you comment. I share pretty much the same opinions as you gave. One point regarding:
This is indeed how it is done currently. But the problem with the current approach is that the default behavior of a VueJS component is to mount only once all of its child components are mounted, so e.g. a dropdown component will render once its (currently known) list items are mounted. I have a strong suspicion that this leads to much of the lag that we have seen and reported in issues.
After some time consuming backs and forths on this behavior, the latest state can now be described as follows:
shacl-vueperformance improvements...Updates can be seen in the current test deployment https://annotate.inm7.de/s/test and compared to the production deployment https://annotate.inm7.de/s/users.
I made major-ish changes to the
InstancesSelectEditorcomponent (the one where you can select e.g. aUserfrom a list of availableUsers) in an attempt to reduce lag and improve performance (see detailed commit message), including:vue-virtual-scroller, which speeds up rendering of long listsI also updated the
NodeShapeViewercomponent, which displays a record in the list of records when a user selects a type, on the main page. See commit message. Mainly a few performance improvements under the hood, and then hiding some details likeAnnotations by default, so that there's less to render.identifiersfield shows up late #31