fix: resolve stale session, ref resolution and cursor-ref collision bugs (#427)

This commit is contained in:
Chris Tate
2026-02-12 17:32:58 -06:00
committed by GitHub
parent b3b9fccd72
commit 221d22c14f
6 changed files with 277 additions and 5 deletions
+10 -1
View File
@@ -204,7 +204,16 @@ async function findCursorInteractiveElements(
}
path.unshift(sel);
current = current.parentElement;
if (path.length >= 3) break;
// Stop once the selector uniquely identifies the element (max 10 levels)
if (path.length >= 1) {
try {
const candidate = path.join(' > ');
if (document.querySelectorAll(candidate).length === 1) break;
} catch (e) {
// If selector is invalid, keep building
}
}
if (path.length >= 10) break;
}
return path.join(' > ');
};