Enable or disable a specific feature flag for my organization
Toggling a feature flag must be a deliberate, two-step action to prevent accidental activation or deactivation. After tapping the toggle on the feature flag admin screen, a confirmation dialog appears summarizing the change and its potential impact (e.g., 'Enabling this will make mileage claim forms visible to all coordinators in your organization'). Upon confirmation, the change is persisted to the repository, the cache is invalidated, and all active sessions in the organization reflect the updated flag state via the Riverpod provider within a short propagation window.
User Story
Acceptance Criteria
- Given I am viewing the feature flag admin screen, when I tap the toggle for a flag, then a confirmation dialog appears showing the flag name, the proposed new state, and a plain-language description of the impact
- Given the confirmation dialog is shown, when I confirm the change, then the flag state is updated in the repository and the feature-flag-cache is invalidated
- Given I confirm enabling a flag, when the update succeeds, then a success toast is shown and the toggle reflects the new enabled state immediately
- Given I confirm disabling a flag, when the update succeeds, then the corresponding feature-gate-widget across the app hides the related UI for all users in the organization
- Given the repository update fails due to a network error, when the save attempt completes, then the toggle reverts to its previous state and an error message is displayed
- Given I tap the toggle and the confirmation dialog appears, when I tap Cancel, then no change is made and the toggle remains in its original state
Business Value
Safe toggling with confirmation prevents administrators from accidentally enabling premature features or disabling active ones used by hundreds of peer mentors. The confirmation-and-rollback pattern is critical because disabling a flag mid-workflow (e.g., during an active mileage claim submission) could cause data loss or user confusion, directly impacting volunteer retention and reporting quality.
Components
- Feature Flag Admin Screen ui
- FeatureGate Widget ui
- Feature Flag Provider infrastructure
- Rollout Condition Evaluator service
- Feature Flag Repository data
- Feature Flag Local Cache data
- Feature Flag Key Constants infrastructure