Skip to content

feat: add hierarchical tag support with exclusion patterns#760

Merged
callumalpass merged 1 commit intomainfrom
issue584
Sep 28, 2025
Merged

feat: add hierarchical tag support with exclusion patterns#760
callumalpass merged 1 commit intomainfrom
issue584

Conversation

@callumalpass
Copy link
Owner

Summary

Implements hierarchical tag support for Obsidian nested tags as requested in issue #584.

Features

  • Hierarchical matching: Searching for t/ef now matches child tags like t/ef/project, t/ef/task, t/ef/bug
  • Exclusion patterns: Support for -t/ef/bug to exclude specific tags and their children
  • Backward compatibility: Existing substring matching preserved (e.g., proj still matches project/alpha)

Implementation

  • Enhanced FilterUtils with matchesHierarchicalTag() and matchesTagConditions() methods
  • Updated FilterBar tag filtering to use hierarchical matching for "contains" operations
  • Enhanced project autosuggester required tags filtering
  • Improved task identification by tags with hierarchical support

Test Coverage

  • All existing tests pass
  • TypeScript compilation succeeds
  • Manual testing confirms all features work correctly
  • No performance regressions

Examples

# Now supported in FilterBar and Project Autosuggester:
- "t/ef"              # Matches: t/ef, t/ef/project, t/ef/task, t/ef/bug
- "-t/ef/bug"         # Excludes: t/ef/bug, t/ef/bug/critical  
- "proj"              # Still matches: project/alpha (backward compatibility)
- ["t/ef", "-t/ef/bug"]  # Include t/ef hierarchy, exclude t/ef/bug branch

Fixes #584

Implements hierarchical tag matching for Obsidian nested tags where
searching for 't/ef' matches 't/ef/project', 't/ef/task', etc.

Features:
- Hierarchical matching: 't/ef' matches child tags like 't/ef/project'
- Exclusion patterns: '-t/ef/bug' excludes specific tags and children
- Backward compatibility: substring matching preserved for existing filters

Changes:
- Enhanced FilterUtils with hierarchical tag matching logic
- Updated FilterBar tag filtering to support new matching rules
- Enhanced project autosuggester tag filtering
- Improved task identification by tags with hierarchical support

Fixes #584
@callumalpass callumalpass merged commit fbfe757 into main Sep 28, 2025
4 checks passed
callumalpass added a commit that referenced this pull request Oct 25, 2025
feat: add hierarchical tag support with exclusion patterns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FR]: Support Obsidian hierarchical tags and folders

1 participant