-
Notifications
You must be signed in to change notification settings - Fork 29
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 search feature in outline view #121
base: master
Are you sure you want to change the base?
Conversation
Thanks for the contribution! This is working, but I'm seeing an error while typing:
(This is when running within Zotero, to be clear. I didn't test running the reader in dev mode.) |
Thanks for the reply! |
Oh, so this is only showing top-level rows, with a recursive search of their contents. The way we always do filtering of hierarchical results is to automatically expand ancestors of matching rows and make non-matching context rows gray. You can see the search bar in the collections pane for the desired behavior here. (My Library is also technically gray here — there's just different styling of selected rows.) |
I see! I would like to have some discussion here. Since some documents (e.g., specs, standards) may have hundreds of rows in the outline, and expanding them all may flood the whole outline view. I think a threshold of about 50 is needed to determine whether to expand all the results. In addition, since zotero/zotero#3751 has also not yet been implemented, I prefer to implement the feature and call the expand function after search results are returned, with some additional style class to gray out ascendents that do not match. Does it seem reasonable? |
I have implemented the double-click feature, but I use a different way to achieve ancestors expansion in the search feature to preserve the expanded status of the pre-search state. For the concern of flood in a large number of outline items, it seems that it would not cause lags (at least on my computer), so I decided to expand all at the moment. Please check it out again; thanks! |
@mrtcode @dstillman Hello, I have modified the code to adapt recent changes to the outline view. Please help review the changes; thanks! |
Implement zotero/zotero#3021.
Thanks for the great project! I have implemented a simple recursive search method to bring the search functionality in outline view and reuse the search box component from the annotation panel.
However, since I have minimal experience in React programming, I don't know if the code changes obey the coding style. Please reply to this thread with any opinions or suggestions; thanks in advance!