fix: Prevent project filters from affecting custom field suggestions / Inconistent Project Suggestions (Bugs #905, #907) #908
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.
Problem
Bug: Project autosuggestion filter settings (tags, folders, properties) were incorrectly applied to custom field file/link suggestions when users typed
[[in custom fields.Bug: #905
Bug: When I click on "Add to Project" button in the Task Edit modal, the project suggestions do not return the same results as the Task Creation modal.
While the Task Creation modal correctly returns results filtered by the plugin's "project auto-suggest" settings respecting hierarchical tags and exclusion settings, the "Task Edit" modal still filters based on simple tags.
Bug: #907
Impact: Users could not select files that didn't match their project filter criteria when using wikilink suggestions in custom fields, even though custom fields should show all vault files.
Root Cause
This caused:
Solution
Made filtering opt-in and generic:
Changes by File
src/suggest/FileSuggestHelper.tsWhat changed: Added generic
FileFilterConfiginterface and made filtering optionalWhy:
plugin.settings.projectAutosuggestand applied filters to all callersfilterConfigparameter -undefinedmeans no filteringKey change:
src/modals/TaskCreationModal.tsWhat changed: Explicitly passes project filter config to FileSuggestHelper
Why:
+trigger) should filter by project settingsKey change:
src/modals/TaskModal.tsWhat changed: Calls FileSuggestHelper without filterConfig for custom fields
Why:
[[trigger) should show ALL vault filesKey change:
src/modals/ProjectSelectModal.tsWhat changed: Updated tag filtering to use
FilterUtils.matchesTagConditions()Why:
.some()matching (exact matches only)-prefix)Key change:
tests/unit/suggest/FileSuggestHelper.test.tsWhat changed: Added 12 unit tests covering filtering behavior
Why:
Test coverage: