Enable Rapid Diffs by default on the merge request Changes tab
Summary
Make Rapid Diffs the default experience on the merge request Changes tab. Today the rapid_diffs_on_mr_show feature flag is default_enabled: true, but users still see legacy diffs unless they opt in via the in-MR toggle (which sets the rapid_diffs_enabled cookie). Flip the default so Rapid Diffs renders without opt-in, and the toggle becomes an opt-out back to legacy.
Current behavior
Projects::MergeRequestsController#rapid_diffs_page_enabled? (app/controllers/projects/merge_requests_controller.rb:751):
::Feature.enabled?(:rapid_diffs_on_mr_show, current_user, type: :beta) &&
params[:rapid_diffs_disabled] != 'true' &&
(params[:rapid_diffs] == 'true' || cookies[:rapid_diffs_enabled] == 'true')An absent rapid_diffs_enabled cookie ⇒ legacy diffs.
Proposal
Change the default resolution so that, with the feature flag enabled, Rapid Diffs renders unless the user has explicitly opted out:
- Absent/unset toggle ⇒ Rapid Diffs (new default).
- Toggle off ⇒ legacy diffs (opt-out, e.g.
rapid_diffs_enabled == 'false'/rapid_diffs_disabled). - Keep
params[:rapid_diffs]/params[:rapid_diffs_disabled]overrides working.
Update the toggle UI copy/state to reflect that Rapid Diffs is the default and the switch now disables it.
Acceptance criteria
- With
rapid_diffs_on_mr_showenabled and no prior preference, the MR Changes tab renders Rapid Diffs. - Users who previously toggled Rapid Diffs off continue to see legacy diffs (opt-out preserved).
- The in-MR toggle switches back to legacy diffs and persists that choice.
-
params[:rapid_diffs]/params[:rapid_diffs_disabled]overrides still work. - Specs updated for the new default.