feat: implement hierarchical rule matching and path pattern support #11
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.
Multiple rule support: URLs now match against all applicable rules instead of just the best one
Priority-based ordering: Rules are applied in order of specificity (exact host → subdomain → path → global)
Composite rule application: Parameters from all matching rules are combined for removal
Enhanced rule specificity calculation: Uses priority level, pattern type, host length, and parameter count
New PatternType.PATH_PATTERN: Enables matching against full URLs including paths and query parameters
Full URL matching:
matchesCompiledRuleWithPath()method supports complex URL pattern matchingComplex pattern support: GitHub repos, YouTube videos, API versioning, search pages with query params
Case sensitivity control: Supports both case-sensitive and case-insensitive path matching
Enhanced default rules: Added Instagram-specific rules with subdomain wildcard support
Better parameter targeting: Focused on actual tracking parameters instead of overly broad removal
Rule priority system: RulePriority enum with EXACT_HOST, SUBDOMAIN_WILDCARD, PATH_SPECIFIC, GLOBAL_WILDCARD
Maintained backward compatibility: Existing rules continue to work unchanged
RuleCompiler utility: Centralized rule compilation with caching and validation
RuleSpecificity calculator: Sophisticated scoring system for rule precedence
CompiledRule caching: Performance optimization for repeated rule matching
Enhanced error handling: Graceful degradation with malformed patterns and URLs
Multiple matching rules display: Shows all rules that matched a URL instead of just one
Improved debugging information: Better visibility into rule matching process
Enhanced clipboard analysis: More detailed information about parameter removal
EdgeCaseUrlCleaningTest: 15+ tests for malformed URLs, encoding issues, edge cases
HierarchicalRuleMatchingTest: 12+ tests for priority-based rule application and composite matching
PathPatternMatchingTest: 10+ tests for complex path pattern scenarios
PerformanceTest: 10+ tests for performance with large parameter sets and rule matching
Complex path patterns (GitHub, YouTube, API versioning)
Hierarchical rule priority and composite application
Performance testing with 1000+ operations
Edge cases: malformed URLs, special characters, very long URLs
Memory usage testing with large datasets
Error handling and graceful degradation
Backward compatible: All existing configurations continue to work
Version bump: 1.0.0-rc → 1.0.1-rc (VERSION_CODE: 10000 → 10001)
No breaking changes: Existing APIs maintained for compatibility
Enhanced functionality: New features are additive, not replacement
✅ All unit tests passing (46 tasks completed)
✅ All instrumented tests configured and ready
✅ Lint checks passing
✅ CI pipeline validated
✅ Documentation updated and synchronized
✅ Performance benchmarks within acceptable limits
This release significantly enhances URL cleaning capabilities while maintaining the app's simple and fast operation. The hierarchical matching system and path pattern support enable more precise and effective tracking parameter removal across a wider range of websites and URL structures.