[Userscript] Daily Vocab Planner

General script installation guide
Open Framework installation
(Optional, make sure it’s loaded first) Word Frequency Filter
Install Daily Vocab Planner

Purpose

Daily Vocab Planner shows you the recommended number of vocabulary items to learn each day so that your vocabulary lesson queue is empty just before you level up. That way, you always start with a blank slate on level up (* see notes further down) and avoid the motivation drain of having an ever increasing vocabulary queue.

You can set the number of radicals & kanji to learn per day and the script will calculate when you’re about to level up. This is then used to calculate the number of vocab you should learn each day.

Visual elements

It adds two optional visual elements:

  • A “Vocabulary unlocks” list under your review list, which shows when you’re going to unlock how many new vocabulary items. It also shows your projected level-up time.
    unlocks

  • A progress bar at the bottom of the lesson panel that shows how many vocabulary items you have learned today and how many you should still learn to reach your target.
    progress

  • There is also a settings dialog under Account > Settings
    Radicals/Day and Kanji/Day set to 0 means “go as fast as possible”, i.e. learn all radicals and kanji as they become available.
    image

Notes

Vocab unlocked on level-up

Due to the way WaniKani works, you always have at least some vocabulary which is unlocked when 90% of your Kanji reach guru level. Those vocab items will always carry over into the next level, so it’s impossible to start a new level with a completely empty queue.

However, by ensuring that your vocab queue is empty by the time you level up that kanji, and assuming you have a steady rate of learning kanji, your carry over stays more or less consistent across levels.

For example, if you always learn all kanji as soon as they are available, you level up when the entire second batch of kanji reaches guru (for a normal speed level). That will also unlock all the associated vocab as carry over (for example 40 items). This carry over is consistent though, so the average number of vocabulary per level should stay roughly the same.

If you only learn a certain number of kanji per day, the carry over will be less but your level-up time is also going to be slower.

Projected level-up time

The recommended number of vocab per day relies on the projection for when you’re going to level up. This calculation assumes that you always do your radical and kanji reviews at the hour you can configure in the settings (default is 9 am) and that you do the reviews that are critical for level up (radicals and the kanji unlocked by the radicals) as soon as they are available. Times will naturally start shifting if you do those reviews later.

If you always follow that schedule, the projection will be accurate from the moment you level up. Otherwise it will drift a bit according to your review and lesson pattern.

Word Frequency Filter integration

This script integrates with Word Frequency Filter if you have that installed. Make sure to load this before Daily Vocab Planner, i.e. place it above Daily Vocab Planner in Tampermonkey.

Then, if you have the Use Word Frequency Filter option enabled in your settings, only vocab that are below the chosen rank cutoff or that you marked will be considered as vocab to learn, i.e. you’ll likely see considerably less vocab unlocks and daily vocab to learn.

Feedback

I hope this is useful to you guys. Please let me know if you have any issues, feedback or feature requests in the comments.

Changelog

1.2.2: Fix level up not being shown if no vocab is unlocked on level up
1.2.1: Integrated with Word Frequency Filter
1.1.8: Fix “After reviews” unlock time
1.1.7: Configure daily lesson time for more accurate predictions
1.1.6: Fix crash if no kana vocab is available
1.1.5: Fix pass time projection for locked kanji when learning a fixed number of radicals/kanji per day
1.1.4: Fix kana-only vocabulary not being included
1.1.3: Fix display of today’s learned vocab after level up
1.1.2: Fix vocab bar when close to the end of the queue
1.1.1: Fixed crash for certain combinations of kanji learned per day

10 Likes

Hello!

Thank you for putting together the script :slight_smile: :+1:
I’m not going fast through the levels but this is still a good addition.

A little feedback:
At least with my current level (8) and kanji left to learn (14), the script only works with the following values for “Kanji/Day”: 0, 5, 7, 8, 10 to 17, 20 and over
Using any other value breaks it and the two visual elements disappear.

Would be nice if this could be fixed… for those of us who learn fewer kanji daily :slight_smile:

Thanks for the feedback!

If the script breaks, there must be some error message appearing in the browser’s console. Would it be possible to provide that one? Then I can fix it. If you’re using Chrome, that would be Ctrl + Shift + I by default.

Unfortunately, I’m somewhat limited as to which combinations I can actively test since I can only use what I have at my own level (and a level 1 account for testing).

I’m using Firefox, here’s what it catches in the console when I set Kanji/Day to 4:

