spraakbanken / korp-frontend

Frontend for Korp, a tool using the IMS Open Corpus Workbench (CWB).
https://spraakbanken.gu.se/en/tools/korp
MIT License
16 stars 8 forks source link

Search history fails to distinguish options with same label #406

Closed arildm closed 1 week ago

arildm commented 1 week ago
  1. Search for "vara" in corpus A
  2. Search for "vara" in corpus B
  3. Select the first search from the search history selector (further down in the list)
  4. Expected: a search in Corpus A is triggered
  5. Actual: no search is triggered
arildm commented 1 week ago

A general pattern in the app is that a search action is triggered if the search URL param is changed. This works via the Searches service. Selecting a search history option will simply change the URL params, so if the search value is unchanged, no search is triggered.

It is not expected that changing the corpus selection (and consequently the corpus URL param) should trigger a search. So the Searches service shouldn't react to that.

I guess what is needed is a function to explicitly trigger the search. This should be used by the Search button as well as the search history selector.

arildm commented 1 week ago

Other parts of the app will set the search param to null before setting it to the desired value, in order to trigger the Searches service.

Both of these solutions (trigger explicitly; unset first) require being in the Angular context. So this should probably be done as a part of: