feature: Add experimental feature opt-ins to profile settings#1779
Draft
feature: Add experimental feature opt-ins to profile settings#1779
Conversation
ksierks
reviewed
Apr 21, 2026
ksierks
reviewed
Apr 21, 2026
627f0e0 to
9112e1c
Compare
ksierks
reviewed
Apr 21, 2026
deepsidhu85
requested changes
Apr 23, 2026
Contributor
deepsidhu85
left a comment
There was a problem hiding this comment.
Just a quick thing after a quick glance below. Also I think we should split this PR up into smaller pieces
| # frozen_string_literal: true | ||
|
|
||
| # Purpose: To handle user opt-in to experimental features via Flipper actor gates | ||
| module Profiles |
Contributor
There was a problem hiding this comment.
I think we should refactor most of the code in the controller into using a service such Profiles::ExperimentalFeatures::UpdateService. Controller should just be making a call to the service and returning a result, just to keep the controller light
- Create config/user_opt_in_features.yml with empty allowlist (separate from features.yml per D-05) - Load USER_OPT_IN_FEATURE_CONFIG constant at boot in flipper.rb initializer - Add resource :experimental_features route (GET show + PATCH update) under profiles scope - Implement Profiles::ExperimentalFeaturesController with authorization, Flipper actor enable/disable, allowlist security guard, and actors_value-based display state - Insert Experimental Features sidebar nav item (flask_conical icon) between Preferences and Account - Add complete en.yml translations: page title, description, empty state, update feedback, toggle aria-label - Add fr.yml stub translations marked with TODO: translator review
…tal features - show.html.erb: PageHeaderComponent + viral_card with flat feature list and empty state - _feature_row.html.erb: name/description + immediate-save toggle form with sr-only checkbox, toggle pill, accessible status div (role=alert, aria-live=polite) - update.turbo_stream.erb: silent success, inline error targeting per-row status div - experimental_feature_toggle_controller.js: requestSubmit() on checkbox change (Turbo-compatible)
- config/user_opt_in_features.yml: add data_grid_samples_table with allowlist: all - config/locales/en.yml + fr.yml: add feature translations for data_grid_samples_table - experimental_features_controller_test.rb: 8 tests covering show, empty state, toggle enable/disable, security guard, unauthenticated redirect, HTML fallback redirect - _feature_row.html.erb: fix W3C violations (aria-label moved to checkbox, div-in-label replaced with span) - All 29 profile controller tests pass with 0 failures
… enhance accessibility
…tions and improve French translation Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
…al variable' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
…troller test Co-authored-by: Copilot <copilot@github.com>
…table Co-authored-by: Copilot <copilot@github.com>
28edda0 to
5ab6012
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do and why?
This branch adds a Profile > Experimental Features page so users can opt in and out of enabled experimental features themselves.
It includes:
user_opt_in_features;How to set using the Rails Console:
OR a new feature flag:
Screenshots or screen recordings
If there are experimental features to toggle

If there are not experimental features to toggle

How to set up and validate locally
bin/setup --resetto refresh DB + seeds.user1@email.comand open Profile > Experimental Features.PARALLEL_WORKERS=4 bundle exec rails test test/controllers/profiles/experimental_features_controller_test.rbPARALLEL_WORKERS=4 bundle exec rails test test/services/profiles/experimental_features/opt_in_service_test.rbPARALLEL_WORKERS=4 bundle exec rails test test/models/application_setting_test.rbPARALLEL_WORKERS=4 bundle exec rails test test/system/profile_test.rb -n "/experimental features with keyboard and keep focus/"PR acceptance checklist