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

feat: Add Search Bar with Filter Functionality to Gnoweb #2881

Closed
wants to merge 2 commits into from

Conversation

Olawale-22
Copy link

This PR implements a search bar with dynamic filtering functionality. It allows users to input search terms and dynamically filter content displayed on the page based on the input. If no match is found, only the header and footer are displayed. When no input is entered, the full content is rendered.

Key Changes:
Added a search bar component.
Implemented conditional content rendering based on search input.
Improved user navigation through filtered search results (Render filtering).
Adjusted the rendering logic to conditionally display content, the header, and footer based on the search results.
Tested the feature across various sections of the site to ensure stability and expected behavior.

Testing and Validation:

  • Manually tested the feature to ensure correct behavior under various input scenarios.
  • Validated that the page renders the entire content when no input is provided and correctly handles cases where no matches are found.
  • No breaking changes were made, as no nodes was altered in the process (mainly javascript).

Contributors Checklist:

Tests made with special characters input to ensure nothing malicious may result from users input.

How to run:
Application is run using the (./build/gnoland start) and (./build/gnoweb -bind localhost:8888) commands or simply by running the 'start.sh' script in the root of the repo.

Next Steps:
Would be glad to make adjustments as needed based on further review and discussions.
Would be looking into other issues moving forward in case of no further adjustment on filters.

Thank you for your consideration, and I look forward to your feedback!

@Olawale-22 Olawale-22 requested review from moul, zivkovicmilos and a team as code owners October 2, 2024 10:44
@github-actions github-actions bot added the 📦 ⛰️ gno.land Issues or PRs gno.land package related label Oct 2, 2024
@Olawale-22 Olawale-22 changed the title Filters Add Search Bar with Filter Functionality to Gnoweb Oct 2, 2024
@Olawale-22 Olawale-22 changed the title Add Search Bar with Filter Functionality to Gnoweb feat: Add Search Bar with Filter Functionality to Gnoweb Oct 2, 2024
@thehowl
Copy link
Member

thehowl commented Oct 2, 2024

What is the advantage of this compared to Ctrl-F? (Browser's Find in Page?)

@Olawale-22
Copy link
Author

Olawale-22 commented Oct 2, 2024

What is the advantage of this compared to Ctrl-F? (Browser's Find in Page?)

Hi @thehowl ,
It displays content based on search input, thereby simplifying what is rendered for easy and clear discovery of what is being looked for. Could come in handy as the project grows larger.

Copy link
Member

@thehowl thehowl left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution, but unfortunately this is not something we're looking for. Apologies for what @leohhhn wrote on #2877; but after also discussing with him we agreed that it's something that does not necessarily add much of value to the web interface; where really content can be searched with the browser's built-in features, in a way that also puts the found content into context, rather than removing all sorrounding elements.

So I'll be closing this and the related issue.

One thing we might look for eventually is a way to search through the rendered content; ie. implementing full-text-search on the gnoweb backend. However, keep in mind this is not something we want right now. It's a complex job which will require the dust on gnoweb to have settled down and various planned improvements to happen - see #1187. For now, it's a job best left to the search engine indexers.

Thanks nonetheless!

@Olawale-22
Copy link
Author

Thank you for your contribution, but unfortunately this is not something we're looking for. Apologies for what @leohhhn wrote on #2877; but after also discussing with him we agreed that it's something that does not necessarily add much of value to the web interface; where really content can be searched with the browser's built-in features, in a way that also puts the found content into context, rather than removing all sorrounding elements.

So I'll be closing this and the related issue.

One thing we might look for eventually is a way to search through the rendered content; ie. implementing full-text-search on the gnoweb backend. However, keep in mind this is not something we want right now. It's a complex job which will require the dust on gnoweb to have settled down and various planned improvements to happen - see #1187. For now, it's a job best left to the search engine indexers.

Thanks nonetheless!

Alright. I was quite working around and thought of some filters by the way, but yes I would be on the lookout for other issues to participate since #1187 is not available for new contributors if I understand perfectly.

Thanks for the review!

@thehowl
Copy link
Member

thehowl commented Oct 2, 2024

@Olawale-22 everything on the repo is open for contributors by default.

we are planning a "gnoweb v2" which will be developed by the team; but some developments can be brought over to the new version if they are adaptable.

if there's something that piques your interest, please, comment on the issue and we'll try to evaluate if we can hand it off to you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 ⛰️ gno.land Issues or PRs gno.land package related
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants