Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow query string in URL for packages list #355

Closed
fingolfin opened this issue Aug 28, 2024 · 7 comments
Closed

Allow query string in URL for packages list #355

fingolfin opened this issue Aug 28, 2024 · 7 comments

Comments

@fingolfin
Copy link
Member

It would be great if one could do something like https://www.gap-system.org/packages/?q=library and then that URL would prefill "library" into the search fill.

Perhaps @schnellecom can be motivated to have a look at it ;-)

@fingolfin
Copy link
Member Author

Clearly that would require some Javascript tweaks. Perhaps the https://datatables.net library we use even already has support for such a thing?

@fingolfin
Copy link
Member Author

I implemented this in be16180 but it is not quite good enough, because the query string is just used in the normal "full text search/filtering". Which is already quite useful and e.g. https://www.gap-system.org/Packages/utils.html now redirects to https://www.gap-system.org/packages/?q=utils and that just shows the "utils" package as desired.

But e.g. https://www.gap-system.org/Packages/ace.html redirects to https://www.gap-system.org/packages/?q=ace which shows 28 packages -- "ace" of course occurs in words like "space", "face", "interface".

So this is a start but not the end.

In principle we can restrict the search to just the first column (just replace table.search by table.columns(1).search), but doing that then is not reflect in the UI, which might confuse users. Also it still doesn't quite do it because 7 packages have names that include "ace".

Perhaps a better alternative then is to bring back a page that has the only purpose of showing a description of a specific package. Something like https://www.gap-system.org/packages/desc?q=example and the JavaScript on that page renders the table -- but do we really want such pages?

@olexandr-konovalov
Copy link
Member

Can we also make use of keywords in PackageInfo.g?

@schnellecom
Copy link
Collaborator

There is a very simple way to add it and I created a PR for it. The search term is just written in the URL after a # and if there is something written there it will be filled into the search field. See
#358

@schnellecom
Copy link
Collaborator

BTW the code is completely copied from this discussion and seems to just work:
https://datatables.net/forums/discussion/30747/prepopulating-the-search-text-box

@fingolfin
Copy link
Member Author

@schnellecom nice! but as I wrote above I already implemented something in be16180, but your PR certainly is nicer. But it should then also remove what I added, and adjust the redirects (as set up in my commit).

@schnellecom
Copy link
Collaborator

Now done with #358

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants