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

Created a menu action to run create a snapshot and exit anki #160

Merged
merged 1 commit into from
Dec 25, 2021

Conversation

evandrocoan
Copy link
Contributor

It is taking some time to create my snapshot and it is not always desirable to create it when exiting/opening Anki.

@aplaice
Copy link
Collaborator

aplaice commented Dec 17, 2021

Thanks for this! It's a brilliant solution (or at least workaround) to the issue of snapshots taking a long time.

However, I'd prefer to be careful when adding extra menu items, since:

  1. They "clutter up" the menu bar for all CrowdAnki users.

    CrowdAnki already takes up half of the space in the File menu.

  2. They provide a suggestion of permanence to the given option. (Users might get used to having the menu action and even once we solve the issue of excruciatingly slow snapshots, they might be unhappy about it being removed.)

  3. They might confuse new users. ("Import git repo", "Import from disk" and "Snapshot" are all pretty self-explanatory, but they might wonder why "Snapshot and exit" is needed.)

OTOH for users with a large collection, who snapshot, this new menu item might be a huge "quality of life" improvement.


From what I understand, you run the add-on from your own private fork, anyway, so not merging this PR immediately won't significantly inconvenience you.(?)

Hence, I'll wait for (hopefully) some feedback from more people and think about how best to get the upsides of this PR without the (slight) downsides, for a while, before merging.


Possible ideas:

  1. A nested menu (might be useful in the long run, anyway).
  2. Having (configurable) keyboard shortcuts (would definitely be useful, anyway).

@aplaice aplaice added the ui label Dec 17, 2021
@evandrocoan
Copy link
Contributor Author

but they might wonder why "Snapshot and exit" is needed

I could change it to something like Snapshot and exit Anki (useful for big collections).

From what I understand, you run the add-on from your own private fork

Yes. I in my fork, I added all files to the top-level (evandroforks@e7e80c9) and directly added the PiPY dependencies into the fork code. This way, I can just clone the repository inside Anki addons directory, and the dependency will load directly from source-code.

I wonder how is the standard development workflow. Do you always build an Anki package and install it after changing the code? i.e., would the workflow be:

  1. bash package_plugin.sh
  2. unzip packagefile.zip -d ~/Anki/addons21/

If this would be the workflow, maybe add it README.md or some development file, as I usually run my Anki addons directly from source-code/git repository cloned directly to my addons directory.

@aplaice
Copy link
Collaborator

aplaice commented Dec 18, 2021

I could change it to something like Snapshot and exit Anki (useful for big collections).

That helps with 3 (explanation), but makes 1 worse (clutter), so I think the original wording is better.


I wonder how is the standard development workflow. Do you always build an Anki package and install it after changing the code? i.e., would the workflow be:

The standard development workflow is described in CONTRIBUTING.md:

  1. If you have the production version of CrowdAnki installed - remove it from Anki.
  2. Run fetch_dependencies.sh - this will download the dependencies required for CrowdAnki to
    operate and put them into the crowd_anki/dist directory.
  3. Add a symlink to the Anki plugins directory (you can find it via Tools>Add-ons>View Files)
    pointing to crowd_anki directory (you should not name the symlink crowd_anki though, see
    #62).

i.e. very close to your current workflow. (The difference is having a symlink vs. having the code directly in the relevant directory, but it's a cosmetic one.)

@aplaice
Copy link
Collaborator

aplaice commented Dec 25, 2021

In the interest of "perfect" not getting in the way of "better", I'm merging this now. Thanks again for contributing it and not just keeping it in your private fork!


I might eventually move this behind an option (i.e. displayed only if a given option is turned on) or into a submenu (e.g. File > CrowdAnki (Advanced) > ...). I'll let you know before I do so.

@aplaice aplaice merged commit c78d837 into Stvad:master Dec 25, 2021
@evandrocoan evandrocoan deleted the snaphot_and_exit branch December 25, 2021 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants