Skip to content

Allow advanced filtering using and:, or: and not:#782

Merged
maxwroc merged 3 commits intomaxwroc:vNextfrom
cr7pt0gr4ph7:combination-filters
Feb 22, 2026
Merged

Allow advanced filtering using and:, or: and not:#782
maxwroc merged 3 commits intomaxwroc:vNextfrom
cr7pt0gr4ph7:combination-filters

Conversation

@cr7pt0gr4ph7
Copy link
Contributor

Improve filtering capabilities by allowing composite filters using the usual combinators.

@maxwroc maxwroc changed the base branch from master to vNext February 22, 2026 18:47
Copy link
Contributor

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 extends the card’s entity filtering system to support composite filters using boolean combinators (not:, and:, or:), enabling more expressive include/exclude rules in configuration.

Changes:

  • Introduces composite filter types (NotFilter, AndFilter, OrFilter) plus a createFilter() factory to build filter trees.
  • Updates battery provider to build filters via createFilter() and updates typings to allow composite filter specs.
  • Expands unit tests to cover not, and, and or behavior.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
test/other/filter.test.ts Switches tests to createFilter() and adds coverage for not/and/or combinators.
src/typings.d.ts Adds FilterSpec recursive type and updates card config typing to accept composite filters.
src/filter.ts Refactors filter implementation into an abstract base + composite filters and adds createFilter() factory.
src/battery-provider.ts Uses createFilter() when building include/exclude filters from config.

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

@maxwroc maxwroc added the enhancement New feature or request label Feb 22, 2026
@maxwroc maxwroc requested a review from Copilot February 22, 2026 20:07
Copy link
Contributor

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

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.


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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@maxwroc maxwroc merged commit b22b95c into maxwroc:vNext Feb 22, 2026
1 check passed
@maxwroc
Copy link
Owner

maxwroc commented Feb 22, 2026

@cr7pt0gr4ph7 thank you for contribution (sorry for such a long wait time)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants