Skip to content
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

Bulk Add from browser (only selected cards) #35

Open
Nayelianne opened this issue Dec 2, 2022 · 3 comments
Open

Bulk Add from browser (only selected cards) #35

Nayelianne opened this issue Dec 2, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@Nayelianne
Copy link

I don't know how tricky it would be to implement, but I would love a way to add pitch to specific cards while I'm creating them, be it by bulk from the edit menu on the browser, or by pressing a button on the card itself or through a right click menu when inside a card.

I know we have a button for manually adding pitches, but that means I have to go out and research the pitch accent for the card (which breaks the flow and can be time consuming), instead of having the addon automatically generate it.
Having such a feature would enable me to add pitches on a "as needed" basis, instead of having to mess with config files if I need it on only certain cards.

@IllDepence
Copy link
Owner

Hi, thanks for the suggestion.
I liked the idea and gave it a shot.

A few notes

  • Compared to the bulk add, where you select all the relevant fields once and are done, I though it would be too cumbersome to do it again and again for single cards, so ideally it would be possible to either
    • (a) select the fields once and have the add-on remember the choice (would have to be deck and card type specific), or
    • (b) have the add-on figure out by itself what the expression and reading fields are
  • In the end I went with the latter option, risking some lookup failures (although then there’s still manual mode), but giving users a bit more freedom (e.g. the possibility to add the pitch accent to different fields on a card by card basis—not sure if any one would want to do that though)
  • Assumptions made in the current implementation:
    • The Japanese expression field comes before any other fields containing Japanese (e.g. example sentences)
    • Reading is always denoted in hiragana only (although it’s not required for a reading to be identified for the function to work)

I’m currently in the process of a bit of an overhaul of the add-on code and can’t say when I’ll update it on AnkiWeb, but you could install a version with the added functionality via Tools→Addons→Install from file and tell me

  • if it works on your end
  • if you noticed any problems/have additional suggestions

Here’s a download link for the version with the added functionality (tested on Anki 2.1.49).

@IllDepence IllDepence added the enhancement New feature or request label Dec 4, 2022
@Nayelianne
Copy link
Author

Nayelianne commented Dec 4, 2022

Wow, that was so quick, I really appreciate all the work!
I played around with it for a bit and it's perfect for my needs, my Expression field is normally the first one on a card so that's totally fine by me. Not that I would mind if I had to mess with the config files to determine the field/note type, since many addons I use already have me doing that haha.

Love that you even made a little visual button for it (specially since the add menu is on a popup, so I can add them while reviewing and not even have to go to the browser window like this)! Very happy that I can more easily add pitches to different fields and new cards without having to open google as well.

I'm also on Anki 2.1.49 so sadly can't comment for other versions, but no bugs encountered here so far.
Thanks again <3

@Nayelianne
Copy link
Author

Nayelianne commented Jan 1, 2023

TL:DR; Found an addon incompatibility: Collapsible Fields.

Hi again! I come with not so great news haha. Things were working as a wonder for a while.
Buuut eventually for some reason both the new automatic generation button and the manual buttons stopped working. When I clicked the button there was a one second pause like it was trying to do something, but then nothing happened at all, no error message, no nothing. Bulk add still worked as intended despite that though.

Sooo I did some digging around to what the cause may have been, and finally narrowed it down to an incompatible addon called "Collapsible Fields" - that I started to use due to having an unholy amount of fields. No fields were actually collapsed when the bug happened, so I guess it just interferes with yours by existing.

"Collapsible Fields" doesn't seem to interfere with any of my dictionary scraper addons that fill predermined fields by right click activation, nor the furigana add-on that also uses little buttons if that information is of any help at all.

I don't know if it's something worth looking into since it involves a different addon. But either way I figured you might like to know even if just to add to the compatibility documentation or in case someone comes pestering you about things not working, haha.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants