Thanks a lot!
I got about 115 reviews to do in the morning -.-', so I’ll try to check if I can find any further issues.
Seems to be working well so far.
Unfortunately no kanji after the 100th item so I couldn’t reproduce your bug. But it even seems to work with the [UserScript] WaniKani Fast Abridged Wrong/Multiple Answer script I’m using.
Thanks for the report!
The way my script works is to manipulate the quiz-queue element so that wk will accept the onyomi readings (editing the answer value for the appropriate questions). But I guess my manipulations are being overridden by either queue manipulator or reorder omega. Do you think you could narrow it down to which of them is causing the conflict?
I could also change my manipulation to run at the start of each question, but without knowing how these scripts work I’m not sure if that would solve the problem reliably or just most of the time.
Thanks! I don’t have any review for a couple hours but I’ll check as soon as I do.
BTW I’m not really sure what queue manipulator is… I think it’s used by reorder omega regardless of whether I have it installed or not?
Just checked and can confirm this works fine without reorder omega (so with these scripts)

It’s a library script I created that can be used by other script authors to manipulate the review queue (like in Reorder Omega). I could either adapt it so that @Harald1 can use it in the Katakana for Onyomi script, or we could try to find a way to coordinate each script’s queue manipulations.
Correct, Reorder Omega already loads a version of Queue Manipulator. Having it installed separately is not necessary, but has the advantage that you will always use the newest version of Queue Manipulator with the latest bugfixes, even if Reorder Omega was not updated yet to require the newest version.
Awesome! I appreciate the work you guys put into scripts even if the technical details go right over my head ![]()
Well, I’m not opposed to using your library script, and that might very well be the best solution to ensure compatibility between scripts, especially going forward.
The interaction I have with the queue right now is this:
var queueEl = document.getElementById('quiz-queue');
var parentEl = queueEl.parentElement;
queueEl.remove();
var cloneEl = queueEl.cloneNode(true);
var items = JSON.parse(cloneEl.children[0].innerText);
for (var i=0; i<items.length; i++) {
if (items[i].type == "Kanji" && items[i].onyomi) {
for (var j=0; j<items[i].onyomi.length; j++) {
items[i].onyomi[j] = convertToKata(items[i].onyomi[j]);
}
}
}
cloneEl.children[0].innerText= JSON.stringify(items);
parentEl.appendChild(cloneEl);
Which I run once on pageload (I am aware that just running it once is bad if there are too many items, but I wanted to get something out). The remove/clone/add workflow is from a recommendation made in another thread. But for the actual queue I loop through each element, and if it is a kanji with an onyomi reading, I alter that property.
I guess your library function
wkQueue.applyManipulation()
should allow for the same changes?
No, that one was intended for manipulations that should be applied to the current queue only once, without registering the manipulation. Currently, Queue Manipulator does not support changing the subject information. I could try adding this feature, but as you already said, I might have to think about how to deal with review queues of more than a 100 items. But maybe I can add all subjects at once, and the WaniKani code will not complain that there are more than 100 items? I assume this should not be a problem. ![]()
Don’t you already have to deal with large review queues to get the reordering working?
Alternatively maybe I just solve the large item count issue on my side, and you publish an event I can listen for whenever you rewrite the queue, so that I can reapply my manipulation?
I’m admittedly not entirely clear on why there is a conflict to begin with, as I don’t see why reordering the queue would replace my edit to the data in the queue.
Yes, after the manipulations are applied, I take the first 100 elements, load their subject info, and write them into the DOM. Maybe I should just load all subject info instead, not just the first 100. For very long queues, it might take longer to load, but that’s the best I can think of currently.
The way I was going to solve long queues was to just make a counter, listen for willShowNextQuestion and rerun my manipulation every 50 counts or so. Since it’s idempotent, the only drawback to running it too many times is computational resources, but it’s not really an expensive operation I think, I could probably run it every time without noticeable impact, it just feels bad to to waste cpu cycles like that.
The problem is that every time the queue Stimulus controller is reset (with the “remove/clone/add workflow”), it also forgets about any half-answered items, so doing the queue manipulation in the middle of a review session is problematic. Maybe there is a way to keep the information about half-answered items, but I think no one has found one yet.
If you do end up supporting this I was already thinking about it as one avenue to get Random Voice Actor working again
Ah, that does seem bad. At the same time, I guess not resetting it would mean it wouldn’t pick up on the changes? It does make it sound like loading lots of items is the way to go.
@Sinyaven I can report that I think I have found a way to implement what I need without messing with the queue (Stimulus.controllers.find(c => c.answerChecker).answerChecker; and then interact directly with the validation function).
I’m testing it now, but if it works it should be the best solution for all involved.
Beta release: // ==UserScript== // @name WaniKani Katakana For On'yomi // @author... - 6f56183b
This version should be compatible with queue manipulators and the latest version of double check.
@nazan
Thanks, working wonderfully for me!!
Uploaded fix for the wk change that got pushed a few hours ago. Would not have solved it so fast without the insight pimanrules provided in another thread.
I tried to push this one out fast, so I’ve really only seen it work once, but the script seemed entirely nonfunctional so I decided to get something out asap.

