yomidevs / yomitan

Pop-up dictionary browser extension. Successor to Yomichan.
https://yomitan.wiki
GNU General Public License v3.0
1.23k stars 97 forks source link

Add a button that overwrites fields in existing cards #578

Open arbyste opened 9 months ago

arbyste commented 9 months ago

I'm considering trying to create a new feature in Yomitan. No idea whether I'll be able to manage it (never worked on a browser extension before) but I thought I'd discuss the idea here before I started.

Currently, when you hover over a word that you already have in Anki, it just shows you a button that allows you to bring up that card in the Anki browser.

I would like to add an additional button which, when pressed, overwrites the fields of the existing card with the data from your current Yomitan setup.

I can see a few use cases for this feature. If someone started off by mining bilingual cards, but has transitioned to monolingual cards, then a button like this would make it easy to convert existing bilingual cards to monolingual cards as you come across them, without losing your review history, or other non-yomtanned fields such as images or audio (assuming they're handled outside Yomitan)

Another use case would be when newer versions of a dictionary are released. For example, a button like this would make it easy to upgrade existing JMDict cards to the newer Jitendex dictionary.

What are people's thoughts?

StefanVukovic99 commented 9 months ago

I've also wished for this feature. I'd like to have it like this image with the "Mode" determining whether the field should be:

  1. skipped (for fields that may be manually changed, e.g. picture)
  2. appended to (e.g. allows gathering example sentences)
  3. overwritten with the newest version.

Don't know how the Anki API works and if this is feasible though.

ganqqwerty commented 9 months ago

I often have multiple cards for the same target word. What will the button do in this case?

arbyste commented 8 months ago

@StefanVukovic99 that's a great idea, I'll see if I can get it to work in that way.

@ganqqwerty , fair point. At the moment, if you have duplicate cards, they appear like this in Yomitan when you right click on the existing card button. To maintain consistency, I think I'll create the same kind of interface. image image

Also, I definitely can't commit to any kind of development timeline. I'll just work on this when I have time, and if I can get it working I'll submit a pull request.

bgslavcho commented 7 months ago

I need that so much.

I created my first 16k cards by hand and the jmdict definitions are really outdated. + I'm using jitendex now and I want to update my old jmdict cards.

Also the local audio server wasn't a thing so I have a lot of cards with bad quality word audio or no audio at all

Right now I'm creating new cards and then I copy over the audio and the jitendex from the new card to the old one and then delete the new card.

I have to do this for thousands of cards and being able to do it with a single click would save me countless of hours.

I've also wished for this feature. I'd like to have it like this image with the "Mode" determining whether the field should be:

1. skipped  (for fields that may be manually changed, e.g. picture)

2. appended to (e.g. allows gathering example sentences)

3. overwritten with the newest version.

Don't know how the Anki API works and if this is feasible though.

This is exactly what I need.

StefanVukovic99 commented 7 months ago

How should this look in the popup UI? When a card is already added, the new red duplicate buttons are shown: image

Options:

  1. Just add a pair of yellow buttons
  2. To not have so many buttons in the popup, make the duplicate setting image a dropdown, with options
    • Prevent (grey out buttons)
    • Overwrite (show yellow buttons)
    • Duplicate (show red buttons)
  3. something else?
Kuuuube commented 7 months ago

A refresh button? Similar in styling to how browsers show a refresh page button maybe.

StefanVukovic99 commented 7 months ago

Now that you mention it, I'm not sure if this needs two buttons or just one. If it's just the one refresh button, it could probably go between the "view notes" book and the "add duplicate" plus?