Hotwire Discussion

`data-turbo-permanent` not working as expected (or maybe at all)?

I’m using data-turbo-action = "advance" in an app with a sidebar → detail layout, so that the URL updates to something real as users traverse objects. In my sidebar, I’m doing various things that I’d like to persist—like adding a class to selected rows and writing data attributes.

I’ve marked the parent sidebar element as data-turbo-permanent, but the entire page gets torn down and repainted with every click. New data loads into the detail frame (which is good), but the ‘dirty’ state of the sidebar is lost. What am I missing? Am I misunderstanding what data-turbo-permanent is for?

I’m calling it like so:

<sidebar id="object-sidebar" class="inset-2-columns__sidebar" data-turbo-permanent>
  <%= render "objects" %>
</sidebar>

data-turbo-permanent applies for cache restoration visits, not standard navigation visits.