-
Notifications
You must be signed in to change notification settings - Fork 9
Add folder exclusion setting for annotations view #44
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
base: main
Are you sure you want to change the base?
Conversation
Adds ability to exclude folders (e.g., _templates/) from appearing in the CriticMarkup annotations view. Files in excluded folders are skipped during database indexing and filtered from the annotations view. - Add excluded_folders setting to PluginSettings interface - Add TextArea UI in General Settings for configuring excluded folders - Filter excluded files in database callback and filterRanges function - Changing excluded_folders triggers database re-indexation
|
Thanks for the PR! I will try to do a review later today. Before I get to reviewing it, could you also maybe elaborate a bit on the cases where folder exclusion is necessary? I want to make sure that I fully understand how this will be used. |
| !plugin.settings.excluded_folders.some(folder => key.startsWith(folder)) | ||
| ); | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not necessary, as all ranges from excluded folders would already be removed due to the DATBASE_REINDEX check.
| ]} | ||
| > | ||
| {#snippet control()} | ||
| <TextArea |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure whether a regular TextArea is the most ergonomic way to input paths, but I'll need to think about this.
| <TextArea | ||
| value={plugin.settings.excluded_folders.join("\n")} | ||
| placeholder="_templates/ archive/" | ||
| onChange={(value) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be debounced (could also be an onBlur callback, but that probably needs to be added in the components submodule).
| */ | ||
| isFileExcluded(filePath: string): boolean { | ||
| return this.settings.excluded_folders.some(folder => | ||
| filePath.startsWith(folder) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure whether the intention is for the excluded_folders setting paths to match (a part of) the absolute path, any part, or only the folder name.
Summary
_templates/) from appearing in the annotations viewChanges
excluded_folders: string[]setting toPluginSettingsfilterRangesfunctionexcluded_folderstriggers database re-indexationTest plan
_templates/with CriticMarkup content