Skip to content

Revert removal of search highlighting on documentation page #6305

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

Closed
agjohnson opened this issue Oct 18, 2019 · 9 comments · Fixed by #6914
Closed

Revert removal of search highlighting on documentation page #6305

agjohnson opened this issue Oct 18, 2019 · 9 comments · Fixed by #6914
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code Needed: design decision A core team decision is required

Comments

@agjohnson
Copy link
Contributor

agjohnson commented Oct 18, 2019

The underlying PR #6087 removed the URL params necessary to add highlighting to the linked documentation page, a feature that is very helpful to users. There wasn't much context in the PR about why the change was required or why the solution we made was the correct one.

I would like to revisit this as I'm already missing the highlighting and there are probably better ways to address problems that we were hitting without wholesale removal of a feature that users are probably expecting.

What are the problems with highlighting and why did we come to the solution that we did?

I normally find myself wanting to remove the &hightlight=... from the URL when linking to customers, but more applicable UXs in that case are:

  • Have a share button
  • Use JS to remove highlight from the URL bar

If the visual additions are the problem, wholesale removal of the feature is definitely the wrong direction to go, as users have no way to opt-in. Opt-out could include any of the following:

  • On keypress ESC, highlight classes are removed from elements
  • We can show a "Showing X results" bar at the top of the page with a close button that removes highlighting -- this works across all themes

Is the problem is that search queries that are multiple words don't highlight correctly? What percentage of search queries are more than 2 or 3 words? Search queries that are this long seem like an edge case, but we still have more options:

  • Fix the sphinx highlighter to match all words
  • Removing highlighting only for queries that are more than 2 or 3 words long
@agjohnson agjohnson added Improvement Minor improvement to code Needed: more information A reply from issue author is required Accepted Accepted issue on our roadmap labels Oct 18, 2019
@no-response
Copy link

no-response bot commented Nov 1, 2019

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further. Thanks!

@no-response no-response bot closed this as completed Nov 1, 2019
@agjohnson
Copy link
Contributor Author

Dammit bot, shut up.

@no-response no-response bot removed the Needed: more information A reply from issue author is required label Nov 1, 2019
@agjohnson agjohnson reopened this Nov 1, 2019
@agjohnson agjohnson added the Needed: design decision A core team decision is required label Nov 1, 2019
@mgeier
Copy link
Contributor

mgeier commented Feb 3, 2020

Yes, please bring this feature back!

I was surprised that it is suddenly missing.

It is really confusing that it works when building locally and it stops working when built on RTD.

@mgeier
Copy link
Contributor

mgeier commented Feb 3, 2020

I've created readthedocs/sphinx_rtd_theme#876 to show a way to get a "Hide Search Matches" link in the RTD theme (like other themes have already). With that, I think there is no reason to disable the search highlighting altogether.

@ericholscher
Copy link
Member

I'm 👍 on the theme change, at least. We talked about this and agree we should revert to the Sphinx original functionality and see if we can tweak it to just be better instead of remove it.

stsewd added a commit that referenced this issue Apr 16, 2020
@agjohnson
Copy link
Contributor Author

Going to reopen this, search as you type still does not highlight. The fix in #6914 reverts back to the old search highlight that was removed. I'd rather find a solution that is somewhere in between -- neither user experience is great.

@agjohnson agjohnson reopened this May 3, 2020
@mgeier
Copy link
Contributor

mgeier commented Aug 15, 2021

Use JS to remove highlight from the URL bar

I've just suggested this in sphinx-doc/sphinx#9551.

@agjohnson
Copy link
Contributor Author

I was going to suggest push state for this, that would be a good middle ground to at least resolve the issue with linking pages with the param.

There is still the issue that Sphinx's default highlighting makes for poor UX on a lot of search queries though:

image

I'm not sure if we can override this behavior easily, or if that even makes sense -- most likely this is better as an upstream patch at Sphinx though. I know this has been the main hurdle to enabling the highlighting on RTD again though.

@humitos
Copy link
Member

humitos commented Feb 21, 2024

I'm closing this issue in favor of readthedocs/addons#36 since it will be implemented in the addons repository if anything.

@humitos humitos closed this as completed Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code Needed: design decision A core team decision is required
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants