Repository navigation
Refactor: Extract autocomplete filter logic to service class - #356
Merged
malibio merged 2 commits intoOct 30, 2025
Merged
Conversation
Extracted @mention autocomplete filter logic from base-node.svelte into a dedicated NodeSearchService class for better maintainability and testability. Changes: - Created NodeSearchService with filterMentionableNodes() method - Implemented comprehensive unit tests (18 test cases) - Updated base-node.svelte to use the new service - All filtering rules preserved and tested: 1. Exclude date nodes (accessible via date shortcuts) 2. Match query in title/content (case-insensitive) 3. Include ALL non-text nodes regardless of hierarchy 4. Include ONLY container text nodes (top-level) Benefits: - ✅ Unit testable - 18 comprehensive test cases - ✅ Centralized business logic - Single source of truth - ✅ Easy to extend - Ready for Issue #201 date shortcuts - ✅ Self-documenting - Clear rules with explicit methods - ✅ Reusable - Other components can use the same filtering Related: #199 (introduced @mention system), #201 (date shortcuts) Closes #204 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Updated test comment at line 142 to accurately reflect the test behavior. The comment previously stated "Whitespace-only query matches everything" but the assertion correctly expects 0 results. Changed to: "Whitespace-only query returns no results (whitespace doesn't naturally occur in content)" Addresses code review feedback (Nit 1) from #204 review. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
malibio
deleted the
feature/issue-204-extract-autocomplete-filter-logic
branch
October 30, 2025 14:26
9 tasks
6 of 11 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #204