-
Notifications
You must be signed in to change notification settings - Fork 100
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
Add an option to allow both viewing and adding duplicates #693
Add an option to allow both viewing and adding duplicates #693
Conversation
View Playwright Report (note: open the "playwright-report" artifact) |
Prior to getting into the details of the implementation, a question: in your experience, how frequent is it that you need to do this? Or anyone else as well, how frequently is it a problem that there is already a note but you want to add another "duplicate" note? |
Can't speak for anyone else, but this is the one feature I've always wished Yomichan/Yomitan offered (and looking at #74, I'm not the only one).
|
Okay, the reason behind my asking is because IMO this should probably not be an option, but just be a right-click menu on the buttons or something like that. |
The made gain of having this as an option as that it can be left on forever1. Also, options are easy to document in the UI. Maybe it could be put all the way at the bottom of the "Check for card duplicates" section to further hide it, and call it "[Advanced]" or "Dangerously enable add buttons". Or maybe even add an "You have duplicates for this card. Are you sure you want to add a new card?" alert when clicking the add buttons. Footnotes
|
Another use case for this is when you want to recreate a card for suspended notes, I do this all the time. You could ofc just delete or move the suspended cards to another deck, but not having to remember to do that would be nice. Having duplicates would also make it so you're able to see that the already existing note has the leech tag which would be helpful when making the card. |
@eloyrobillard
What do you think? |
The stacked "+" icon sounds fun, I'd be happy to implement it. It would only show up when "Check for cards duplicates" is on, right? |
I think it would be best if the icon shows up always. But when "Check for cards duplicates" is on it shouldnt let you add a duplicate and should be grayed out similar to how it is now. Although this does make the option's name a bit of a misnomer I think that would best integrate into how things currently are done. |
When we don't check for duplicates how would we choose between the normal or stacked "+" icon, since we wouldn't know if there are duplicates? |
It would have to always check for duplicates like that. The main issue I see here with keeping the button active always when is "Check for cards duplicates" is on is visual clarity. At a very quick glance a user may not see the difference between a stacked + and a single +. If we're going to go that route and keep the option actually checking for dupes or not, maybe it should be something that stands out more like a red + when dupes are found instead. |
Though, red vs green raises its own issues (colorblindness). So maybe red and stacked makes the most sense. |
True. Could also be a smaller circle in top-right of the "+" icon showing the number of duplicates. Either way, always checking for duplicates is probably not an option since it would make Anki/AnkiConnect freeze for some users with ultra-massive Anki collections (as per FooSoft#993). |
Heres my suggestion for the icons, made them stacked based on what darius suggested as well: If you want to use these heres the files icons.zip (they go into |
CodSpeed Performance ReportMerging #693 will degrade performances by 19.65%Comparing Summary
Benchmarks breakdown
|
Here's what I have for now (using @Kuuuube's buttons): The new add buttons only show up when the entry has duplicates in Anki (so only when "Check for card duplicates" is on). |
Gave it a test, it works well. Just needs a commit to actually add the svgs. |
added the SVGs |
@toasted-nutbread If you have any comments on the code please go ahead and review, otherwise will merge in a day or two |
New icons should probably be added to resources/icons.svg as new layers, as this has generally served as the source for editing icons. Idk if anyone has modified this since Yomichan, but I used Inkscaped for it. |
done |
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.
Thanks for sticking through the long peer review process!
Belated, but the description in settings May also be good to update/expand the docs at https://github.com/themoeway/yomitan/blob/7681131782d958997663b1fb443a3e32e8eef550/docs/anki-integration.md?plain=1#L108 to explain the new feature. |
Overview
This PR keeps add buttons on when the term has a duplicate:
This way the user can both add duplicate notes and check current duplicates if they wish to. As mentioned below this is mainly useful when mining for:
Also, as @Maltesaa mentioned: this helps to recreate a card for suspended notes without having to manually delete those suspended notes
Based on #74