readwise-mirror icon indicating copy to clipboard operation
readwise-mirror copied to clipboard

ER - Filter sync based on tag

Open emaynard opened this issue 10 months ago • 1 comments

Allow for filtering sync based on document tag or possibly other metadata in order to allow for syncing to multiple vaults e.g. personal vs work

emaynard avatar Jan 31 '25 00:01 emaynard

+1 similar use case. Would like to filter based on a document tag.

rmateu avatar Jan 31 '25 21:01 rmateu

@johannrichard I used Gemini to modify the main.js file so that tags can now actually be used as a filter criterion. Unfortunately, I'm not very good at programming, and since (as far as I know) a pull request has to be created based on the main.ts file, I can't really do that because I only modified the main.js file. Should I tell you the changes I made to the file?

rouvenjahnke avatar Apr 19 '25 15:04 rouvenjahnke

Thanks for the offer @rpj-07. A priori I think it is a relatively straightforward matter to solve in principle, at the same time with some tricky questions related to User Interface and User Experience. Using document tags is quite straightforward. Using other metadata might be trickier or lead to unexpected results.

@emaynard what did you have in mind regarding the latter ("other metadata")? Particular authors? Keywords in titles? Tags from highlights? @rmateu and @rpj-07 would appreciate your feedback on these questions as well.

johannrichard avatar Apr 22 '25 16:04 johannrichard

@emaynard what did you have in mind regarding the latter ("other metadata")? Particular authors? Keywords in titles? Tags from highlights?

Thanks for the response! So for me I think the option to filter keywords in the metadata author and/or the source (e.g. the original link), as well as keywords in the title would be helpful. But I think tags in highlights might also be nice. Why do you think these other metadata will be more difficult to implement?

rouvenjahnke avatar Apr 26 '25 14:04 rouvenjahnke

Why do you think these other metadata will be more difficult to implement?

One element I have in mind is how you deal with multiple filter criteria (if at all). For tags, you could relatively simply say to a) match, and b) select whether multiple tags are combined with an "OR" / "AND". From there, you can obviously go and create or implement an arbitrarily complex filter machine. I want to make sure we keep it simple and useful.

johannrichard avatar Aug 26 '25 18:08 johannrichard

Practical question: Where would you expect or look for the filter settings (Assuming we use tags from document level only)?

johannrichard avatar Aug 26 '25 18:08 johannrichard

:tada: This issue has been resolved in version 2.2.0-beta.4 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

github-actions[bot] avatar Aug 26 '25 20:08 github-actions[bot]

@rouvenjahnke @rmateu and @emaynard would appreciate you testing this (with a Sandbox Vault I would suggest): It is a very simple implementation which sync notes whose tags match any of the tags defined in the filter. As outlined above, I would advise against much more filter power than this, otherwise we might end up in "filter hell".

johannrichard avatar Aug 26 '25 20:08 johannrichard

I was mainly thinking of a single tag and that appears to work fine. I'm not certain what other metadata I meant, but I was probably thinking if tags were not possible.

emaynard avatar Aug 26 '25 23:08 emaynard

Practical question: Where would you expect or look for the filter settings (Assuming we use tags from document level only)?

I looked right where you put it. The only catch was I intuited I had to restart the plugin (Obsidian) to get it to show

emaynard avatar Aug 26 '25 23:08 emaynard

I've installed 2.2.0-beta.4 in 2 different vaults. Each filtered to a unique set of tags with no overlap. The first is just using single tag and the second is using 4 tags. Seems to be syncing as expected, but will monitor for errors

emaynard avatar Aug 26 '25 23:08 emaynard

Thank you very much for the update! It works also in my two wallets. The filter based on different tags is very nice, at works perfectly for my workflow!

rouvenjahnke avatar Aug 27 '25 08:08 rouvenjahnke

Thanks for testing and your feedbacks. The feature will be released soon with v2.2.0.

@rouvenjahnke, @emaynard, and @rmateu: Please note that due to some optimisations for robustness in the code, and incompatible changes related to that, you must enable the feature and redefine the tags again once you upgrade beyond 2.2.0-beta.6.

johannrichard avatar Aug 31 '25 09:08 johannrichard

:tada: This issue has been resolved in version 2.2.0-beta.7 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

github-actions[bot] avatar Aug 31 '25 11:08 github-actions[bot]

:tada: This issue has been resolved in version 2.2.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

github-actions[bot] avatar Aug 31 '25 18:08 github-actions[bot]

Thanks for testing and your feedbacks. The feature will be released soon with v2.2.0.

@rouvenjahnke, @emaynard, and @rmateu: Please note that due to some optimisations for robustness in the code, and incompatible changes related to that, you must enable the feature and redefine the tags again once you upgrade beyond 2.2.0-beta.6.

Also keep in mind: Obsidian does not recognise when a plugin moves out of beta. You have to use BRAT to update to 2.2.0 (Improving BRAT regarding that is another priority, hope to get there soon).

johannrichard avatar Aug 31 '25 19:08 johannrichard