[Userscript] Reorder Buttons

This script adds buttons that reorder remaining reviews by their SRS level in either ascending or descending order.

This is a fork (l33t for altered ripoff :stuck_out_tongue:) of @Towe’s awesome SRS Reorder Script (their post can be found here).

Differences

Particular to this fork:

  • Ability to sort SRS in descending order
  • Separate buttons to do the previous item
  • Ascending ordering of review items by default

Install

  • Ensure you have some userscript engine installed – User Mempo has a great guide on this here
  • Click this link to open the script file and be prompted to install it

Links

Screenshots

12 Likes

Exactly what I wanted. Thanks, boss!

1 Like

Glad to hear. Chief! Let me know if anything about it feels like it could be improved!

Thanks for this script!

I was desperate for something like this to help me gently climb out of 1000+ review pile.
Focusing on Apprentice/Guru from time to time will make it a bit easier.

1 Like

It’s no problem! I’m super glad it’s helped!

I’m really interested in trying out this script to target my burnable items, but I can’t get it to work in Firefox. I’m able to run other WaniKani scripts, just not this one. I’ve edited the script a bit to try and do some print-line debugging, but I don’t even hit those. It seems like the script is not being run at all, despite no error/log information in the console indicating a failure.

Do you know of any common failure points I could try addressing? I’m using Firefox with ViolenceMonkey at the moment (though I also have TamperMonkey and have verified the same behavior in that environment as well).

1 Like

Update: I downloaded a chromium-based browser and verified that it works. It would be nice if this ran on Firefox, but it isn’t the end of the world. Thanks for the script!

1 Like

Heya! I’m super grateful you put in so much time looking into that! I’m not currently running FireFox on my machine, but I’ll set myself a reminder to try a fresh FireFox+Tampermonkey setup tonight and debug if needed.

Ideally, this would work across any user script engine/browser combo given there’s really nothing super specific going on with the script. It really helps knowing it at least still works on Chromium browsers – I personally use it daily on Safari+Tampermonkey and have had it work on FireFox+Tampermonkey before.

I’ll get back to this later today with an update.

2 Likes

Alrighty, tested out a fresh install of stable-channel Firefox on OS Catalina with a fresh install of Tampermonkey and no other config changes nor scripts.

I went to https://www.wanikani.com/review/session and the script activated just fine. Both ascending and descending order buttons worked, and counters remained updated as I cleared reviews.

@ihfdayton, I’m totally down to help you debug this so that it works with your intended setup. I wish I knew enough to add debug logging or utility to the script, but that’s honestly way out of my skill set for user scripts, so I’d definitely need your help in recreating your setup locally to iterate on things. If you want to go through with that, please open up a ticket on the project issue tracker and we can go back and forth there :grin:

1 Like

Thanks for being so willing to help! I’ll do some detailed reporting as soon as I can and open up an issue on github.

Interestingly, the script is now failing to run in my Chromium environment as well.

EDIT: Turns out I’m bad at JavaScript. I did a bit of debugging and tinkering with the code and I believe the problem I was seeing was a timing issue. It seems like sometimes the reviews kick up faster than the script can populate from the WK API. By adding a breakpoint in the script initialization and then continuing after a couple seconds, I can reliably run the script in both Chromium and Firefox.

1 Like

Oh! That’s super useful info!
So to be sure I understand, the issue is resolved by literally pausing the script’s initialization while reviews load? If so, I think I know some quick changes I can make to prevent sorting until reviews are loaded.
Thanks a bunch for the investigation! :grin:

2 Likes

Yep, spot on. Sorry for any confusion, I had WK vs. script backwards in my previous post. Let me know if you need anything else!

1 Like

Heya :wave: so I tried recreating things so I could be sure the issue would be fixed when I make edits to the script, but I really couldn’t get it worked out.

I’ve created this issue to track updates or maybe other reports of the same bug. If you could add any edits you made that helped out, it’d be really helpful for both myself and other potential users running into the same issue in the future.