Frontend rework - #298
Conversation
|
Okay, now. Let’s hope that this method won’t be heck to set up now, eh? |
I don’t think that’s a fair assessment. Most of the issues you’ve run into stem from the very constrained storage environment. I’ve set this up on several Raspberry Pi models during testing, and it worked fine in each case. |
|
Well I hope I can get my hands on a 32 GB micro SD card from Target, their same day pickup is a GODSEND. |
Don't rush it for now though, this is not yet finished! 😊 |
|
I did test with Ubuntu 22.04 on how to create the USB gadget in a VM and if the container would run. I could not check though if a connection to the game is possible. Therefore I did not provide any instructions for VM setup in the docs right now. I did not have any problems with the new frontend, but I still will leave this as draft for a few days, to allow others to test! |
This comment has been minimized.
This comment has been minimized.
|
BTW, the bash part of the commands should be removed. The Pi tries to run the command as a binary file and fails. |
|
Don't know if anybody else had time to test the branch as well. Should i change base of the pull request such that it will be merged into dev first? |
|
Did you test the rework with color puzzles in-game? |
|
No, I haven't encountered a color puzzle yet, I am still on my playthrough, but sadly time is limited as well. You can leave the pull request open though until I get to one (or if you prefer me to convert it back to a draft that's fine as well). |
I don't have the game installed right now, but these puzzles are pretty frequent. It is important that colors are clearly visible and pulsing still works with the new design. I'll just wait, no problem. |
|
Ah can the part where you need to place Wyldstyle on each pad (in Vorton) be considered a color puzzle then? Since, if I am not mistaken, this also uses pulsing. I'll play a bit more and report back here as soon as I get to it. A lot to do with university and work. :) |
|
Blinking is good. A real color puzzle is where placing a character on a colored toypad space changes things in-game with the same color. The keystone is called Chroma: https://lego-dimensions.fandom.com/wiki/Chroma This should appear in the main story and is a pretty frequent puzzle in about every story pack. |
|
Okay, so I think (or more guess, the first time I could recreate this issue was right now with Trixie), this has something to do with the USB gadget working a bit differently under newer RPi OS versions. I will need to test this more. I just set up a Bookworm SD card. Maybe also Bullseye is needed, then it would be probably necessary to revise the gadget mode setup. This also makes sense with the solution #301, which also seems to point towards Trixie. Though it could also be that Bookworm faces this problem as well, since it reports a similar kernel version. So maybe I need to further test it with Bullseye (since the original USB gadget setup was also done with this OS version), and I was just "lucky" that it worked for me without any issues, though being "lucky" isn't really a satisfying explanation either ... So you cannot move the tags on desktop if you click, hold, and then drag. Are there any logs in the browser console? |
|
Good to know it wasn't just me doing something wrong. 😅 For the purposes of continuing to test the new frontend I can switch to Bookworm if that has less issues, and if I encounter it again then I'll go back even further. I should also add that I haven't been using a USB splitter cable like I know I am supposed to be, so it could very well be the same issue that you were having with with your Zero W not getting enough power. I guess I really do need to get one to test out if that fixes it issue first. As for the tags I apologise I meant on desktop the click, hold and drag does work. It's more that is that the required hold delay when using a mouse is not intuitive to do so, as I didn't realise that's what I needed to do until I tried it on my phone. |
|
So I am currently trying it with Bullseye; I just have to finish the setup. I'll report if it works with Bullseye. Yes, for me, the same, up until today, I have never encountered this error. It could technically also be related to the use of node22, but this needs more testing to be done. Well, I also never did bother to use such a splitter, and just had this issue for the first time, but yeah, all of those things could very well play into the reproducibility/weirdness of the issue as well. Ah, yes, I can see that. I'll check if I can remove the click delay on desktop 👍 |
|
Please try it with Bullseye, on Trixie and Bookworm it resulted in the same error for me now, Bullseye does work. I used the latest version of Bullseye found here: https://downloads.raspberrypi.org/raspios_lite_arm64/images/ (from 2023-05-03). Maybe this was also just lucky now, hard to tell for me now. |
|
I also quickly checked the delay-on-touch-only option in Vue Draggable, which seems not to accept the shorthand form, as I originally had it. Now, the desktop should not have a delay anymore. Sorry for the inconvenience! 🙂 Edit: will update the Readme/Docs with instructions to use Bullseye today or tomorrow evening. Probably will then also start inspecting how to fix it for newer Kernel versions 🙂 |
I used that same image and also even made sure to use the I've also discovered some other frontend specific problems that you might already know about. The first is when moving a tag from the middle pad position back to the toybox the scaling of the tag gets all messed up and becomes massive when hovering hover the toybox, but goes back to it's normal size when letting go/placing in the toybox. This happens both on mobile and PC. I have two more but are yet to be able to consistently reproduce the problem. Both are only on PC in Edge and Firefox though, while I can't trigger either at all on mobile. The first is sometimes when creating more then one character it can lead to the below Syntaxerror which results in a crash. The error message is always the same. The second is when creating a new character sometimes all of the images will disappear, where refreshing the page is required to fix it. There's nothing unexpected in the logs when this happens. |
Perfect, so it should be included in the docs to still use Bullseye, until we can figure out what to change for the USB setup.
Yes, I have seen it already, though I am still unsure on how to fix this, as the draggable element will take the parent size. As I said, I am also not a frontend pro, but I'll check if I can fix this.
After a quick inspection, my best guess: This error could actually happen without the new frontend as well. The problem here is that the
I have not encountered this before, but I'll try to reproduce & fix it. If you manage to trigger this bug again, could you check if the browser console logs anything? |
|
After some experimenting, this should fix the huge toybox items, though I am pretty sure my CSS and DOM structure can still be further improved ... |
I'll try and see if I can get your build working in a Trixie VM, as well as also seek to source a splitter cable as a way to try and further narrow down if it is a hardware/power issue.
Yeah that's a good point. The original frontend doesn't allow for creating more then one tag at a time, so it could be a holdover issue that has just never surfaced until now. Probably as you continue to tweak things and add stuff like this to a list, said list will continue to get longer and longer, eventually justifying a greater need to do some more major changes to the banckend as well.
I managed to capture the browser console logs when the problem happened. There's very much something there that should hopefully be enough for you to work with. |
|
Hey @aurarius1 I was thinking more about power... do you also have a Pi 4(B) or just a Zero W? I know the 4 can be powered using the GPIO pins, as while that comes with it's own set of complications, I can't help thinking it would still be a more ideal way then using a Y splitter cable that who knows what the quality of it may be like, where I am not sure if we could trust whatever result we would get when using one. |
|
Thanks for the log, I'll try and trace the bug. Regarding the power splitter: yes I do have a Pi 4B, but even if you used the GPIO Pins to power the Pi you would still need to have a power blocker, to protect your console/pc from backfeed. I can test this soon, since I should have a power blocker somewhere, although at the moment I suspect it's how the creation of the usb gadget is done, since newer guides I found seem to differ a bit - but I still need to read more into it, I have never dealt with this on a Pi before! |
I'll leave this one to you then, as I don't the required hardware and would have to purchase it which would be a bit of a waste as I don't think I would use it ever again. 😄 |
|
I just wanted to give a quick update: I think I found the issue with the "vanishing" frontend. It is most likely also related to the asynchronous file writing in the backend. I will add proper redirections to error pages, such that the frontend won't disappear due to this. I think the backend should not be touched by this pull request, but those issues should be fixed afterwards as well. I'll test a bit with the error page, etc., before pushing the code! |
|
Please note, there has been lots of code cleanup in #326. |
|
Thanks for the heads up. Sorry that it is taking so long to push the error handling stuff, I really couldn't test it yet, life is busy atm. |
|
I got distracted/busy with other things as well and haven't touched anything for a while. Decided to buy a Zero 2 to use exclusive for this project as I wanted to use my 4 for Steam Link, which was difficult given how many times I have been re-flashing the OS. Trixie and Bookworm are still busted (as noted in #325) but that's no surprise, given that some time has passed I wanted to refresh myself on where things were. I've spent a lot of hours recently trying (and failing) to get legacy GPU drivers working in Debian 13, which got me to think that if it's the USB gadget side that is failing then it's probably because whatever drivers and libraries the project was originally used aren't supported in newer kernel versions. Given that this was meant to be for your purely frontend work @aurarius1 and it's kinda my fault for opening a can of can of worms and getting thigs off track. I agree it's best for you to just focus on just the frontend stuff which is what you already started, as the rest really needs to get collated and split off into its own thing. |
# Conflicts: # server/index.html # server/scripts/main.js # server/stylesheets/main.css
|
I just merged everything back into the frontend branch and will test everything next week. After that it should be done! Sorry for taking so long, a lot is going on rn. |
|
From what I've seen so far, everything still works except the issues with creating tokens. Is it okay if i change the methods to edit the toytags.json synchronously? Also, what I just noticed, if the game writes update commands to a vehicle tag (tested when creating the Batmobile for the first time), the tags will have N/A stored as the name in the toytags.json, which also happens with the original frontend. However, the original frontend doesn't rely on the name stored in toytags.json, mine does. I found that the EDIT: just saw with the original frontend, names with N/A are filtered out on a page refresh. This might also be the reason for #280 |
|
Instead of further relying on toytags.json, the project could also implement a sqlite database for created toytags. However, if this is the way to go, refactoring this should definitely be a new PR. |
|
Thanks for looking into it. You can include the json fixes here too. |
|
I've played the first level with the changes, seems to work fine for me. However, somebody else should test this as well. I did not add the batch creation route, but the file reads are now synchronous. |

As said in #295 here the draft request for the frontend updates.
I did include a revised version of the Dockerfile and tested building an image with it for the Pi Zero (then copied it on the Pi Zero, since building on it directly will not work anymore due to the issues with the updated frontend I already outlined in the discussions). The resulting image is less than half in size. Nevertheless since raspberrypi.com suggests using a 16GB SD Card for Raspberry Pi OS Lite I updated the requirements a little bit, to ensure it works smoothly for everybody (since technically we cannot do much if the remaining storage is too low for the image to run).
I also included the PSA that docker dropped support for the Pi Zero.
This is opened as a draft, because it might still need some work and I think it is easier to checkout a pull request than fork a different repo.