June 19
Hi all, hope you're doing well. Updates below!
Moderation Progress
I've made good progress on Deserted Chateau's moderation system, but there's still quite a bit to do.
Modals
The report details modal, for showing all reports for a given item being reported (such as a user or artwork) is done, though I have only configured it to show artworks so far. I'll need to configure it to show user details and comment details before it's finished.
The "moderator actions" part of the modal, that lets moderators decide which actions to take, is still in a fairly basic form. Modifying artworks is done through the main artwork submission code, and the other functions should be easy in comparison, I just haven't gotten to them yet.
Form Handlers
I've moved the code logic for submitting and editing artworks, along with artwork comments, to backend PHP files that now handle these operations rather than the form files themselves doing it. This was mainly done so that the same code didn't need to be written twice for creating moderator functions, but also since it doesn't make sense for the forms to contain code logic.
Moderators being able to edit artworks is now implemented. All moderator actions on a given resource (for instance, editing a user or modifying a user's artwork) are recorded in a database table; the details of the changes aren't recorded yet, it would be quite difficult to properly do that, but the fact that the moderator made changes is recorded. This is to try and avoid potential confusion in cases where e.g. a user wasn't correctly notified of moderation changes.
Notifications Progress
I've started implementing the notifications details page, and cleaning up the notifications dropdown area in the navigation bar. The SQL stored procedure for getting user notifications has been significantly improved; I had to use some novel ideas to get it to a point where a user's notifications can be returned in groups, but also allow for individual display in the same query.
I'm partway through implementing the visual layout for the notifications; the difficult part of this work is done, now it's a case of designing the HTML templates and accompanying CSS styling to display the notifications returned from the server.
Clientside notification caching
I've made a simple system for caching user notifications client-side, that allows users to decide how long they want them to be cached for (e.g. for those who don't like frequent notifications). It's a small bit of code in the CacheManager class that handles paginated cache entries, e.g. for notifications where each set of results has to be cached separately, and then cleared collectively after the ttl expires.
Gallery SQL and search improvements
I've fixed some errors in the Gallery SQL stored procedure, that was causing it to incorrectly return no results in certain cases. While the procedure currently works well, it is nowhere near the level of search software; I don't expect to get it to that level, but there are some improvements to make in the word matching and other areas.
I'm investigating how to improve the procedure's ability to match lists of terms and so on; MariaDB does have the MATCH keyword, which requires special table indexes to function. It's unclear what the performance cost of this would be at scale (the index cost is not so much a problem, more the query execution time), so I'll need to do some experiments to see if it causes significantly heavier database load.
Another minor improvement is that bookmark galleries now load in the order in which they were bookmarked (i.e. bookmarking an artwork, then going to your bookmarks gallery, will show that artwork first as it was most recently bookmarked).
CSS improvements
I've refactored most of the CSS rules contained in the main.css file into separate files, as it was getting unwieldy (and now that the system for merging CSS files in production is done, there's no need to worry about having lots of separated files).
Backend Script Loading
Fairly recently, I finished refactoring the head HTML sections into different pages, so that they were easier to maintain. I've further improved how the backend adds the main required scripts to each page, by having the necessary URLs (relative to the root static assets path) and version strings in a database table, caching those values in Redis, and getting the necessary scripts to load from there.
This is a lot easier to configure, as it'll make it possible to upgrade versions of libraries or scripts (e.g. jQuery, lodash and so on) by changing a database value and clearing the cached copy in Redis, instead of having to change the codebase.
Artwork Comments
Artwork comments now have edit and delete buttons next to them, that the author of the comment can make use of. The owner of an artwork sees a "hide" button, that allows them to hide comments they do not want displayed next to their artwork.
This is the current appearance of the details area of an artwork page. Artwork owners see the hide button (represented by the eye-slash icon), and comment owners see edit and delete buttons.
Gallery Buttons: download button added
Due to how Deserted Chateau's galleries are coded in the frontend, right clicking on images doesn't come with the usual save image menu (since technically the user is clicking on a link element). I've added a download button to the feed controls, so that users looking to e.g. download a thumbnail for reference purposes can do so easily. Example below:
I need to make a few extra changes to make this work for artworks with more than one image or video attached, so that the download button uses the current media link, but that shouldn't be difficult.
Profile picture and banner improvements
Users can now delete profile pictures or banners they have uploaded, reverting to the default. The default profile picture and banner image have been changed to be simple CSS backgrounds (the profile picture has an icon inside), so that they display well on all themes.
User Safety Settings
I've added a new settings page, Safety, which allows users to manage who they have blocked/muted/hidden. It's still in progress, but the functionality for it to work is mostly done. The remaining bits to do here are polishing up the styling, adding tooltip explanations, and maybe some other appearance-related stuff.
It's possible some navigation settings should be moved into the Safety settings, but I'll need to think on that a bit to ensure the pages are clearly laid out.
Open Source preparation
I decided on a license for Deserted Chateau's codebase: the GNU AGPL v3.0 license. It's a strong copyleft license, i.e. it can be used by others, and modifications can be made by others (e.g. to make their own versions of it), but only if the source code of those new versions is available under the same license.
This allows Deserted Chateau to be transparent, to allow its source code to be used for other art site projects if they choose to do so, and ensures that any other projects derived from Deserted Chateau's codebase would have to be transparent as well. I'll probably release the public code repository once the website is live, or a little before that, basically once I'm happy that most of the refactoring work is done.
Misc
Bug Fixes
- Fixed a major bug that was causing artwork files to be deleted from S3 when editing an artwork (I inadvertently messed up the order of some code logic when refactoring the artwork submission form a while back, finally pinpointed the cause).
- Fixed a bug causing artworks to move from the top to the center of the page in the artwork details page on initial load, making for a slightly janky appearance.
- Fixed a bug in the gallery feed style display, that was causing videos not to work properly with the left and right arrows on artworks that have multiple images/videos in them.
Minor Improvements / Changes
- Modified the httpd configuration to have neater URLs for the moderation pages.
- The artwork submission page now shows "Edit Artwork" as its title when editing an existing submission.