jargons.dev
jargons.dev copied to clipboard
Add Suggestion to Contribute a Word When Search Yields No Results
To encourage user contributions and enhance our dictionary, we would like to add a message suggesting users contribute a word to the dictionary when a search yields no results. This message should be displayed in the search dialog to prompt users to add new words that are not currently in the dictionary.
Current Implementation
When a search is performed and no matching words are found, the search dialog currently displays a message indicating that no results were found. Below is a screenshot of the current implementation:
Desired Implementation
In addition to the current message, we want to include a suggestion for users to contribute the missing word to the dictionary. This will be done within the components/islands/search.jsx island.
Implementation Details
- Check for No Results: When a search query returns no results, display the current "no results found" message.
- Add Contribution Suggestion: Enhance the message to include a suggestion for users to contribute the missing word to the dictionary. Provide a link or call-to-action that guides them to the Jargons Editor for easy contribution.
Example Message
When no results are found, display the following message:
"No results found for [search term]. Would you like to contribute this word to our dictionary? [Contribute Here]"
You could look to work with our currently existing "Contribution CTA" component (see #69 for component related info)
Acceptance Criteria
- When a search query yields no results, the search dialog displays a suggestion to contribute the missing word.
- The suggestion includes a link or call-to-action that directs users to the Jargons Editor for contribution.
- The implementation is done in the
components/islands/search.jsxisland. - The functionality is tested and verified for consistent behavior.
Additional Information
- Feel free to ask for more details or clarifications if needed. This enhancement aims to improve user engagement and expand our dictionary through community contributions.
Hi @babblebey, I would like to take this
I'm thinking of making another component very similar to the structure of the ContributionCTA component but in react, then passing in the searchTerm as a prop to the react component.
The image is just to show you how I plan to implement it
Sure thing @DevYoma,
Kindly proceed!
You can just create component within the same search island file (take notice of how the other sub-components are done in there 😉) no need to extract to another.
Can't wait for the PR 😁
This issue will now be close following the introduction of feat: implement search with ✨jAI
This feature introduces a guardrail for cases where results for a word isn't found in the dictionary introducing the ability to search for the word with ✨jAI
We are however looking to implement AI Prompted Word Contribution with ✨jAI - https://github.com/jargonsdev/roadmap/issues/9 which takes the word whose meaning was generated by AI because it wasn't in the dictionary, acts and suggests for such word to be contributed to the dictionary.