-
Notifications
You must be signed in to change notification settings - Fork 68
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
Add comment search #887
Add comment search #887
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really awesome! Thanks for taking this on, it'll definitely be useful to have a search function for comments.
I did ensure that, if cycling through results causes additional paging/fetching, we will stay in search mode.
Just for a bit of clarification here, if additional fetching happens, will the search results be updated (e.g., if the additional comment fetch retrieves a comment with the given search term firefox
, will that new comment will be added into the results of the existing search)?
Yes exactly. You can't tell in the video because the fetching happens off-screen, but at one point the "next result" button puts us within the threshold of fetching more comments. Some of those new comments contain the search term, so pressing "next result" again goes to the new one rather than back to the top. |
Awesome! Let me know if this is all good to be merged 😄 |
Should be good! |
Pull Request Description
This PR introduces a basic comment text search within a post. There is a new FAB button from which you can initiate a search and enter a search term. After that, if there are any matches, the first matching comment will be highlighted. At that point, the main FAB button will become a "next result" button, allowing you to cycle through all the results. Then you can expand the FAB to cancel the search using the same button that initiated it.
Limitations
Notes
newlyCreatedCommentId
property of thePostState
to highlight the search results. Since this property is really only used for highlighting, it could be renamed to a more generalhighlightedCommendId
or similar. But that would be more of a refactoring task for the future.Issue Being Fixed
Issue Number: N/A
Screenshots / Recordings
qemu-system-x86_64_iz4ujnFOLO.mp4
Checklist
semanticLabel
s where applicable for accessibility?