classification
Title: Make search result in online docs keep their position when search finishes
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, mdk, roelschroeven, xtreak
Priority: normal Keywords:

Created on 2019-01-29 14:40 by roelschroeven, last changed 2019-02-05 23:08 by xtreak. This issue is now closed.

Messages (5)
msg334525 - (view) Author: Roel Schroeven (roelschroeven) Date: 2019-01-29 14:40
Search in the online documentation shows results while the search continues in the background, which is very nice.

Only problem is: when the search finishes, a line with the text "Search finished, found x page(s) matching the search query." appears which pushes all the search results down a bit. When the result you were looking for was already displayed, you suddenly have to aim the mouse cursor at a new position, or it can happen that you accidentally open the wrong link because of the results not staying in their place.

Is it possible to allocate space for the "Search finished, ..." line from the beginning, so that search results stay in the same place the whole time?
msg334527 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-01-29 15:11
I have minimum experience with CSS but this seems to be a Sphinx level enhancement that needs to be made. The text is set after search completion at [0]. The element [1] to which the text is added has no fixed height and is empty at the beginning so adding a fixed height might ensure the text doesn't push it down. But the relevant file is part of sphinx repo and doesn't have an id associated with it so I am not sure how feasible it is to customize this as part of Python doc distribution.

[0] https://github.com/sphinx-doc/sphinx/blob/97d99f830258a4612a6c77f5be084819634dcbad/sphinx/themes/basic/static/searchtools.js#L299
[1] https://github.com/sphinx-doc/sphinx/blob/97d99f830258a4612a6c77f5be084819634dcbad/sphinx/themes/basic/static/searchtools.js#L133
msg334791 - (view) Author: Julien Palard (mdk) * (Python committer) Date: 2019-02-03 13:59
Hi Roel,

I like the idea, but as xtreak told, it's a sphinx issue we cannot easy fix on our side, better fix it sphinx side. Would you please repoen it on the sphinx bug tracker at https://github.com/sphinx-doc/sphinx/issues?
msg334816 - (view) Author: Roel Schroeven (roelschroeven) Date: 2019-02-04 10:23
Issue opened on the Sphinx bug tracker: https://github.com/sphinx-doc/sphinx/issues/6016
msg334891 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-02-05 23:08
This is fixed upstream and will be available as Sphinx is upgraded. Closing it now. Thanks @roelschroeven for the report.

Upstream PR : https://github.com/sphinx-doc/sphinx/pull/6018
History
Date User Action Args
2019-02-05 23:08:44xtreaksetstatus: open -> closed
resolution: third party
messages: + msg334891

stage: resolved
2019-02-04 10:23:13roelschroevensetmessages: + msg334816
2019-02-03 13:59:57mdksetmessages: + msg334791
2019-01-29 15:11:50xtreaksetnosy: + xtreak, mdk

messages: + msg334527
versions: - Python 2.7, Python 3.4, Python 3.5, Python 3.6
2019-01-29 14:40:07roelschroevencreate