Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

fix(circuitjs): retain measurements when reopening Scope Lab (#229)

Dee34d3094a3ec1
diff --git a/store/agents/circuitjs/README.md b/store/agents/circuitjs/README.md
index 7ee898c41..f7ce3ab30 100644
--- a/store/agents/circuitjs/README.md
+++ b/store/agents/circuitjs/README.md
@@ -24,6 +24,8 @@ export, the capture instance's export, timestamped CSV/JSON measurements, a stan
your notes, runtime fingerprints, checksums and a ZIP. Reopen it from **Your captures**, including
after a restart or after removing the original circuit. Unsaved takes stay in this tab; keep or
discard them before closing. Arrow keys move the active cursor; Enter switches A/B.
+Within this tab, reopening Scope Lab or keeping the current capture preserves its cursors and zoom.
+Choosing a different capture starts a fresh measurement view.
The capture is a new simulation of an exported circuit, not a full checkpoint of the running
solver. It uses a fresh time origin and faster display pacing; imported internal state can produce
diff --git a/store/agents/circuitjs/lab/ui.mjs b/store/agents/circuitjs/lab/ui.mjs
index a367534a4..b26362745 100644
--- a/store/agents/circuitjs/lab/ui.mjs
+++ b/store/agents/circuitjs/lab/ui.mjs
@@ -267,10 +267,12 @@ export async function initScopeLab({ getSim, getSourceFile }) {
return takes.get(id)
}
function showTake(take) {
+ if (selected !== take.id) {
+ cursors = {}
+ viewWindow = null
+ }
selected = take.id
activeDraft = null
- cursors = {}
- viewWindow = null
if (reference === selected) reference = null
$('slTitle').value = take.title
$('slNote').value = take.note || ''