-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: refactor fuzzy search for users and conversations (#1684)
* refactor: refactor fuzzy search for users and conversations - 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. * refactor: improve command palette search functionality - 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. * feat: enable fatal warnings in build configuration and improve command 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. * refactor: update SQL queries for improved search logic - 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. * refactor: enhance fuzzy search logic and SQL query structure - 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.
- Loading branch information
Showing
10 changed files
with
469 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.