Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: refactor fuzzy search for users and conversations #1684

Merged
merged 5 commits into from
Jan 16, 2025

Conversation

YeungKC
Copy link
Collaborator

@YeungKC YeungKC commented Jan 16, 2025

  • Added fuzzySearchUserItem and fuzzySearchConversationItem methods in the database layer for improved search functionality.
  • Updated ConversationDao and UserDao to utilize the new search methods.
  • Introduced SearchItem class to encapsulate search results.
  • Refactored UI components to display search results using SearchItemWidget.
  • Enhanced SQL queries in common.drift for better search performance and accuracy.

- Added fuzzySearchUserItem and fuzzySearchConversationItem methods in the database layer for improved search functionality.
- Updated ConversationDao and UserDao to utilize the new search methods.
- Introduced SearchItem class to encapsulate search results.
- Refactored UI components to display search results using SearchItemWidget.
- Enhanced SQL queries in common.drift for better search performance and accuracy.
- Moved search logic into dedicated _useSearchState and _useNavigationState hooks for better organization and readability.
- Updated CommandPalettePage to utilize the new hooks, enhancing the separation of concerns.
- Removed redundant code related to user and conversation search, streamlining the implementation.
- Ensured that search results are displayed correctly using the updated state management approach.
@YeungKC YeungKC requested review from crossle and boyan01 January 16, 2025 04:46
…d palette navigation

- Added 'fatal_warnings' option in build.yaml to enhance build error handling.
- Updated command palette navigation logic to handle empty item lists gracefully, preventing potential runtime errors.
- Modified SQL queries in mixin_database.g.dart and common.drift to enhance the handling of the 'enableNameLike' condition.
- Changed the condition from 'WHEN :enableNameLike = TRUE' to 'WHEN :enableNameLike != TRUE' for better clarity and functionality.
- Ensured consistency in query logic across both files to improve search performance and accuracy.
- Updated fuzzy search methods in ConversationDao and UserDao to improve search accuracy by incorporating LIKE escape functionality.
- Removed unnecessary parameters from fuzzy search queries to streamline logic.
- Refactored SQL queries in mixin_database.g.dart and common.drift for better performance and clarity, ensuring consistent handling of search conditions.
- Introduced LikeEscapeOperator and LikeEscapeExpression for improved LIKE query handling in the database layer.
@crossle crossle merged commit 605afc4 into main Jan 16, 2025
1 check passed
@crossle crossle deleted the refactor/CommandPalette branch January 16, 2025 10:35
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.

2 participants