Error: Permission denied to access property "ownerDocument"
projectLevelUpTime moz-extension://6513fcb6-95e3-45e2-9472-164002e2a128/userscripts/Daily-Vocab-Planner.user.js?id=8a353b5b-c852-46fb-908c-f5735ae91e2b:418
    updateData moz-extension://6513fcb6-95e3-45e2-9472-164002e2a128/userscripts/Daily-Vocab-Planner.user.js?id=8a353b5b-c852-46fb-908c-f5735ae91e2b:282
    settingsSaved moz-extension://6513fcb6-95e3-45e2-9472-164002e2a128/userscripts/Daily-Vocab-Planner.user.js?id=8a353b5b-c852-46fb-908c-f5735ae91e2b:188
    setting_changed https://www.wanikani.com/ line 7 > injectedScript:534
    dispatch https://assets.wanikani.com/assets/default-v2/application-6302d62523250d58a9c4f0746e1da15d9dbfbf584e584d9110b94810ec96c4f3.js:2
    handle https://assets.wanikani.com/assets/default-v2/application-6302d62523250d58a9c4f0746e1da15d9dbfbf584e584d9110b94810ec96c4f3.js:2
    nrWrapper https://www.wanikani.com/:7
    nrWrapper https://www.wanikani.com/:7
    add https://assets.wanikani.com/assets/default-v2/application-6302d62523250d58a9c4f0746e1da15d9dbfbf584e584d9110b94810ec96c4f3.js:2
    w https://assets.wanikani.com/assets/default-v2/application-6302d62523250d58a9c4f0746e1da15d9dbfbf584e584d9110b94810ec96c4f3.js:1
    each https://assets.wanikani.com/assets/default-v2/application-6302d62523250d58a9c4f0746e1da15d9dbfbf584e584d9110b94810ec96c4f3.js:1
    each https://assets.wanikani.com/assets/default-v2/application-6302d62523250d58a9c4f0746e1da15d9dbfbf584e584d9110b94810ec96c4f3.js:1
    w https://assets.wanikani.com/assets/default-v2/application-6302d62523250d58a9c4f0746e1da15d9dbfbf584e584d9110b94810ec96c4f3.js:1
    on https://assets.wanikani.com/assets/default-v2/application-6302d62523250d58a9c4f0746e1da15d9dbfbf584e584d9110b94810ec96c4f3.js:2
    open https://www.wanikani.com/ line 7 > injectedScript:296
    openSettings moz-extension://6513fcb6-95e3-45e2-9472-164002e2a128/userscripts/Daily-Vocab-Planner.user.js?id=8a353b5b-c852-46fb-908c-f5735ae91e2b:173
    insert_script_link https://www.wanikani.com/ line 7 > injectedScript:285
    nrWrapper https://www.wanikani.com/:7
line 9 > injectedScript:418:7
    projectLevelUpTime moz-extension://6513fcb6-95e3-45e2-9472-164002e2a128/userscripts/Daily-Vocab-Planner.user.js?id=8a353b5b-c852-46fb-908c-f5735ae91e2b:418
    updateData moz-extension://6513fcb6-95e3-45e2-9472-164002e2a128/userscripts/Daily-Vocab-Planner.user.js?id=8a353b5b-c852-46fb-908c-f5735ae91e2b:282
    settingsSaved moz-extension://6513fcb6-95e3-45e2-9472-164002e2a128/userscripts/Daily-Vocab-Planner.user.js?id=8a353b5b-c852-46fb-908c-f5735ae91e2b:188
    setting_changed https://www.wanikani.com/ line 7 > injectedScript:534
    dispatch https://assets.wanikani.com/assets/default-v2/application-6302d62523250d58a9c4f0746e1da15d9dbfbf584e584d9110b94810ec96c4f3.js:2
    handle https://assets.wanikani.com/assets/default-v2/application-6302d62523250d58a9c4f0746e1da15d9dbfbf584e584d9110b94810ec96c4f3.js:2
    nrWrapper https://www.wanikani.com/:7
    (Async: EventListener.handleEvent)
    nrWrapper https://www.wanikani.com/:7
    add https://assets.wanikani.com/assets/default-v2/application-6302d62523250d58a9c4f0746e1da15d9dbfbf584e584d9110b94810ec96c4f3.js:2
    w https://assets.wanikani.com/assets/default-v2/application-6302d62523250d58a9c4f0746e1da15d9dbfbf584e584d9110b94810ec96c4f3.js:1
    each https://assets.wanikani.com/assets/default-v2/application-6302d62523250d58a9c4f0746e1da15d9dbfbf584e584d9110b94810ec96c4f3.js:1
    each https://assets.wanikani.com/assets/default-v2/application-6302d62523250d58a9c4f0746e1da15d9dbfbf584e584d9110b94810ec96c4f3.js:1
    w https://assets.wanikani.com/assets/default-v2/application-6302d62523250d58a9c4f0746e1da15d9dbfbf584e584d9110b94810ec96c4f3.js:1
    on https://assets.wanikani.com/assets/default-v2/application-6302d62523250d58a9c4f0746e1da15d9dbfbf584e584d9110b94810ec96c4f3.js:2
    open https://www.wanikani.com/ line 7 > injectedScript:296
    openSettings moz-extension://6513fcb6-95e3-45e2-9472-164002e2a128/userscripts/Daily-Vocab-Planner.user.js?id=8a353b5b-c852-46fb-908c-f5735ae91e2b:173
    insert_script_link https://www.wanikani.com/ line 7 > injectedScript:285
    nrWrapper https://www.wanikani.com/:7

