Skip to content

Implement page search URL + Opensearch XML#2143

Merged
hustcer merged 5 commits into
nushell:mainfrom
ian-h-chamberlain:feat/search-url
May 21, 2026
Merged

Implement page search URL + Opensearch XML#2143
hustcer merged 5 commits into
nushell:mainfrom
ian-h-chamberlain:feat/search-url

Conversation

@ian-h-chamberlain
Copy link
Copy Markdown
Contributor

Closes #1093

I tend to create a lot of shortcuts to doc searches in my browser, so I wanted the same thing for Nushell! I decided to take a crack at implementing the search URL logic I've seen used by many other docs websites.

Screen.Recording.2026-03-28.at.01.25.37.mov

Also set up Opensearch XML so some browsers can more easily add a search engine:

image

Implementation

  • Wrap the DocSearch component provided by the docsearchPlugin, and override its registration with our custom component

In the new URLDocSearch component:

  • Prefill and execute search when a page loads with the search param set, at onMounted

  • Add an input event handler, which updates the URL bar when the search bar is updated. Use a 500ms debounce to avoid flooding the user's browser history with partial searches

There are two pieces to this:
- Prefill and execute search when a page loads with the `search` param set
- Update the URL bar when a search is executed, with 500ms debounce
Also fixup some TS lint errors in the new component, language server
wasn't working before.
@fdncred
Copy link
Copy Markdown
Contributor

fdncred commented Mar 28, 2026

sounds cool!

Comment thread .vuepress/components/URLDocSearch.vue Outdated
ian-h-chamberlain and others added 3 commits April 12, 2026 14:27
Use a visibility observer for the input box, which clears the query when
it's dismssed. Also use manual `input` dispatch instead of
`initialQuery`, so that the initial query is dismissed after the first
search runs.
@hustcer
Copy link
Copy Markdown
Contributor

hustcer commented May 21, 2026

Hi @ian-h-chamberlain , sorry it took me so long to circle back on this — thanks for your patience. The latest revision looks great. I pushed a couple of tiny polish commits on top; happy to merge 👍

@hustcer hustcer merged commit b7315ff into nushell:main May 21, 2026
2 checks passed
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

Successfully merging this pull request may close these issues.

FR: Generate search URL

3 participants