Flagsmith / Flagsmith/flagsmith

Improve clarity around `Project.hide_disabled_flags`

Open
#5,836 0 comments 0 reactions 0 assignees View on GitHub
front-end
Dominant language
Python
Stars
6.6k
Forks
567
Avg merge
1d 13h
Merged PRs (30d)
121

Description

Summary: The `Project.hide_disabled_flags` setting leads to confusing behavior in feature overrides.

## How to reproduce

This is similar to a recent case from a customer:

1. Set up a new feature "experience":
- `state=true`
- `value="standard"`
- 25% `value="beta"` (rolling out a new experience as an AB test)

Image

2. Set up a new segment "acme_users".
- Matching trait `email` REGEX `[^@]+@acme\.com`.
Image
- Override `experience` to
- `state=false` (**the default state when creating the override in the UI**)
- 100% `value="beta"`

Image

3. Set up a new identity.
- `identifier="someuser"`
- Traits: `email="someuser@acme.com"`

```sh
curl -I -X POST http://localhost:8000/api/v1/identities/ -H "X-Environment-Key: $key" -H "Content-Type: application/json" -d '{"identifier": "someuser", "traits": [{"trait_key": "email", "trait_value": "someuser@acme.com"}]}'
```
3. Set the project's `hide_disabled_flags` to `true`.

Image
4. Retrieve evaluated features for identity `"someuser"`.
```sh
curl -I -X GET 'http://localhost:8000/api/v1/identities/?identifier=someuser' -H "X-Environment-Key: $key"
```
5. Verify the "experience" feature is **absent**, while the expected behavior was that evaluated features included `experience="beta"`, _assuming 100% of users will affect all within that segment_.
```http
HTTP/1.1 200 OK
Content-Type: application/json

{
"flags": [],
"identifier": "someuser",
"traits": [
{
"id": 1,
"trait_key": "email",
"trait_value": "someuser@acme.com",
"transient": false
}
]
}
```

## The problem

While the goal of the setting `hide_disabled_flags` is well explained in the Project Settings UI (screenshot below), it might still lead to confusing behavior when overriding environment features **values**.

Image

An override similar to the following example would be invisible in the evaluated features for a matching identity.

## Proposed solution

Improve clarity in the UI in distinct moments:

1. When setting the `hide_disabled_flags` setting to `true` in the Project Settings page, the UI should warn that Flagsmith will also remove any overrides when their state is disabled, _regardless if the value is overridden or not_.

Image
2. When creating a new override, and `Project.hide_disabled_flags` is `true`, the UI should warn that the override will be removed when the feature is disabled.

Image
3. When editing a segment to add a feature override, consider leaving "Enabled" turned on by default, at least when `Project.hide_disabled_flags` is `true`. This might be very relevant to scenarios such as A/B testing using overridden multivariate features (see "How to reproduce").

Image

I believe this would prevent further confusion when users are trying to understand why their overrides are not being applied.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.