Page MenuHomePhabricator

{PULA} Add debounce to search
Closed, ResolvedPublic

Description

Domain:
Coding

Difficulty:
Advanced

Problem / steps to reproduce (for bugs)

  • On the homepage & results page, there is a search input field.
  • Each time the user types a character, the app immediately triggers an API call.
  • This results in many unnecessary/expensive API requests (one per keystroke).
  • This behavior causes performance issues, slow UI, and unnecessary server load.

Expected outcome / task:
Implement a debounce mechanism on the homepage search input so that:

  • The API call is not triggered on every keypress.
  • Instead, the call is made only after the user stops typing for a defined timeout (e.g., 300–500ms).
  • Ensure the search experience feels smooth and responsive.

Any links or references:

Setup Steps (short):

  • Ensure the project runs locally (e.g., npm install + npm run dev).
  • Locate the homepage search component.
  • Add or import a debounce helper (custom or via lodash).
  • Wrap the search API trigger inside the debounce function.
  • Test by typing quickly in the search bar and confirm only one API call fires after typing stops.

Event Timeline

mengawanjim subscribed.

Hello Team,

I am currently working on this ticket, to Implement a debounce mechanism on the homepage search

Regards

3ch310n renamed this task from Add debounce to search to {PULA} Add debounce to search.Dec 12 2025, 7:08 PM

Add debounce to search

This PR introduces a debounce mechanism to the search functionality by wrapping the search trigger in a setTimeout.

https://github.com/Goethe-Kamerun/pula-web/pull/40

mengawanjim moved this task from In progress to Review on the Pulac board.