-
-
Notifications
You must be signed in to change notification settings - Fork 647
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
[Extremely Minor] Search Query Stays in URL on Documentation #936
Comments
This is somewhat intentional, so that the search query is remembered the next time you go to search. I also find it annoying, though, so I'd prefer to remove it. |
This is a combination of two things:
I don't remember the reason, but this was definitely intentional -- I remember that Matthew added this functionality at some point (I remember that at that point I stopped using the top-left search box, to avoid the sticky parameter). |
Looks like this was added here: racket/scribble@2eb8e45 by @elibarzilay. I'm looking for discussion now. |
I've been unable to find any discussion about this change from 2009, although I think I remember something about it. |
Perhaps it was me who wrote the code, but I still don't like it... In any case, there were several possible reasons for doing this: (1) there was the attempt to get to the docs from the teaching language in a way that remembers that context (so you won't find other documentation bits); (2) there was some potential mess if you have multiple versions (and that was somehow done with cookies, too, maybe?); and (3) there was the problem of remembering where to go back to if you start in a page in your local doc directory, then go to some page that is in the installation (and/or going in the other direction). |
I accidentally stumbled upon this issue over a year later, but I’d like to say that I agree this behavior is annoying. I use the search box a lot, but when I link people to documentation I always have to manually strip the query string off of the URL. I personally don’t think it’s a worthwhile feature, but I would imagine some people might find it to be a better user experience, so I wouldn’t mind too much if it were kept as-is. |
Another annoying issue: the back button doesn't work the way it's supposed to. Consider:
|
Note that I believe the query string is there to support the immediate Back button. This is a must-have feature, but it should be doable without using the query string hack. |
Based on my read of this issue and the responses, it seems the additional query string is primarily meant to preserve search queries to allow for forward/backward navigation in a web browser. Simply by adding this query string, browsers will be able to navigate between pages as expected so there is no need to manipulate all URLs. This is the current behavior at the time of writing:
When the result of a search shows a list of prospective links, following these links as shown above does not result in populating the top-left search field with the current search parameter. Due to this, there appears to be no need for this context to be preserved once a link would result in the user leaving the route
Solution (WIP)server-side, when a search is completed I'd like for an HTTP cookie to be set. This can be handled bidirectionally in JS or Racket, so I'll see what seems like "the right way". Coupling that with the History API and invalidating stale cookies, if set, seems to cover most of the cases I can think of. Client-Side Server-Side I'll stew on this a little and think through the problem more meaningfully. Thanks to @sorawee and @samth for bouncing ideas in |
@mflatt Thanks so much for fixing this, it's been bugging me for years |
When you search in a page other than the main search page, the search request is communicated as a "q" query in the URL. Meanwhile, the search page generally propagates all query arguments, as a kind of store-passing facility, which means that the "q" query was passed along. Avoid adding the "q" to search results, so it doesn't get propagated so much. Closes racket#936
When you search in a page other than the main search page, the search request is communicated as a "q" query in the URL. Meanwhile, the search page generally propagates all query arguments, as a kind of store-passing facility, which means that the "q" query was passed along. Avoid adding the "q" to search results, so it doesn't get propagated so much. Closes racket#936
I've noticed something while using the search functionality on the docs (Disclaimer: This might not even be a real problem; I just thought I would mention it in case. If it's not a problem, I apologize for taking up space in the issue queue):
Steps to Reproduce
foo
into the search bar and press enterExpected Behavior
A URL of
http://docs.racket-lang.org/index.html
Actual Behavior
A URL of
http://docs.racket-lang.org/index.html?q=foo
The text was updated successfully, but these errors were encountered: