Closed prachigarg19 closed 4 months ago
The recent updates aim to refine user interaction and data management in the TreeMapper application. The Map component now includes a delayed data fetching mechanism for enhanced performance, while the Project Filter component introduces local state management for date selection, empowering users with more precise control over date filters.
File Path | Change Summary |
---|---|
.../Analytics/components/Map/index.tsx |
Added a delayed fetch operation using setTimeout in MapContainer to optimize data fetching timing. |
.../Analytics/components/ProjectFilter/index.tsx |
Implemented local state management for date selection in ProjectFilter to elevate user input control. |
🐇✨ Oh, hark! A change does bloom, In the garden of our code's room. Delays in fetch, a thoughtful pause, Dates held close, without a flaw. Hop and tweak, with care we thread, Through lines of logic, our path we tread. 🌼🍃
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
planet-webapp | ✅ Ready (Inspect) | Visit Preview | May 6, 2024 9:53am | |
planet-webapp-multi-tenancy-setup | ✅ Ready (Inspect) | Visit Preview | May 6, 2024 9:53am |
We once upon a time invented https://github.com/Plant-for-the-Planet-org/planet-webapp/blob/develop/src/utils/useDebouncedEffect.ts to throttle the projects search to not trigger it for every single input change of the users in the search field. Maybe this concept would also be useful here?
Works, but a little bit ugly code now having two hooks and also the type check for the paramters for useDebouncedEffect is failing now of course. (I fixed some wrong label on the page saying "from" instead of "to".)
I could reset the changes in this case.
Description
There are multiple api calls being made at below places:
Expected behavior
For first point, debouncing should be implemented to reduce the number of calls per second
In the second point, API calls should be made only after the user has finalized their date selection, rather than for each individual date chosen from the calendar.
Summary by CodeRabbit
New Features
Refactor