WIP: Improved Skip Patterns
This is currently a work in progress commit. I'm making a draft pull request to get your feedback on the feature and its implementation.
The idea of this pull request to improve the user experience of the "Skip patterns" setting by providing more types of patterns, a better user interface for editing the patterns, and visual feedback to know if patterns are working.
New Features:
- Custom settings UI for adding/removing/changing the skip patterns.
- Provides feedback for patterns: ❌ --> Invalid pattern ✅ --> Valid pattern
- Glob-style patterns for skip patterns.
*matches everything except directories**matches directories{a,b}matches eitheraorb- Like bash,
{a}is invalid, so it literally matches{a}.
- Like bash,
Fixed:
- #168
Done
- Add support for glob-style skip patterns.
- Add setting component for adding and removing skip patterns.
To-Do
- Show a different icon if the pattern does not match any files in the vault (⚠️, maybe? or a non-green ✔)
- Test that the regex created by the glob pattern compiler works as expected.
- Synced skip patterns (like a .gitignore checked in to a repo)
- Clean up the
PatternSetSettingto use lessdata-attributes. - Allow case-sensitive/insensitive regex patterns
- As discussed as the fix for #168
- Possible way to do it: PCRE-style flags at the start of the user-provided regex string:
(?i)at the start of the pattern => case insensitive (default)(?-i)at the start of the pattern => case sensitive
Thank you for proposing great new features. I think it would be very useful!
I have just seen your codes only on mobile yet, this is based on only this note, and I hope to see the details later!
Show a different icon if the pattern does not match any files in the vault (⚠️, maybe? or a non-green ✔)
If we count the number of matched documents, how about indicating that? Like: ✅ (2), ✅(0), ❌(-) And, It might be also nice to display the beginning of the list as a tooltip of the number.
Also, is this PR dead?