Skip to content

PM-4992 Update talent search view#1795

Merged
himaniraghav3 merged 1 commit into
devfrom
PM-4992
Apr 30, 2026
Merged

PM-4992 Update talent search view#1795
himaniraghav3 merged 1 commit into
devfrom
PM-4992

Conversation

@himaniraghav3

@himaniraghav3 himaniraghav3 commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator

Related JIRA Ticket:

https://topcoder.atlassian.net/browse/PM-4992

What's in this PR?

image
Open in Devin Review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View 3 additional findings in Devin Review.

Open in Devin Review

Comment on lines 245 to +253
const clearAllFilters = useCallback((): void => {
searchGenerationRef.current += 1
setSelectedCountries([])
setOnlyProfileComplete(true)
setOnlyProfileComplete(false)
setOnlyOpenToWork(true)
setOnlyActive(true)
setSortBy('alphabetical')
setSelectedSkills([])
setHasSearched(true)
setErrorMessage('')
skipNextAutoSearchRef.current = true
setLastSearchedDescription('')
runMemberSearch([], {
countries: [],
generation: searchGenerationRef.current,
openToWork: true,
page: 1,
profileComplete: true,
recentlyActive: true,
})
}, [runMemberSearch])
}, [])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔴 clearAllFilters does not reset results state, leaving stale results displayed with no way to dismiss them

After a successful search, clicking "Clear Filters" calls clearAllFilters which resets filter inputs (skills, countries, toggles) but does not reset hasSearched, results, totalResults, or lastAppliedSearchSignature. Because shouldShowIntroState is !hasSearched (TalentSearchPage.tsx:75), the results view remains visible showing stale results from the previous search. The user cannot dismiss these results because the Search button is disabled when selectedSkills.length === 0 (TalentSearchPage.tsx:492), and there's no other mechanism to clear or refresh the view.

Suggested change
const clearAllFilters = useCallback((): void => {
searchGenerationRef.current += 1
setSelectedCountries([])
setOnlyProfileComplete(true)
setOnlyProfileComplete(false)
setOnlyOpenToWork(true)
setOnlyActive(true)
setSortBy('alphabetical')
setSelectedSkills([])
setHasSearched(true)
setErrorMessage('')
skipNextAutoSearchRef.current = true
setLastSearchedDescription('')
runMemberSearch([], {
countries: [],
generation: searchGenerationRef.current,
openToWork: true,
page: 1,
profileComplete: true,
recentlyActive: true,
})
}, [runMemberSearch])
}, [])
const clearAllFilters = useCallback((): void => {
setSelectedCountries([])
setOnlyProfileComplete(false)
setOnlyOpenToWork(true)
setOnlyActive(true)
setSelectedSkills([])
setErrorMessage('')
setLastSearchedDescription('')
setHasSearched(false)
setResults([])
setTotalResults(0)
setLastAppliedSearchSignature('')
}, [])
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is intended

@himaniraghav3 himaniraghav3 merged commit b36e955 into dev Apr 30, 2026
9 checks passed
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