Stvad / CrowdAnki

Plugin for Anki SRS designed to facilitate cooperation on creation of notes and decks.
MIT License
520 stars 44 forks source link

enhancement: Preventing overwriting of existing cards from import (in-built merge calling) #117

Open newageoflight opened 3 years ago

newageoflight commented 3 years ago

An enhancement I'd like to see in CrowdAnki is the ability to prevent the importer from overwriting existing cards on import.

When collaborating with others I find that I will often edit cards for people as new changes are being pushed, and importing the newest commits (which don't have my changes in them) will destroy all the edits I've made. In the absence of merging, a simple fix for this would just be to have the ability to suppress overwriting of existing cards. This may not necessarily be the standard behaviour of other imports but I think it's very useful to have in a collaborative context.

I'm aware this can be (sort of) already be solved using git diff. And if my impression is correct I think you guys are already working on merging stuff; I think that having a merge dialogue pop up in Anki (similar to how Unison will call your preferred merge program) would be much more convenient (and would likely present a far lower entry barrier for the non-tech people using this add-on!).

ohare93 commented 3 years ago

Agreed, this would be a useful toggle in the Import menu. Though you should be able to do this, in part, with Personal Fields 👍 if you only made changes on some specific fields then you can toggle that as "Personal" and keep your own values while importing the rest. I get it would be good to do on a card by card basis (perhaps by tag?), but that's the best CA can currently do.

Good idea 🚀

newageoflight commented 3 years ago

By tag or by deck preferably - I'd rather not have to specify it by type as CA is currently offering. The way my team's workflow works at the moment is basically that I can accept changes in some (sub)decks but not in others.

Though this might just come down to me being insufficiently informed about the addon's usage as well, so just for the record: if I mark all the fields for a specific card type as "Personal Fields", will it essentially skip over all the cards in the JSON that already exist in my collection, thereby only adding the new ones?

ohare93 commented 3 years ago

Though this might just come down to me being insufficiently informed about the addon's usage as well, so just for the record: if I mark all the fields for a specific card type as "Personal Fields", will it essentially skip over all the cards in the JSON that already exist in my collection, thereby only adding the new ones?

Yes! 👍 There are 3 states for personal fields:

New cards: Always added Existing card with filled in existing field: never added Existing card with blank field: Added

By tag or by deck preferably - I'd rather not have to specify it by type as CA is currently offering. The way my team's workflow works at the moment is basically that I can accept changes in some (sub)decks but not in others.

Personal tag/deck would be quite easy to implement, I believe 👍 Will add it to the backlog 😁

newageoflight commented 3 years ago

Thanks heaps for that! And just to be sure, outside of using git diff or other similar external merging tools, am I right to guess that CrowdAnki doesn't curently have any existing merge capabilities (like the stuff I am proposing) in-built somewhere that I'm missing? i.e. for the existing card with filled in existing field case, I might want to merge changes from another contributor while I am still working on the deck without having to export to a new commit.

ohare93 commented 3 years ago

You are correct, no such functionality currently exists. Though it would be sweet!