Skip to content

Add wildcard search#253

Merged
ManlyMarco merged 2 commits intoIllusionMods:masterfrom
Mixiel1:AddWildcardSearch
Apr 14, 2026
Merged

Add wildcard search#253
ManlyMarco merged 2 commits intoIllusionMods:masterfrom
Mixiel1:AddWildcardSearch

Conversation

@Mixiel1
Copy link
Copy Markdown
Contributor

@Mixiel1 Mixiel1 commented Apr 14, 2026

Add wildcard search support to ModMatchFilter

Implemented support for wildcard patterns (* and ?) in mod searches. Added logic to detect and process wildcard queries using regular expressions, allowing flexible matching against mod Name, Guid, or FileName. Wildcard search is only applied when not filtering by specific columns.

Add wildcard search support to ModMatchFilter

Implemented support for wildcard patterns (* and ?) in mod searches. Added logic to detect and process wildcard queries using regular expressions, allowing flexible matching against mod Name, Guid, or FileName. Wildcard search is only applied when not filtering by specific columns.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds wildcard search support (* and ?) to ModMatchFilter, enabling pattern-based matching against mod Name, Guid, or FileName when the search query includes wildcard characters and is not using the existing same:* column-style filter.

Changes:

  • Detect wildcard queries in ContainsStrings and enable a wildcard-search mode.
  • Precompute wildcard matches using escaped regex patterns and store matches in _sameMods.
  • Update Filter() to return cached wildcard matches for mod rows.
Comments suppressed due to low confidence (1)

src/KKManager.Core/Util/ModMatchFilter.cs:49

  • In wildcard mode (_isWildcardSearch), Filter() still calls _textMatchFilter.Filter(modelObject) for every row even though the result is ignored for mods. This can be a hot path on large lists since TextMatchFilter typically scans multiple columns. Consider short-circuiting: if _isMod && _isWildcardSearch, return _sameMods.Contains(modelObject) before computing textMatch (and keep the existing behavior for the non-wildcard paths).
        {
            bool textMatch = _textMatchFilter.Filter(modelObject);

            if (_isMod && ((_isFilterCol && textMatch) || _isWildcardSearch))
            {
                return _sameMods.Contains(modelObject);
            }
            return textMatch;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/KKManager.Core/Util/ModMatchFilter.cs Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Collaborator

@ManlyMarco ManlyMarco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as described in mod and plugin windows. Thanks for the PR.

@ManlyMarco ManlyMarco linked an issue Apr 14, 2026 that may be closed by this pull request
@ManlyMarco ManlyMarco merged commit 75d3218 into IllusionMods:master Apr 14, 2026
1 check passed
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.

Wildcard search

3 participants