diff --git a/.claude/skills/critique/scripts/detect-antipatterns-browser.js b/.claude/skills/critique/scripts/detect-antipatterns-browser.js index 5255bdc6c..6c6e7794b 100644 --- a/.claude/skills/critique/scripts/detect-antipatterns-browser.js +++ b/.claude/skills/critique/scripts/detect-antipatterns-browser.js @@ -1301,6 +1301,19 @@ if (IS_BROWSER) { } }, { rootMargin: '99999px' }); + // Reposition overlays after CSS transitions end (e.g. reveal animations). + // Listens at document level so it catches transitions on ancestor elements + // (the transform may be on a parent, not the flagged element itself). + document.addEventListener('transitionend', (e) => { + if (e.propertyName !== 'transform') return; + for (const o of overlays) { + if (!o._targetEl || o.classList.contains('impeccable-banner') || o.style.display === 'none') continue; + if (e.target === o._targetEl || e.target.contains(o._targetEl)) { + positionOverlay(o); + } + } + }); + const highlight = function(el, findings) { const fixed = isInFixedContext(el); const rect = el.getBoundingClientRect(); diff --git a/source/skills/critique/scripts/detect-antipatterns.mjs b/source/skills/critique/scripts/detect-antipatterns.mjs index 3907f7ac7..a5385cd66 100644 --- a/source/skills/critique/scripts/detect-antipatterns.mjs +++ b/source/skills/critique/scripts/detect-antipatterns.mjs @@ -1299,6 +1299,19 @@ if (IS_BROWSER) { } }, { rootMargin: '99999px' }); + // Reposition overlays after CSS transitions end (e.g. reveal animations). + // Listens at document level so it catches transitions on ancestor elements + // (the transform may be on a parent, not the flagged element itself). + document.addEventListener('transitionend', (e) => { + if (e.propertyName !== 'transform') return; + for (const o of overlays) { + if (!o._targetEl || o.classList.contains('impeccable-banner') || o.style.display === 'none') continue; + if (e.target === o._targetEl || e.target.contains(o._targetEl)) { + positionOverlay(o); + } + } + }); + const highlight = function(el, findings) { const fixed = isInFixedContext(el); const rect = el.getBoundingClientRect();