constructicon / russian

Searchable database of multiword grammatical constructions of Russian.
https://constructicon.github.io/russian/
GNU Affero General Public License v3.0
1 stars 4 forks source link

Implement stable URLs for constructions #82

Open jwbth opened 7 months ago

jwbth commented 7 months ago

Hello there! I came across your website while researching Laura Janda's work on Russian verbs and found it very nice!

I'm an open source contributor and I really liked your university's enthusiasm in regards to open source. In return for your contribution to open source linguistics, I would want to suggest a feature for your website: stable URLs for constructions.

Rationale:

Here's a demonstration:

https://github.com/constructicon/russian/assets/33615628/0963ccdb-faa2-4665-9a1e-6d9b750905b6

I have tested the patch on my machine in Chrome and Firefox. It works on all pages, including /advanced-search/ and /daily/.

It does the following:

  1. Sets the construction in the select to the one specified in the URL fragment (#number), both at page load and when the user changes it. If there is no construction with that number in the record list, it clears the selection.
  2. Sets the URL fragment when the user selects a construction in the select.

I would also suggest changing the page title together with the URL fragment so that the names of the constructions are evident to the user when they navigate them, but that would be trickier.

bast commented 7 months ago

This is a great idea! I need to study the solution a bit. I will return to it soon.