Skip to content

feat: replace GitHub search redirect with client-side Fuse.js search - #21

Open
mahir-b0 wants to merge 1 commit into
fawazahmed0:mainfrom
mahir-b0:feature/client-side-search
Open

feat: replace GitHub search redirect with client-side Fuse.js search#21
mahir-b0 wants to merge 1 commit into
fawazahmed0:mainfrom
mahir-b0:feature/client-side-search

Conversation

@mahir-b0

Copy link
Copy Markdown

what this changes

replaces existing search engine which redirects users to Github code search with a proper client-side search that displays first 20 results inline on the page.

  • uses Fuse.js for fuzzy search over the current edition's hadith text
  • cached fetched data so repeat searches on the same edition don't re-fetch

Why

previous implementation opened github.com/search in a new tab, which requires the user to be logged into GitHub, broke on mobile, and felt disconnected from the site experience.

testing

tested locally by running npm test and testing across multiple editions. there are some issues with non-English searches

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