Merge pull request #29821 from overleaf/dp-editor-redesign-opt-out

Prepare editor redesign for opt-out phase

GitOrigin-RevId: 5831970ff27e5c20f22c68b83471b6b832c2b2b4
This commit is contained in:
David
2025-12-03 09:05:48 +00:00
committed by Copybot
parent a1f1ca2028
commit 5982eed3fa
18 changed files with 372 additions and 35 deletions
@@ -22,6 +22,7 @@ import { expressify } from '@overleaf/promise-utils'
import { acceptsJson } from '../../infrastructure/RequestContentTypeDetection.mjs'
import Modules from '../../infrastructure/Modules.mjs'
import OneTimeTokenHandler from '../Security/OneTimeTokenHandler.mjs'
import SplitTestHandler from '../SplitTests/SplitTestHandler.mjs'
async function _sendSecurityAlertClearedSessions(user) {
const emailOptions = {
@@ -405,7 +406,18 @@ async function updateUserSettings(req, res, next) {
user.ace.referencesSearchMode = mode
}
if (body.enableNewEditor != null) {
user.ace.enableNewEditor = Boolean(body.enableNewEditor)
const assignment = await SplitTestHandler.promises.getAssignment(
req,
res,
'editor-redesign-opt-out'
)
const isOptOutStageEnabled = assignment.variant === 'enabled'
if (isOptOutStageEnabled) {
user.ace.enableNewEditorStageFour = Boolean(body.enableNewEditor)
} else {
user.ace.enableNewEditor = Boolean(body.enableNewEditor)
}
}
if (body.darkModePdf != null) {
user.ace.darkModePdf = Boolean(body.darkModePdf)