From 6aa9e5c855a6db5d92f62ff69bb62aca22f0eb96 Mon Sep 17 00:00:00 2001
From: David <33458145+davidmcpowell@users.noreply.github.com>
Date: Tue, 4 Nov 2025 12:55:26 +0000
Subject: [PATCH] Merge pull request #29496 from
overleaf/dp-remove-new-editor-old-logs
Move all new editor users to new logs
GitOrigin-RevId: 224a4476eddb6576eaa04086a68b6579650a1bc5
---
.../ide-redesign/utils/new-editor-utils.ts | 19 -------------------
.../pdf-preview/components/pdf-log-entry.tsx | 6 +++---
.../components/pdf-preview-pane.tsx | 10 +++-------
.../pdf-preview/hooks/use-log-events.ts | 8 ++++----
.../pdf-preview/new-editor-utils.test.tsx | 2 +-
5 files changed, 11 insertions(+), 34 deletions(-)
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 8c0499357a..fa6d0d9f1e 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
@@ -41,18 +41,6 @@ export const canUseNewEditor = () => {
)
}
-const canUseNewLogs = () => {
- const newUserTestVariant = getSplitTestVariant('editor-redesign-new-users')
- const canUseNewLogsViaNewUserFeatureFlag =
- isNewUser() &&
- (newUserTestVariant === 'new-editor' ||
- newUserTestVariant === 'new-editor-new-logs-old-position')
-
- return (
- canUseNewEditorViaPrimaryFeatureFlag() || canUseNewLogsViaNewUserFeatureFlag
- )
-}
-
export const useIsNewEditorEnabledViaPrimaryFeatureFlag = () => {
const { userSettings } = useUserSettingsContext()
const hasAccess = canUseNewEditorViaPrimaryFeatureFlag()
@@ -67,15 +55,8 @@ export const useIsNewEditorEnabled = () => {
return hasAccess && enabled
}
-export const useAreNewErrorLogsEnabled = () => {
- const newEditorEnabled = useIsNewEditorEnabled()
- return newEditorEnabled && canUseNewLogs()
-}
-
export function useNewEditorVariant() {
const newEditor = useIsNewEditorEnabled()
- const newErrorLogs = useAreNewErrorLogsEnabled()
if (!newEditor) return 'default'
- if (!newErrorLogs) return 'new-editor-old-logs'
return 'new-editor-new-logs-old-position'
}
diff --git a/services/web/frontend/js/features/pdf-preview/components/pdf-log-entry.tsx b/services/web/frontend/js/features/pdf-preview/components/pdf-log-entry.tsx
index d0e574d5ad..e2e7e5893a 100644
--- a/services/web/frontend/js/features/pdf-preview/components/pdf-log-entry.tsx
+++ b/services/web/frontend/js/features/pdf-preview/components/pdf-log-entry.tsx
@@ -4,9 +4,9 @@ import PdfLogEntryContent from './pdf-log-entry-content'
import HumanReadableLogsHints from '../../../ide/human-readable-logs/HumanReadableLogsHints'
import getMeta from '@/utils/meta'
import { ErrorLevel, LogEntry, SourceLocation } from '../util/types'
-import { useAreNewErrorLogsEnabled } from '@/features/ide-redesign/utils/new-editor-utils'
import NewLogEntry from '@/features/ide-redesign/components/error-logs/log-entry'
import { useEditorAnalytics } from '@/shared/hooks/use-editor-analytics'
+import { useIsNewEditorEnabled } from '@/features/ide-redesign/utils/new-editor-utils'
function PdfLogEntry({
autoExpand,
@@ -71,9 +71,9 @@ function PdfLogEntry({
[level, onSourceLocationClick, ruleId, sourceLocation, sendEvent]
)
- const newErrorlogs = useAreNewErrorLogsEnabled()
+ const newEditor = useIsNewEditorEnabled()
- if (newErrorlogs) {
+ if (newEditor) {
return (
)}
- {newErrorLogs && }
+ {newEditor && }
{compileTimeout < 60 && }
@@ -51,7 +47,7 @@ function PdfPreviewPane() {
- {newErrorLogs ? : }
+ {newEditor ? : }
{pdfPromotions.map(({ import: { default: Component }, path }) => (
))}
diff --git a/services/web/frontend/js/features/pdf-preview/hooks/use-log-events.ts b/services/web/frontend/js/features/pdf-preview/hooks/use-log-events.ts
index 4bed8a5500..05396aa597 100644
--- a/services/web/frontend/js/features/pdf-preview/hooks/use-log-events.ts
+++ b/services/web/frontend/js/features/pdf-preview/hooks/use-log-events.ts
@@ -1,8 +1,8 @@
import { useCallback } from 'react'
import { useLayoutContext } from '@/shared/context/layout-context'
-import { useAreNewErrorLogsEnabled } from '@/features/ide-redesign/utils/new-editor-utils'
import { useEditorContext } from '@/shared/context/editor-context'
import useEventListener from '@/shared/hooks/use-event-listener'
+import { useIsNewEditorEnabled } from '@/features/ide-redesign/utils/new-editor-utils'
function scrollIntoView(element: Element) {
setTimeout(() => {
@@ -18,7 +18,7 @@ function scrollIntoView(element: Element) {
*/
export const useLogEvents = (setShowLogs: (show: boolean) => void) => {
const { pdfLayout, setView } = useLayoutContext()
- const newLogs = useAreNewErrorLogsEnabled()
+ const newEditor = useIsNewEditorEnabled()
const { hasPremiumSuggestion } = useEditorContext()
const selectLogOldLogs = useCallback((id: string, suggestFix: boolean) => {
@@ -117,7 +117,7 @@ export const useLogEvents = (setShowLogs: (show: boolean) => void) => {
openLogs()
- if (newLogs) {
+ if (newEditor) {
selectLogNewLogs(
id,
Boolean(suggestFix),
@@ -127,7 +127,7 @@ export const useLogEvents = (setShowLogs: (show: boolean) => void) => {
selectLogOldLogs(id, Boolean(suggestFix))
}
},
- [openLogs, selectLogNewLogs, selectLogOldLogs, newLogs]
+ [openLogs, selectLogNewLogs, selectLogOldLogs, newEditor]
)
useEventListener(
diff --git a/services/web/test/frontend/components/pdf-preview/new-editor-utils.test.tsx b/services/web/test/frontend/components/pdf-preview/new-editor-utils.test.tsx
index baaa8b1998..bcacd7898b 100644
--- a/services/web/test/frontend/components/pdf-preview/new-editor-utils.test.tsx
+++ b/services/web/test/frontend/components/pdf-preview/new-editor-utils.test.tsx
@@ -14,7 +14,7 @@ describe('new-editor-utils', function () {
},
{
splitTestVariant: 'new-editor-old-logs',
- uiVariant: 'new-editor-old-logs',
+ uiVariant: 'new-editor-new-logs-old-position',
},
{
splitTestVariant: 'new-editor-new-logs-old-position',