Skip to content

Comments

Replace CompendiumBrowser checkbox filters with a tri-state filter component#20282

Open
In3luki wants to merge 1 commit intofoundryvtt:v13-devfrom
In3luki:comp-browser-predicate
Open

Replace CompendiumBrowser checkbox filters with a tri-state filter component#20282
In3luki wants to merge 1 commit intofoundryvtt:v13-devfrom
In3luki:comp-browser-predicate

Conversation

@In3luki
Copy link
Collaborator

@In3luki In3luki commented Sep 21, 2025

This one has grown a bit bigger than I anticipated so I'm pushing this up for review before adding any more to it. The browser should overall work the same as before but there might be some filter edge cases that are not covered.

  • Adds a tri-state (neutral, include, exclude) chip filter to make it possible to exclude certain options from searches.
    • The first click includes the option, the second click excludes the options, the third click clears the option.
    • A right clicks clears the option immediately.
    • Shift left click excludes the option immediately.
  • Replaces the custom filter implementation with a filter based on a Predicate which should make it even easier to implement new filter options.
  • Updates all filter options to use arrays of labeled values instead of objects, eliminating the need for conversion before iteration.
  • Adds a Defense filter to the spell tab that allows filtering by save, AC, basic save, etc.
  • Introduces the concept of a custom trait filter that is not based on an actual trait to solve the problem of showing ancestry items that have no ancestry trait:
image
  • Moves the FilterContainer wrapper to the indiviudal filters to remove the need for the getClearFunction function.
image

@stwlam
Copy link
Collaborator

stwlam commented Sep 21, 2025

Any way to get a minimal fix extracted from this?

@In3luki In3luki force-pushed the comp-browser-predicate branch from 7223560 to b4191e7 Compare September 21, 2025 21:37
@In3luki In3luki marked this pull request as draft September 22, 2025 14:14
@In3luki In3luki force-pushed the comp-browser-predicate branch from b4191e7 to fbb8cb9 Compare September 22, 2025 16:01
@In3luki In3luki marked this pull request as ready for review September 22, 2025 16:04
@In3luki In3luki force-pushed the comp-browser-predicate branch from fbb8cb9 to abf5b86 Compare September 22, 2025 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants