[Userscript] WK Dashboard Cockpit

Seems to be the case. Just tested simply by removing and re-adding via the console. The turbo frame inside the div likely executes as soon as it is added to the document.

The best I can think of – and this is a kind of hacky workaround – is saving the innerHTML of the turbo frame at the same time you store the lessonsButton, then after it gets moved you replace the innerHTML with the saved HTML. Not sure how robust of a solution that is.

I’ll think about maybe adding a window variable with access to the main function for this script to use for identifying if someone is running it and giving a way to run it in your own script (although I’m not sure what to do about it being async currently).

2 Likes

Just want to say, what a cool project. I love that you were inspired to recreate the dash in a new but still effective way. Signed, a designer and aspiring web dev :sparkling_heart:

2 Likes

Now that WK changed the content of the lesson and review buttons, I was wondering how hard it would be to implement an option to not alter at all their look. Here’s a screenshot of what my dashboard looks like now vs a mockup of what I think it could look like with that option:


I’m trying to play with the script locally to achieve that result, but maybe that’s an idea that could interest people :smiley:

2 Likes

I did turn off other scripts to test if they were interfering, and got the same result.

I tried changing the settings and reloading, reverting and then reloading again, with no change.

What worked eventually was simply clearing cookies for the page and logging in again. I had to change all the settings back, but this time everything slotted into place as expected.

I don’t know if any of that is useful to you at all or just on my end but I thought I’d report back.

Edit: This seems to have fixed a couple minor issues with other scripts as well, should have done this sooner.

1 Like

I can’t get the cockpit to work in Chrome any more. I have reinstalled Chrome - no luck. I have also removed all other scripts. All I have now is the cockpit plus WKOF. Any ideas?

I also run Edge and the Cockpit works OK there. I just prefer to use Chrome if possible…

1 Like

I’m also running Chrome, and it still loads for me. Means there is something specific going on. The error you screenshotted speaks of ‘db_cockpit’ being undefined. That specific name by itself is only used 1 way in the script - it’s the settings. But that’s weird, as the settings should load a default if it can’t find them.

You can check the contents in Chrome. If you hit F12, find the Application tab and then expand IndexedDB and then wkof.file_cache - files, you should be able to find an entry for
wkof.settings.db_cockpit. Mine looks like this

I’m thinking yours might be corrupt. Deleting that specific entry (don’t touch the rest!) should reload the defaults upon page refresh.

1 Like

Looks like you were right! Thank you so very much! I have reinstalled Chrome and WKOF and deleted cookies and site data and you name it, but those files must have lived on somewhere. I deleted all the cached files and now the cockpit works again.

Thank you so much, both for your help right now, and for making the cockpit, and for still being here and helping out even long after reaching level 60. You’re the best!

1 Like

To push the cockpit closer up to the counter-bar:
change on line 2389 $('#dbc_core').css('margin-top','-50px'); the -50 to -180 and add $('#dbc_bar60').css('height','fit-content'); to the part after line 2390 //position bar.

At least that’s how it worked for me.

1 Like

I found a little bug: items numbers are slightly different with dashboard cockpit activated:


Here’s the browser console:

1 Like

Ooh, a puzzle. 13 items is a weird amount. It’s not 1 or 2 items that present an issue, but it’s also not a category like kana vocab. I did some digging.

From Nov 22 - Dec 13 last year WK moved 7 items from below your current level to above your current level.

And from Feb 7 to Mar 27 it moved an additional 5 items to above level 41, or, if you relogged and your forum level is your current level, 6 above 40.

7 + 6 = 13. And this actually makes sense. Last year WK changed how they handle previously unlocked items above your current level. These used to ‘go into hiding’, but can now be reviewed and completed, as they were unlocked already.
The cockpit on the other hand, wasn’t changed for this update - the wheel only shows items up to your current level.

So that’s where the cockpit need to be updated. That looks like a fairly simple fix. I did want to look into the suggested update that was posted above your bug report as well, but hadn’t gotten to it, so I’ll try to get a fix out this week.

2 Likes

Did something break today with the new update to the SRS Section?

Until yesterday, I was able to run the Cockpit together with Heat Map and Item Inspector. Today, when I have the Cockpit enabled, the Heat Map and Item Inspector don’t show up.

With Cockpit running:

Without the Cockpit:

Console with Cockpit running:

Console with Cockpit disabled:

My scripts:

Disabling the Heatmap or Item Inspector doesn’t help, so it looks like it has something to do with how the Cockpit rearranges the dashboard.

I love the Cockpit, so I hope it’s possible to fix this! Thank you so much!

1 Like

I’ve been away for the weekend, so just seeing this. Yes, something definitely broke. I’ll start on it now.

1 Like

Thank you so much! I really appreciate it!

I saw the same problem in the Heatmap thread. It seems that changing the position of the Heatmap makes it come back when running the Cockpit.

1 Like

Version 0.7.4 is out

@hotdogsuplex This should fix the item counts that have moved to above your current level
@Marifly This should make HeatMap, ItemInspector and other scripts that rely on the item breakdown count positioning to be visible again.

3 Likes

Thank you so much! I’m on vacation now, but I’ll test when I get home.

1 Like

I’m back home on my computer, and the Heatmap and ItemInspector are back on my page along with the Dashboard. Again, thank you so much for making the Dashboard, and for fixing it!

1 Like

new WK update broke the script

2 Likes

Version 0.7.5 is out and should be fixed. Let me know if you find any issues, because there were quite a few name changes, and I’m not 100% convinced I got everything.

2 scripts down, at least 3 to go.

3 Likes

Looks great to me so far, thank you once again :pray:
[Edit] Actually, when coming back after review or lesson sessions, the cockpit is absent, whoops

1 Like

thanks much for the fix! Great work!

1 Like