From 281dc16a6d311aa50d59bd64012af6b7d07fc560 Mon Sep 17 00:00:00 2001 From: Davinder Singh Date: Wed, 4 Mar 2026 16:19:08 +0000 Subject: [PATCH] removing the usage of useIsNewEditorEnabled from first set of files (#31800) GitOrigin-RevId: 821885295f4dab046d9abf552d7fbd7a21d86fb5 --- .../web/frontend/extracted-translations.json | 4 -- .../js/features/chat/context/chat-context.tsx | 8 +--- .../components/file-tree-context-menu.tsx | 4 +- .../file-tree/components/file-tree-icon.tsx | 34 +++---------- .../file-tree-item/file-tree-item-inner.tsx | 40 +++++----------- .../file-tree/components/file-tree-root.tsx | 5 +- .../file-tree/util/icon-type-from-name.ts | 17 ------- .../file-tree/history-file-tree-doc.tsx | 23 ++++----- .../file-tree/history-file-tree-folder.tsx | 8 ---- .../ide-react/components/editor-survey.tsx | 5 +- .../components/pdf-hybrid-theme-button.tsx | 7 --- .../components/pdf-preview-detached-root.tsx | 6 --- .../components/pdf-preview-pane.tsx | 7 +-- .../pdf-preview/hooks/use-log-events.ts | 48 +++---------------- .../components/review-panel-header.tsx | 19 ++------ .../components/codemirror-toolbar.tsx | 8 ++-- .../components/full-project-search-button.tsx | 13 ++--- .../components/math-preview-tooltip.tsx | 18 ++----- .../use-toolbar-menu-editor-commands.tsx | 13 ++--- services/web/locales/en.json | 4 -- services/web/locales/zh-CN.json | 1 - .../js/components/full-project-search.tsx | 9 ---- .../util/icon-type-from-name.test.ts | 21 -------- 23 files changed, 55 insertions(+), 267 deletions(-) delete mode 100644 services/web/test/frontend/features/file-tree/util/icon-type-from-name.test.ts diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index 7732811598..a31c347f8b 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -357,7 +357,6 @@ "cookie_banner_info": "", "copied": "", "copy": "", - "copy_code": "", "copy_project": "", "copy_response": "", "copying": "", @@ -444,7 +443,6 @@ "disable_ai_features": "", "disable_equation_preview": "", "disable_equation_preview_confirm": "", - "disable_equation_preview_enable": "", "disable_equation_preview_enable_in_settings": "", "disable_single_sign_on": "", "disable_sso": "", @@ -748,7 +746,6 @@ "github_workflow_files_error": "", "github_workflow_files_error_non_owner": "", "give_feedback": "", - "give_your_feedback": "", "go_next_page": "", "go_page": "", "go_prev_page": "", @@ -1930,7 +1927,6 @@ "this_experiment_gives_you_access_to_new_versions_of_latex": "", "this_field_is_required": "", "this_grants_access_to_features_2": "", - "this_is_a_new_feature": "", "this_is_the_file_that_references_pulled_from_your_reference_manager_will_be_added_to": "", "this_organization_is_tax_exempt": "", "this_project_already_has_maximum_collaborators": "", diff --git a/services/web/frontend/js/features/chat/context/chat-context.tsx b/services/web/frontend/js/features/chat/context/chat-context.tsx index 047ec2b5c9..59e08b7a24 100644 --- a/services/web/frontend/js/features/chat/context/chat-context.tsx +++ b/services/web/frontend/js/features/chat/context/chat-context.tsx @@ -24,13 +24,11 @@ import { prependMessages, } from '../utils/message-list-utils' import useBrowserWindow from '../../../shared/hooks/use-browser-window' -import { useLayoutContext } from '../../../shared/context/layout-context' import { useIdeContext } from '@/shared/context/ide-context' import getMeta from '@/utils/meta' import { debugConsole } from '@/utils/debugging' import { User } from '../../../../../types/user' import { useRailContext } from '@/features/ide-react/context/rail-context' -import { useIsNewEditorEnabled } from '@/features/ide-redesign/utils/new-editor-utils' const PAGE_SIZE = 50 @@ -272,12 +270,8 @@ export const ChatProvider: FC = ({ children }) => { const user = useUserContext() const { projectId } = useProjectContext() - const { chatIsOpen: chatIsOpenOldEditor } = useLayoutContext() const { selectedTab: selectedRailTab, isOpen: railIsOpen } = useRailContext() - const newEditor = useIsNewEditorEnabled() - const chatIsOpen = newEditor - ? selectedRailTab === 'chat' && railIsOpen - : chatIsOpenOldEditor + const chatIsOpen = selectedRailTab === 'chat' && railIsOpen const { hasFocus: windowHasFocus, diff --git a/services/web/frontend/js/features/file-tree/components/file-tree-context-menu.tsx b/services/web/frontend/js/features/file-tree/components/file-tree-context-menu.tsx index 344ad60062..a00e890396 100644 --- a/services/web/frontend/js/features/file-tree/components/file-tree-context-menu.tsx +++ b/services/web/frontend/js/features/file-tree/components/file-tree-context-menu.tsx @@ -9,14 +9,12 @@ import { useFileTreeMainContext } from '../contexts/file-tree-main' import FileTreeItemMenuItems from './file-tree-item/file-tree-item-menu-items' import classNames from 'classnames' -import { useIsNewEditorEnabled } from '@/features/ide-redesign/utils/new-editor-utils' function FileTreeContextMenu() { const { fileTreeReadOnly } = useFileTreeData() const { contextMenuCoords, setContextMenuCoords } = useFileTreeMainContext() const toggleButtonRef = useRef(null) const keyboardInputRef = useRef(false) - const newEditor = useIsNewEditorEnabled() useEffect(() => { if (contextMenuCoords) { @@ -90,7 +88,7 @@ function FileTreeContextMenu() { style={contextMenuCoords} // TODO ide-redesign-cleanup: remove 'ide-redesign-main' class when old editor is removed // It is only used to apply dark theme styles to the context menu in the new editor - className={classNames('context-menu', { 'ide-redesign-main': newEditor })} + className="context-menu ide-redesign-main" > - - {isLinkedFile && ( - - )} - - ) - } - return ( <> -   - + {isLinkedFile && ( void setIsDraggable: (isDraggable: boolean) => void }) => { - const newEditor = useIsNewEditorEnabled() - - if (newEditor) { - return onClick ? ( - - ) : ( -
- {icons} - -
- ) - } - - return ( - <> + return onClick ? ( + + ) : ( +
+ {icons} + +
) } diff --git a/services/web/frontend/js/features/file-tree/components/file-tree-root.tsx b/services/web/frontend/js/features/file-tree/components/file-tree-root.tsx index 8a85109ffe..3914c1cec1 100644 --- a/services/web/frontend/js/features/file-tree/components/file-tree-root.tsx +++ b/services/web/frontend/js/features/file-tree/components/file-tree-root.tsx @@ -6,7 +6,6 @@ import FileTreeContext from './file-tree-context' import FileTreeDraggablePreviewLayer from './file-tree-draggable-preview-layer' import FileTreeFolderList from './file-tree-folder-list' import FileTreeToolbar from './file-tree-toolbar' -import FileTreeToolbarNew from '@/features/file-tree/components/file-tree-toolbar' import FileTreeModalDelete from './modals/file-tree-modal-delete' import FileTreeModalCreateFolder from './modals/file-tree-modal-create-folder' import FileTreeModalError from './modals/file-tree-modal-error' @@ -19,7 +18,6 @@ import FileTreeInner from './file-tree-inner' import { useDragLayer } from 'react-dnd' import classnames from 'classnames' import { pathInFolder } from '@/features/file-tree/util/path' -import { useIsNewEditorEnabled } from '@/features/ide-redesign/utils/new-editor-utils' import { FileTreeFindResult } from '@/features/ide-react/types/file-tree' const FileTreeRoot = React.memo<{ @@ -44,7 +42,6 @@ const FileTreeRoot = React.memo<{ const { projectId } = useProjectContext() const { fileTreeData } = useFileTreeData() const isReady = Boolean(projectId && fileTreeData) - const newEditor = useIsNewEditorEnabled() useEffect(() => { if (fileTreeContainer) { @@ -101,7 +98,7 @@ const FileTreeRoot = React.memo<{ fileTreeContainer={fileTreeContainer} > {isConnected ? null :
} - {newEditor ? : } + diff --git a/services/web/frontend/js/features/file-tree/util/icon-type-from-name.ts b/services/web/frontend/js/features/file-tree/util/icon-type-from-name.ts index 3994494345..dddf13a1d5 100644 --- a/services/web/frontend/js/features/file-tree/util/icon-type-from-name.ts +++ b/services/web/frontend/js/features/file-tree/util/icon-type-from-name.ts @@ -18,20 +18,3 @@ export const newEditorIconTypeFromName = ( } return 'description' } - -export default function iconTypeFromName(name: string): string { - let ext = name.split('.').pop() - ext = ext ? ext.toLowerCase() : ext - - if (ext && ['png', 'pdf', 'jpg', 'jpeg', 'gif'].includes(ext)) { - return 'image' - } else if (ext && ['csv', 'xls', 'xlsx'].includes(ext)) { - return 'table_chart' - } else if (ext && ['py', 'r'].includes(ext)) { - return 'code' - } else if (ext && ['bib'].includes(ext)) { - return 'menu_book' - } else { - return 'description' - } -} diff --git a/services/web/frontend/js/features/history/components/file-tree/history-file-tree-doc.tsx b/services/web/frontend/js/features/history/components/file-tree/history-file-tree-doc.tsx index 7088588e27..5e5f755c71 100644 --- a/services/web/frontend/js/features/history/components/file-tree/history-file-tree-doc.tsx +++ b/services/web/frontend/js/features/history/components/file-tree/history-file-tree-doc.tsx @@ -1,12 +1,9 @@ import { memo } from 'react' import classNames from 'classnames' import HistoryFileTreeItem from './history-file-tree-item' -import iconTypeFromName, { - newEditorIconTypeFromName, -} from '../../../file-tree/util/icon-type-from-name' +import { newEditorIconTypeFromName } from '../../../file-tree/util/icon-type-from-name' import type { FileDiff } from '../../services/types/file' import MaterialIcon from '@/shared/components/material-icon' -import { useIsNewEditorEnabled } from '@/features/ide-redesign/utils/new-editor-utils' type HistoryFileTreeDocProps = { file: FileDiff @@ -23,16 +20,6 @@ function HistoryFileTreeDoc({ onClick, onKeyDown, }: HistoryFileTreeDocProps) { - const newEditor = useIsNewEditorEnabled() - const icon = newEditor ? ( - - ) : ( - - ) return (
  • + } />
  • ) diff --git a/services/web/frontend/js/features/history/components/file-tree/history-file-tree-folder.tsx b/services/web/frontend/js/features/history/components/file-tree/history-file-tree-folder.tsx index 738b0a4688..c59ed88b66 100644 --- a/services/web/frontend/js/features/history/components/file-tree/history-file-tree-folder.tsx +++ b/services/web/frontend/js/features/history/components/file-tree/history-file-tree-folder.tsx @@ -6,7 +6,6 @@ import HistoryFileTreeFolderList from './history-file-tree-folder-list' import type { HistoryDoc, HistoryFileTree } from '../../utils/file-tree' import MaterialIcon from '@/shared/components/material-icon' -import { useIsNewEditorEnabled } from '@/features/ide-redesign/utils/new-editor-utils' type HistoryFileTreeFolderProps = { name: string @@ -36,7 +35,6 @@ function HistoryFileTreeFolder({ docs, }: HistoryFileTreeFolderProps) { const { t } = useTranslation() - const newEditor = useIsNewEditorEnabled() const [expanded, setExpanded] = useState(() => { return hasChanges({ name, folders, docs }) @@ -54,12 +52,6 @@ function HistoryFileTreeFolder({ className="file-tree-expand-icon" /> - {!newEditor && ( - - )} ) diff --git a/services/web/frontend/js/features/ide-react/components/editor-survey.tsx b/services/web/frontend/js/features/ide-react/components/editor-survey.tsx index c3ea42d40a..3a340d4010 100644 --- a/services/web/frontend/js/features/ide-react/components/editor-survey.tsx +++ b/services/web/frontend/js/features/ide-react/components/editor-survey.tsx @@ -8,7 +8,6 @@ import { OLToastContainer } from '@/shared/components/ol/ol-toast-container' import useTutorial from '@/shared/hooks/promotions/use-tutorial' import { memo, useCallback, useEffect, useMemo, useState } from 'react' import { sendMB } from '@/infrastructure/event-tracking' -import { useIsNewEditorEnabled } from '@/features/ide-redesign/utils/new-editor-utils' import { useTranslation } from 'react-i18next' type EditorSurveyPage = 'ease-of-use' | 'meets-my-needs' | 'thank-you' @@ -27,7 +26,6 @@ const EditorSurveyContent = () => { const [easeOfUse, setEaseOfUse] = useState(null) const [meetsMyNeeds, setMeetsMyNeeds] = useState(null) const [page, setPage] = useState('ease-of-use') - const newEditor = useIsNewEditorEnabled() const { t } = useTranslation() @@ -51,11 +49,10 @@ const EditorSurveyContent = () => { sendMB('editor-survey-submit', { easeOfUse, meetsMyNeeds, - newEditor, }) setPage('thank-you') completeSurvey({ event: 'promo-click', action: 'complete' }) - }, [easeOfUse, meetsMyNeeds, completeSurvey, newEditor]) + }, [easeOfUse, meetsMyNeeds, completeSurvey]) if (!showSurvey && page !== 'thank-you') { return null diff --git a/services/web/frontend/js/features/pdf-preview/components/pdf-hybrid-theme-button.tsx b/services/web/frontend/js/features/pdf-preview/components/pdf-hybrid-theme-button.tsx index 8e5af5ea81..188adf6eed 100644 --- a/services/web/frontend/js/features/pdf-preview/components/pdf-hybrid-theme-button.tsx +++ b/services/web/frontend/js/features/pdf-preview/components/pdf-hybrid-theme-button.tsx @@ -3,12 +3,10 @@ import { useCallback, useId } from 'react' import { useTranslation } from 'react-i18next' import { useDetachCompileContext as useCompileContext } from '../../../shared/context/detach-compile-context' import OLIconButton from '@/shared/components/ol/ol-icon-button' -import { useIsNewEditorEnabled } from '@/features/ide-redesign/utils/new-editor-utils' export const PdfHybridThemeButton = () => { const id = useId() const { t } = useTranslation() - const usesNewEditor = useIsNewEditorEnabled() const { pdfViewer, darkModePdf, @@ -21,11 +19,6 @@ export const PdfHybridThemeButton = () => { setDarkModePdf(!darkModePdf) }, [darkModePdf, setDarkModePdf]) - if (!usesNewEditor) { - // The old editor does not support dark mode PDF, so don't show the button - return null - } - if (activeOverallTheme !== 'dark') { return null } diff --git a/services/web/frontend/js/features/pdf-preview/components/pdf-preview-detached-root.tsx b/services/web/frontend/js/features/pdf-preview/components/pdf-preview-detached-root.tsx index baa3db8ef6..d93d8d961f 100644 --- a/services/web/frontend/js/features/pdf-preview/components/pdf-preview-detached-root.tsx +++ b/services/web/frontend/js/features/pdf-preview/components/pdf-preview-detached-root.tsx @@ -2,7 +2,6 @@ import { createRoot } from 'react-dom/client' import PdfPreview from './pdf-preview' import useWaitForI18n from '../../../shared/hooks/use-wait-for-i18n' import { ReactContextRoot } from '@/features/ide-react/context/react-context-root' -import { useIsNewEditorEnabled } from '@/features/ide-redesign/utils/new-editor-utils' import { useDetachCompileContext as useCompileContext } from '@/shared/context/detach-compile-context' import { useEffect } from 'react' @@ -36,11 +35,6 @@ function PdfPreviewDetachedRootContent() { ) } function EditorRedesignWrapper({ children }: { children: React.ReactNode }) { - const newEditorEnabled = useIsNewEditorEnabled() - if (!newEditorEnabled) { - return <>{children} - } - // TODO ide-redesign-cleanup: this wrapper should not be required return
    {children}
    } diff --git a/services/web/frontend/js/features/pdf-preview/components/pdf-preview-pane.tsx b/services/web/frontend/js/features/pdf-preview/components/pdf-preview-pane.tsx index d776b2da83..8482554013 100644 --- a/services/web/frontend/js/features/pdf-preview/components/pdf-preview-pane.tsx +++ b/services/web/frontend/js/features/pdf-preview/components/pdf-preview-pane.tsx @@ -7,7 +7,6 @@ import { PdfPreviewMessages } from './pdf-preview-messages' import CompileTimeWarningUpgradePrompt from './compile-time-warning-upgrade-prompt' import { PdfPreviewProvider } from './pdf-preview-provider' import PdfPreviewHybridToolbar from '@/features/pdf-preview/components/pdf-preview-hybrid-toolbar' -import { useIsNewEditorEnabled } from '@/features/ide-redesign/utils/new-editor-utils' import importOverleafModules from '../../../../macros/import-overleaf-module.macro' import PdfCodeCheckFailedBanner from '@/features/pdf-preview/components/pdf-code-check-failed-banner' import getMeta from '@/utils/meta' @@ -21,12 +20,8 @@ function PdfPreviewPane() { activeOverallTheme, } = useCompileContext() const { compileTimeout } = getMeta('ol-compileSettings') - const usesNewEditor = useIsNewEditorEnabled() const darkModePdf = - usesNewEditor && - pdfViewer === 'pdfjs' && - activeOverallTheme === 'dark' && - darkModeSetting + pdfViewer === 'pdfjs' && activeOverallTheme === 'dark' && darkModeSetting const classes = classNames('pdf', 'full-size', { 'pdf-empty': !pdfUrl, 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 05396aa597..d1d7b76155 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 @@ -2,7 +2,6 @@ import { useCallback } from 'react' import { useLayoutContext } from '@/shared/context/layout-context' 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,39 +17,8 @@ function scrollIntoView(element: Element) { */ export const useLogEvents = (setShowLogs: (show: boolean) => void) => { const { pdfLayout, setView } = useLayoutContext() - const newEditor = useIsNewEditorEnabled() const { hasPremiumSuggestion } = useEditorContext() - const selectLogOldLogs = useCallback((id: string, suggestFix: boolean) => { - window.setTimeout(() => { - const element = document.querySelector( - `.log-entry[data-log-entry-id="${id}"]` - ) - - if (element) { - scrollIntoView(element) - - if (suggestFix) { - // if they are paywalled, click that instead - const paywall = document.querySelector( - 'button[data-action="assistant-paywall-show"]' - ) - - if (paywall) { - scrollIntoView(paywall) - paywall.click() - } else { - element - .querySelector( - 'button[data-action="suggest-fix"]' - ) - ?.click() - } - } - } - }) - }, []) - const selectLogNewLogs = useCallback( ( id: string, @@ -117,17 +85,13 @@ export const useLogEvents = (setShowLogs: (show: boolean) => void) => { openLogs() - if (newEditor) { - selectLogNewLogs( - id, - Boolean(suggestFix), - Boolean(showPaywallIfOutOfSuggestions) - ) - } else { - selectLogOldLogs(id, Boolean(suggestFix)) - } + selectLogNewLogs( + id, + Boolean(suggestFix), + Boolean(showPaywallIfOutOfSuggestions) + ) }, - [openLogs, selectLogNewLogs, selectLogOldLogs, newEditor] + [openLogs, selectLogNewLogs] ) useEventListener( diff --git a/services/web/frontend/js/features/review-panel/components/review-panel-header.tsx b/services/web/frontend/js/features/review-panel/components/review-panel-header.tsx index 52f68d0051..92c5a39e72 100644 --- a/services/web/frontend/js/features/review-panel/components/review-panel-header.tsx +++ b/services/web/frontend/js/features/review-panel/components/review-panel-header.tsx @@ -1,28 +1,17 @@ import { FC, memo } from 'react' import { ReviewPanelResolvedThreadsButton } from './review-panel-resolved-threads-button' import { useTranslation } from 'react-i18next' -import { PanelHeading } from '@/shared/components/panel-heading' -import useReviewPanelLayout from '../hooks/use-review-panel-layout' import RailPanelHeader from '@/features/ide-react/components/rail/rail-panel-header' -import { useIsNewEditorEnabled } from '@/features/ide-redesign/utils/new-editor-utils' const ReviewPanelHeader: FC = () => { - const { closeReviewPanel } = useReviewPanelLayout() const { t } = useTranslation() - const newEditor = useIsNewEditorEnabled() return (
    - {newEditor ? ( - } - /> - ) : ( - - - - )} + } + />
    ) } diff --git a/services/web/frontend/js/features/source-editor/components/codemirror-toolbar.tsx b/services/web/frontend/js/features/source-editor/components/codemirror-toolbar.tsx index f1b9b98329..e296c589df 100644 --- a/services/web/frontend/js/features/source-editor/components/codemirror-toolbar.tsx +++ b/services/web/frontend/js/features/source-editor/components/codemirror-toolbar.tsx @@ -29,7 +29,6 @@ import { useTranslation } from 'react-i18next' import { ToggleSearchButton } from '@/features/source-editor/components/toolbar/toggle-search-button' import ReviewPanelHeader from '@/features/review-panel/components/review-panel-header' import useReviewPanelLayout from '@/features/review-panel/hooks/use-review-panel-layout' -import { useIsNewEditorEnabled } from '@/features/ide-redesign/utils/new-editor-utils' import Breadcrumbs from '@/features/source-editor/extensions/breadcrumbs' import classNames from 'classnames' import { useUserSettingsContext } from '@/shared/context/user-settings-context' @@ -73,7 +72,6 @@ const Toolbar = memo(function Toolbar() { const listDepth = minimumListDepthForSelection(state) - const newEditor = useIsNewEditorEnabled() const { showHeader: showReviewPanelHeader } = useReviewPanelLayout() const { @@ -162,11 +160,11 @@ const Toolbar = memo(function Toolbar() { return ( <> - {newEditor && showReviewPanelHeader && } + {showReviewPanelHeader && }
    ) )} - {newEditor && breadcrumbs && } + {breadcrumbs && }
    ) diff --git a/services/web/frontend/js/features/source-editor/components/full-project-search-button.tsx b/services/web/frontend/js/features/source-editor/components/full-project-search-button.tsx index a7fe5e72f5..e33386bc56 100644 --- a/services/web/frontend/js/features/source-editor/components/full-project-search-button.tsx +++ b/services/web/frontend/js/features/source-editor/components/full-project-search-button.tsx @@ -1,35 +1,28 @@ import { sendSearchEvent } from '@/features/event-tracking/search-events' import OLButton from '@/shared/components/ol/ol-button' import OLTooltip from '@/shared/components/ol/ol-tooltip' -import { useLayoutContext } from '@/shared/context/layout-context' import { closeSearchPanel, SearchQuery } from '@codemirror/search' import { useCallback } from 'react' import { useCodeMirrorViewContext } from './codemirror-context' import MaterialIcon from '@/shared/components/material-icon' import { useTranslation } from 'react-i18next' -import { useIsNewEditorEnabled } from '@/features/ide-redesign/utils/new-editor-utils' import { useRailContext } from '@/features/ide-react/context/rail-context' export const FullProjectSearchButton = ({ query }: { query: SearchQuery }) => { const view = useCodeMirrorViewContext() const { t } = useTranslation() - const { setProjectSearchIsOpen } = useLayoutContext() - const newEditor = useIsNewEditorEnabled() const { openTab } = useRailContext() const openFullProjectSearch = useCallback(() => { - if (newEditor) { - openTab('full-project-search') - } else { - setProjectSearchIsOpen(true) - } + openTab('full-project-search') + closeSearchPanel(view) window.setTimeout(() => { window.dispatchEvent( new CustomEvent('editor:full-project-search', { detail: query }) ) }, 200) - }, [setProjectSearchIsOpen, query, view, newEditor, openTab]) + }, [query, view, openTab]) const onClick = useCallback(() => { sendSearchEvent('search-open', { diff --git a/services/web/frontend/js/features/source-editor/components/math-preview-tooltip.tsx b/services/web/frontend/js/features/source-editor/components/math-preview-tooltip.tsx index 497d01c72e..3805ba2be7 100644 --- a/services/web/frontend/js/features/source-editor/components/math-preview-tooltip.tsx +++ b/services/web/frontend/js/features/source-editor/components/math-preview-tooltip.tsx @@ -24,7 +24,6 @@ import { mathPreviewStateField } from '../extensions/math-preview' import { getTooltip } from '@codemirror/view' import ReactDOM from 'react-dom' import OLDropdownMenuItem from '@/shared/components/ol/ol-dropdown-menu-item' -import { useIsNewEditorEnabled } from '@/features/ide-redesign/utils/new-editor-utils' const MathPreviewTooltipContainer: FC = () => { const state = useCodeMirrorStateContext() @@ -60,8 +59,6 @@ const MathPreviewTooltipContainer: FC = () => { const MathPreviewTooltipMenu: FC = () => { const { t } = useTranslation() - const newEditor = useIsNewEditorEnabled() - const [showDisableModal, setShowDisableModal] = useState(false) const { setMathPreview } = useProjectSettingsContext() const openDisableModal = useCallback(() => setShowDisableModal(true), []) @@ -126,17 +123,10 @@ const MathPreviewTooltipMenu: FC = () => { {t('disable_equation_preview_confirm')}
    - {newEditor ? ( - }} - /> - ) : ( - }} - /> - )} + }} + />
    diff --git a/services/web/frontend/js/features/source-editor/hooks/use-toolbar-menu-editor-commands.tsx b/services/web/frontend/js/features/source-editor/hooks/use-toolbar-menu-editor-commands.tsx index 8dfb19883f..65d8f09190 100644 --- a/services/web/frontend/js/features/source-editor/hooks/use-toolbar-menu-editor-commands.tsx +++ b/services/web/frontend/js/features/source-editor/hooks/use-toolbar-menu-editor-commands.tsx @@ -13,7 +13,6 @@ import { redo, selectAll, undo } from '@codemirror/commands' import { openSearchPanel } from '@codemirror/search' import { useCallback } from 'react' import { useTranslation } from 'react-i18next' -import { useIsNewEditorEnabled } from '../../ide-redesign/utils/new-editor-utils' import { usePermissionsContext } from '@/features/ide-react/context/permissions-context' import { language } from '@codemirror/language' @@ -35,10 +34,8 @@ export const useToolbarMenuBarEditorCommands = () => { ) }, []) - const newEditor = useIsNewEditorEnabled() - useCommandProvider(() => { - if (!newEditor || !editorIsVisible) { + if (!editorIsVisible) { return } @@ -80,11 +77,11 @@ export const useToolbarMenuBarEditorCommands = () => { }, }, ] - }, [editorIsVisible, t, view, trackedWrite, newEditor]) + }, [editorIsVisible, t, view, trackedWrite]) // LaTeX commands useCommandProvider(() => { - if (!newEditor || !editorIsVisible) { + if (!editorIsVisible) { return } if (!isTeXFile || !trackedWrite) { @@ -284,7 +281,6 @@ export const useToolbarMenuBarEditorCommands = () => { t, editorIsVisible, openFigureModal, - newEditor, trackedWrite, isTeXFile, state.selection.main.empty, @@ -294,7 +290,7 @@ export const useToolbarMenuBarEditorCommands = () => { const { toggleSymbolPalette } = useEditorPropertiesContext() const symbolPaletteAvailable = getMeta('ol-symbolPaletteAvailable') useCommandProvider(() => { - if (!newEditor || !editorIsVisible) { + if (!editorIsVisible) { return } @@ -322,6 +318,5 @@ export const useToolbarMenuBarEditorCommands = () => { editorIsVisible, isTeXFile, trackedWrite, - newEditor, ]) } diff --git a/services/web/locales/en.json b/services/web/locales/en.json index 4fd7e60efd..d68dc857f2 100644 --- a/services/web/locales/en.json +++ b/services/web/locales/en.json @@ -457,7 +457,6 @@ "cookie_banner_info": "We only use cookies for essential purposes and to improve your experience on our site. You can find out more in our <0>cookie policy.", "copied": "Copied", "copy": "Copy", - "copy_code": "Copy code", "copy_project": "Copy project", "copy_response": "Copy response", "copying": "Copying", @@ -567,7 +566,6 @@ "disable_ai_features": "Disable AI features", "disable_equation_preview": "Disable equation preview", "disable_equation_preview_confirm": "This will disable equation preview for you in all projects.", - "disable_equation_preview_enable": "You can enable it again from the Menu.", "disable_equation_preview_enable_in_settings": "You can enable it again in Settings.", "disable_single_sign_on": "Disable single sign-on", "disable_sso": "Disable SSO", @@ -953,7 +951,6 @@ "github_workflow_files_error": "The __appName__ GitHub sync service couldn’t sync GitHub Workflow files (in .github/workflows/). Please authorize __appName__ to edit your GitHub workflow files and try again.", "github_workflow_files_error_non_owner": "The __appName__ GitHub sync service couldn’t sync GitHub Workflow files (in .github/workflows/). Please ensure the project owner has authorized __appName__ to edit this project’s GitHub workflow files and try again.", "give_feedback": "Give feedback", - "give_your_feedback": "give your feedback", "global": "global", "go_back_and_link_accts": "Go back and link your accounts", "go_next_page": "Go to Next Page", @@ -2458,7 +2455,6 @@ "this_experiment_gives_you_access_to_new_versions_of_latex": "For advanced users only. This experiment gives you regular access to new, untested versions of TeX Live (the LaTeX engine used for compiling). You can then <0>choose this as your compiler on a project-by-project basis. <1>Find out more about rolling TeX Live", "this_field_is_required": "This field is required", "this_grants_access_to_features_2": "This grants you access to <0>__appName__ <0>__featureType__ features.", - "this_is_a_new_feature": "This is a new feature", "this_is_the_file_that_references_pulled_from_your_reference_manager_will_be_added_to": "This is the file that references pulled from your reference manager will be added to.", "this_is_your_template": "This is your template from your project", "this_organization_is_tax_exempt": "This organization is tax exempt", diff --git a/services/web/locales/zh-CN.json b/services/web/locales/zh-CN.json index 0225d5106c..223875f049 100644 --- a/services/web/locales/zh-CN.json +++ b/services/web/locales/zh-CN.json @@ -504,7 +504,6 @@ "disable_ai_features": "禁用 AI 功能", "disable_equation_preview": "禁用公式预览", "disable_equation_preview_confirm": "这将在所有项目中禁用公式预览。", - "disable_equation_preview_enable": "您可以从菜单再次启用它。", "disable_single_sign_on": "禁用 单点登录(SSO)", "disable_sso": "关闭 SSO", "disable_stop_on_first_error": "禁用 “出现第一个错误时停止”", diff --git a/services/web/modules/full-project-search/frontend/js/components/full-project-search.tsx b/services/web/modules/full-project-search/frontend/js/components/full-project-search.tsx index 7720b21589..8ddb7a83ca 100644 --- a/services/web/modules/full-project-search/frontend/js/components/full-project-search.tsx +++ b/services/web/modules/full-project-search/frontend/js/components/full-project-search.tsx @@ -1,17 +1,8 @@ import React, { FC, lazy, Suspense } from 'react' -import { useLayoutContext } from '@/shared/context/layout-context' -import { useIsNewEditorEnabled } from '@/features/ide-redesign/utils/new-editor-utils' const FullProjectSearchUI = lazy(() => import('./full-project-search-ui')) const FullProjectSearch: FC = () => { - const { projectSearchIsOpen } = useLayoutContext() - const newEditor = useIsNewEditorEnabled() - - if (!projectSearchIsOpen && !newEditor) { - return null - } - return ( diff --git a/services/web/test/frontend/features/file-tree/util/icon-type-from-name.test.ts b/services/web/test/frontend/features/file-tree/util/icon-type-from-name.test.ts deleted file mode 100644 index 855244d237..0000000000 --- a/services/web/test/frontend/features/file-tree/util/icon-type-from-name.test.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { expect } from 'chai' - -import iconTypeFromName from '../../../../../frontend/js/features/file-tree/util/icon-type-from-name' - -describe('iconTypeFromName', function () { - it('returns correct icon type', function () { - expect(iconTypeFromName('main.tex')).to.equal('description') - expect(iconTypeFromName('main.png')).to.equal('image') - expect(iconTypeFromName('main.csv')).to.equal('table_chart') - expect(iconTypeFromName('main.py')).to.equal('code') - expect(iconTypeFromName('main.bib')).to.equal('menu_book') - }) - - it('handles missing extensions', function () { - expect(iconTypeFromName('main')).to.equal('description') - }) - - it('lowercases extension', function () { - expect(iconTypeFromName('ZOTERO.BIB')).to.equal('menu_book') - }) -})