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

Add support for new congratulations screen #152

Open
glutanimate opened this issue May 19, 2022 · 3 comments
Open

Add support for new congratulations screen #152

glutanimate opened this issue May 19, 2022 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@glutanimate
Copy link
Owner

glutanimate commented May 19, 2022

Since the introduction of the new "congratulations" / "deck finished" screen, users are no longer able to access per-deck stats for the day once they've completed that deck. We should look into adding support for this view.

For an example see: #137 (comment)

Implementation notes:

  • This will require a new way for the add-on to inject its content into web views as the congrats screen does not provide the same web content APIs as other main window views (cf. also the new stats screen)
  • We could either figure something out for own purposes or work towards improving Anki's APIs in this regard
@sameersismail
Copy link

I took a stab at this today. The diff is here (tested with the latest Anki, ad74a014). I ran into a few issues, culminating in that clumsy commit. I may be using the wrong hook (or using it incorrectly), but appending the resultant HTML from render_for_view didn’t work; the <script> tags weren’t being loaded, so I had to load them separately: First, load the library dependencies. Add heatmap.js in a setImmediate-style so that d3 was loaded already (else there’s an uncaught exception). Then wait for the CongratsPage.svelte content to be rendered (is there a hook for this?) and append the heatmap_html, the initialisation <script> won’t run, so pull it out and eval it.

image

@ratman-codes
Copy link

Any update on this? Seems weird we can't see on deck screens still when complete.

@mnmnks
Copy link

mnmnks commented Oct 12, 2023

Can the fix @sameersismail suggested be implemented @glutanimate? I would love an update addressing this. Thank you.

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

4 participants