I’ve been grinding away at the query page/sidebar functionality for the past few days. I kept running up against issues of the ItemList
component. After attempting to tackle refactoring of this component from multiple angles (including an abandoned PR), I gave up and decided to try re-creating the SceneList
component without using ItemList
at all. First, this allowed me to then be able to modify the scene list functionality without it impacting on all of the other list components that use ItemList
. Secondly, it gave me the opportunity to convert a lot of the business logic in the item list component into separate, reusable hooks. After a bit of work, I got this PR ready to go. This allowed me to rebase my existing sidebar work on top of it and made it much easier to work with.
I suspect there may be some bugs left in the PR. On my sidebar branch I just now discovered that the zoom bar appears to have disappeared, and I previously had to re-add the filter tags back - whoops.
Based on @echo6ix’s suggestion, I changed the sidebar toggle to show on the left side of the screen, and I think it works well. I also moved the edit filter and search field into the sidebar.
Most of the remaining work has been wrestling the styling into something that’s not horrible to work with. I found with regular use that the sidebar scrolling with the content wasn’t going to work. Once you scrolled down the content, you’d be left with empty space on the left. After a great deal of trial and error, I eventually settled on a fixed position for the sidebar. On large screens (width >= 1200px), the sidebar sits alongside the content, whereas on smaller screens it overlaps the content. On mobile viewports, the sidebar now uses the entire width.
After that I spend a chunk of time implementing the rating and organised sidebar filter options. Satisfied, I thought it was ready for external testing (subject to the aforementioned PR being merged). And then I went to a Performer details page.
The layout was completely broken. Switching the position to fixed meant that the sidebar overlapped the performer page and it was just a mess. So then it was another couple of hours re-styling the sidebar in the details pages. I ended up using sticky positioning for those pages, which in turn completely broke things on mobile viewports. I think it’s fairly good now, but as I play with it now I realise there’s more wrinkles to iron out.
Have I mentioned how much I hate css (and UI dev in general really)?
Login page improvements
A frequent annoyance I’ve had using stash has been pressing back after logging in from an expired session. Instead of returning to whatever page I was on before my session expired, it would return to the login page. I believe I’ve finally fixed this by changing the login handler to just return a success or error code and not redirect. This meant changing the login html page to perform the redirection itself, which meant it could replace the current URL. This fix is now live on the develop branch.
Also in the pipeline is login page internationalisation. I wanted it to use our existing locale files so that we could use weblate to perform the localisation. This meant making a script to extract the login strings from the UI locale files, and write them into a separate locale files for the login page. I also added a handler to serve the applicable locale file based on the configured language.
I couldn’t use the existing locale files as these are packaged into the UI payload. I also didn’t want to move the login stuff into the main UI since it exposes too much information. I wanted to keep the login page as simple as possible.
Stash-box rate limiting
It was brought to my attention recently that identify tasks were causing stash-box endpoints to be hit by very frequent requests. Rate limiting these requests has been on my mind for a while, but hearing that admins had to make changes because of it kind of gave me the impetus to finally do something about it. There’s now a pending PR that allows configuring stash-box endpoints with a maximum requests per minute setting. This is currently defaulted to 240 requests per minute, which should be plenty.
I plan to do a similar change for scrapers as it has a similar issue. It’s a bit of a different change, so it wasn’t something I wanted to do at the same time as the stash-box change.