[Bug] Dashboard is loaded without CSS when tab is restored
When restoring the browser tab that shows the dashboard (e.g. through Ctrl + Shift + T or after the tab was paused due to inactivity), the page is loaded without CSS.
This happens in Firefox as well as in Cromium.
This can easily be reproduced: close a tab, then restore it (see above).
This appears to be a known issue with htmx: https://github.com/bigskysoftware/htmx/issues/497. You can set Cache-Control: no-store, max-age=0 to mitigate the issue, but I wouldn't call this a fix.
Digging into this: history management does not just have some bugs but seems to be a major design flaw of htmx.
Against all promises, a next major version of htmx is announced and it will completely change the approach to history management. It will change a lot of things as well though, so a rewrite of the dashboard might be inevitable at some point.
So maybe this would be a great opportunity to switch to an actual frontend framework. Big Sky Software's claim is "we find hot new trends in the industry & then build the opposite of that". This sounds like a really stubborn approach to software development and it shows in all the many quirks of htmx that you have to work around yourself. I wouldn't say that each new trend should be followed, but there are a couple of battle proven frontend frameworks out there that have already found simple solutions to the complex problems of the modern web.
Nice find. Thanks! For now we will only fix it with the provided solution. For the Dashboard to work with a different framework, it would require extensive redesign of APIs and other resources.
I will try to fix this today with a middleware.
As a side note: if we were to start again, I don't think we would use EJS + HTMX. HTMX has proven to be a huge pain. Maybe only EJS (it's pretty neat actually).
IMHO the best approach to frontend and backend still is a properly designed REST API. It requires some more work, but it is also way more flexible which is what you need in the long run.
I've seen many frameworks that tightly integrate frontend and backend (e.g. Laravel and Nuxt) and although they seem to be the efficient choice in the beginning, they all have their limitations that make them cumbersome to work with in the long run.
:tada: This issue has been resolved in version 1.14.1 :tada:
The release is available on:
v1.14.1- GitHub release
Your semantic-release bot :package::rocket: