mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-10-23 20:12:29 +00:00
Refactor wakeCanvasEngine and add test seams
Refactor wakeCanvasEngine function and expose internal state for testing.
This commit is contained in:
1 parent
e70e1543f9
commit
fa4817ee46
1 file changed
+11
-3
+11
-3
@@ -675,7 +675,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
window._wakeCanvasEngine = function() {
|
||||
function wakeCanvasEngine() {
|
||||
if (!isAnimating && activeAnimations.length > 0) {
|
||||
const isPaused = VCR.mode === 'PAUSED' || VCR.speed === 0;
|
||||
if (!isPaused) {
|
||||
@@ -683,7 +683,7 @@
|
||||
requestAnimationFrame(renderAnimations);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function vcrFormatTime(tsMs) {
|
||||
const d = new Date(tsMs);
|
||||
@@ -746,7 +746,7 @@
|
||||
updateVCRLcd();
|
||||
|
||||
// WAKE THE ENGINE: If we unpaused or changed speed above 0, kickstart the canvas
|
||||
if (window._wakeCanvasEngine) window._wakeCanvasEngine();
|
||||
wakeCanvasEngine();
|
||||
}
|
||||
|
||||
function dbPacketToLive(pkt) {
|
||||
@@ -2706,6 +2706,14 @@
|
||||
};
|
||||
window._liveRebuildFeedList = function() { return rebuildFeedList(); };
|
||||
|
||||
// PR #1490 test seams: Expose internal state for Playwright assertions
|
||||
window._liveDrawAnimatedLine = drawAnimatedLine;
|
||||
window._liveTestSeams = {
|
||||
getAnimCount: () => activeAnimations.length,
|
||||
isAnimating: () => isAnimating,
|
||||
getPathCount: () => (typeof recentPaths !== 'undefined' ? recentPaths.length : 0)
|
||||
};
|
||||
|
||||
async function replayRecent() {
|
||||
try {
|
||||
// Single bulk fetch with expand=observations — no N+1 calls
|
||||
|
||||
Reference in new issue
Block a user