That block in the console links to the debugger which opens at a function:

function projectLevelUpTime(kanjiIds)
function projectLevelUpTime(kanjiIds) {
    const kanjiPasses = groupByTime(kanjiIds, shared.passTimes);
    const numKanjisToLevelUp = Math.ceil(kanjiIds.length * 0.9);
    let remaining = kanjiIds.length - numKanjisToLevelUp;
    for (let i = kanjiPasses.length - 1; i >= 0; ++i) {
      remaining -= kanjiPasses[i].count;
      if (remaining <= 0) {
        return parseInt(kanjiPasses[i].timeMillis);
      }
    }
    // Should never happen
    return 0;
  }

Specifically (I think?) to the line with remaining -= kanjiPasses[i].count;

Hope this helps!

1 Like

Thanks!

I updated the script, I think that should fix it. It was indeed a combination I currently couldn’t reproduce on my account. Hope that helps!

1 Like

It does work now :slight_smile:
Thanks much!

Updated again with a small fix to the vocab bar when close to the end of the vocab queue

1 Like

Fixed display of today’s learned vocab after level up, previously it would show nothing

1.1.4: Fix kana-only vocabulary not being included

1 Like

1.1.5: Fix pass time projection for locked kanji when learning a fixed number of radicals/kanji per day

This was pretty broken actually which became apparent when early in a new level. Previously you had some pretty wild unlocks like this (set to 8 kanji/day).
image

Now it shows the correct unlocks based on when those kanji are going to pass Guru level:
image

2 Likes

Hello, I installed it but somehow it doesn’t show up… :pensive:

1 Like

It’s stopped working for me too. I’ve already tried disabling every other script, and none of them were interfering with it.

It’s still working for me right now, version 1.1.5.

This morning I did all radicals from level 9, haven’t started kanji or vocab.
I completed the vocab from level 8 yesterday, so I only have L9 items.

@peachonatree @hotdogsuplex Would it be possible to check the browser console for errors and post them here?

It’s very likely that it’s not working due to a condition that only happens on your particular levels.

Now that you mention it, it did stop working right around the time I leveled up to 39. Here’s what shows up with all other scripts minus open framework disabled:

Ah thanks, that’s helpful. I’ll fix that today!

1 Like

1.1.6: Fix crash if no kana vocab is available

Not entirely sure why this only happened for you now. On the surface it looks like the crash happens when you have no kana-only vocabulary available but that was the case on level 38 as well. This should fix it for you though.

1 Like

Continuing the discussion from [Userscript] Daily Vocab Planner:

When I first installed it, it was working too but it stopped working mid level not while levelling up. I hope the screenshot is right, I got no clue about such things hehe :sweat_smile:

@peachonatree Thanks, it’s the same issue and the same fix, just update to 1.1.6! :slightly_smiling_face:

1.1.7: Configure daily lesson time for more accurate predictions

There’s now an option in the settings where you can set your daily lesson time (for learning radicals and kanji). So far the prediction always assumed that you’d learn items on other days using the current hour today but that’s wrong in most cases.

The prediction looks very accurate to me now. I have one failed kanji (the Mon 14:00 +2 one), the others are all assuming 8 kanji/day, learned at 8 am.

image

Of course this would be less accurate if you have multiple kanji sessions per day. Let me know if you have any issues with this setting.

1 Like