provide a REST API to render the first page quickly in multi-page wizards
jstrachan opened this issue · 2 comments
When using a multi page forge wizard which does things (e.g. loaded the github token from keycloak/secretes, loaded the users github organisations, validate that the current project name doesn't exist already in github, load the openshift namespaces and so forth such as in fabric8-generator) it can take a little time on the very first request to validate all the possible pages that could be invoked if the user hits Finish
immediately.
i.e. the very first request takes 1-10 seconds due to the cache being cold which isn't a good first experience of the wizard for new users.
However as soon as any key is pressed or selection is made (its rare for users to just it Finish
immediately), all pages are validated etc.
So it might be nice for the UI to pass a flag to the REST API on the very first request aimed at loading page 0 first - and only page 0 - which would return false for being able to go to Next
or Finish
etc. Then the UI can make a second regular request after the data for the first page is loaded.
i.e. load the first page as quickly as possible; then once thats loaded, then load & validate all the possible pages in the wizard. Then the page loads quickly; the user then has time to look at the options, press some keys, then hit Finish
. By the time they are ready to hit Finish
then hopefully we'll have validated & warmed the caches ;)
So maybe we need a 'this step only' or loading first page
form attribute the UI can pass in on the very first request on startup to avoid loading/defaulting/validating all the steps in a wizard so it can just load the first one quickly?
Is this still an issue? The cache is warmed up during initialization here: https://github.com/obsidian-toaster/generator-backend/blob/master/src/main/java/org/obsidiantoaster/generator/rest/ObsidianResource.java#L121
yeah, still an issue. The first page render takes a long time to validate every page of a multi-page wizard before it renders the first page