diff --git a/services/web/app/src/Features/Project/ProjectController.mjs b/services/web/app/src/Features/Project/ProjectController.mjs index 1bfb7a210e..00d6a0a3c7 100644 --- a/services/web/app/src/Features/Project/ProjectController.mjs +++ b/services/web/app/src/Features/Project/ProjectController.mjs @@ -459,6 +459,7 @@ const _ProjectController = { 'writefull-asymetric-queue-size-per-model', 'pdf-dark-mode', 'email-notifications', + 'editor-redesign-no-opt-out', ].filter(Boolean) const getUserValues = async userId => diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index 37a99eafef..52f9bfeb5d 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -750,6 +750,7 @@ "go_to_writefull": "", "good_news_you_already_purchased_this_add_on": "", "good_news_you_are_already_receiving_this_add_on_via_writefull": "", + "got_questions": "", "group_admin": "", "group_audit_logs": "", "group_has_no_licenses_available_error": "", @@ -1421,6 +1422,7 @@ "read_more": "", "read_more_about_managed_users": "", "read_more_about_the_new_editor": "", + "read_more_about_the_new_editor_or_explore_our_documentation_for_tips_and_tricks": "", "read_only_dropbox_sync_message": "", "read_only_token": "", "read_write_token": "", diff --git a/services/web/frontend/js/features/ide-redesign/components/editor-tour/editor-tour-switch-back-tooltip.tsx b/services/web/frontend/js/features/ide-redesign/components/editor-tour/editor-tour-switch-back-tooltip.tsx index 805065a1d3..f60c0fea88 100644 --- a/services/web/frontend/js/features/ide-redesign/components/editor-tour/editor-tour-switch-back-tooltip.tsx +++ b/services/web/frontend/js/features/ide-redesign/components/editor-tour/editor-tour-switch-back-tooltip.tsx @@ -1,5 +1,6 @@ import { Trans, useTranslation } from 'react-i18next' import EditorTourTooltip from './editor-tour-tooltip' +import { useFeatureFlag } from '@/shared/context/split-test-context' export default function EditorTourSwitchBackTooltip({ target, @@ -7,27 +8,56 @@ export default function EditorTourSwitchBackTooltip({ target: HTMLElement | null }) { const { t } = useTranslation() + // NOTE: This should really be a different component, but to reduce + // complexity of the tour code, let's just change the content here. + // The feature flag can be torn down soon, and the component renamed. + const noOptOut = useFeatureFlag('editor-redesign-no-opt-out') + const canSwitchBack = !noOptOut return ( - , - , - ]} - /> + {canSwitchBack ? ( + , + , + ]} + /> + ) : ( + , + /* eslint-disable-next-line jsx-a11y/anchor-has-content, react/jsx-key */ + , + ]} + /> + )} ) } diff --git a/services/web/frontend/js/features/ide-redesign/contexts/settings-modal-context.tsx b/services/web/frontend/js/features/ide-redesign/contexts/settings-modal-context.tsx index bdfba12e0f..c20e39401d 100644 --- a/services/web/frontend/js/features/ide-redesign/contexts/settings-modal-context.tsx +++ b/services/web/frontend/js/features/ide-redesign/contexts/settings-modal-context.tsx @@ -89,6 +89,8 @@ export const SettingsModalProvider: FC = ({ const hasDarkModePdf = useFeatureFlag('pdf-dark-mode') const hasEmailNotifications = useFeatureFlag('email-notifications') + const noNewEditorOptOut = useFeatureFlag('editor-redesign-no-opt-out') + const allSettingsTabs: SettingsEntry[] = useMemo( () => [ { @@ -228,6 +230,7 @@ export const SettingsModalProvider: FC = ({ { key: 'newEditor', component: , + hidden: noNewEditorOptOut, }, ], }, @@ -265,7 +268,7 @@ export const SettingsModalProvider: FC = ({ href: '/user/subscription', }, ], - [t, overallTheme, hasDarkModePdf, hasEmailNotifications] + [t, overallTheme, hasDarkModePdf, hasEmailNotifications, noNewEditorOptOut] ) const settingsTabs = useMemo( diff --git a/services/web/frontend/js/features/ide-redesign/utils/new-editor-utils.ts b/services/web/frontend/js/features/ide-redesign/utils/new-editor-utils.ts index 02c3c83dfd..3a7ff510ba 100644 --- a/services/web/frontend/js/features/ide-redesign/utils/new-editor-utils.ts +++ b/services/web/frontend/js/features/ide-redesign/utils/new-editor-utils.ts @@ -1,3 +1,4 @@ +import { useFeatureFlag } from '@/shared/context/split-test-context' import { useUserSettingsContext } from '@/shared/context/user-settings-context' import getMeta from '@/utils/meta' @@ -15,9 +16,16 @@ export const canUseNewEditor = () => { export const useIsNewEditorEnabled = () => { const { userSettings } = useUserSettingsContext() + const noOptOut = useFeatureFlag('editor-redesign-no-opt-out') const hasAccess = canUseNewEditor() + if (!hasAccess) { + return false + } const enabled = userSettings.enableNewEditor - return hasAccess && enabled + if (noOptOut) { + return true + } + return enabled } export const useIsNewToNewEditor = () => { diff --git a/services/web/locales/en.json b/services/web/locales/en.json index e6cefc2e80..e37a7fc837 100644 --- a/services/web/locales/en.json +++ b/services/web/locales/en.json @@ -965,6 +965,7 @@ "go_to_writefull": "Go to Writefull", "good_news_you_already_purchased_this_add_on": "Good news! You already have this add-on, so no need to pay again.", "good_news_you_are_already_receiving_this_add_on_via_writefull": "Good news! You already have this add-on via your Writefull subscription. No need to pay again.", + "got_questions": "Got questions?", "great_for_getting_started": "Great for getting started", "great_for_small_teams_and_departments": "Great for small teams and departments", "group": "Group", @@ -1842,6 +1843,7 @@ "read_more": "Read more", "read_more_about_managed_users": "Read more about managed users", "read_more_about_the_new_editor": "<0>Read more about the new editor design, or temporarily switch back to the old editor using the <1>Appearance settings.", + "read_more_about_the_new_editor_or_explore_our_documentation_for_tips_and_tricks": "<0>Read more about the new editor, or <1>explore our documentation for tips and tricks.", "read_only_dropbox_sync_message": "As a read-only viewer you can sync the current project version to Dropbox, but changes made in Dropbox will <0>not sync back to Overleaf.", "read_only_token": "Read-Only Token", "read_write_token": "Read-Write Token",