[Userscript] Critical Review Countdown

Hey everyone,

I’ve created a simple little script that adds a “Next Critical Review” time to the dashboard. This is the time that the review for the last radical/kanji that you will need to complete the level becomes available.

Another way of saying that, is that if you always complete your reviews at the suggested time, with 100% accuracy, then you will level up in the minimum period of time.

The main use for me is that it helps me not stress about reviews coming up each hour. Instead of tricking myself into staying up 20 more minutes for another batch of reviews, if I know that the next “critical” review is several hours after that, I can just go to bed :slight_smile:

Script is here: Wanikani: Critical Review Countdown

Here is what it looks like when the next “critical” review is in the future:

Here is when you need to do your reviews ASAP!:

And finally, when you need to complete lessons to move forward:

I’ve been using/debugging this script for a couple days, so let me know if you run into any issues!

23 Likes

7 Likes

I installed your userscript but it doesn’t show up, neither on the dashboard nor on this list:

image

It’s not working :confused: I can see it in the list of all my downloaded userscripts in Tampermonkey though.

2 Likes

I’m guessing the include statement had an issue. I’ve changed it to match what I see in other scripts, so update and give ti a try! If that doesn’t work, can you tell me what url is in the address bar?

1 Like

It’s working now! :smiley:

image

On a side note, is it supposed to say that the next critical review is in 6 days? :thinking:

image This is my “second batch” of kanji.

I already did all of the radicals on this level.

2 Likes

Nope, definitely a defect. Sorry about that. Just pushed another update. There’s no way it should ever be more than 2 days.

2 Likes

FWIW, this only seems to work if the URL is WaniKani — Log in… which doesn’t include wanikani.com. I know they go to the same place, but I usually visit wanikani.com, which means it doesn’t show up.

It also has this unfortunate interaction with a common dashboard script; I wonder if there’s a way to get it to just list all 5 items (next review, next critical review, etc) on a single line. As an interesting note, that dashboard script correctly expands it from 3 items to 4 items, so I wonder what the problem is here.

3 Likes

Yay, it’s fixed :slight_smile:

image (The little crop out at the end tho :eyes:)

3 Likes

Added to list of scripts

4 Likes

Pushed a fix for “wanikani.com”.

Looking into what it would take to get the scripts to play together. Both scripts attempt to resize the columns to fit four items, so somehow need to detect that the ither script is in play then override changes to make each box 20%.

2 Likes

Hey, I made the other script so we should coordinate our patches so it works regardless of which runs first. I think the best way is probably just checking how many elements there are in there already and setting the width to that. That way it would still work if there’s any other scripts doing the same thing in the future

4 Likes

That is simpler than what I was thinking. What do you think of adding something like this to both scripts?

    function set_header_width() {
        var header_count = $('.dashboard section.review-status ul li').length;
        var width = (100/header_count) - .1;
        $('.dashboard section.review-status ul li').css('width', width + '%');
    }
2 Likes

I haven’t tried it, but that looks good to me 230185602321088514

Great, I’ve pushed up a new version with that patch. I also locally edited “Expected Daily Number of Reviews” to test it, and the outcome looks good to me!

2 Likes

Thanks. Super useful script^^
But since the include statement is *.wanikani.com it also includes the community section which leads to it asking for the open framework which is inactive on that page.
Changing both include statements to https://www.wanikani.com fixes that and should not break anything(not entirely sure though, but changing it locally didn’t introduce any bugs for me).

1 Like

Thanks for the bug report, script is now updated!

I tried adding the function to the “expected daily reviews” script, but it doesn’t seem to work no matter where i call it. i’m a programmer–but not a javascript one–so i might be missing some aspect of it.

Looks like @Kumirei has already published an updated script with the change! Wanikani: Expected Daily Number of Reviews

Nerdy programming moment: There are two changes required to make it work. (1) call the function somewhere after the html DOM is injected, and (2) remove the css style that sets width. The !important flag in the style would override any other width change.

The updated script has both changes, so you are good to go!

2 Likes

Yep, went through all the scripts yesterday and for Daily Expected I also added the function you made. All is good 230185602321088514

1 Like

I will heavily enjoy using this script for the remaining 3 levels I have. Shoutout to you and all the other scripters who make WaniKani a better experience for everyone! Would’ve loved this script in the times when I lost motivation. It seems like a great way to keep your eye on reality and keep moving forward, even if slowly.

Edit: It actually looks like it’s not working for me for some reason. Here’s the script list I’ve got for the dashboard, and what my dash looks like. I don’t think it would be (I don’t know much about coding, though), but could it be the Breeze Dark Theme somehow?

Script List

Dashboard

4 Likes