sidequest icon indicating copy to clipboard operation
sidequest copied to clipboard

[Bug] Dashboard is loaded without CSS when tab is restored

Open frederikheld opened this issue 8 months ago • 5 comments

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.

frederikheld avatar Mar 11 '26 12:03 frederikheld

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.

frederikheld avatar Mar 11 '26 12:03 frederikheld

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.

GiovaniGuizzo avatar Mar 11 '26 13:03 GiovaniGuizzo

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).

GiovaniGuizzo avatar Mar 11 '26 13:03 GiovaniGuizzo

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.

frederikheld avatar Mar 11 '26 16:03 frederikheld

:tada: This issue has been resolved in version 1.14.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

sidequest-release[bot] avatar Mar 12 '26 12:03 sidequest-release[bot]