SamuKata
Touhou-Project.com
Touhou-Project.com

patreon


Spring Cleaning

I’ve been doing a bit of everything as of late and don’t have a unified theme for this entry. As is the nature of miscellanea, not much of it is interesting on its own. So I’m going to cherry pick a few things so that this doesn’t become too dry a read.

There is now a setting that lets threads auto refresh

It’s in the settings menu and as you might imagine it pulls new posts into a thread every couple of minutes and adds them to the bottom. There’s a red line to show which posts are new and mousing over the last thread marks them as ‘read’.  

A lot of refactoring and expansion

The quest to make code easier to understand, more portable and modular continues. Quite a bit of the javascript was worked over: more functions were added to reduce repeated code, some features integrated with newer features (like the auto refresh), and more corner cases for different options were added. Quite a lot of the basic things were impacted and all for the better. See the following picture for a few random commits in that vein:

Bugs, of course

Part of the benefit of looking over code and optimizing is that I also took care of quite a few bugs. For example, the watched threads functionality is now even cleaner, updates regularly across multiple tabs and plays nice with other features and configurations. Backlinks also got smarter and now take into account multiple quotes in a single post.

Library updates

Some of the external libraries used by PHP and the javascript were updated to their latest versions. It was pretty uneventful. I didn’t have to change existing code as sometimes is the case.

Removing clutter and improving organization

This one is related to the refactoring. I moved around some files in the directory tree and consolidated much of the code related to asynchronous requests. Quick explanation of that gobbledygook: the most obvious use is whenever you hover over a link to a post and that post pops up, it’s an asynchronous request that provides parameters to a file, which runs queries and formats a response before the javascript spits it out.  There’s several other for other things (including a new one for the auto refresh of threads) and those were all over the place. I simplified legacy code in some places and have these files all in one directory now.  

More archive stuff

I’m nowhere near done with the story archive. I’ve made a few changes to the storylist page itself, simplifying the statuses of stories. Now stories are considered abandoned if they haven’t been updated in over a year, stalled if it’s been a few months and active anything below that. I did have to do a few manual interventions to get some story statuses correct but by the most part it was a smooth process. I wish to automate more and tie it in with other site features in the future, so this is very much a work-in-progress.

Out with the old

Nearly every board had its total number of pages reduced by one. There’s just so many old and otherwise dead threads that are pointless to have around on the live site instead of in the archives. I am considering reducing the pages even more but haven’t made a final decision on that. It frees resources (such as image storage) and also makes pages generate faster whenever a post is made. If I’m honest, this was also motivated by a desire to test some of the newer archiving features (see previous two tech entries) on the live site. It takes forever for stories to get bumped off, so I just sped it up a bit. The results were that I did get some useful data and quashed some bugs in specific circumstances (/shrine/ in particular was being difficult when it came to archiving threads).

And the rest...

I had originally planned to add a few more features and do more work before pushing these changes to the live site and writing up another post. I decided to jump the gun a little as it might have been a little too hard to test everything if the scope just kept increasing.  

Here’s a few objectives I have for the rest of the month and how likely it is for me to actually finish them. (ordered from most to least likely):

1) Overhaul the settings menu with categories and better descriptions of what each setting does.

2) Refactor some of the mobile-specific code and add a few minor bells and whistles.

3) Add a few medium-sized features to the mobile code, including a mobile-specific settings menu.

4) Continue to expand story archiving. In particular continue making it easier to add and manipulate data like relationships to other stories and between threads.

I do have other things I’ve been planning out and prototyping but I’ve come to the conclusion that it’s best if all that takes a back seat. There’s a lot of small things I want to do, especially with the archives, that it makes sense only to commit to a final design once I have everything else out of the way.  

Well, hope that was at least somewhat insightful and useful to read. Let me know if there’s anything else you’d like to know. Otherwise, until next time, take it easy!


More Creators