legumeinfo / website-ui-specs

User interface specification of components built for the Jekyll sites.
Apache License 2.0
0 stars 0 forks source link

Specify behavior of previous search results when form is changed #4

Closed sammyjava closed 1 year ago

sammyjava commented 1 year ago

We need to specify what happens to previous search results when the search form is updated (change of selector, change of text input, etc.). There are various options, add to this list if it is not complete:

adf-ncgr commented 1 year ago

I vote for "leave the previous search results there, only change when the form is submitted and new results are loaded". It seems simplest and I don't see any clear advantage to anticipating the next user move.

alancleary commented 1 year ago

I also vote for "leave the previous search results there, only change when the form is submitted and new results are loaded".

Something else I didn't mention in issue #3 is that the existing web components always show an alert that indicates the search status, i.e. it says when a search is in progress, has succeeded, or failed. Currently it doesn't say anything useful when a search succeeds or fails but this could be updated to include the user's search parameters so the screenshot use-case @sammyjava mentioned wouldn't be thrown off by a form that has been changed but not submitted.

adf-ncgr commented 1 year ago

This raises a good point: I think we ought to update the URLs with search parameters for easy sharing (even better than taking a screenshot); and of course, we'd have to use query params specified in a URL if supplied. Probably hijacking this issue...

alancleary commented 1 year ago

This raises a good point: I think we ought to update the URLs with search parameters for easy sharing (even better than taking a screenshot); and of course, we'd have to use query params specified in a URL if supplied. Probably hijacking this issue...

This should be part of the spec for the component, although I don't think it needs to be implemented in the prototype since it's a plug and play feature in the Web Component implementation.

sammyjava commented 1 year ago

Yeah, the React demo is strictly for UI spec purposes. The pagination, query string URI, etc. should be plug-n-play as @alancleary says. At least I hope so. :) And that was a classic thread-jack.

sammyjava commented 1 year ago

@cann0010 any comments? It looks like we've got two in favor of just leaving search results up, which I'll implement unless you have strong opposition.

alancleary commented 1 year ago

Yeah, the React demo is strictly for UI spec purposes. The pagination, query string URI, etc. should be plug-n-play as @alancleary says. At least I hope so. :) And that was a classic thread-jack.

Another requirement that should be spec'd for all components that load data from services is making sure that promise returned by the service function is cancleable. This is to avoid race conditions when the service is being slow and/or the user makes another request before the previous one has been fulfilled. This can be done with the LisCancelPromiseController class.

sammyjava commented 1 year ago

I'm closing this with saying that we've decided to let search results persist until a new set of results is received. I've added it to https://github.com/legumeinfo/component-search-ui-srs/blob/main/general-requirements.md