Skip to content

Require three characters before searching docs - #2022

Merged
enriquegh merged 1 commit into
mainfrom
search-min-query-length
Sep 22, 2026
Merged

enriquegh merged 1 commit into
mainfrom
search-min-query-length

Conversation

@enriquegh

Copy link
Copy Markdown
Contributor

Summary

  • Wait until the trimmed query contains at least three characters before requesting Algolia results.
  • Show a minimum-length prompt for short input and hide previous results when deleting below the threshold.
  • Preserve curated suggestions before typing.

Verification

  • pnpm exec tsc --noEmit passed.
  • Targeted ESLint and git diff --check passed.
  • Browser checks: one- and two-character queries send no search requests; api returns results; deleting back to two characters hides results; whitespace and product filters cannot bypass the minimum; clearing restores curated suggestions.
  • Inspected the rendered short-query state.

Amp thread: https://ampcode.com/threads/T-01a0ca8a-763a-7208-8639-edbaaa47c876

@vercel

vercel Bot commented Sep 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sourcegraph-docs Ready Ready Preview Sep 22, 2026 8:02pm UTC

Request Review

@github-actions

github-actions Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

@marcleblanc2 marcleblanc2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need to remember to revisit this with the migration

@enriquegh
enriquegh merged commit b8c83cf into main Sep 22, 2026
6 checks passed
@enriquegh
enriquegh deleted the search-min-query-length branch September 22, 2026 20:19

This branch was successfully deployed

1 active deployment
Preview 086c8489 Deployed Sep 22, 2026 by vercel[bot]
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.

2 participants