From 32f51ae739679789585182ba659ec5f1168d652d Mon Sep 17 00:00:00 2001 From: Thomas Hallock Date: Wed, 5 Nov 2025 08:41:59 -0600 Subject: [PATCH] refactor: remove debug console.log statements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clean up debugging output from production code: - Remove bead click analysis logging from InteractiveAbacus - Remove sessionStorage operation logging from HomeHeroContext These were useful during development but should not be in production. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- apps/web/src/components/InteractiveAbacus.tsx | 33 ------------------- apps/web/src/contexts/HomeHeroContext.tsx | 21 ------------ 2 files changed, 54 deletions(-) diff --git a/apps/web/src/components/InteractiveAbacus.tsx b/apps/web/src/components/InteractiveAbacus.tsx index 14d37d12..91451f58 100644 --- a/apps/web/src/components/InteractiveAbacus.tsx +++ b/apps/web/src/components/InteractiveAbacus.tsx @@ -66,32 +66,6 @@ export function InteractiveAbacus({ const beadPosition = beadElement.getAttribute('data-bead-position') const isActive = beadElement.getAttribute('data-bead-active') === '1' - console.log('Bead clicked:', { - beadType, - beadColumn, - beadPosition, - isActive, - }) - console.log('Current value before click:', currentValue) - - if (beadType === 'earth') { - const position = parseInt(beadPosition || '0', 10) - const placeValue = beadColumn - const columnPower = 10 ** placeValue - const currentDigit = Math.floor(currentValue / columnPower) % 10 - const heavenContribution = Math.floor(currentDigit / 5) * 5 - const earthContribution = currentDigit % 5 - console.log('Earth bead analysis:', { - position, - beadColumn, - placeValue, - columnPower, - currentDigit, - heavenContribution, - earthContribution, - }) - } - if (beadType === 'heaven') { // Toggle heaven bead (worth 5) // Now using place-value based column numbering: 0=ones, 1=tens, 2=hundreds @@ -140,13 +114,6 @@ export function InteractiveAbacus({ newEarthContribution = position + 1 } - console.log('Earth bead calculation:', { - position, - isActive, - currentEarthContribution: earthContribution, - newEarthContribution, - }) - // Calculate the new digit for this column const newDigit = heavenContribution + newEarthContribution diff --git a/apps/web/src/contexts/HomeHeroContext.tsx b/apps/web/src/contexts/HomeHeroContext.tsx index ba2dd3b7..234701a3 100644 --- a/apps/web/src/contexts/HomeHeroContext.tsx +++ b/apps/web/src/contexts/HomeHeroContext.tsx @@ -53,49 +53,28 @@ export function HomeHeroProvider({ children }: { children: React.ReactNode }) { // Load from sessionStorage after mount (client-only, no hydration mismatch) useEffect(() => { - console.log('[HeroAbacus] Loading from sessionStorage...') isLoadingFromStorage.current = true // Block saves during load const saved = sessionStorage.getItem('heroAbacusValue') - console.log('[HeroAbacus] Saved value from storage:', saved) if (saved) { const parsedValue = parseInt(saved, 10) - console.log('[HeroAbacus] Parsed value:', parsedValue) if (!Number.isNaN(parsedValue)) { - console.log('[HeroAbacus] Setting abacus value to:', parsedValue) setAbacusValue(parsedValue) } - } else { - console.log('[HeroAbacus] No saved value found, staying at 0') } // Use setTimeout to ensure the value has been set before we allow saves setTimeout(() => { isLoadingFromStorage.current = false setIsAbacusLoaded(true) - console.log('[HeroAbacus] Load complete, allowing saves now and fading in') }, 0) }, []) // Persist value to sessionStorage when it changes (but skip during load) useEffect(() => { - console.log( - '[HeroAbacus] Save effect triggered. Value:', - abacusValue, - 'isLoadingFromStorage:', - isLoadingFromStorage.current - ) - if (!isLoadingFromStorage.current) { - console.log('[HeroAbacus] Saving to sessionStorage:', abacusValue) sessionStorage.setItem('heroAbacusValue', abacusValue.toString()) - console.log( - '[HeroAbacus] Saved successfully. Storage now contains:', - sessionStorage.getItem('heroAbacusValue') - ) - } else { - console.log('[HeroAbacus] Skipping save (currently loading from storage)') } }, [abacusValue])