fix(mavweb): stable panel refresh on /ecosystem

The auto-refresh replaced cards by index while mutating the parsed
document — each replaceWith detached a card from the fetched doc,
shifting the remaining indices, so Praxis got dropped and Hexis
rendered twice after the first tick. Give the three sections stable
ids and replace by getElementById (dash.html's proven pattern).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
kami
2026-07-19 22:12:07 +04:00
parent 5fe8f228c1
commit 1d0cdebd20
+7 -7
View File
@@ -2,7 +2,7 @@
<h1>Ecosystem</h1>
<p class=hint>The sibling services Maven coordinates — read-only. Identity, attention, capabilities. Enabling &amp; execution live on the authed surfaces, never here.</p>
<section class=card>
<section class=card id=eco-nexus>
<div class=section-header>
<h2>Nexus <span class=card-sub>identity</span></h2>
</div>
@@ -15,7 +15,7 @@
{{end}}
</section>
<section class=card>
<section class=card id=eco-praxis>
<div class=section-header>
<h2>Praxis <span class=card-sub>attention</span></h2>
</div>
@@ -28,7 +28,7 @@
{{end}}
</section>
<section class=card>
<section class=card id=eco-hexis>
<div class=section-header>
<h2>Hexis <span class=card-sub>capabilities</span></h2>
</div>
@@ -45,10 +45,10 @@
<script>
setInterval(() => fetch('/ecosystem').then(r => r.text()).then(html => {
const d = new DOMParser().parseFromString(html, 'text/html');
document.querySelectorAll('main.content section.card').forEach((old, i) => {
const nu = d.querySelectorAll('main.content section.card')[i];
if (nu) old.replaceWith(nu);
});
for (const id of ['eco-nexus', 'eco-praxis', 'eco-hexis']) {
const old = document.getElementById(id), nu = d.getElementById(id);
if (old && nu) old.replaceWith(nu);
}
}), 15000);
</script>
</html>