mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-13 21:53:43 +01:00
Merge pull request #36407 from overleaf/mj-tabs-teardown
[web] Tear down tabs feature flag GitOrigin-RevId: c25a3abe5c4b85f9802751bb1882385ed9c50a4a
This commit is contained in:
committed by
Copybot
parent
57697c6c56
commit
06b4124aca
@@ -504,7 +504,6 @@ const _ProjectController = {
|
||||
'wf-rebrand',
|
||||
'testing-ai-usage',
|
||||
'wf-fake-non-english-suggestions',
|
||||
'editor-tabs',
|
||||
'overleaf-code',
|
||||
'export-docx',
|
||||
'sharing-updates',
|
||||
|
||||
@@ -26,7 +26,6 @@ import getMeta from '@/utils/meta'
|
||||
import EditorCloneProjectModalWrapper from '@/features/clone-project-modal/components/editor-clone-project-modal-wrapper'
|
||||
import useOpenProject from '@/shared/hooks/use-open-project'
|
||||
import importOverleafModules from '../../../../../macros/import-overleaf-module.macro'
|
||||
import { useFeatureFlag } from '@/shared/context/split-test-context'
|
||||
import ReviewModeOptions from './review-mode-options'
|
||||
|
||||
const menubarExtraComponents = importOverleafModules(
|
||||
@@ -54,8 +53,6 @@ export const ToolbarMenuBar = () => {
|
||||
const showSupport = getMeta('ol-showSupport')
|
||||
const showDocumentation = getMeta('ol-wikiEnabled')
|
||||
|
||||
const hasEditorTabs = useFeatureFlag('editor-tabs')
|
||||
|
||||
useCommandProvider(
|
||||
() => [
|
||||
{
|
||||
@@ -291,16 +288,14 @@ export const ToolbarMenuBar = () => {
|
||||
}
|
||||
onClick={toggleBreadcrumbs}
|
||||
/>
|
||||
{hasEditorTabs && (
|
||||
<MenuBarOption
|
||||
eventKey="show_editor_tabs"
|
||||
title={t('show_editor_tabs')}
|
||||
leadingIcon={
|
||||
editorTabs ? 'check' : <OLDropdownItem.EmptyLeadingIcon />
|
||||
}
|
||||
onClick={toggleEditorTabs}
|
||||
/>
|
||||
)}
|
||||
<MenuBarOption
|
||||
eventKey="show_editor_tabs"
|
||||
title={t('show_editor_tabs')}
|
||||
leadingIcon={
|
||||
editorTabs ? 'check' : <OLDropdownItem.EmptyLeadingIcon />
|
||||
}
|
||||
onClick={toggleEditorTabs}
|
||||
/>
|
||||
<MenuBarOption
|
||||
eventKey="show_equation_preview"
|
||||
title={t('show_equation_preview')}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { useProjectSettingsContext } from '@/features/ide-settings/context/project-settings-context'
|
||||
import { useFeatureFlag } from '@/shared/context/split-test-context'
|
||||
|
||||
export const useAreTabsEnabled = () => {
|
||||
const { editorTabs } = useProjectSettingsContext()
|
||||
const featureFlag = useFeatureFlag('editor-tabs')
|
||||
return featureFlag && Boolean(editorTabs)
|
||||
return Boolean(editorTabs)
|
||||
}
|
||||
|
||||
@@ -102,7 +102,6 @@ export const SettingsModalProvider: FC<React.PropsWithChildren> = ({
|
||||
const { settingsShown, setSettingsShown } = useLayoutContext()
|
||||
|
||||
const hasEmailNotifications = useFeatureFlag('email-notifications')
|
||||
const hasEditorTabs = useFeatureFlag('editor-tabs')
|
||||
const hasToolbarMigration = useFeatureFlag('writefull-toolbar-migration')
|
||||
|
||||
const editorTabExtraSections = useSlotSections(editorTabExtraSectionHooks)
|
||||
@@ -137,12 +136,10 @@ export const SettingsModalProvider: FC<React.PropsWithChildren> = ({
|
||||
{
|
||||
key: 'editorTabs',
|
||||
component: <EditorTabsSetting />,
|
||||
hidden: !hasEditorTabs,
|
||||
},
|
||||
{
|
||||
key: 'previewTabs',
|
||||
component: <PreviewTabsSetting />,
|
||||
hidden: !hasEditorTabs,
|
||||
},
|
||||
{
|
||||
key: 'mode',
|
||||
@@ -336,7 +333,6 @@ export const SettingsModalProvider: FC<React.PropsWithChildren> = ({
|
||||
],
|
||||
[
|
||||
t,
|
||||
hasEditorTabs,
|
||||
overallTheme,
|
||||
hasEmailNotifications,
|
||||
isOverleaf,
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { isSplitTestEnabled } from '@/utils/splitTestUtils'
|
||||
import { Compartment, Transaction, TransactionSpec } from '@codemirror/state'
|
||||
import { EditorView } from '@codemirror/view'
|
||||
|
||||
@@ -19,13 +18,9 @@ const updateListener = EditorView.updateListener.of(update => {
|
||||
})
|
||||
|
||||
export const tabsListener = (enabled: boolean) => {
|
||||
return tabsListenerCompartment.of(
|
||||
enabled && isSplitTestEnabled('editor-tabs') ? updateListener : []
|
||||
)
|
||||
return tabsListenerCompartment.of(enabled ? updateListener : [])
|
||||
}
|
||||
|
||||
export const setEditorTabs = (enabled: boolean): TransactionSpec => ({
|
||||
effects: tabsListenerCompartment.reconfigure(
|
||||
enabled && isSplitTestEnabled('editor-tabs') ? updateListener : []
|
||||
),
|
||||
effects: tabsListenerCompartment.reconfigure(enabled ? updateListener : []),
|
||||
})
|
||||
|
||||
@@ -197,6 +197,9 @@ describe('<ReviewPanel />', function () {
|
||||
cy.mount(
|
||||
<TestContainer className="rp-size-expanded">
|
||||
<EditorProviders
|
||||
// Disable tabs since the review panel is rendered differently
|
||||
// when tabs are enabled
|
||||
userSettings={{ editorTabs: false }}
|
||||
scope={scope}
|
||||
providers={{ ProjectProvider: makeProjectProvider(project) }}
|
||||
>
|
||||
|
||||
@@ -206,15 +206,6 @@ function selectDoc(id: string, path?: string[]) {
|
||||
selectEntity(makeDocEntity(id, DOC_NAMES[id], path))
|
||||
}
|
||||
|
||||
function enableEditorTabs() {
|
||||
cy.window().then(win => {
|
||||
win.metaAttributesCache.set('ol-splitTestVariants', {
|
||||
'editor-tabs': 'enabled',
|
||||
})
|
||||
win.metaAttributesCache.set('ol-labsExperiments', ['editor-tabs'])
|
||||
})
|
||||
}
|
||||
|
||||
describe('File Tabs', function () {
|
||||
function mountTabs(options?: { rootFolder?: any; userSettings?: any }) {
|
||||
const rootFolder = options?.rootFolder ?? defaultRootFolder
|
||||
@@ -241,7 +232,6 @@ describe('File Tabs', function () {
|
||||
cy.interceptEvents()
|
||||
cy.interceptTutorials()
|
||||
cy.interceptCompile()
|
||||
enableEditorTabs()
|
||||
|
||||
// Clear persisted tab state from localStorage
|
||||
cy.window().then(win => {
|
||||
@@ -1208,7 +1198,6 @@ describe('File Tabs', function () {
|
||||
cy.clock()
|
||||
cy.window().then(win => {
|
||||
win.metaAttributesCache.set('ol-splitTestVariants', {
|
||||
'editor-tabs': 'enabled',
|
||||
'intermittent-connection-improvements': 'enabled',
|
||||
})
|
||||
})
|
||||
@@ -1235,11 +1224,6 @@ describe('File Tabs', function () {
|
||||
})
|
||||
|
||||
it('does not disable tabs when the feature flag is off', function () {
|
||||
cy.window().then(win => {
|
||||
win.metaAttributesCache.set('ol-splitTestVariants', {
|
||||
'editor-tabs': 'enabled',
|
||||
})
|
||||
})
|
||||
mountWithStaleDocs()
|
||||
cy.then(() => selectDoc(DOC_IDS.main))
|
||||
cy.tick(1000)
|
||||
|
||||
Reference in New Issue
Block a user