Skip to content

Conversation

@ShivaGupta-14
Copy link
Contributor

@ShivaGupta-14 ShivaGupta-14 commented Nov 15, 2025

Description

This PR implements fuzzy search support in the Tasks screen using Fuse.js, replacing the previous exact-match .includes() search.
With this improvement, users can now find tasks using partial matches or even minor typos, significantly enhancing the search experience and workflow speed.

Key Changes

  • Fuzzy Search Integration:

    • Added Fuse.js to perform fuzzy matching on description, project, and tags.
    • Configured a balanced threshold to ensure relevant matches while reducing noise.
  • Improved Search UX:

    • Introduced a two-state pattern:
      • searchInput → immediate UI updates
      • debouncedTerm → fuzzy search triggered after 300ms debounce
    • Ensures smoother typing and prevents expensive searches on every keystroke.
  • Unified Filtering Logic:

    • Consolidated search + selected tags + selected projects + selected status filters into a single Master Filter useEffect.
    • Guarantees accurate combined results without inconsistencies.
  • Test Enhancements:

    • Updated Jest tests to correctly validate fuzzy-search behavior.
    • Added tests for typo tolerance using "Norml" to match "Normal Synced Task".

Stacked PR Notice

⚠️ This PR is stacked on top of PR #181.
Please merge PR #181 first; after that, this PR will become clean automatically.

Checklist

  • Ran npx prettier --write . (for formatting)
  • Ran gofmt -w . (for Go backend)
  • Ran npm test (for JS/TS testing)
  • Added unit tests, if applicable
  • Verified all tests pass
  • Updated documentation, if needed

Additional Notes

Video: Link to see changes

Adds visual indicators for tasks modified locally but not yet synced
with the backend.

Implementation details:
- Uses `localStorage` to track dirty UUIDs (keeps IndexedDB schema clean).
- Adds "Unsynced" badge to task rows.
- Adds a notification counter badge to the Sync button.
- Masks temporary negative IDs with a dash in the UI.
- Updates tasks optimistically for instant UI feedback.
- Clears unsynced status automatically upon successful sync.
Replaces the previous exact-match `.includes()` search with a
more flexible and powerful fuzzy search. This allows users to
find tasks even with partial matches or typos, improving workflow
efficiency.

Key changes:
- Integrates `fuse.js` to search across the `description`, `project`,
  and `tags` fields.
- Implements a dual-state (`searchInput` / `debouncedTerm`) pattern to
  keep the input responsive while debouncing the expensive search logic.
- Consolidates all filtering (dropdown filters + search) into a single
  "Master Filter" `useEffect` to ensure all filters work together correctly.
- Updates tests using `jest.fakeTimers` and `act` to validate the debounced
  fuzzy search behavior using a typo search term ("Norml").

Fixes: CCExtractor#162

---

 **Stacked PR Notice**
This PR is *stacked on top of PR CCExtractor#143*.
Please merge **PR CCExtractor#143** first.
@ShivaGupta-14 ShivaGupta-14 changed the title Feat/162 fuzzy search feat(tasks): Add fuzzy search support using Fuse.js Nov 15, 2025
@ShivaGupta-14
Copy link
Contributor Author

@its-me-abhishek

Closing this PR as it was stacked on another PR. I’ve opened a clean, standalone PR #217 to make the review easier.

@ShivaGupta-14 ShivaGupta-14 deleted the feat/162-fuzzy-search branch November 21, 2025 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement fuzzy search in task list with instant results

1 participant