-
Notifications
You must be signed in to change notification settings - Fork 327
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
Add search-as-you-type (inline search results) feature #2093
base: main
Are you sure you want to change the base?
Conversation
This is super cool |
For me it's the most wanted feature, brilliant ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you a thousand times for including such clear and detailed code comments. So far I've only read the implementation, haven't played around with it on the PR build yet.
// Don't interfere with the default search UX on /search.html. | ||
if (window.location.pathname.endsWith("/search.html")) { | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should also account for dirhtml builds, which I think (?) will have a url like https://whatever.com/en/search/
or potentially https://whatever.com/en/search/index.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dirhtml
was not on my radar. Will need to look into what that does to figure out how it affects the impl.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I introduced a temporary change to tox.ini
in this PR to make docs-dev
build dirhtml
instead of html. It all seems to work fine still
// searchtools.js loads. | ||
// | ||
// Search class is defined in upstream Sphinx: | ||
// https://github.com/sphinx-doc/sphinx/blob/master/sphinx/themes/basic/static/searchtools.js#L181 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
link to .../blob/master/...
may suffer from line number drift or otherwise go stale. Let's use a permalink to a specific repo state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed now, will let you resolve
} | ||
|
||
// Create a new search-as-you-type results container. | ||
results = document.createElement("section"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gabalafou would appreciate your perspective on what is the best node type for an appearing/disappearing list of search results, and how this can/should/will interact with things like tab focus.
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
@@ -122,7 +122,7 @@ set_env = PYDEVD_DISABLE_FILE_VALIDATION=1 | |||
extras = {[testenv:docs-no-checks]extras} | |||
package = editable | |||
commands = | |||
sphinx-build -b html docs/ docs/_build/html -v -w warnings.txt {posargs} | |||
sphinx-build -b dirhtml docs/ docs/_build/html -v -w warnings.txt {posargs} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be reverted before (hopefully eventually) merging
@drammock all actionable feedback addressed |
time for more feedback then 😆 I was just playing around with the CI build, and 2 things didn't match expectations:
|
Fixes #1977