Skip to content
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

Added a search functionality with Fuse.js #15

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

KrishnanN27
Copy link

This PR adds a search functionality to the RDF Explorer using Fuse.js. It includes the following changes:

Modified Files:

  • packages/explorer-views/src/pages/navigation.tsx: Added a search input element and results container to the navigation view.
  • packages/explorer-views/src/pages/navigation.css: Added styling for the search input and results container.
  • packages/explorer-site/src/main.ts: Implemented the search functionality to fetch JSON data, initialize Fuse.js, and dynamically update the search results.

Detailed Changes:

  • Search Input and Results Container:

    • Added a search input element and results container to navigation.tsx.
    • Updated navigation.css to style the search input and results container.
  • Search Functionality:

    • Implemented functions in main.ts to fetch tree.json and search.json, initialize Fuse.js with the search data, perform searches based on user input, and update the view dynamically.
    • Added event listeners to the search input to handle user queries and display search results.
    • Implemented navigation functionality to allow users to navigate to selected search results.

    To-Do:

  • Turn Off Auto-Suggestions:

    • Currently, the search input field may show auto-suggestions based on previous searches or form inputs in the browser.
    • A related discussion and potential solutions can be found here.
  • CSS Corrections for Responsiveness:

    • Review and adjust CSS to ensure the search input and results container are responsive and work well on different screen sizes.

@KrishnanN27
Copy link
Author

  • .gitignore: Updated to ignore public files related to fonts.

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.

3 participants