[Userscript] Integrated Dashboard Overhaul

I’d be interested to see what you come up with.
This is how I currently have it BTW:

2 Likes

Wow love it!

1 Like

For anyone wanting to change the font of the lesson/review count, just add this to the GlobalStyle part of the script.

  • Replace RiiTegakiFude with your font.
  • Replace normal with bold if you want bold.
  • Font-size is self-explanatory.
  • Padding is the size of that white border. 5px is the website default.
.lessons-and-reviews__button span {
            font-weight: normal;
            font-family: RiiTegakiFude;
            font-size: 15.0px;
            padding-top: 5px;
            padding-bottom: 5px;
          }

I’m glad you like it @BJennWare and see you made the changes to the original script.

I have however changed double-character labels back to single-character labels.
Definately looks less cluttered, especially when one is drowning in lessons and reviews like I am right now.

Before:

After:

2 Likes

True is a bit cleaner. I’m not completely sure if the meaning of the single kanji is correct so I’m trusting you on that :smiley:

Here’s an additonal add-on for styling options. Adding fonts is the same process as in Jitai.
Available here: https://greasyfork.org/en/scripts/403932-wanikani-integrated-dashboard-overhaul-settings

Settings Panel is accessed by: Profile Icon > Scripts > Settings > Integrated Dashboard Overhaul


Screenshot from 2020-05-22 08-09-37 Screenshot from 2020-05-22 08-10-09

1 Like

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::

2 Likes

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 => {
                     console.log(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.

2 Likes

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