From a47c72ce848ad24a6248f97d35a405556d59b069 Mon Sep 17 00:00:00 2001 From: hobostay <110hqc@gmail.com> Date: Tue, 3 Mar 2026 21:23:27 +0800 Subject: [PATCH] fix(actions): remove debug console.log statements Remove [SCROLL DEBUG] console.log statements that were left over from development in scrollVertically and scrollHorizontally functions. These debug statements should not be in production code. --- packages/page-controller/src/actions.ts | 70 ------------------------- 1 file changed, 70 deletions(-) diff --git a/packages/page-controller/src/actions.ts b/packages/page-controller/src/actions.ts index 0079b96..a8325ca 100644 --- a/packages/page-controller/src/actions.ts +++ b/packages/page-controller/src/actions.ts @@ -181,11 +181,6 @@ export async function scrollVertically( // Element-specific scrolling if element is provided if (element) { const targetElement = element - console.log( - '[SCROLL DEBUG] Starting direct container scroll for element:', - targetElement.tagName - ) - let currentElement = targetElement as HTMLElement | null let scrollSuccess = false let scrolledElement: HTMLElement | null = null @@ -198,19 +193,6 @@ export async function scrollVertically( const hasScrollableY = /(auto|scroll|overlay)/.test(computedStyle.overflowY) const canScrollVertically = currentElement.scrollHeight > currentElement.clientHeight - console.log( - '[SCROLL DEBUG] Checking element:', - currentElement.tagName, - 'hasScrollableY:', - hasScrollableY, - 'canScrollVertically:', - canScrollVertically, - 'scrollHeight:', - currentElement.scrollHeight, - 'clientHeight:', - currentElement.clientHeight - ) - if (hasScrollableY && canScrollVertically) { const beforeScroll = currentElement.scrollTop const maxScroll = currentElement.scrollHeight - currentElement.clientHeight @@ -228,27 +210,10 @@ export async function scrollVertically( const afterScroll = currentElement.scrollTop const actualScrollDelta = afterScroll - beforeScroll - console.log( - '[SCROLL DEBUG] Scroll attempt:', - currentElement.tagName, - 'before:', - beforeScroll, - 'after:', - afterScroll, - 'delta:', - actualScrollDelta - ) - if (Math.abs(actualScrollDelta) > 0.5) { scrollSuccess = true scrolledElement = currentElement scrollDelta = actualScrollDelta - console.log( - '[SCROLL DEBUG] Successfully scrolled container:', - currentElement.tagName, - 'delta:', - actualScrollDelta - ) break } } @@ -344,11 +309,6 @@ export async function scrollHorizontally( // Element-specific scrolling if element is provided if (element) { const targetElement = element - console.log( - '[SCROLL DEBUG] Starting direct container scroll for element:', - targetElement.tagName - ) - let currentElement = targetElement as HTMLElement | null let scrollSuccess = false let scrolledElement: HTMLElement | null = null @@ -361,19 +321,6 @@ export async function scrollHorizontally( const hasScrollableX = /(auto|scroll|overlay)/.test(computedStyle.overflowX) const canScrollHorizontally = currentElement.scrollWidth > currentElement.clientWidth - console.log( - '[SCROLL DEBUG] Checking element:', - currentElement.tagName, - 'hasScrollableX:', - hasScrollableX, - 'canScrollHorizontally:', - canScrollHorizontally, - 'scrollWidth:', - currentElement.scrollWidth, - 'clientWidth:', - currentElement.clientWidth - ) - if (hasScrollableX && canScrollHorizontally) { const beforeScroll = currentElement.scrollLeft const maxScroll = currentElement.scrollWidth - currentElement.clientWidth @@ -391,27 +338,10 @@ export async function scrollHorizontally( const afterScroll = currentElement.scrollLeft const actualScrollDelta = afterScroll - beforeScroll - console.log( - '[SCROLL DEBUG] Scroll attempt:', - currentElement.tagName, - 'before:', - beforeScroll, - 'after:', - afterScroll, - 'delta:', - actualScrollDelta - ) - if (Math.abs(actualScrollDelta) > 0.5) { scrollSuccess = true scrolledElement = currentElement scrollDelta = actualScrollDelta - console.log( - '[SCROLL DEBUG] Successfully scrolled container:', - currentElement.tagName, - 'delta:', - actualScrollDelta - ) break } }