Filter by whole file path instead of file name#176
Filter by whole file path instead of file name#176wboult wants to merge 2 commits intoberzniz:masterfrom
Conversation
| return null | ||
| } | ||
|
|
||
| const filtered = createFileTree(filter).tree |
There was a problem hiding this comment.
Originally I didn't have this here, but when the tree was reloaded for a reason other than the filter changing (e.g. sync button pressed, or "viewed" checkbox clicked) it would add back folders that should not be visible.
Not sure if this is the best way to address that, but it seems to work fine.
| this.state = {} | ||
| } | ||
|
|
||
| getHighlight ({ nodeLabel, filter, index }) { |
There was a problem hiding this comment.
I did try and move this to the shared lib.js but it didn't work because of the React stuff, so settled for just having a copy in Folder
| files.forEach(({ title, parts, href }) => { | ||
| let location = tree | ||
| if (filterItem(parts[parts.length - 1], filter)) { | ||
| if (filterItem(title, filter)) { |
There was a problem hiding this comment.
this is the main change, I haven't made it optional but I'm happy to if you'd like
|
Thanks I will review soon |
|
Hi @berzniz, any chance to have this merged any soon (along with other PR's)? This looks really useful. |
|
Hi @kopach - I won't be able to merge this to the upcoming 1.0.36 version. There are two main things:
|
Updates the filter logic to filter by the whole file path instead of just the file name.
Example:

Closes #175