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

Foam Treating Links to Images as Nonexistent Notes #1200

Closed
micharris42 opened this issue Apr 20, 2023 · 6 comments
Closed

Foam Treating Links to Images as Nonexistent Notes #1200

micharris42 opened this issue Apr 20, 2023 · 6 comments

Comments

@micharris42
Copy link

Describe the bug

I updated a note with a link to an image today, and after saving the file, the link to the image turned yellow (to signify a nonexistent note) and hovering over it brought up the popup to create a new note. Likewise, clicking on the link now creates a new note, rather then taking me to the image file. The file name will show up in the Placeholders section of the sidebar.

The image is still showing up in the preview, so the image link is recognized by VSCodium, just not Foam.

This is new behavior, so it seems most likely to be a bug introduced with the latest version of Foam.

Thank you.

Small Reproducible Example

No response

Steps to Reproduce the Bug or Issue

  1. Create a link to an image file.
  2. Save the document.
  3. Foam will treat the link as a nonexistent note.

Expected behavior

That upon creating a link to an image file, Foam does not treat it as a nonexistent note.

Screenshots or Videos

The link to the image file, colored yellow:

Capture1

The image file listed in the Placeholders section of the sidebar:

Capture2

The image displayed in the preview:

Capture3

Operating System Version

Windows 10

Visual Studio Code Version

VSCodium 1.77.3

Additional context

No response

@riccardoferretti
Copy link
Collaborator

Hi @micharris42 - I tried to reproduce it, but without success. I notice the file is in a .foam dir?
I literally today pushed a commit to explicitly ignore anything under .foam.

  1. could this be the cause of your issue?
  2. is it on purpose that you are using that folder?
  3. if so, why?

@micharris42
Copy link
Author

micharris42 commented Apr 21, 2023

@riccardoferretti, yes, have just tried moving the image file to another folder, and that has solved the issue! Thank you.

Yes, I was intentionally keeping my image files saved in .foam. No in-depth reason. Just wanted all of my files in one place, and putting them in the .foam dir just got them out of the way. Can—and have—solved this by creating an assets folder for image files.

I do believe this issue may be considered Closed.

One thing I would like to add. Also gave putting my image files into a .assets folder a go as well, and that ended up with the same result as when the files were saved to .foam. Not sure if this is intentional, but at the moment Foam seems to ignore all "dot" folders, not just .foam.

Best.

@micharris42
Copy link
Author

@riccardoferretti, sorry for the re-open, close, re-open, but I think I have found an additional issue.

I do not like to include my image files in my graph, so for both .foam and assets, I added the folders to the "foam.files.ignore" setting.

After doing so, my image file links are back to being treated as nonexistent notes:

Capture

Is this a bug, or is this the intended behavior?

Thank you.

@riccardoferretti
Copy link
Collaborator

That setting will completely hide a file from Foam, so from its point of view the file doesn't exist.
What you want should be achievable with Note Filters, but it has not been integrated in the graph command yet

@riccardoferretti
Copy link
Collaborator

Also, by default attachments, including images are not shown in the graph, isn't that right?

@micharris42
Copy link
Author

@riccardoferretti, thank you for the clarification, as well as your patience with me in getting this sorted out.

Removing the folder(s) from the Foam ignore list has resolved the issue. I do apologize; I had misread the directions and thought the setting only ignored files for the purpose of the Graph view. A second reading proved that this was not the case.

This has been a good push to do a clean up of the non-Markdown assets in my Foam workspace.

Putting this issue down as Closed. Thank you again.

Best.

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

No branches or pull requests

2 participants