fix(live-state): eliminate flash on poll by switching to innerHTML swap
outerHTML removes and re-inserts the section on each tick, causing a blank frame. Keeping the <section> as a stable DOM container and swapping only innerHTML means avatars and text update in-place without any teardown/reconstruct cycle. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
096d18ac64
commit
175e4e653c
2 changed files with 59 additions and 64 deletions
|
|
@ -1,7 +1,3 @@
|
||||||
<section class="panel live-state"
|
|
||||||
hx-get="/servers/{{ server.id }}/live-state"
|
|
||||||
hx-trigger="every {{ poll_seconds }}s"
|
|
||||||
hx-swap="outerHTML">
|
|
||||||
<h2 class="section-title">Live state</h2>
|
<h2 class="section-title">Live state</h2>
|
||||||
{% if not snapshot or not snapshot_fresh %}
|
{% if not snapshot or not snapshot_fresh %}
|
||||||
<p class="muted">No data — server is not currently reporting.</p>
|
<p class="muted">No data — server is not currently reporting.</p>
|
||||||
|
|
@ -62,4 +58,3 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</section>
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
<section class="panel live-state"
|
<section class="panel live-state"
|
||||||
hx-get="/servers/{{ server.id }}/live-state"
|
hx-get="/servers/{{ server.id }}/live-state"
|
||||||
hx-trigger="load, every 5s"
|
hx-trigger="load, every 5s"
|
||||||
hx-swap="outerHTML">
|
hx-swap="innerHTML">
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<h2 class="section-title">Files</h2>
|
<h2 class="section-title">Files</h2>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue