Clicking the chatbot button opens the chatbot iframe
The JS code for the chatbot iframe was copied into ankihub_ai_old.js. This is used when the mh_integration feature flag is not active. When it is active, ankihub_ai.js will be used. This version of the file doesn't have the JS code related to the old chatbot button. (We will remove ankihub_ai_old.js soon.)
Buttons have a light or a dark theme depending on Anki's theme settings
When there is an auth failure, this is handled by unselecting all buttons and opening the login dialog
Auth failures are signaled from JS to Python using the INVALID_AUTH_TOKEN_PYCMD
Currently only from the chatbot
How to reproduce
Create mh_integration feature flag and enable it
Restart Anki
Install deck that has note embeddings
Open reviewer for note in the deck
The new buttons should be there
Clicking them should have the behavior described above
When the mh_integration feature flag is disabled, there should be no changes in the behavior and look to the current main branch.
Adds buttons for B&B, FA4 and chatbot to the reviewer (protected by a feature flag).
Related issues
https://ankihub.atlassian.net/jira/software/c/projects/BUILD/boards/1?selectedIssue=BUILD-855
Proposed changes
ankihub_ai_old.js
. This is used when themh_integration
feature flag is not active. When it is active,ankihub_ai.js
will be used. This version of the file doesn't have the JS code related to the old chatbot button. (We will removeankihub_ai_old.js
soon.)INVALID_AUTH_TOKEN_PYCMD
How to reproduce
mh_integration
feature flag and enable itWhen the
mh_integration
feature flag is disabled, there should be no changes in the behavior and look to the current main branch.Comments
We will need to add tests in a different PR.
Screenshots and videos
Light mode
Dark mode
Sidebar
Chatbot