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

Content search #515

Merged
merged 5 commits into from
Jun 10, 2024
Merged

Content search #515

merged 5 commits into from
Jun 10, 2024

Conversation

Dananji
Copy link
Collaborator

@Dananji Dananji commented Jun 6, 2024

Related issue: #502 #508

Please feel free to make changes as needed and then, squash and merge once again it's ready.

Copy link
Member

@cjcolvar cjcolvar left a comment

Choose a reason for hiding this comment

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

This looks really great! 🎉

I only had one small question which I don't think should impact behavior significantly so I'm going ahead and approving this. Feel free to merge if my question doesn't lead to anything new.

@@ -102,6 +102,8 @@ export const TranscriptSearch = ({
onClick={() => {
setSearchQuery(null);
if (searchInputRef.current) searchInputRef.current.value = '';
// Set focus to the search input field
searchInputRef.current.focus();
Copy link
Member

Choose a reason for hiding this comment

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

👍

Comment on lines +192 to +198
setSearchResults(searchResults);
if (hitCounts?.length > 0) {
setSearchResults({
...searchResults,
counts: hitCounts,
});
}
Copy link
Member

Choose a reason for hiding this comment

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

Why does setSearchResults get called twice when there are hitCounts? Wouldn't it be simpler to conditionally add hitCounts to searchResults and then call setSearchResults once?

@cjcolvar
Copy link
Member

Merging this now so we can test and continue work on it this week.

@cjcolvar cjcolvar merged commit fd2868a into main Jun 10, 2024
2 checks passed
@cjcolvar cjcolvar deleted the content-search branch June 10, 2024 18:55
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.

2 participants