Open rolodato opened 4 months ago
@kyle-ssg I believe the BE can already support this, but I'm not sure how easy it will be to represent on the FE.
Im really unsure as to what the UI would look like, it might be worth getting Akveo to mock a design. I haven't seen this attempted before in products I don't think.
I feel like this could lead to people getting very confused if it's not done right.
I can't think of anything feasible besides a tree-style editor to build arbitrarily complex boolean conditions, similar to https://querybuilder.js.org/ but with an actually nice design :)
This will likely require extracting "New Segment" from the current modal into its own page, to get a reasonable amount of screen space to work with.
If we do allow customers to define more complex conditions, IMO we should provide some "tester" functionality that lets customers play around with sample values to sanity-check their segment definitions and explain what is causing a certain result. This could be part of the segment editor or its own page (separate page would be my preference), which could help explain if segment or identity overrides are being applied and not need to create fake identities just for testing.
As a workaround for anyone running into this limitation, it's possible to rewrite any logical formula into conjunctive normal form (CNF) so that it's expressed as an AND
chain of OR
statements. For example: https://www.wolframalpha.com/input?i=%28A+and+B%29+or+%28C+and+D%29
Is your feature request related to a problem? Please describe.
When defining a segment, we can only define conditions in the shape
(A or B or ...) AND/AND NOT (D or E or ...) AND/AND NOT ...
. It's not possible toOR
multiple sets of conditions together.Describe the solution you'd like.
Support
OR
-ing multiple sets of conditions together when defining a segment. Unsure what the UI would look like for this yet.Describe alternatives you've considered
Implementing the logic in the application (i.e. using Flagsmith as a remote config store and not for its evaluation engine)
Additional context
No response