Conversation
|
Closing this for now as the existing behavior is not behaving too bad with the current database. The new change will add some complexity while it is not required for the current performance. Previous test issue was based in dev mode with console on. |
|
Originally close this as when i test original it stopped happening but I noticed the issue surface again after browsing for a while, so re-opening this. |
|
Still couldn't reproduce it, only got by chance, but it feels like I didn't trigger any yet when in packaged app, but does when in dev mode (console close) somehow. Closing this again for now. |
|
This really keeps happening to me, especially when you keep having wishlist / other tag filter. Plus from the logic stand point it makes sense (the downside is extra complexity but if it's what needed I think it's worth) so I am reopening this again 🙆 |
What this changes
Apply search input debouncing for Library and Browse mode. Typing should stays smooth and responsive instad of lag due to refresh, or re-rendering, while filtering/fetching waits for the user to pause. Clicking clear immediately resets the list without waiting. Remove the existing fetch debounce in browse mode that will cause duplicate delay when this new change come in.
Why
#397
Updating
activeFilters.texton every single keystroke was triggering a full filter pass in the Library (and queueing catalog API requests in Browse) for every character typed. On larger libraries, this caused input lag and visible UI stuttering as the catalog re-fetched and cleared grid views. Moving the debounce logic beforesetActiveFiltersvia a shared hook fixes the delay without dropping input state.How it was tested
npm run checkpasses locallyCHANGELOG.mdupdatednightly, notmainAI assistance
Tool and model: VSCode auto free
What it wrote:
src/hooks/useDebouncedSearch.jshook (handles input state and reset signal), search component wiring inSearchBox.jsxandSearchSidebar.jsx,App.jsxsignal routing,CHANGELOG.mdentries, and the regression tests intests/search-debounce.test.jsx.What you verified yourself:
Manually tested search behavior on the client to confirm input responsiveness, verified that clearing resets instantly, and confirmed all regression tests pass.