Skip to content

Improve Pagefind search responsiveness - #15

Merged
walishcs merged 1 commit into
mainfrom
template
Aug 10, 2026
Merged

Improve Pagefind search responsiveness#15
walishcs merged 1 commit into
mainfrom
template

Conversation

@walishcs

Copy link
Copy Markdown
Owner

What changed

  • Preload the Pagefind runtime when search receives focus, hover, or opens.
  • Use Pagefind debounced search with a fixed 200 ms timeout.
  • Limit initial result hydration to six entries and cache query-specific result data.
  • Ignore superseded queries and preserve the existing Astryx CommandPalette behavior.
  • Add focused unit coverage for preparation, debounce, limits, caching, and stale searches.

Why

The first query previously paid the runtime initialization cost, every keystroke could start work, and up to twelve result payloads were loaded before rendering. This made search feel delayed and scales poorly as the index grows.

Validation

  • npm run check
  • npm test (25 tests)
  • npm run format:check
  • npm run build (17 Pagefind pages indexed)
  • npm run astryx -- doctor
  • Production browser smoke test: results rendered in about 227 ms after warm-up, rapid input kept only the latest query, and keyboard controls remained functional.

@walishcs
walishcs merged commit 43833e8 into main Aug 10, 2026
1 check 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.

1 participant