Closed RisingOrange closed 4 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 87.64%. Comparing base (
ce0a928
) to head (681e0fd
). Report is 2 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@pedroven
Can you add the header of the chatbot widget? Since the header has a close button. this probably needs to be added here
Where is this header? Is it already implemented?
Is there a way to adapt the visualization (responsivity) of the widget on different window sizes?
Anki sets the .mobile
class on mobile devices: https://docs.ankiweb.net/templates/styling.html#platform-specific-css.
We can also use media queries: https://www.w3schools.com/css/css_rwd_mediaqueries.asp
Where is this header? Is it already implemented?
no, this is on the Figma files
Anki sets the .mobile class on mobile devices: https://docs.ankiweb.net/templates/styling.html#platform-specific-css. We can also use media queries: https://www.w3schools.com/css/css_rwd_mediaqueries.asp
I was talking specifically about the desktop environment @RisingOrange
Where is this header? Is it already implemented?
no, this is on the Figma files
It might be easiest to define this header on the template returned by the server and make it use postMessage
to send a message to a js listener on the reviewer webview when the close button is clicked. Then the listener can react by hiding the ifame.
We will probably also use this pattern for opening the browser and unsuspending cards when the user clicks on the related button in the ifame. See https://github.com/ankipalace/ankihub/pull/2138.
Anki sets the .mobile class on mobile devices: https://docs.ankiweb.net/templates/styling.html#platform-specific-css. We can also use media queries: https://www.w3schools.com/css/css_rwd_mediaqueries.asp
I was talking specifically about the desktop environment @RisingOrange
CSS with media queries should work here, or percentage values for the width and height of the iframe.
Adds the AnkiHub AI button and iframe to the reviewer webview.
Related issues
https://ankihub.atlassian.net/browse/BUILD-424
Proposed changes
webview_will_set_content
hook to injectankihub_ai.js
to the reviewer web content.ankihub_ai.js
sets up the AnkiHub AI button and firame. The button is used for toggling the visibility of the iframe.ankihub_ai.js
needs images for the button icons. These images are copied into Anki's media folder to make them accessible from the webview (they are copied inentry_point._copy_web_media_to_media_folder
).chatbot
feature flagHow to reproduce
Screenshots and videos
The screenshot shows the iframe loading the flashcard selector page, instead of the chatbot page. This is just for testing.
Comments
For now, it's simpler to inject the javascript into the reviewer webview, instead of adding it to the note type template. This way we...
However, we can't use this method for showing the AnkiHub AI UI on mobile.