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

Explorer filterFn does not see index.md files in folder children #1140

Open
bachrc opened this issue May 16, 2024 · 1 comment · May be fixed by #1141
Open

Explorer filterFn does not see index.md files in folder children #1140

bachrc opened this issue May 16, 2024 · 1 comment · May be fixed by #1141
Labels
bug Something isn't working

Comments

@bachrc
Copy link
Contributor

bachrc commented May 16, 2024

strongly related to #941

Describe the bug
When using the filterFn on the Explorer component, the filter mechanism works for notes, but not for folders.

I've tried to add an index.md file in the folder i wanted to hide, with an excluded tag. Though, in the filterFn, on the FileNode of the folder, I would expect the index.md to me listed as the children. Though, it does not : the index file is not listed in the folder's children

To Reproduce

  1. Have the explorer component enabled, and the folder page plugin
  2. Create a folder pouet
  3. Create a index.md file in the folder pouet
  4. In the filterFn function of the Explorer component, the node of the folder is found, but in its children, we cannot see the index.md file

Expected behavior
Even in not displayed, I would expect to find the index file in the node children

Screenshots and Source
If applicable, add screenshots to help explain your problem.

You can help speed up fixing the problem by either

  1. providing a simple reproduction
  2. linking to your Quartz repository where the problem can be observed

Desktop (please complete the following information):

  • Quartz Version: v4.2.3
@bachrc bachrc added the bug Something isn't working label May 16, 2024
@bachrc
Copy link
Contributor Author

bachrc commented May 16, 2024

Okay it's because when we are reaching the index file, we are not adding it to the tree :

// index case (we are the root and we just found index.md), set our data appropriately

Problem is: in the filterFn function, the content of the file is lost.

We could think that we could just put the index file attribute in the folder file, but this would introduce some regression. People following the docs already rely on the data attribute to know if a FileNode is a folder :

> You can check if a `FileNode` is a folder or a file like this:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant