jkomoros / card-web

The web app behind thecompendium.cards
Apache License 2.0
46 stars 8 forks source link

Allow a 'expand' filter that expands the matched set out by a BFS #570

Closed jkomoros closed 2 years ago

jkomoros commented 2 years ago

A use case: "search for cards that match a given query, and then also include any cards that are within 1 inbound or outbound link"

A few ways of doing it:

1) Having a expand/<others> that is a special kind of filter that runs after the rest of the logic runs and is given the currently matched set and then can expand it. This requires all the collectiondescription logic to be updated and seems clunky. 2) Make it so every filter in a chain is passed the results of the previous filters in the chain... but then how do you EXPAND it? 3) (The right answer, likely) is introduce an expand query that takes two sub-filters. It's basically a union filter, but where it does the left side of it, then passes that set to the second part, and then returns the full union

jkomoros commented 2 years ago

Also don't forget to update the filter creator UI

jkomoros commented 2 years ago
jkomoros commented 2 years ago

We can just skip the cardID in the second part of filters, but the parsing machinery is actually hard to change, so it's easiest to just have there still be a (noop) card ID there. The KEY_CARD_PLACEHOLDER_ID is fine, and that's the default anyway so 🤷

jkomoros commented 2 years ago

All of the remaining parts are now captured in other issues

jkomoros commented 2 years ago

7ffb5d3d4f092534bf2e85be51b06eecb1d22298 is also part of this