mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
feat: implement Overleaf Code experiment with Python execution support
GitOrigin-RevId: 54ca98525b2ae056fb34b3713320e868b8c19613
This commit is contained in:
committed by
Copybot
parent
138f7f8023
commit
3b17b0a46a
@@ -10,6 +10,7 @@ import { FullSizeLoadingSpinner } from '@/shared/components/loading-spinner'
|
||||
import SymbolPalettePane from '@/features/ide-react/components/editor/symbol-palette-pane'
|
||||
import { useEditorPropertiesContext } from '@/features/ide-react/context/editor-properties-context'
|
||||
import { PythonEditorSplit } from '@/features/ide-react/components/layout/python-editor-split'
|
||||
import { isInExperiment } from '@/utils/labs-utils'
|
||||
|
||||
export const Editor = () => {
|
||||
const { opening, errorState, showSymbolPalette } =
|
||||
@@ -19,6 +20,7 @@ export const Editor = () => {
|
||||
const isPythonDocument =
|
||||
openEntity?.type === 'doc' &&
|
||||
openEntity.entity.name.toLowerCase().endsWith('.py')
|
||||
const pythonExecutionEnabled = isInExperiment('overleaf-code')
|
||||
|
||||
if (!currentDocumentId) {
|
||||
return null
|
||||
@@ -43,7 +45,11 @@ export const Editor = () => {
|
||||
order={1}
|
||||
className="ide-redesign-editor-panel"
|
||||
>
|
||||
{isPythonDocument ? <PythonEditorSplit /> : <SourceEditor />}
|
||||
{isPythonDocument && pythonExecutionEnabled ? (
|
||||
<PythonEditorSplit />
|
||||
) : (
|
||||
<SourceEditor />
|
||||
)}
|
||||
{isLoading && <EditorLoadingPane />}
|
||||
</Panel>
|
||||
{showSymbolPalette && (
|
||||
|
||||
Reference in New Issue
Block a user