Closed vanderhoop closed 6 months ago
Closing, as this appears to be an issue only in liveviews, and not something related to phoenix_live_reload. 👈 Correction: this appears to also be an issue in deadviews
That’s because changing .ex files cause a full request in order to recompile. Changing CSS only reloads assets instead. There was a discussion about supporting partial reloads for .heex templates but it comes with pitfalls.
@josevalim given the full reload, I think the proposal above makes sense and would provide value. Cool if I reopen?
I'd be happy to take on the work.
I'm actually not confident that my issue would be fixed by this proposal, as liveview itself does some non-trivial scroll position changes...
I'm actually not confident that my issue would be fixed by this proposal, as liveview itself does some non-trivial scroll position changes...
Disregard. The scroll changes in liveview only occur after patches, and won't conflict with the changes in #145
Use case: updating UI code for components that exist far down a page.
Problem: At the moment, lightly tweaking a heex component or
.heex
file (consider the frequent task of adding/removing tailwind classes during UI work) results in a full page refresh on every save, but the scroll position is lost with each refresh. This necessitates manual scroll restoration (and a loss of flow) for the developer when they are working on components below the fold.Proposal: expose an optional config,
:scroll_restoration
, which, if true, results in the scroll position being restored on refresh.