[Userscript]: Dashboard Kanji Sorting

A simple script that adds a sorting button to the Kanji on the dashboard.

You can sort by:

  • Time: Sorts by time (closest review first)
  • Stage: Sorts by SRS Stage (Apprentice I, Apprentice II, Apprentice III, etc. in ascending order)

[Download / Install via GreasyFork]

Normally, the kanji on the dashboard are all mixed and it’s hard to tell how many kanji are left for the completion of the level, or when the next current-level item can be reviewed again:

With the sorting, however, the kanji section on the dashboard is much clearer, making information on the current level easily accessible:
DashboardKanjiSortingButton

Note: It already sorts when the page loads, so there is no need to click the button every single time.

4 Likes

Nice!

Two minor suggestions (feel free to ignore):

  • It isn’t obvious that the toggle is clickable. There are tons of common visual indications for switches. Even radio-buttons might be better (and simple to implement).

  • The word “time” is a bit overloaded. I think it sorts by srs stage, or by scheduled review, so perhaps the two labels should be “stage” and “schedule” (both are part of the SRS)?

2 Likes

Thanks for the suggestions!

You’re right about it not being obvious that the toggle is in fact clickable, but I feel like since people will most likely read the description or see the gif from this topic, or just click on it because they see something new has been added by the script they just installed, it should not be too big of a problem.

About the labels, “Time” may be overloaded, but it’s the simplest term to describe the kind of sorting. “Stage” though, is much simpler than “SRS”, so i will change the label from “SRS” to “Stage”.

1 Like

nice feature!

however, i’ve installed it, it appears in my tampermonkey dashboard, but doesn’t appear on my WK dashboard. am i missing a step?

when i look at the code, there’s a line “include […]” which seems to be commented out. it seems i’d have to uncomment it? but i am not a coder, and don’t really want to mess with code without double-checking.

You’re not missing a step. There just might be some incompatibility with the browser / other scripts might be interfering.
The thing that comes after the “@include” is not commented out, the “/” at the beginning and end indicate start and finish of something called regular expression.

Do you mean that only the button doesn’t appear, or do you mean that the script is not being executed at all when you’re on the dashboard?
If you’re on the dashboard, clicking on the tampermonkey extension will show the currently active scripts. Is the “WaniKani Dashboard Kanji Sorting” script visible and enabled there?

If it’s running and enabled, it should look like this:
image

this is what it looks like on the WK dashboard (it doesn’t appear at all):

and on the tampermonkey dashboard (it appears like all the other userscripts):

i tried disabling all other userscripts on the WK dashboard, it still doesn’t appear…

edit: running firefox 103.0.1; tampermonkey 4.17.6161; macOs 12.5

I understand. So the script is being executed just fine, just the button seems to not appear… I’m afraid troubleshooting this might not be completely possible for me since I don’t own a device with macOS 12.5.

From what I could test on a macOS 10.15.7 device- with the same Tampermonkey and Firefox version- I am unable to reproduce this behavior.

ahh, i’ve been able to narrow down the problem.

earlier, i had accidentally disabled all scripts, including the kanji sorting, oops. i’ve had time to look at it in a bit more detail, and it seems to be some conflict with the ganbarometer - if i disable the ganbarometer, the kanji sorting works. otherwise it doesn’t.

i don’t know if there’s anything you can do, ah well ^^

1 Like

Thanks for the additional info! I’ll check it out tomorrow :+1:

1 Like

So, I’ve done some additional testing, and running Dashboard Kanji Sorting, Open Framework and ganbarometer-svelte worked just fine.
Right after installing either ganbarometer-svelte or Dashboard Kanji Sorting, sometimes, one of the two would not immediately appear, but it was just a matter of refreshing and they both worked flawlessly at the same time.

Since I can’t really investigate it further without a specific error message or something similar, I’m afraid other than trying to refresh the website, there aren’t other things i could recommend.

Edit: I’ve updated the script (now v0.3) to run at document-end, and it seems to work every single time now.

Yes - sounds like a race condition with page load.

Haven’t looked at ganbarometer in ages (“works for me” :smile:). Let me take a peak.

sorry for the delayed reply, had a busy week and wasn’t on WK. Kanji sorting is working beautifully now, thanks for a great little script ^^

1 Like