Commit 7f1d2c1
committed
feat(ui): ✨ add smart pattern merge and import/export capabilities to filter rules
This commit introduces comprehensive pattern management features to the Model Filter GUI, significantly improving the user experience for managing filter rules.
Core features added:
- Smart pattern merge logic that prevents redundant rules by detecting when patterns are covered by existing broader patterns (e.g., "gpt-4" is covered by "gpt-4*")
- Pattern coverage detection system with three new methods in FilterEngine: `pattern_is_covered_by`, `is_pattern_covered`, and `get_covered_patterns`
- Import/Export functionality for filter rules with dedicated dialogs (ImportRulesDialog, ImportResultDialog)
- Copy-to-clipboard buttons for all model lists and rule panels, enabling easy pattern transfer
- Replace mode for imports that clears all existing rules vs. merge mode for incremental additions
UI improvements:
- Refactored HelpWindow to use CTkTextbox instead of CTkScrollableFrame, fixing scrolling issues with dark theme
- Proper text formatting with configurable tags for titles, sections, and content
- Enhanced rule panel headers showing rule counts and action buttons (Import/Copy)
- Model list headers with copy buttons for filtered and all models
- Improved tooltip positioning calculation for virtual rule list
The smart merge system eliminates duplicate or redundant patterns automatically:
- When adding "gpt-4*", existing "gpt-4" and "gpt-4-turbo" rules are removed as they're now covered
- When adding "gpt-4", it's skipped if "gpt-4*" already exists
- Wildcard "*" covers everything and prevents addition of any other patterns
This creates a more intuitive workflow where users can paste comma-separated model lists, import them in bulk, and the system intelligently consolidates them into minimal effective rulesets.1 parent ad2ed1a commit 7f1d2c1
1 file changed
+682
-94
lines changed
0 commit comments