⚡ Bolt: Debounce search input to avoid redundant heavy re-renders#34
⚡ Bolt: Debounce search input to avoid redundant heavy re-renders#34MrAlokTech wants to merge 1 commit intomainfrom
Conversation
Added a debounce wrapper around the `renderPDFs` function when attached to the `searchInput` event listener. This significantly reduces the frequency of DOM re-renders and list filtering operations while the user is typing, greatly improving UI responsiveness. Co-authored-by: MrAlokTech <107493955+MrAlokTech@users.noreply.github.com>
Deploying classnotes with
|
| Latest commit: |
cc66ae5
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b535fadf.classnotes.pages.dev |
| Branch Preview URL: | https://bolt-debounce-search-4615648.classnotes.pages.dev |
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
💡 What:
Implemented a
debounceutility function and wrapped therenderPDFscall on thesearchInputevent listener.🎯 Why:
Previously,
renderPDFsfired on every singleinputevent (keystroke). This caused heavy DOM filtering, object formatting, andinnerHTMLreplacements synchronously, causing main thread blocking and lag during quick typing.📊 Impact:
Reduces redundant DOM rebuilds during search. Instead of 10 renders for typing a 10-character search, it will now only render once the user pauses typing for 300ms.
🔬 Measurement:
Verified by running a playwright script that fired 4 keystrokes in succession and observed only 1 call to
renderPDFsafter the delay elapsed, instead of 4 consecutive calls.PR created automatically by Jules for task 4615648964259755386 started by @MrAlokTech