obsidian-livesync icon indicating copy to clipboard operation
obsidian-livesync copied to clipboard

WIP: Improved Skip Patterns

Open eth-p opened this issue 2 years ago • 2 comments

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.

image

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 either a or b
      • Like bash, {a} is invalid, so it literally matches {a}.

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 PatternSetSetting to use less data- 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

eth-p avatar Jan 28 '23 03:01 eth-p

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.

vrtmrz avatar Jan 28 '23 07:01 vrtmrz

Also, is this PR dead?

pwall2222 avatar Jun 11 '24 21:06 pwall2222