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 switch modes #407

Closed arildm closed 1 week ago

arildm commented 1 week ago

In 1398d512, the search history functionality was consolidated to a component. One essential change was that searches are now stored as param objects, not as url strings. In this, I forgot about the ?mode parameter. Now, when selecting a history item that was made in another mode, you will likely get an error because the app stupidly selects corpora that are not available.

We cannot simply include the ?mode parameter, because it is not in the hash string unlike all the others.

One approach could be to store search history under the mode name in local storage.

Also remember that multiple Korp instances can be hosted under the same domain. The search history should either be split by base url + mode, or it should be able to switch between them when a history item is selected.