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

Enhancement: refresh search button #286

Closed
grahampcharles opened this issue Mar 10, 2022 · 16 comments
Closed

Enhancement: refresh search button #286

grahampcharles opened this issue Mar 10, 2022 · 16 comments
Labels
enhancement New feature or request

Comments

@grahampcharles
Copy link

If I search posts from the FM Dashboard with a filter (by tag, for example), and then edit some of those posts to remove the tag, the search results don't change -- there's no "Refresh" or re-search button. Even clearing and re-setting the search criteria doesn't refresh the search ; the stale results are still returned. Only closing and re-opening the dashboard triggers the search function to update.

A Refresh button on the search results (next to (X) Clear, maybe?) could trigger a re-catalog.

@estruyf estruyf added the enhancement New feature or request label Mar 10, 2022
@estruyf
Copy link
Owner

estruyf commented Mar 10, 2022

Will check what we can do to optimize the behavior. The page list gets updated when a page gets updated, but it could indeed be the index needs to be regenerated as well. Having a clear or refresh button is an intermediate solution, but can force the update.

@estruyf
Copy link
Owner

estruyf commented Mar 11, 2022

Have been trying to reproduce the issue in order to see how we can improve things, but for now, all seems to work fine on my end.

2022-03-11_17-36-29.mp4

What and where does it behave differently on your end? If you are able, feel free to share a video on where and how it goes wrong in your environment.

@grahampcharles
Copy link
Author

That's interesting. I did the same thing, essentially, and it did not refresh the filtered search. Only closing and opening the dashboard entirely did the trick:

frontmatter.mp4

I have v.6.1.1 of FM, which VSCode reports is the latest available.

Hope that helps sort it out!

@estruyf
Copy link
Owner

estruyf commented Mar 15, 2022

Thanks @grahampcharles, it should also work in version 6.1.1. Would you be able to open the output tab, select vscode-front-matter from the dropdown, and do the same steps?

This way I'll be able to validate if the file watchers are getting triggered. In the output the extension logs what it is actually doing, more information on: https://frontmatter.codes/docs/troubleshooting#looking-what-is-happening-behind-the-scenes

@grahampcharles
Copy link
Author

Sure, I can do that. For now, though, I noticed that opening the dashboard gives me this error 129 times (which I think is every content page):

["ERROR" - 12:03:35] Front Matter: File error: ...\index.md - Cannot read property 'find' of undefined

So I imagine that's what's at the root of it. Hang on, I'm going to clone your repo and see if I can find exactly where the error occurs.

@estruyf
Copy link
Owner

estruyf commented Mar 16, 2022

@grahampcharles just did a couple of test runs on a Windows machine, but haven't been able to reproduce the error you are seeing.

If you would be able to share a sample project or your project, feel free to do so. You can also send me an email to elio@struyfconsulting.be if there are things you do not want to share in this thread.

estruyf added a commit that referenced this issue Mar 16, 2022
@estruyf
Copy link
Owner

estruyf commented Mar 16, 2022

A refresh button got added next to the searchbox. It is not the final solution, as I want to make sure the file error gets fixed as well.

@grahampcharles
Copy link
Author

Sure, I'm happy to share it semi-privately. I'll add you to my repo for it. It's not particularly sensitive stuff -- just schoolwork.

I am now getting the file error on every open and the FM tools aren't working at all since I uninstalled and reinstalled. Maybe I should open a new issue for that?

@grahampcharles
Copy link
Author

I figured out the file error thing. I had added this setting:

  "frontMatter.taxonomy.contentTypes": [
    {
      "name": "default",
      "pageBundle": true
    }
  ]

...but didn't add any fields to it. Whoops. (Probably worth catching, so it doesn't disable the whole plugin, but still, clearly user error.)

@estruyf
Copy link
Owner

estruyf commented Mar 16, 2022

Oh, that is great news! Will see what we can do to still make use of the default fields if this happens.

@grahampcharles
Copy link
Author

Okay, now that I've cleared up the file error thing that was my fault, here's a recording of the same process from above (test tag 1, etc.) showing that the search list is not getting refreshed for me

2022-03-16.10-56-20.mp4

.

@estruyf
Copy link
Owner

estruyf commented Mar 16, 2022

It seems the saved file listener from VS Code isn't triggered. Another request, would you be able to test the beta version (https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-front-matter-beta)? First uninstall the main version from VS Code, next install the beta version. Nothing will get lost in the process.

In the beta, there are already a couple of issues fixed, like the metadata flow.

@estruyf
Copy link
Owner

estruyf commented Mar 18, 2022

Wrapping up the tasks for the 7.0.0 release, and this one is still open. @grahampcharles have you had the chance to check it out?

@grahampcharles
Copy link
Author

Sorry to take so long. That's done it! You want me to record a screencap?

@grahampcharles
Copy link
Author

Oh, incidentally, the plaintext search seems to have some problems. I think I'll start that as a new issue, though -- I'm not sure it's related to this.

@estruyf
Copy link
Owner

estruyf commented Mar 20, 2022

Thanks, @grahampcharles for confirming!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants