Spaces:
Runtime error
Runtime error
Commit ·
34563f9
1
Parent(s): 6b41a13
feat(web): memory-type toggle (3 persona memories) in errand replay
Browse filesCo-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
proteus/web/local/static/index.html
CHANGED
|
@@ -86,6 +86,7 @@
|
|
| 86 |
<div id="memReplay" class="hidden" style="padding:6px 0">
|
| 87 |
<div style="margin-bottom:6px">
|
| 88 |
<span style="color:var(--fg)">memory replay</span>
|
|
|
|
| 89 |
<button id="memReplayPrev" type="button">◀ prev</button>
|
| 90 |
<button id="memReplayNext" type="button">next ▶</button>
|
| 91 |
<button id="memReplayPlay" type="button">▶ play</button>
|
|
@@ -310,7 +311,27 @@ function showMem(m) {
|
|
| 310 |
`memory shown at handover — source: ${m.source}`
|
| 311 |
+ `${m.persona ? " (persona " + m.persona + ")" : ""} · ${m.turns} turns`
|
| 312 |
+ " · blue = other agents, light = you, mouth-block = predator";
|
| 313 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 314 |
$("memReplayPlay").textContent = "▶ play";
|
| 315 |
const rep = $("memReplay");
|
| 316 |
if (MEM_FRAMES.length) { rep.classList.remove("hidden"); renderMemFrame(); }
|
|
|
|
| 86 |
<div id="memReplay" class="hidden" style="padding:6px 0">
|
| 87 |
<div style="margin-bottom:6px">
|
| 88 |
<span style="color:var(--fg)">memory replay</span>
|
| 89 |
+
<span id="memTypeToggle" class="toggle" style="margin-right:8px"></span>
|
| 90 |
<button id="memReplayPrev" type="button">◀ prev</button>
|
| 91 |
<button id="memReplayNext" type="button">next ▶</button>
|
| 92 |
<button id="memReplayPlay" type="button">▶ play</button>
|
|
|
|
| 311 |
`memory shown at handover — source: ${m.source}`
|
| 312 |
+ `${m.persona ? " (persona " + m.persona + ")" : ""} · ${m.turns} turns`
|
| 313 |
+ " · blue = other agents, light = you, mouth-block = predator";
|
| 314 |
+
// errand: 3 selectable memory types
|
| 315 |
+
const tog = $("memTypeToggle");
|
| 316 |
+
tog.innerHTML = "";
|
| 317 |
+
if (m.variants && m.variants.length) {
|
| 318 |
+
m.variants.forEach(v => {
|
| 319 |
+
const b = document.createElement("button");
|
| 320 |
+
b.type = "button"; b.textContent = v.label; b.dataset.id = v.id;
|
| 321 |
+
b.className = (v.id === m.selected) ? "active" : "";
|
| 322 |
+
b.addEventListener("click", () => {
|
| 323 |
+
tog.querySelectorAll("button").forEach(x => x.classList.toggle("active", x === b));
|
| 324 |
+
MEM_FRAMES = v.frames || []; MEM_I = 0; MEM_PLAY = false;
|
| 325 |
+
$("memReplayPlay").textContent = "▶ play"; renderMemFrame();
|
| 326 |
+
});
|
| 327 |
+
tog.appendChild(b);
|
| 328 |
+
});
|
| 329 |
+
const sel = m.variants.find(v => v.id === m.selected) || m.variants[0];
|
| 330 |
+
MEM_FRAMES = sel.frames || [];
|
| 331 |
+
} else {
|
| 332 |
+
MEM_FRAMES = (m && m.frames) || [];
|
| 333 |
+
}
|
| 334 |
+
MEM_I = 0; MEM_PLAY = false;
|
| 335 |
$("memReplayPlay").textContent = "▶ play";
|
| 336 |
const rep = $("memReplay");
|
| 337 |
if (MEM_FRAMES.length) { rep.classList.remove("hidden"); renderMemFrame(); }
|