Add source filter support in bot search feature#1858
Open
ShivCharanSharma wants to merge 2 commits intoKhalisFoundation:devfrom
Open
Add source filter support in bot search feature#1858ShivCharanSharma wants to merge 2 commits intoKhalisFoundation:devfrom
ShivCharanSharma wants to merge 2 commits intoKhalisFoundation:devfrom
Conversation
- Isolate SearchForm state from local storage by introducing an `isolateFromLocalStorage` prop and using it for the Gurbani Bot search.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Feat: Add source filter support in AskGurbaniBot search | Fixes #1828
Summary
This PR fixes issue #1828 by adding source selection support to the Ask GurbaniBot modal and ensuring its search state is fully isolated from the main site search (header/SearchForm) state.
Changes
✨ feat: Add source selection to AskGurbaniBot search
<select>) insideAskGurbaniBotQuestionModalso users can filter which Gurbani source the bot searches from.AskGurbaniBotSearchto accept and pass the selectedsourcevalue through to the bot API query.sourcefrom the modal to theSearchResultscomponent for the bot search.🔒 feat: Isolate bot search state from main/normal search state
isolateFromLocalStorageboolean prop onSearchFormto prevent the bot's form state (type, source, writer) from being read from or written tolocalStorage.AskGurbaniBotQuestionModalnow passesisolateFromLocalStorageto itsSearchForm, keeping the bot's selections completely independent of the main header search.saveToLocalStorageandremoveFromLocalStoragehelper methods insideSearchFormthat respect theisolateFromLocalStorageflag — all existinglocalStoragecalls now route through these helpers.Files Changed
src/js/components/Modals/AskGurbaniBotQuestionModal.tsxisolateFromLocalStoragepropsrc/js/components/SearchResults/AskGurbaniBotSearch.tsxsourceprop through to the bot APIsrc/js/components/SearchForm.jsisolateFromLocalStorageprop & localStorage helper methodssrc/js/components/Header.jsnpm test& fixed newly introduced lint errors.Failed prop type: Invalid propdefaultAutoDetectGurmukhiof typebooleansupplied toSearchForm, expectedstring.Warning: validateDOMNesting(...): <button> cannot appear as a descendant of <button>. Error Component Stackfor FloatingActionsinstallHook.js:1 Warning: Each child in a list should have a unique "key" prop.in HomePageIconsTesting
Demo Video
https://drive.google.com/file/d/1C_t8AA7QLJFOmsoQiZ5cgFZUWsaOCWsP/view?usp=sharing
npm test output
Updated UI screenshots