What actually causes sluggish clicks after page load
Pages often score well on lab speed tests yet fail Google’s Chrome UX Report for Interaction to Next Paint (INP). Three real-world culprits dominate: oversized JavaScript hydration bundles, blocking third-party chat/analytics scripts running on the main thread, and synchronous DOM reads paired with writes inside event listeners.
When a user taps a navigation menu, filter chip or cart button, the browser must run event callbacks, recalculate styles, lay out affected elements and paint the next frame. Any main-thread work exceeding 200 milliseconds makes the interface feel frozen.
// Yield long event work so the browser paints visual feedback first
button.addEventListener('click', async () => {
button.classList.add('is-busy');
if ('scheduler' in window && typeof scheduler.yield === 'function') {
await scheduler.yield();
}
runHeavyStateUpdate();
});Pruning DOM depth and third-party tag bloat
Every extra wrapper div multiplies CSS selector matching and layout work whenever a tab switches or an accordion opens. By writing semantic HTML with shallow nesting and deferring non-critical embeds until idle or user intent, BottleCap builds routinely stay well under Google’s 200ms good threshold—often responding under 80ms on mid-tier Android phones.
