-
Notifications
You must be signed in to change notification settings - Fork 675
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
Orphaned notes #457
Orphaned notes #457
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks amazing! I left a few questions, in general I prefer it much more to the command approach
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
everything looks good, I just left a question around an event listener disposal.
I think we only need tests and adding the feature to the docs - am I missing anything?
) | ||
); | ||
|
||
foam.notes.onDidUpdateNote(() => provider.refresh()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should add this to the subscription? so the listener is properly disposed
This looks great, @leonhfr I just have concern, does this necessarily need to be a pane, given that this just needs to be checked that whether a note is orphaned or not, can we just do a notification message: Panes, I personally feel, are for introspection and browsing. Given we willl have Backlinks, Tag Explorer, and Outline in any Foam setup do we need one more? |
I think the point is not to check that a given note is orphaned or not, but to be able to reference all current orphans, so they can be discovered / rediscovered / referenced with others. It does make sense then to use a panel instead of message or other solutions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic work!
@allcontributors add @leonhfr for code |
I've put up a pull request to add @leonhfr! 🎉 |
Closes #367
Summary
This PR adds an
Orphans
panel that references all notes that have neither backlinks nor forward links.There are two new settings:
foam.orphans.exclude
: exclude some repositories from the orphans report (for example, excluding the/journal
for daily notes)foam.orphans.groupBy
: either group orphans by folder, or not at all, defaults to folder. The orphans are then sorted alphabetically.I had a first iteration that allowed creating an
orphans.md
note with a command. However, it feels redundant with the panel, which also has the advantage of self updating, so I think we could leave that part of the issue out.Todo
Screenshot
Updating the groupBy setting on the fly (does not overwrite settings.json):
Toggle using the tree list / tree flat icons: