[Userscript] Integrated Dashboard Overhaul

Hah thats cool! Now everyone can style it the way he or she wants :slight_smile:

You should add // @include /^https?://(www|preview).wanikani.com to the top of the script though.
If you click on the big WaniKani Icon at the top it forwards you to https://www.wanikani.com/

Oh yes these are good,
we use kanji like this in Japan much like abbreviations are used in the west:

部 for 部首 (Radical)
漢 for 漢字 (Kanji)
語 for 単語 (Word) and 語彙 (Vocabulary)

Spoilt for choice now, nice!

It unfortunately does not work correctly though:

Prior to install:

After install:

Notice the missing 176 Vocab Lessons and 11 Reviews for some reason??

1 Like

Good to know - thx :slight_smile:

Oh woops! Yeah there was a new parsing error after the original script was updated. I thought I uploaded the update but I didn’t :sweat_smile:. Anywayyyy the new update is live so feel free to try again :upside_down_face::


I am getting incorrect results for the critical review feature. It is listing a radical that I have already cleared and have another review for next week as the critical review instead of one of the kanji for the current level that I have yet to pass. It seems to be related to the filtering predicate in lines 207-209. Where is item.data.passed defined? Is that a part of API v1 that didn’t get updated? In that case comparing the current date with item.data.passed_at should work instead for API v2.

const radicals = assignmentResponse.data
    .filter((item) => item.data.subject_type == 'radical' && !item.data.passed)
    .sort((a, b) => a.data.srs_stage < b.data.srs_stage || (a.data.srs_stage == b.data.srs_stage && a.data.available_at > b.data.available_at) ? 1 : -1);
1 Like

See here

In particular this part (bold added)

We will be dropping the endpoint /srs_stages and the attributes assignment.srs_stage_name , assignment.passed , reviews.starting_srs_stage_name and reviews.ending_srs_stage_name on August 17, 2020 .

Is item.data.passed an alias for assignment.passed? This change went live yesterday.

Looks like the culprit to me. Thanks for the link.

The script works again with the following patch applied.

diff --git a/Wanikani: Integrated Dashboard Overhaul.user.js b/Wanikani: Integrated Dashboard Overhaul.user.js
index ec3bf80..0ac4fee 100644
--- a/Wanikani: Integrated Dashboard Overhaul.user.js	
+++ b/Wanikani: Integrated Dashboard Overhaul.user.js	
@@ -205,7 +205,7 @@
                 wkof.Apiv2.fetch_endpoint('assignments', {filters: { levels: [level], subject_types: ['radical', 'kanji'] }}).then(assignmentResponse => {
                     const radicals = assignmentResponse.data
-                        .filter((item) => item.data.subject_type == 'radical' && !item.data.passed)
+                        .filter((item) => item.data.subject_type == 'radical' && !item.data.passed_at)
                         .sort((a, b) => a.data.srs_stage < b.data.srs_stage || (a.data.srs_stage == b.data.srs_stage && a.data.available_at > b.data.available_at) ? 1 : -1);
                     if (radicals.length > 0) {

I don’t see how this will ever be true?

1 Like

Ah, thanks for catching my time traveling blunder. Boolean coincidentally giving my desired behavior != correct. I’ve updated my previous comment.

1 Like

@LiteracyFanatic nit: do you even need to compare against the current date? Why not just check for null in item.data.passed_at?

1 Like

You’re right. I guess I really overcomplicated things when only a three character change was needed.


Hello !

Sorry to be such a newbie :sweat_smile: how could I implement your patch to fix the current script ? Do I just need to copy paste inside the script like at the end ? thanks :smile:

It’s a very small change, so you can fix it manually by searching for passed and changing it to passed_at. More generally, the command line program diff can be used to show all the changes between two versions of a file, say a.js and b.js. You can save this output to a file and use the patch tool to apply the changes necessary to transform your copy of a.js to b.js. When developers collaborate on larger pieces of code, they naturally pile up many such changes. There is another tool called git which is used to track and manage them. You can search for the names of these tools online to learn more if you’re interested (they likely are not installed on your computer by default). Like I said earlier, you can just make the change manually this time.

1 Like

Perfect it worked well thanks ! This sound interesting, I have seen some friends work on GItHub before but never learn how it works. Maybe I should investigate more in order to not be lost next time !

I’m currently using this script mainly for the critical review time feature. But I’ve discovered a conflict between this and the Keisei Semantic-Phonetic Composition script which is causing a minor problem in how both lessons and reviews are displayed.

For some reason it affects the spacing between sections as per my screenshot in the link below. If I disable Integrated Dashboard Overhaul the spacing reappears.

Anyone know how to resolve it?

I’ve sort of fixed my own problem with this script conflict through a bit of trial and error (I’m not a coder).

I commented out the line that starts with

 section { margin: 0 0 20px !important; }

and the correct spacing has come back in lessons and reviews.

For some reason this script has suddenly stopped working at all for me. I use it for the critical review feature and the lessons and reviews breakdown info.

Tried disabling all other scripts except WKOF and still nothing. Also tried with the Compatibility Mode enabled but no joy.

I’m guessing the OP is no longer supporting this but does anyone else use it?!

EDIT: Took screenshots from the Chrome inspection window. Hopefully someone understands what this means and why it would suddenly take objection to it:
Screenshot 2021-10-24 at 23.16.39

Screenshot 2021-10-24 at 23.16.57


@Kumirei @prouleau Hope you don’t mind me tagging you since you’ve posted in this thread before but looks like the OP is no longer active. Maybe the issue above means something to you?

I don’t know why it’s causing an error, but by just trying some things I found out that it’s one of the dependencies that is causing it. I don’t think that the script is actually using that one anyway, so you can just remove it.

In the beginning of the script you just need to remove the last line with // @require (the one before @license.

1 Like

Genius! This seems to have fixed it.

I’m now running a rather heavily modified version of this script (I previously had to take another part out) but as long as it keeps doing the two features I like then I’m happy. :sweat_smile:

Just one thing is it now seems to have removed the gap above the lessons and reviews button on the main page from the Progress Percentages bar add-in that I also have. Not really a big deal but not sure why it would have caused that.

With it running it looks like this:

If I disable the script it looks like this:

… which is what it used to be like.

No idea why this script would be messing with the margins like that.

1 Like