Commit 6eaf0ce
authored
feat(tasks): implement fuzzy search using Fuse.js (#217)
Replaces the previous exact-match `.includes()` search with a more flexible
and powerful fuzzy search. Users can now find tasks even with partial
matches or typos, improving workflow efficiency and overall usability.
Key changes:
- Integrated `Fuse.js` to perform fuzzy matching across `description`,
`project`, and `tags`.
- Added a dual-state search pattern (`searchInput` + `debouncedTerm`) to keep
typing responsive while debouncing the expensive search operation.
- Consolidated all filters (projects, tags, status) and fuzzy search into a
single "Master Filter" `useEffect`, ensuring all filters interact correctly.
- Updated Jest tests using `jest.useFakeTimers()` and `act` to validate the
debounced fuzzy search, including typo-tolerant queries like "fiace".
Fixes: #1621 parent 7eaf791 commit 6eaf0ce
File tree
4 files changed
+86
-28
lines changed- frontend
- src/components/HomeComponents/Tasks
- __tests__
4 files changed
+86
-28
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
| 132 | + | |
131 | 133 | | |
132 | 134 | | |
133 | 135 | | |
| |||
153 | 155 | | |
154 | 156 | | |
155 | 157 | | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
| 158 | + | |
175 | 159 | | |
176 | 160 | | |
177 | 161 | | |
| |||
586 | 570 | | |
587 | 571 | | |
588 | 572 | | |
| 573 | + | |
589 | 574 | | |
590 | 575 | | |
591 | 576 | | |
| |||
596 | 581 | | |
597 | 582 | | |
598 | 583 | | |
599 | | - | |
| 584 | + | |
600 | 585 | | |
601 | 586 | | |
602 | 587 | | |
| |||
611 | 596 | | |
612 | 597 | | |
613 | 598 | | |
614 | | - | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
615 | 607 | | |
616 | | - | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
617 | 616 | | |
618 | | - | |
| 617 | + | |
619 | 618 | | |
620 | 619 | | |
621 | 620 | | |
| |||
Lines changed: 53 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
| 51 | + | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
62 | 88 | | |
63 | 89 | | |
64 | 90 | | |
| |||
275 | 301 | | |
276 | 302 | | |
277 | 303 | | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
278 | 326 | | |
0 commit comments