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:
@@ -2,7 +2,7 @@
|
|||||||
<h1>Ecosystem</h1>
|
<h1>Ecosystem</h1>
|
||||||
<p class=hint>The sibling services Maven coordinates — read-only. Identity, attention, capabilities. Enabling & execution live on the authed surfaces, never here.</p>
|
<p class=hint>The sibling services Maven coordinates — read-only. Identity, attention, capabilities. Enabling & execution live on the authed surfaces, never here.</p>
|
||||||
|
|
||||||
<section class=card>
|
<section class=card id=eco-nexus>
|
||||||
<div class=section-header>
|
<div class=section-header>
|
||||||
<h2>Nexus <span class=card-sub>identity</span></h2>
|
<h2>Nexus <span class=card-sub>identity</span></h2>
|
||||||
</div>
|
</div>
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
{{end}}
|
{{end}}
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class=card>
|
<section class=card id=eco-praxis>
|
||||||
<div class=section-header>
|
<div class=section-header>
|
||||||
<h2>Praxis <span class=card-sub>attention</span></h2>
|
<h2>Praxis <span class=card-sub>attention</span></h2>
|
||||||
</div>
|
</div>
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
{{end}}
|
{{end}}
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class=card>
|
<section class=card id=eco-hexis>
|
||||||
<div class=section-header>
|
<div class=section-header>
|
||||||
<h2>Hexis <span class=card-sub>capabilities</span></h2>
|
<h2>Hexis <span class=card-sub>capabilities</span></h2>
|
||||||
</div>
|
</div>
|
||||||
@@ -45,10 +45,10 @@
|
|||||||
<script>
|
<script>
|
||||||
setInterval(() => fetch('/ecosystem').then(r => r.text()).then(html => {
|
setInterval(() => fetch('/ecosystem').then(r => r.text()).then(html => {
|
||||||
const d = new DOMParser().parseFromString(html, 'text/html');
|
const d = new DOMParser().parseFromString(html, 'text/html');
|
||||||
document.querySelectorAll('main.content section.card').forEach((old, i) => {
|
for (const id of ['eco-nexus', 'eco-praxis', 'eco-hexis']) {
|
||||||
const nu = d.querySelectorAll('main.content section.card')[i];
|
const old = document.getElementById(id), nu = d.getElementById(id);
|
||||||
if (nu) old.replaceWith(nu);
|
if (old && nu) old.replaceWith(nu);
|
||||||
});
|
}
|
||||||
}), 15000);
|
}), 15000);
|
||||||
</script>
|
</script>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user