feat: Custom Field Autosuggestion Filtering #7
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.
User Need
Users need to filter file suggestions when using custom fields with wikilink autocomplete (
[[). Without filtering, all vault files appear in suggestions, making it difficult to find relevant notes. For example:Solution
Add optional per-field autosuggestion filters to custom user fields. Each field can independently configure:
Key UX features:
Architecture Overview
Data Flow:
Design Principles:
FileFilterConfiginterface (same as project autosuggest)FileSuggestHelper.suggest()filtering logicFilterSettingsComponent(DRY principle)Files Changed
Core Implementation (3 files)
src/types/settings.ts(+2 lines)autosuggestFilter?: FileFilterConfigtoUserMappedFieldinterfaceFileFilterConfigtypesrc/settings/components/FilterSettingsComponent.ts(NEW, 98 lines)src/modals/TaskModal.ts(+5 lines)this.fieldConfig.autosuggestFiltertoFileSuggestHelper.suggest()inUserFieldSuggest.getSuggestions()UI Enhancements (2 files)
src/settings/tabs/taskPropertiesTab.ts(+50 lines)styles/settings-view.css(+59 lines)Translations (1 file)
src/i18n/resources/en.ts(+4 lines)autosuggestFilters.headerandautosuggestFilters.descriptionTests (2 files)
tests/unit/settings/FilterSettingsComponent.test.ts(NEW, 15 tests)tests/integration/custom-field-filtering.integration.test.ts(NEW, 7 scenarios)Documentation (3 files)
docs/features/user-fields.md(+96 lines)docs/settings/task-properties.md(+23 lines)docs/assets/CustomFields-Selection-Filter.gif(NEW)Testing
Breaking Changes
None. The
autosuggestFilterfield is optional, so existing custom fields work unchanged.Commits
ac084f2- feat: add autosuggestFilter field to UserMappedField interfacebe316be- feat: add custom field suggestion filtering2dd789f- feat(settings): add collapsible filter section with visual indicator3c7061b- test: add comprehensive tests for custom field filtering feature7505cc3- docs: add custom field autosuggestion filtering documentationPull Request opened by Augment Code with guidance from the PR author