From f27c99ea4b9d938859932aa2123ea25ff290ce08 Mon Sep 17 00:00:00 2001 From: Davinder Singh Date: Wed, 4 Mar 2026 10:09:59 +0000 Subject: [PATCH] Tearing down of old Editor (File tree) (#31784) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * merging ide-redesign/components/file-tree into features/file-tree * moving ide-redesign/contexts/settings-modal-context to features/settings/contexts * use-collapsible-file-tree.tsx → features/file-tree/hooks * use-focus-on-setting.tsx → features/settings/hooks * use-project-notification-preferences.ts → features/settings/hooks * use-rail-overflow.tsx→ features/ide-react/hooks * deleting use-switch-enable-new-editor-state.ts * use-toolbar-menu-editor-commands.tsx → features/source-editor/hooks * npm run extract-translations * modifying the test to target correct buttons and removing a test for old component * adding a test back and modifying it * changing the test GitOrigin-RevId: baa1e9a992c88b84313eea82161354d4958cf1ef --- .../web/frontend/extracted-translations.json | 1 - .../components}/file-tree-action-button.tsx | 0 .../components}/file-tree-action-buttons.tsx | 4 +- .../components}/file-tree-outline-panel.tsx | 2 +- .../file-tree/components/file-tree-root.tsx | 2 +- .../components/file-tree-toolbar.tsx | 132 +++--------------- .../hooks/use-collapsible-file-tree.tsx | 0 .../ide-react/components/rail/rail.tsx | 4 +- .../hooks/use-rail-overflow.tsx | 2 +- .../file-tree/file-tree-toolbar.tsx | 32 ----- .../use-switch-enable-new-editor-state.ts | 37 ----- .../project-notifications-setting.tsx | 2 +- .../components/settings-modal-body.tsx | 2 +- .../settings/components/settings-modal.tsx | 4 +- .../settings/components/settings-tab-pane.tsx | 2 +- .../context}/settings-modal-context.tsx | 0 .../hooks/use-focus-on-setting.tsx | 2 +- .../use-project-notification-preferences.ts | 2 +- .../components/codemirror-editor.tsx | 2 +- .../use-toolbar-menu-editor-commands.tsx | 2 +- .../components/file-tree-toolbar.spec.tsx | 5 +- .../auto-close-brackets-setting.test.tsx | 2 +- .../settings/auto-compile-setting.test.tsx | 2 +- .../settings/auto-complete-setting.test.tsx | 2 +- .../settings/breadcrumbs-setting.test.tsx | 2 +- .../settings/code-check-setting.test.tsx | 2 +- .../settings/compiler-setting.test.tsx | 2 +- .../settings/dictionary-setting.test.tsx | 2 +- .../settings/draft-setting.test.tsx | 2 +- .../settings/editor-theme-setting.test.tsx | 2 +- .../settings/font-family-setting.test.tsx | 2 +- .../settings/font-size-setting.test.tsx | 2 +- .../settings/image-name-setting.test.tsx | 2 +- .../settings/keybinding-setting.test.tsx | 2 +- .../settings/line-height-setting.test.tsx | 2 +- .../settings/math-preview-setting.test.tsx | 2 +- .../settings/overall-theme-setting.test.tsx | 2 +- .../settings/pdf-viewer-setting.test.tsx | 2 +- .../settings/root-document-setting.test.tsx | 2 +- .../settings/spell-check-setting.test.tsx | 2 +- .../stop-on-first-error-setting.test.tsx | 2 +- 41 files changed, 57 insertions(+), 222 deletions(-) rename services/web/frontend/js/features/{ide-redesign/components/file-tree => file-tree/components}/file-tree-action-button.tsx (100%) rename services/web/frontend/js/features/{ide-redesign/components/file-tree => file-tree/components}/file-tree-action-buttons.tsx (95%) rename services/web/frontend/js/features/{ide-redesign/components/file-tree => file-tree/components}/file-tree-outline-panel.tsx (95%) rename services/web/frontend/js/features/{ide-redesign => file-tree}/hooks/use-collapsible-file-tree.tsx (100%) rename services/web/frontend/js/features/{ide-redesign => ide-react}/hooks/use-rail-overflow.tsx (94%) delete mode 100644 services/web/frontend/js/features/ide-redesign/components/file-tree/file-tree-toolbar.tsx delete mode 100644 services/web/frontend/js/features/ide-redesign/hooks/use-switch-enable-new-editor-state.ts rename services/web/frontend/js/features/{ide-redesign/contexts => settings/context}/settings-modal-context.tsx (100%) rename services/web/frontend/js/features/{ide-redesign => settings}/hooks/use-focus-on-setting.tsx (95%) rename services/web/frontend/js/features/{ide-redesign => settings}/hooks/use-project-notification-preferences.ts (98%) rename services/web/frontend/js/features/{ide-redesign => source-editor}/hooks/use-toolbar-menu-editor-commands.tsx (99%) diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index c08541822c..7732811598 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -1395,7 +1395,6 @@ "project_approaching_file_limit": "", "project_categories_tags": "", "project_figure_modal": "", - "project_files": "", "project_files_history": "", "project_flagged_too_many_compiles": "", "project_has_too_many_files_limit": "", diff --git a/services/web/frontend/js/features/ide-redesign/components/file-tree/file-tree-action-button.tsx b/services/web/frontend/js/features/file-tree/components/file-tree-action-button.tsx similarity index 100% rename from services/web/frontend/js/features/ide-redesign/components/file-tree/file-tree-action-button.tsx rename to services/web/frontend/js/features/file-tree/components/file-tree-action-button.tsx diff --git a/services/web/frontend/js/features/ide-redesign/components/file-tree/file-tree-action-buttons.tsx b/services/web/frontend/js/features/file-tree/components/file-tree-action-buttons.tsx similarity index 95% rename from services/web/frontend/js/features/ide-redesign/components/file-tree/file-tree-action-buttons.tsx rename to services/web/frontend/js/features/file-tree/components/file-tree-action-buttons.tsx index f6e0646c1e..8ade6fcfa3 100644 --- a/services/web/frontend/js/features/ide-redesign/components/file-tree/file-tree-action-buttons.tsx +++ b/services/web/frontend/js/features/file-tree/components/file-tree-action-buttons.tsx @@ -1,12 +1,12 @@ import { useTranslation } from 'react-i18next' -import * as eventTracking from '../../../../infrastructure/event-tracking' +import * as eventTracking from '../../../infrastructure/event-tracking' import { useFileTreeActionable } from '@/features/file-tree/contexts/file-tree-actionable' import { useFileTreeData } from '@/shared/context/file-tree-data-context' import React from 'react' import { useCommandProvider } from '@/features/ide-react/hooks/use-command-provider' import { usePermissionsContext } from '@/features/ide-react/context/permissions-context' import FileTreeActionButton from './file-tree-action-button' -import { useRailContext } from '../../../ide-react/context/rail-context' +import { useRailContext } from '../../ide-react/context/rail-context' export default function FileTreeActionButtons({ fileTreeExpanded, diff --git a/services/web/frontend/js/features/ide-redesign/components/file-tree/file-tree-outline-panel.tsx b/services/web/frontend/js/features/file-tree/components/file-tree-outline-panel.tsx similarity index 95% rename from services/web/frontend/js/features/ide-redesign/components/file-tree/file-tree-outline-panel.tsx rename to services/web/frontend/js/features/file-tree/components/file-tree-outline-panel.tsx index 3fe4af3942..fd0fd8ce8f 100644 --- a/services/web/frontend/js/features/ide-redesign/components/file-tree/file-tree-outline-panel.tsx +++ b/services/web/frontend/js/features/file-tree/components/file-tree-outline-panel.tsx @@ -3,7 +3,7 @@ import { FileTree } from '@/features/ide-react/components/file-tree' import { OutlineContainer } from '@/features/outline/components/outline-container' import { VerticalResizeHandle } from '@/features/ide-react/components/resize/vertical-resize-handle' import { useOutlinePane } from '@/features/ide-react/hooks/use-outline-pane' -import useCollapsibleFileTree from '../../hooks/use-collapsible-file-tree' +import useCollapsibleFileTree from '@/features/file-tree/hooks/use-collapsible-file-tree' import classNames from 'classnames' function FileTreeOutlinePanel() { 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 cbc3b1f689..8a85109ffe 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,7 @@ 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/ide-redesign/components/file-tree/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' diff --git a/services/web/frontend/js/features/file-tree/components/file-tree-toolbar.tsx b/services/web/frontend/js/features/file-tree/components/file-tree-toolbar.tsx index a759452472..eff3ea5212 100644 --- a/services/web/frontend/js/features/file-tree/components/file-tree-toolbar.tsx +++ b/services/web/frontend/js/features/file-tree/components/file-tree-toolbar.tsx @@ -1,124 +1,30 @@ import { useTranslation } from 'react-i18next' -import * as eventTracking from '../../../infrastructure/event-tracking' -import { useFileTreeActionable } from '../contexts/file-tree-actionable' -import { useFileTreeData } from '@/shared/context/file-tree-data-context' -import OLTooltip from '@/shared/components/ol/ol-tooltip' import MaterialIcon from '@/shared/components/material-icon' -import OLButtonToolbar from '@/shared/components/ol/ol-button-toolbar' -import importOverleafModules from '../../../../macros/import-overleaf-module.macro' -import React, { ElementType } from 'react' - -const fileTreeToolbarComponents = importOverleafModules( - 'fileTreeToolbarComponents' -) as { import: { default: ElementType }; path: string }[] +import React from 'react' +import useCollapsibleFileTree from '@/features/file-tree/hooks/use-collapsible-file-tree' +import FileTreeActionButtons from './file-tree-action-buttons' function FileTreeToolbar() { - const { fileTreeReadOnly } = useFileTreeData() const { t } = useTranslation() - - if (fileTreeReadOnly) return null + const { fileTreeExpanded, toggleFileTreeExpanded } = useCollapsibleFileTree() return ( - - - - - ) -} - -function FileTreeToolbarLeft() { - const { t } = useTranslation() - const { - canCreate, - startCreatingFolder, - startCreatingDocOrFile, - startUploadingDocOrFile, - } = useFileTreeActionable() - - const createWithAnalytics = () => { - eventTracking.sendMB('new-file-click', { location: 'toolbar' }) - startCreatingDocOrFile() - } - - const uploadWithAnalytics = () => { - eventTracking.sendMB('upload-click', { location: 'toolbar' }) - startUploadingDocOrFile() - } - - if (!canCreate) return null - - return ( -
- + - - - - - - - -
- ) -} - -function FileTreeToolbarRight() { - const { t } = useTranslation() - const { canRename, canDelete, startRenaming, startDeleting } = - useFileTreeActionable() - - return ( -
- {fileTreeToolbarComponents.map( - ({ import: { default: Component }, path }) => ( - - ) - )} - - {canRename ? ( - - - - ) : null} - - {canDelete ? ( - - - - ) : null} + +

{t('file_tree')}

+ +
) } diff --git a/services/web/frontend/js/features/ide-redesign/hooks/use-collapsible-file-tree.tsx b/services/web/frontend/js/features/file-tree/hooks/use-collapsible-file-tree.tsx similarity index 100% rename from services/web/frontend/js/features/ide-redesign/hooks/use-collapsible-file-tree.tsx rename to services/web/frontend/js/features/file-tree/hooks/use-collapsible-file-tree.tsx diff --git a/services/web/frontend/js/features/ide-react/components/rail/rail.tsx b/services/web/frontend/js/features/ide-react/components/rail/rail.tsx index 36d6adf69d..73b6c98178 100644 --- a/services/web/frontend/js/features/ide-react/components/rail/rail.tsx +++ b/services/web/frontend/js/features/ide-react/components/rail/rail.tsx @@ -6,7 +6,7 @@ import { RailTabKey, useRailContext, } from '@/features/ide-react/context/rail-context' -import FileTreeOutlinePanel from '@/features/ide-redesign/components/file-tree/file-tree-outline-panel' +import FileTreeOutlinePanel from '@/features/file-tree/components/file-tree-outline-panel' import ChatPane from '@/features/chat/components/chat-pane' import ChatIndicator from '@/features/chat/components/chat-indicator' import getMeta from '@/utils/meta' @@ -29,7 +29,7 @@ import RailPanel from './rail-panel' import RailResizeHandle from './rail-resize-handle' import RailModals from './rail-modals' import RailOverflowDropdown from './rail-overflow-dropdown' -import useRailOverflow from '@/features/ide-redesign/hooks/use-rail-overflow' +import useRailOverflow from '@/features/ide-react/hooks/use-rail-overflow' import EditorTourRailTooltip from '@/features/ide-redesign/components/editor-tour/editor-tour-rail-tooltip' import importOverleafModules from '../../../../../macros/import-overleaf-module.macro' import EditorTourThemeTooltip from '@/features/ide-redesign/components/editor-tour/editor-tour-theme-tooltip' diff --git a/services/web/frontend/js/features/ide-redesign/hooks/use-rail-overflow.tsx b/services/web/frontend/js/features/ide-react/hooks/use-rail-overflow.tsx similarity index 94% rename from services/web/frontend/js/features/ide-redesign/hooks/use-rail-overflow.tsx rename to services/web/frontend/js/features/ide-react/hooks/use-rail-overflow.tsx index a5b452db87..e3b2ca097d 100644 --- a/services/web/frontend/js/features/ide-redesign/hooks/use-rail-overflow.tsx +++ b/services/web/frontend/js/features/ide-react/hooks/use-rail-overflow.tsx @@ -1,5 +1,5 @@ import { useCallback, useState } from 'react' -import { RailElement } from '../../ide-react/util/rail-types' +import { RailElement } from '../util/rail-types' import { useResizeObserver } from '@/shared/hooks/use-resize-observer' const useRailOverflow = (railTabs: RailElement[]) => { diff --git a/services/web/frontend/js/features/ide-redesign/components/file-tree/file-tree-toolbar.tsx b/services/web/frontend/js/features/ide-redesign/components/file-tree/file-tree-toolbar.tsx deleted file mode 100644 index f8dab55c4c..0000000000 --- a/services/web/frontend/js/features/ide-redesign/components/file-tree/file-tree-toolbar.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { useTranslation } from 'react-i18next' -import MaterialIcon from '@/shared/components/material-icon' -import React from 'react' -import useCollapsibleFileTree from '../../hooks/use-collapsible-file-tree' -import FileTreeActionButtons from './file-tree-action-buttons' - -function FileTreeToolbar() { - const { t } = useTranslation() - const { fileTreeExpanded, toggleFileTreeExpanded } = useCollapsibleFileTree() - - return ( -
- - -
- ) -} - -export default FileTreeToolbar diff --git a/services/web/frontend/js/features/ide-redesign/hooks/use-switch-enable-new-editor-state.ts b/services/web/frontend/js/features/ide-redesign/hooks/use-switch-enable-new-editor-state.ts deleted file mode 100644 index 3d0b2484c8..0000000000 --- a/services/web/frontend/js/features/ide-redesign/hooks/use-switch-enable-new-editor-state.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { postJSON } from '@/infrastructure/fetch-json' -import { useUserSettingsContext } from '@/shared/context/user-settings-context' -import { useCallback, useState } from 'react' - -export const useSwitchEnableNewEditorState = () => { - const [loading, setLoading] = useState(false) - const [error, setError] = useState('') - const { setUserSettings } = useUserSettingsContext() - - const setEditorRedesignStatus = useCallback( - (status: boolean): Promise => { - setLoading(true) - setError('') - return new Promise((resolve, reject) => { - postJSON('/user/settings', { - body: { enableNewEditor: status }, - }) - .then(() => { - setUserSettings(current => ({ - ...current, - enableNewEditor: status, - })) - resolve() - }) - .catch(e => { - setError('Failed to update settings') - reject(e) - }) - .finally(() => { - setLoading(false) - }) - }) - }, - [setUserSettings] - ) - return { loading, error, setEditorRedesignStatus } -} diff --git a/services/web/frontend/js/features/settings/components/editor-settings/project-notifications-setting.tsx b/services/web/frontend/js/features/settings/components/editor-settings/project-notifications-setting.tsx index 2c747364f7..d15a327eee 100644 --- a/services/web/frontend/js/features/settings/components/editor-settings/project-notifications-setting.tsx +++ b/services/web/frontend/js/features/settings/components/editor-settings/project-notifications-setting.tsx @@ -3,7 +3,7 @@ import RadioButtonSetting, { RadioOption } from '../radio-button-setting' import { NotificationLevel, useProjectNotificationPreferences, -} from '../../../ide-redesign/hooks/use-project-notification-preferences' +} from '../../hooks/use-project-notification-preferences' export default function ProjectNotificationsSetting() { const { t } = useTranslation() diff --git a/services/web/frontend/js/features/settings/components/settings-modal-body.tsx b/services/web/frontend/js/features/settings/components/settings-modal-body.tsx index 5f7e5392f6..071880cac3 100644 --- a/services/web/frontend/js/features/settings/components/settings-modal-body.tsx +++ b/services/web/frontend/js/features/settings/components/settings-modal-body.tsx @@ -1,7 +1,7 @@ import MaterialIcon from '@/shared/components/material-icon' import { Nav, NavLink, TabContainer, TabContent } from 'react-bootstrap' -import { SettingsEntry } from '../../ide-redesign/contexts/settings-modal-context' +import { SettingsEntry } from '../context/settings-modal-context' import SettingsTabPane from './settings-tab-pane' import BetaBadgeIcon from '@/shared/components/beta-badge-icon' import OLTooltip from '@/shared/components/ol/ol-tooltip' diff --git a/services/web/frontend/js/features/settings/components/settings-modal.tsx b/services/web/frontend/js/features/settings/components/settings-modal.tsx index abf775eb2f..429448cea2 100644 --- a/services/web/frontend/js/features/settings/components/settings-modal.tsx +++ b/services/web/frontend/js/features/settings/components/settings-modal.tsx @@ -9,8 +9,8 @@ import { SettingsModalBody } from './settings-modal-body' import { SettingsModalProvider, useSettingsModalContext, -} from '../../ide-redesign/contexts/settings-modal-context' -import useFocusOnSetting from '../../ide-redesign/hooks/use-focus-on-setting' +} from '../context/settings-modal-context' +import useFocusOnSetting from '../hooks/use-focus-on-setting' const SettingsModalWrapper = () => { return ( diff --git a/services/web/frontend/js/features/settings/components/settings-tab-pane.tsx b/services/web/frontend/js/features/settings/components/settings-tab-pane.tsx index 41e0cb15b7..5dc5932216 100644 --- a/services/web/frontend/js/features/settings/components/settings-tab-pane.tsx +++ b/services/web/frontend/js/features/settings/components/settings-tab-pane.tsx @@ -1,5 +1,5 @@ import { TabPane } from 'react-bootstrap' -import { SettingsTab } from '../../ide-redesign/contexts/settings-modal-context' +import { SettingsTab } from '../context/settings-modal-context' import SettingsSection from './settings-section' import { Fragment } from 'react' diff --git a/services/web/frontend/js/features/ide-redesign/contexts/settings-modal-context.tsx b/services/web/frontend/js/features/settings/context/settings-modal-context.tsx similarity index 100% rename from services/web/frontend/js/features/ide-redesign/contexts/settings-modal-context.tsx rename to services/web/frontend/js/features/settings/context/settings-modal-context.tsx diff --git a/services/web/frontend/js/features/ide-redesign/hooks/use-focus-on-setting.tsx b/services/web/frontend/js/features/settings/hooks/use-focus-on-setting.tsx similarity index 95% rename from services/web/frontend/js/features/ide-redesign/hooks/use-focus-on-setting.tsx rename to services/web/frontend/js/features/settings/hooks/use-focus-on-setting.tsx index 49fc596497..023d447118 100644 --- a/services/web/frontend/js/features/ide-redesign/hooks/use-focus-on-setting.tsx +++ b/services/web/frontend/js/features/settings/hooks/use-focus-on-setting.tsx @@ -1,6 +1,6 @@ import { useEditorLeftMenuContext } from '@/features/editor-left-menu/components/editor-left-menu-context' import { useEffect, useState } from 'react' -import { useSettingsModalContext } from '../contexts/settings-modal-context' +import { useSettingsModalContext } from '../context/settings-modal-context' /** * A hook to scroll to and focus on a specific setting in the settings modal diff --git a/services/web/frontend/js/features/ide-redesign/hooks/use-project-notification-preferences.ts b/services/web/frontend/js/features/settings/hooks/use-project-notification-preferences.ts similarity index 98% rename from services/web/frontend/js/features/ide-redesign/hooks/use-project-notification-preferences.ts rename to services/web/frontend/js/features/settings/hooks/use-project-notification-preferences.ts index b757ab5eba..c85b0941a2 100644 --- a/services/web/frontend/js/features/ide-redesign/hooks/use-project-notification-preferences.ts +++ b/services/web/frontend/js/features/settings/hooks/use-project-notification-preferences.ts @@ -2,7 +2,7 @@ import { useCallback, useEffect, useState } from 'react' import { useProjectContext } from '@/shared/context/project-context' import { getJSON, postJSON } from '@/infrastructure/fetch-json' import { debugConsole } from '@/utils/debugging' -import type { NotificationPreferencesSchema } from '../../../../../modules/notifications/app/src/types.ts' +import type { NotificationPreferencesSchema } from '../../../../../modules/notifications/app/src/types.js' export type NotificationLevel = 'all' | 'replies' | 'off' diff --git a/services/web/frontend/js/features/source-editor/components/codemirror-editor.tsx b/services/web/frontend/js/features/source-editor/components/codemirror-editor.tsx index 848451a611..5c98f5c506 100644 --- a/services/web/frontend/js/features/source-editor/components/codemirror-editor.tsx +++ b/services/web/frontend/js/features/source-editor/components/codemirror-editor.tsx @@ -19,7 +19,7 @@ import { import MathPreviewTooltip from './math-preview-tooltip' import { getVisualEditorComponent } from '../utils/visual-editor' import EditorContextMenu from './editor-context-menu' -import { useToolbarMenuBarEditorCommands } from '@/features/ide-redesign/hooks/use-toolbar-menu-editor-commands' +import { useToolbarMenuBarEditorCommands } from '@/features/source-editor/hooks/use-toolbar-menu-editor-commands' import { useProjectContext } from '@/shared/context/project-context' import { useFeatureFlag } from '@/shared/context/split-test-context' import { useEditorOpenDocContext } from '@/features/ide-react/context/editor-open-doc-context' diff --git a/services/web/frontend/js/features/ide-redesign/hooks/use-toolbar-menu-editor-commands.tsx b/services/web/frontend/js/features/source-editor/hooks/use-toolbar-menu-editor-commands.tsx similarity index 99% rename from services/web/frontend/js/features/ide-redesign/hooks/use-toolbar-menu-editor-commands.tsx rename to services/web/frontend/js/features/source-editor/hooks/use-toolbar-menu-editor-commands.tsx index a7211d06ca..324ca476af 100644 --- a/services/web/frontend/js/features/ide-redesign/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,7 @@ import { redo, selectAll, undo } from '@codemirror/commands' import { openSearchPanel } from '@codemirror/search' import { useCallback } from 'react' import { useTranslation } from 'react-i18next' -import { useIsNewEditorEnabled } from '../utils/new-editor-utils' +import { useIsNewEditorEnabled } from '../../ide-redesign/utils/new-editor-utils' import { usePermissionsContext } from '@/features/ide-react/context/permissions-context' import { language } from '@codemirror/language' diff --git a/services/web/test/frontend/features/file-tree/components/file-tree-toolbar.spec.tsx b/services/web/test/frontend/features/file-tree/components/file-tree-toolbar.spec.tsx index e663541049..a361cfd080 100644 --- a/services/web/test/frontend/features/file-tree/components/file-tree-toolbar.spec.tsx +++ b/services/web/test/frontend/features/file-tree/components/file-tree-toolbar.spec.tsx @@ -28,7 +28,7 @@ describe('', function () { ) - cy.findAllByRole('button').should('not.exist') + cy.findAllByRole('button').should('have.length', 1) }) it('with one selected file', function () { @@ -53,7 +53,6 @@ describe('', function () { cy.findAllByRole('button', { name: 'New file' }) cy.findAllByRole('button', { name: 'New folder' }) cy.findAllByRole('button', { name: 'Upload' }) - cy.findAllByRole('button', { name: 'Rename' }) - cy.findAllByRole('button', { name: 'Delete' }) + cy.findAllByRole('button', { name: 'Close' }) }) }) diff --git a/services/web/test/frontend/features/settings-modal/settings/auto-close-brackets-setting.test.tsx b/services/web/test/frontend/features/settings-modal/settings/auto-close-brackets-setting.test.tsx index 1d5ebb5823..a104d0337a 100644 --- a/services/web/test/frontend/features/settings-modal/settings/auto-close-brackets-setting.test.tsx +++ b/services/web/test/frontend/features/settings-modal/settings/auto-close-brackets-setting.test.tsx @@ -3,7 +3,7 @@ import { expect } from 'chai' import fetchMock from 'fetch-mock' import { EditorProviders } from '../../../helpers/editor-providers' import AutoCloseBracketsSetting from '@/features/settings/components/editor-settings/auto-close-brackets-setting' -import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context' +import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context' describe('', function () { afterEach(function () { diff --git a/services/web/test/frontend/features/settings-modal/settings/auto-compile-setting.test.tsx b/services/web/test/frontend/features/settings-modal/settings/auto-compile-setting.test.tsx index b6ccfd9db8..54d84b81d1 100644 --- a/services/web/test/frontend/features/settings-modal/settings/auto-compile-setting.test.tsx +++ b/services/web/test/frontend/features/settings-modal/settings/auto-compile-setting.test.tsx @@ -1,7 +1,7 @@ import { screen, render } from '@testing-library/react' import { expect } from 'chai' import fetchMock from 'fetch-mock' -import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context' +import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context' import { EditorProviders, projectDefaults, diff --git a/services/web/test/frontend/features/settings-modal/settings/auto-complete-setting.test.tsx b/services/web/test/frontend/features/settings-modal/settings/auto-complete-setting.test.tsx index f1d1bf96e6..0ee6f038c0 100644 --- a/services/web/test/frontend/features/settings-modal/settings/auto-complete-setting.test.tsx +++ b/services/web/test/frontend/features/settings-modal/settings/auto-complete-setting.test.tsx @@ -1,7 +1,7 @@ import { screen, render } from '@testing-library/react' import { expect } from 'chai' import fetchMock from 'fetch-mock' -import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context' +import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context' import { EditorProviders } from '../../../helpers/editor-providers' import AutoCompleteSetting from '@/features/settings/components/editor-settings/auto-complete-setting' diff --git a/services/web/test/frontend/features/settings-modal/settings/breadcrumbs-setting.test.tsx b/services/web/test/frontend/features/settings-modal/settings/breadcrumbs-setting.test.tsx index e1a4bee8bb..a557e3aa73 100644 --- a/services/web/test/frontend/features/settings-modal/settings/breadcrumbs-setting.test.tsx +++ b/services/web/test/frontend/features/settings-modal/settings/breadcrumbs-setting.test.tsx @@ -1,7 +1,7 @@ import { screen, render } from '@testing-library/react' import { expect } from 'chai' import fetchMock from 'fetch-mock' -import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context' +import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context' import { EditorProviders } from '../../../helpers/editor-providers' import BreadcrumbsSetting from '@/features/settings/components/editor-settings/breadcrumbs-setting' diff --git a/services/web/test/frontend/features/settings-modal/settings/code-check-setting.test.tsx b/services/web/test/frontend/features/settings-modal/settings/code-check-setting.test.tsx index 638ae81d2d..26edce68e3 100644 --- a/services/web/test/frontend/features/settings-modal/settings/code-check-setting.test.tsx +++ b/services/web/test/frontend/features/settings-modal/settings/code-check-setting.test.tsx @@ -2,7 +2,7 @@ import { screen, render } from '@testing-library/react' import { expect } from 'chai' import fetchMock from 'fetch-mock' import { EditorProviders } from '../../../helpers/editor-providers' -import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context' +import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context' import CodeCheckSetting from '@/features/settings/components/editor-settings/code-check-setting' describe('', function () { diff --git a/services/web/test/frontend/features/settings-modal/settings/compiler-setting.test.tsx b/services/web/test/frontend/features/settings-modal/settings/compiler-setting.test.tsx index fae45fa213..7ed9f8f12a 100644 --- a/services/web/test/frontend/features/settings-modal/settings/compiler-setting.test.tsx +++ b/services/web/test/frontend/features/settings-modal/settings/compiler-setting.test.tsx @@ -1,7 +1,7 @@ import { screen, within, render } from '@testing-library/react' import { expect } from 'chai' import fetchMock from 'fetch-mock' -import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context' +import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context' import { EditorProviders, projectDefaults, diff --git a/services/web/test/frontend/features/settings-modal/settings/dictionary-setting.test.tsx b/services/web/test/frontend/features/settings-modal/settings/dictionary-setting.test.tsx index 1106027135..282608b35c 100644 --- a/services/web/test/frontend/features/settings-modal/settings/dictionary-setting.test.tsx +++ b/services/web/test/frontend/features/settings-modal/settings/dictionary-setting.test.tsx @@ -1,6 +1,6 @@ import { fireEvent, screen, within, render } from '@testing-library/react' import { expect } from 'chai' -import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context' +import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context' import { EditorProviders } from '../../../helpers/editor-providers' import DictionarySetting from '@/features/settings/components/editor-settings/dictionary-setting' import RailModals from '@/features/ide-react/components/rail/rail-modals' diff --git a/services/web/test/frontend/features/settings-modal/settings/draft-setting.test.tsx b/services/web/test/frontend/features/settings-modal/settings/draft-setting.test.tsx index 32440e0cdc..208583f3b1 100644 --- a/services/web/test/frontend/features/settings-modal/settings/draft-setting.test.tsx +++ b/services/web/test/frontend/features/settings-modal/settings/draft-setting.test.tsx @@ -1,6 +1,6 @@ import { screen, within, render } from '@testing-library/react' import { expect } from 'chai' -import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context' +import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context' import { EditorProviders, projectDefaults, diff --git a/services/web/test/frontend/features/settings-modal/settings/editor-theme-setting.test.tsx b/services/web/test/frontend/features/settings-modal/settings/editor-theme-setting.test.tsx index 3df82d4bd6..4cc0a2d9b9 100644 --- a/services/web/test/frontend/features/settings-modal/settings/editor-theme-setting.test.tsx +++ b/services/web/test/frontend/features/settings-modal/settings/editor-theme-setting.test.tsx @@ -1,7 +1,7 @@ import { screen, within, render } from '@testing-library/react' import { expect } from 'chai' import fetchMock from 'fetch-mock' -import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context' +import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context' import { EditorProviders } from '../../../helpers/editor-providers' import EditorThemeSetting from '@/features/settings/components/appearance-settings/editor-theme-setting' import userEvent from '@testing-library/user-event' diff --git a/services/web/test/frontend/features/settings-modal/settings/font-family-setting.test.tsx b/services/web/test/frontend/features/settings-modal/settings/font-family-setting.test.tsx index db0b44f923..8a6f3614d6 100644 --- a/services/web/test/frontend/features/settings-modal/settings/font-family-setting.test.tsx +++ b/services/web/test/frontend/features/settings-modal/settings/font-family-setting.test.tsx @@ -1,7 +1,7 @@ import { screen, within, render } from '@testing-library/react' import { expect } from 'chai' import fetchMock from 'fetch-mock' -import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context' +import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context' import { EditorProviders } from '../../../helpers/editor-providers' import FontFamilySetting from '@/features/settings/components/appearance-settings/font-family-setting' import userEvent from '@testing-library/user-event' diff --git a/services/web/test/frontend/features/settings-modal/settings/font-size-setting.test.tsx b/services/web/test/frontend/features/settings-modal/settings/font-size-setting.test.tsx index b72a6c45bb..0d444712d2 100644 --- a/services/web/test/frontend/features/settings-modal/settings/font-size-setting.test.tsx +++ b/services/web/test/frontend/features/settings-modal/settings/font-size-setting.test.tsx @@ -1,7 +1,7 @@ import { screen, within, render } from '@testing-library/react' import { expect } from 'chai' import fetchMock from 'fetch-mock' -import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context' +import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context' import { EditorProviders } from '../../../helpers/editor-providers' import FontSizeSetting from '@/features/settings/components/appearance-settings/font-size-setting' import userEvent from '@testing-library/user-event' diff --git a/services/web/test/frontend/features/settings-modal/settings/image-name-setting.test.tsx b/services/web/test/frontend/features/settings-modal/settings/image-name-setting.test.tsx index af4663a629..14719a6cac 100644 --- a/services/web/test/frontend/features/settings-modal/settings/image-name-setting.test.tsx +++ b/services/web/test/frontend/features/settings-modal/settings/image-name-setting.test.tsx @@ -2,7 +2,7 @@ import { screen, within, render } from '@testing-library/react' import { expect } from 'chai' import fetchMock from 'fetch-mock' import type { ImageName } from '../../../../../types/project-settings' -import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context' +import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context' import { EditorProviders, projectDefaults, diff --git a/services/web/test/frontend/features/settings-modal/settings/keybinding-setting.test.tsx b/services/web/test/frontend/features/settings-modal/settings/keybinding-setting.test.tsx index b1e687b5b3..3b271829eb 100644 --- a/services/web/test/frontend/features/settings-modal/settings/keybinding-setting.test.tsx +++ b/services/web/test/frontend/features/settings-modal/settings/keybinding-setting.test.tsx @@ -2,7 +2,7 @@ import { screen, within, render } from '@testing-library/react' import { expect } from 'chai' import fetchMock from 'fetch-mock' import { EditorProviders } from '../../../helpers/editor-providers' -import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context' +import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context' import KeybindingSetting from '@/features/settings/components/editor-settings/keybinding-setting' import userEvent from '@testing-library/user-event' diff --git a/services/web/test/frontend/features/settings-modal/settings/line-height-setting.test.tsx b/services/web/test/frontend/features/settings-modal/settings/line-height-setting.test.tsx index f14d2855cf..30d5ba032b 100644 --- a/services/web/test/frontend/features/settings-modal/settings/line-height-setting.test.tsx +++ b/services/web/test/frontend/features/settings-modal/settings/line-height-setting.test.tsx @@ -2,7 +2,7 @@ import { screen, within, render } from '@testing-library/react' import { expect } from 'chai' import fetchMock from 'fetch-mock' import { EditorProviders } from '../../../helpers/editor-providers' -import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context' +import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context' import LineHeightSetting from '@/features/settings/components/appearance-settings/line-height-setting' import userEvent from '@testing-library/user-event' diff --git a/services/web/test/frontend/features/settings-modal/settings/math-preview-setting.test.tsx b/services/web/test/frontend/features/settings-modal/settings/math-preview-setting.test.tsx index d37e6c7249..b6dffcf619 100644 --- a/services/web/test/frontend/features/settings-modal/settings/math-preview-setting.test.tsx +++ b/services/web/test/frontend/features/settings-modal/settings/math-preview-setting.test.tsx @@ -2,7 +2,7 @@ import { screen, render } from '@testing-library/react' import { expect } from 'chai' import fetchMock from 'fetch-mock' import { EditorProviders } from '../../../helpers/editor-providers' -import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context' +import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context' import MathPreviewSetting from '@/features/settings/components/editor-settings/math-preview-setting' describe('', function () { diff --git a/services/web/test/frontend/features/settings-modal/settings/overall-theme-setting.test.tsx b/services/web/test/frontend/features/settings-modal/settings/overall-theme-setting.test.tsx index 7c43854e01..e96b49b023 100644 --- a/services/web/test/frontend/features/settings-modal/settings/overall-theme-setting.test.tsx +++ b/services/web/test/frontend/features/settings-modal/settings/overall-theme-setting.test.tsx @@ -4,7 +4,7 @@ import fetchMock from 'fetch-mock' import type { OverallThemeMeta } from '../../../../../types/project-settings' import getMeta from '@/utils/meta' import { EditorProviders } from '../../../helpers/editor-providers' -import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context' +import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context' import OverallThemeSetting from '@/features/settings/components/appearance-settings/overall-theme-setting' import userEvent from '@testing-library/user-event' diff --git a/services/web/test/frontend/features/settings-modal/settings/pdf-viewer-setting.test.tsx b/services/web/test/frontend/features/settings-modal/settings/pdf-viewer-setting.test.tsx index 32cb238eaa..68a89b8562 100644 --- a/services/web/test/frontend/features/settings-modal/settings/pdf-viewer-setting.test.tsx +++ b/services/web/test/frontend/features/settings-modal/settings/pdf-viewer-setting.test.tsx @@ -2,7 +2,7 @@ import { screen, within, render } from '@testing-library/react' import { expect } from 'chai' import fetchMock from 'fetch-mock' import { EditorProviders } from '../../../helpers/editor-providers' -import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context' +import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context' import PDFViewerSetting from '@/features/settings/components/editor-settings/pdf-viewer-setting' import userEvent from '@testing-library/user-event' diff --git a/services/web/test/frontend/features/settings-modal/settings/root-document-setting.test.tsx b/services/web/test/frontend/features/settings-modal/settings/root-document-setting.test.tsx index 02d264edbb..841dbbd111 100644 --- a/services/web/test/frontend/features/settings-modal/settings/root-document-setting.test.tsx +++ b/services/web/test/frontend/features/settings-modal/settings/root-document-setting.test.tsx @@ -2,7 +2,7 @@ import { screen, within, render } from '@testing-library/react' import { expect } from 'chai' import fetchMock from 'fetch-mock' import { Folder } from '../../../../../types/folder' -import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context' +import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context' import { EditorProviders, projectDefaults, diff --git a/services/web/test/frontend/features/settings-modal/settings/spell-check-setting.test.tsx b/services/web/test/frontend/features/settings-modal/settings/spell-check-setting.test.tsx index 32880ed004..0455616bc6 100644 --- a/services/web/test/frontend/features/settings-modal/settings/spell-check-setting.test.tsx +++ b/services/web/test/frontend/features/settings-modal/settings/spell-check-setting.test.tsx @@ -6,7 +6,7 @@ import { EditorProviders, projectDefaults, } from '../../../helpers/editor-providers' -import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context' +import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context' import SpellCheckSetting from '@/features/settings/components/editor-settings/spell-check-setting' import userEvent from '@testing-library/user-event' diff --git a/services/web/test/frontend/features/settings-modal/settings/stop-on-first-error-setting.test.tsx b/services/web/test/frontend/features/settings-modal/settings/stop-on-first-error-setting.test.tsx index 08b88c0ac0..61ecafdfba 100644 --- a/services/web/test/frontend/features/settings-modal/settings/stop-on-first-error-setting.test.tsx +++ b/services/web/test/frontend/features/settings-modal/settings/stop-on-first-error-setting.test.tsx @@ -1,7 +1,7 @@ import { screen, render } from '@testing-library/react' import { expect } from 'chai' import fetchMock from 'fetch-mock' -import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context' +import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context' import { EditorProviders, projectDefaults,