Skip to content

Conversation

@wboult
Copy link

@wboult wboult commented Sep 19, 2021

Updates the filter logic to filter by the whole file path instead of just the file name.

Example:
Animation

Closes #175

return null
}

const filtered = createFileTree(filter).tree
Copy link
Author

Choose a reason for hiding this comment

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

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 }) {
Copy link
Author

Choose a reason for hiding this comment

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

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)) {
Copy link
Author

Choose a reason for hiding this comment

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

this is the main change, I haven't made it optional but I'm happy to if you'd like

@berzniz
Copy link
Owner

berzniz commented Sep 19, 2021

Thanks I will review soon

@kopach
Copy link

kopach commented Dec 21, 2021

Hi @berzniz, any chance to have this merged any soon (along with other PR's)? This looks really useful.

@berzniz
Copy link
Owner

berzniz commented Jan 7, 2022

Hi @kopach - I won't be able to merge this to the upcoming 1.0.36 version. There are two main things:

  1. I need to understand the logic better and see how to move createFileTree out of the main render flow.
  2. Adding this with an optional flag. There might be people who will prefer to turn this off

@berzniz berzniz added this to the 2.0.0 milestone Jan 7, 2022
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.

Extra features for large PR workflow

3 participants