Add is_on_anki=True query argument to flashcard selector url in settings.py
ref: Move js/pycmd message handling code from reviewer.py to js_message_handling.py
The reason is that the OPEN_BROWSER_PYCMD is now used for the flashcard selector as well, and not just in the reviewer. So it's better to move it to a separate module. Other pycmd code which could also be useful in multiple contexts was also moved to js_message_handling.py.
How to reproduce
Make sure that you have the show_flashcards_selector_button feature flag active
Set up an AnkiHub deck with embeddings (generated using the generate_vector_embeddings_for_decks.py script) and a tag tree (generated using the save_deck_tags_tree.py script).
Install the deck via the add-on
Change ANKING_DECK_ID in settings.py to the deck id of the deck
Open Anki, there should be a Select flashcards button next to the deck
Open the flashcard selector, open the text search tab, search for something, open the card preview
There should be a Open in Browser button on the card preview
When you click the button the card should be opened in the Anki browser
In the card preview add a Copy Note ID button when shown on the AnkiHub Webapp and a Open in browser button when shown on Anki Desktop.
This is the addon-side of the task. This is the web app PR: https://github.com/AnkiHubSoftware/ankihub/pull/2260
Related issues
https://ankihub.atlassian.net/jira/software/c/projects/BUILD/boards/1?selectedIssue=BUILD-575
Proposed changes
is_on_anki=True
query argument to flashcard selector url insettings.py
reviewer.py
tojs_message_handling.py
OPEN_BROWSER_PYCMD
is now used for the flashcard selector as well, and not just in the reviewer. So it's better to move it to a separate module. Other pycmd code which could also be useful in multiple contexts was also moved tojs_message_handling.py
.How to reproduce
show_flashcards_selector_button
feature flag activegenerate_vector_embeddings_for_decks.py
script) and a tag tree (generated using thesave_deck_tags_tree.py
script).ANKING_DECK_ID
insettings.py
to the deck id of the deckScreenshots and videos