Basically I have rewritten the whole preview script (it was a bit hard to follow). Now it does less things, and parameters should not be updated on reload.
In general it works fine 👏
Just a couple of thing I noticed:
if you open the url without query string like localhost:xxx/fragment-preview the fragment type is selected but you cannot choose any, you have to switch to page templates and back to fragments.
When changing from fragments to page template and the user doesn't have page template the fragment is kept rendered
Basically I have rewritten the whole preview script (it was a bit hard to follow). Now it does less things, and parameters should not be updated on reload.